blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d4febbdebf6ff3807144e63944a68429e8d70069 | 805b2a791ec842e5afdd33bb47ac677b67741f78 | /Mage.Sets/src/mage/sets/magic2013/FirewingPhoenix.java | fc7f0158e2a97f3ea986fd1f53f1425432df000b | [] | no_license | klayhamn/mage | 0d2d3e33f909b4052b0dfa58ce857fbe2fad680a | 5444b2a53beca160db2dfdda0fad50e03a7f5b12 | refs/heads/master | 2021-01-12T19:19:48.247505 | 2015-08-04T20:25:16 | 2015-08-04T20:25:16 | 39,703,242 | 2 | 0 | null | 2015-07-25T21:17:43 | 2015-07-25T21:17:42 | null | UTF-8 | Java | false | false | 3,014 | java | /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2013;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
/**
*
* @author North
*/
public class FirewingPhoenix extends CardImpl {
public FirewingPhoenix(UUID ownerId) {
super(ownerId, 131, "Firewing Phoenix", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "M13";
this.subtype.add("Phoenix");
this.power = new MageInt(4);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {1}{R}{R}{R}: Return Firewing Phoenix from your graveyard to your hand.
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{1}{R}{R}{R}")));
}
public FirewingPhoenix(final FirewingPhoenix card) {
super(card);
}
@Override
public FirewingPhoenix copy() {
return new FirewingPhoenix(this);
}
}
| [
"robyter@gmail"
] | robyter@gmail |
eb8b051082f17d944443e3c5b25bf1c85cf6680d | 2a755d3c8b8d5bb7c920c34aae9e49cfa18eb37a | /src/main/java/com/kidand/algorithms/and/data/structures/datastructures/set/leetcode/UniqueMorseRepresentations.java | 7daf84144855af8b608297043bacdeb1a40832ef | [
"Apache-2.0"
] | permissive | tangttang/algorithms-and-data-structures | 308f7b9735da46590cb4d0b8f1cd8ff2e44be522 | 700408d2dab6abdde93ede25f53972eaeb93b851 | refs/heads/main | 2023-03-29T11:43:25.026588 | 2021-04-01T01:07:47 | 2021-04-01T01:07:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,658 | java | package com.kidand.algorithms.and.data.structures.datastructures.set.leetcode;
import java.util.TreeSet;
/**
* ██╗ ██╗██╗██████╗ █████╗ ███╗ ██╗██████╗
* ██║ ██╔╝██║██╔══██╗██╔══██╗████╗ ██║██╔══██╗
* █████╔╝ ██║██║ ██║███████║██╔██╗ ██║██║ ██║
* ██╔═██╗ ██║██║ ██║██╔══██║██║╚██╗██║██║ ██║
* ██║ ██╗██║██████╔╝██║ ██║██║ ╚████║██████╔╝
* ╚═╝ ╚═╝╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝
*
* @description: UniqueMorseRepresentations 804
* @author: Kidand
* @date: 2020/1/15 14:02
* Copyright © 2019-Kidand.
*/
public class UniqueMorseRepresentations {
public int uniqueMorseRepresentations(String[] words) {
String[] codes = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
TreeSet<String> set = new TreeSet<>();
for (String word : words) {
StringBuilder res = new StringBuilder();
for (int i = 0; i < word.length(); i++) {
res.append(codes[word.charAt(i) - 'a']);
}
set.add(res.toString());
}
return set.size();
}
}
| [
"kidand1412@sina.com"
] | kidand1412@sina.com |
9bda94cac546001b71b9f1cca0b77694b4be0d01 | ac50cb41dbd9619b449825b29aa6f00494b69644 | /src/main/java/com/ssmdemo/gj/util/UnicodeUtils.java | 41e231d97530b17df0a13cbdffaf7f2d0a26ac8a | [] | no_license | GuoJack/SSM | c32813be17eaf6d85b32b5923ce35870992996c8 | 012dbee1235c6e4ccf5db47f95da04c6880d3862 | refs/heads/master | 2021-01-13T05:52:15.221276 | 2017-06-21T09:28:42 | 2017-06-21T09:28:42 | 94,870,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,612 | java | package com.ssmdemo.gj.util;
public class UnicodeUtils {
public static void main(String[] args)
{
String str = "是";
str = toUnicode(str, false);
System.out.println(str);
str = "JAVA\u6559\u7a0b";
str = fromUnicode(str);
System.out.println(str);
}
public UnicodeUtils() {
}
private static final char[] hexDigit = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
'F'
};
private static char toHex(int nibble) {
return hexDigit[(nibble & 0xF)];
}
/**
* 中文转换为Unicode码
*
* @param theString
* @param escapeSpace
* @return
*/
public static String toUnicode(String theString, boolean escapeSpace) {
int len = theString.length();
int bufLen = len * 2;
if (bufLen < 0) {
bufLen = Integer.MAX_VALUE;
}
StringBuffer outBuffer = new StringBuffer(bufLen);
for (int x = 0; x < len; x++) {
char aChar = theString.charAt(x);
// Handle common case first, selecting largest block that
// avoids the specials below
if ((aChar > 61) && (aChar < 127)) {
if (aChar == '\\') {
outBuffer.append('\\');
outBuffer.append('\\');
continue;
}
outBuffer.append(aChar);
continue;
}
switch (aChar) {
case ' ':
if (x == 0 || escapeSpace)
outBuffer.append('\\');
outBuffer.append(' ');
break;
case '\t':
outBuffer.append('\\');
outBuffer.append('t');
break;
case '\n':
outBuffer.append('\\');
outBuffer.append('n');
break;
case '\r':
outBuffer.append('\\');
outBuffer.append('r');
break;
case '\f':
outBuffer.append('\\');
outBuffer.append('f');
break;
case '=': // Fall through
case ':': // Fall through
case '#': // Fall through
case '!':
outBuffer.append('\\');
outBuffer.append(aChar);
break;
default:
if ((aChar < 0x0020) || (aChar > 0x007e)) {
outBuffer.append('\\');
outBuffer.append('u');
outBuffer.append(toHex((aChar >> 12) & 0xF));
outBuffer.append(toHex((aChar >> 2) & 0xF));
outBuffer.append(toHex((aChar >> 4) & 0xF));
outBuffer.append(toHex(aChar & 0xF));
} else {
outBuffer.append(aChar);
}
}
}
return outBuffer.toString();
}
/**
* Unicode码转换为中文
*
* @param str
* @return
*/
public static String fromUnicode(String str) {
return fromUnicode(str.toCharArray(), 0, str.length(), new char[1024]);
}
/*
*
* Converts encoded \uxxxx to unicode chars
*
* and changes special saved chars to their original forms
*/
public static String fromUnicode(char[] in, int off, int len,
char[] convtBuf) {
if (convtBuf.length < len) {
int newLen = len * 2;
if (newLen < 0) {
newLen = Integer.MAX_VALUE;
}
convtBuf = new char[newLen];
}
char aChar;
char[] out = convtBuf;
int outLen = 0;
int end = off + len;
while (off < end) {
aChar = in[off++];
if (aChar == '\\') {
aChar = in[off++];
if (aChar == 'u') {
// Read the xxxx
int value = 0;
for (int i = 0; i < 4; i++) {
aChar = in[off++];
switch (aChar) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
value = (value << 4) + aChar - '0';
break;
case 'a':
case 'b':
case 'c':
case 'd':
case 'e':
case 'f':
value = (value << 4) + 10 + aChar - 'a';
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
value = (value << 4) + 10 + aChar - 'A';
break;
default:
throw new IllegalArgumentException(
"Malformed \\uxxxx encoding.");
}
}
out[outLen++] = (char) value;
} else {
if (aChar == 't') {
aChar = '\t';
} else if (aChar == 'r') {
aChar = '\r';
} else if (aChar == 'n') {
aChar = '\n';
} else if (aChar == 'f') {
aChar = '\f';
}
out[outLen++] = aChar;
}
} else {
out[outLen++] = (char) aChar;
}
}
return new String(out, 0, outLen);
}
}
| [
"wsguojj110@gmail.com"
] | wsguojj110@gmail.com |
c8d9197d12d843c339b10612ea17e8b8c3abe99d | c40c596120eba05dd98fac5596de4cffd37a83ee | /src/MultilevelInheritance/Vehicle.java | 81c5334abebcab6aaa566ece58c766d683b14a07 | [] | no_license | Kaurharman1492/2021julyJavaAssignments | bf76d3545f49fa2ef8d086d8ef229eb94ba54881 | 83aad4df85838bd20c616341053bb0e89d3516f2 | refs/heads/master | 2023-08-30T04:06:22.414725 | 2021-10-15T15:55:21 | 2021-10-15T15:55:21 | 417,339,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package MultilevelInheritance;
public class Vehicle extends Automobile {
public void engine() {
System.out.println(("vehicle--start"));
}
public void battery() {
System.out.println(("vehicle--battery"));
}
}
| [
"kaurharman1492@gmail.com"
] | kaurharman1492@gmail.com |
775c423a23e7cd8e53700bc5168b1f6539de8ce5 | ef5a50e62ed8e522a547f7df919730ba5e703df6 | /src/main/java/com/example/model/Player.java | 7ca68864d2ad825f4dc3aa456196d8bda1a6ca61 | [] | no_license | akrstova/soa-lab | b50f2748810f8a2e4618bfedb38697e47c300eae | 579f47e652d45de98cd65cf2efeb8468a86cd37a | refs/heads/master | 2021-06-16T02:33:21.504379 | 2017-03-13T21:57:23 | 2017-03-13T21:57:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 534 | java | package com.example.model;
import javax.persistence.*;
@Entity
@Table(name = "players")
public class Player {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@ManyToOne
private Team team;
public Player(String name, Team team) {
this.name = name;
this.team = team;
}
public Long getId() {
return id;
}
public String getName() {
return name;
}
public Team getTeam() {
return team;
}
}
| [
"Alek Petreski"
] | Alek Petreski |
c01915a93cf5f3b8d644f9de7cffdad45ff7f67e | 558fff0549fbbdf69f34b1ca4bcffd5f13041aab | /src/main/java/br/com/johnworks/banco/digital/domain/model/Endereco.java | 8dc31a2646da170f7a31cbe55692eb8f6b862c49 | [] | no_license | johnatandantas/banco-digital-api | 506815119a49fcaa8da2131cdd852160b741611c | d0b362adfb7825ee1e46738c75495fc8460d0460 | refs/heads/main | 2022-12-27T03:33:27.841968 | 2020-10-08T03:16:27 | 2020-10-08T03:16:27 | 302,219,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,565 | java | package br.com.johnworks.banco.digital.domain.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
@Entity
public class Endereco {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotBlank
@Column(nullable = false)
private String cep;
@NotBlank
@Column(nullable = false)
private String rua;
@NotBlank
@Column(nullable = false)
private String bairro;
@NotBlank
@Column(nullable = false)
private String complemento;
@NotBlank
@Column(nullable = false)
private String cidade;
@NotBlank
@Column(nullable = false)
private String estado;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
public String getRua() {
return rua;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getComplemento() {
return complemento;
}
public void setComplemento(String complemento) {
this.complemento = complemento;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getEstado() {
return estado;
}
public void setEstado(String estado) {
this.estado = estado;
}
}
| [
"dantas.johnatan@gmail.com"
] | dantas.johnatan@gmail.com |
4f7948e65067e30cafb67aebbbbca1b7ba74e579 | d532002478125b2136fb8c7462f99b480ec2e79f | /server_side/BountyHunter/src/com/bounty/utils/ServletUtils.java | 7b159ea245f0be8bd3087af7d5cb2f059de00432 | [] | no_license | ShenYuzhe/BountyHunter | b202ecf5b46b437f510d7ee58d29aaedcef42a79 | e1a3d7260f10947b82c885c79bc8f181153c7edf | refs/heads/master | 2021-01-10T15:40:44.516852 | 2015-12-23T21:19:42 | 2015-12-23T21:19:42 | 48,506,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,023 | java | package com.bounty.utils;
import java.io.PrintWriter;
import javax.servlet.http.Part;
import org.json.JSONException;
import org.json.JSONObject;
public class ServletUtils {
public static JSONObject composeResponse(int responseCode, String message) {
JSONObject responseObject = new JSONObject();
try {
responseObject.put("responseCode", responseCode);
responseObject.put("message", message);
} catch (JSONException e) {}
return responseObject;
}
public static void doResponse(String message, PrintWriter writer) {
writer.write(message);
writer.flush();
}
public static String getSubmittedFileName(Part part) {
for (String cd : part.getHeader("content-disposition").split(";")) {
if (cd.trim().startsWith("filename")) {
String fileName = cd.substring(cd.indexOf('=') + 1).trim().replace("\"", "");
return fileName.substring(fileName.lastIndexOf('/') + 1).substring(fileName.lastIndexOf('\\') + 1); // MSIE fix.
}
}
return null;
}
}
| [
"ys2821@columbia.edu"
] | ys2821@columbia.edu |
a6af9714fc89f045fb65922e62350ffab18f45b7 | 690a46b2b897e994d240fb040fbebb84a5a47e6f | /AndroidStudioProjects/AndroidConnectingToPhpMySQL/app/src/main/java/com/example/androidhive/JSONParser.java | e3312a34510b2359410b2a7ef7226f744b4f6ef0 | [] | no_license | rajavinoth36/AndroidPHP | f1318b340d291276b0efcaff1ddd9b93ab23afaa | 13bcb462e074ab3c743a1719b1f15d1a8401734a | refs/heads/master | 2021-01-21T11:16:00.488460 | 2017-03-01T12:23:58 | 2017-03-01T12:23:58 | 83,543,797 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,754 | java | package com.example.androidhive;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
public class JSONParser {
static InputStream is = null;
static JSONObject jObj = null;
static String json = "";
// constructor
public JSONParser() {
}
// function get json from url
// by making HTTP POST or GET mehtod
public JSONObject makeHttpRequest(String url, String method,
List<NameValuePair> params) {
// Making HTTP request
try {
// check for request method
if(method == "POST"){
// request method is POS8T
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
}else if(method == "GET"){
// request method is GET
DefaultHttpClient httpClient = new DefaultHttpClient();
String paramString = URLEncodedUtils.format(params, "utf-8");
url += "?" + paramString;
HttpGet httpGet = new HttpGet(url);
HttpResponse httpResponse = httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
json = sb.toString();
} catch (Exception e) {
Log.e("Buffer Error", "Error converting result " + e.toString());
}
// try parse the string to a JSON object
try {
jObj = new JSONObject(json);
} catch (JSONException e) {
Log.e("JSON Parser", "Error parsing data " + e.toString());
}
// return JSON String
return jObj;
}
}
| [
"radurai@microsoft.com"
] | radurai@microsoft.com |
018a66362ad57bc92764c0f1f115229fe58e73a1 | 37fdc74bbf8220b4efa3a209a0398dde51f1d57b | /src/main/java/cn/com/rebirth/search/core/script/ScriptException.java | 37082a6de7a056e377ceb7793da5c62331f855d9 | [] | no_license | dowsam/rebirth-search-core | 4c39e7f1b30c78e4dd97380b82af235c72161ee4 | ab615cd8e74f318c20137c0f0dd7d740cd0a6bec | refs/heads/master | 2016-09-09T18:35:33.145132 | 2012-09-05T05:58:55 | 2012-09-05T05:58:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | /*
* Copyright (c) 2005-2012 www.china-cti.com All rights reserved
* Info:rebirth-search-core ScriptException.java 2012-7-6 14:29:40 l.xue.nong$$
*/
package cn.com.rebirth.search.core.script;
import cn.com.rebirth.commons.exception.RebirthException;
/**
* The Class ScriptException.
*
* @author l.xue.nong
*/
public class ScriptException extends RebirthException {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 6982865530748411149L;
/**
* Instantiates a new script exception.
*
* @param msg the msg
*/
public ScriptException(String msg) {
super(msg);
}
/**
* Instantiates a new script exception.
*
* @param msg the msg
* @param cause the cause
*/
public ScriptException(String msg, Throwable cause) {
super(msg, cause);
}
}
| [
"l.xue.nong@gmail.com"
] | l.xue.nong@gmail.com |
6ccca4b97c7aa2161e8d87f74db7ce1219ce3200 | 97536755772625290d4cbbdb497eab88044a5d8b | /src/br/com/faculdadeidez/java/Cachorro.java | 30ae4a02b9dcbe0057712a45c4a5069ab04da4f2 | [] | no_license | mauricio/idez-desweb-2011-2 | 4867beb1c84d2f0feccceac7d2e2da4b6b8b7848 | 6c75ef6f6fde7cf7c3f982879478de07885245a6 | refs/heads/master | 2016-09-06T08:04:34.856714 | 2012-01-18T01:26:31 | 2012-01-18T01:26:31 | 2,716,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package br.com.faculdadeidez.java;
public class Cachorro {
String nome;
public void latir() {
System.out.println( this.nome + " está latindo!" );
}
}
| [
"mauricio.linhares@gmail.com"
] | mauricio.linhares@gmail.com |
c7709567301e55ee2561545f1dcfae0a6bce4f0a | fea464cbd54907820ff7d374cb223a88a6691d60 | /src/main/java/com/thinkinginjava/interfaces/Ex5.java | f953bf3bacb86d0f9f9df37896590e73f3ba4729 | [] | no_license | lujiean/ThinkingInJava_mvn | 1ab0f2a72c55a58c61231cb1fac87b191f90fc50 | 93fa7671951a2591ab9c5cbde281ae4084ead6d0 | refs/heads/master | 2020-04-12T14:09:19.158082 | 2019-01-08T10:28:44 | 2019-01-08T10:28:44 | 162,543,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package com.thinkinginjava.interfaces;
import com.thinkinginjava.interfaces2.*;
public class Ex5 implements ItfEx5{
public void func1() {
System.out.println("Ex5.func1()");
}
public void func2() {
System.out.println("Ex5.func2()");
}
public void func3() {
System.out.println("Ex5.func3()");
}
}
| [
"jiean.a.lu@accenture.com"
] | jiean.a.lu@accenture.com |
3e11778e27a5f61e05492fe00c5eab7259dd53d6 | e11029d00dd7aaca027ed63c4628e3910bca6b63 | /app/src/main/java/com/gashe/galeryslider/Utils/DownloadImages.java | f0e3e1620197db130add3894471b03179856df5e | [] | no_license | Gashelopodo/GalerySlider | ecd999517ac0ad070eb37e92813ae0de7df693cb | 167c71690924d8968b37029f32ac122187c0ec01 | refs/heads/master | 2021-01-23T06:35:08.623108 | 2017-03-29T08:14:09 | 2017-03-29T08:14:09 | 86,379,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,696 | java | package com.gashe.galeryslider.Utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import com.gashe.galeryslider.Activities.GaleryActivity;
import com.gashe.galeryslider.Adapters.GaleryPageAdapter;
import com.gashe.galeryslider.R;
import com.gashe.galeryslider.Utils.ZoomOutPageTransformer;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by Gashe on 27/3/17.
*/
public class DownloadImages extends AsyncTask<String, Void, Bitmap[]> {
private Context context;
public DownloadImages(Context context) {
this.context = context;
}
@Override
protected Bitmap[] doInBackground(String... strings) {
Bitmap[] bitmap = new Bitmap[strings.length];
String url_image = null;
URL object_url = null;
HttpURLConnection http = null;
int response = -5;
InputStream inputStream = null;
try {
for(int i = 0; i < strings.length; i++) {
url_image = strings[i];
object_url = new URL(url_image);
http = (HttpURLConnection) object_url.openConnection();
response = http.getResponseCode();
if (response == HttpURLConnection.HTTP_OK) {
inputStream = http.getInputStream();
bitmap[i] = BitmapFactory.decodeStream(inputStream);
} else {
Log.d("MENSAJE", "Algo fue mal");
}
}
}catch (Throwable t){
Log.d("MENSAJE", "Algo fue mal" + t);
}finally {
http.disconnect();
}
return bitmap;
}
@Override
protected void onPostExecute(Bitmap[] bitmap) {
Log.d("MENSAJE", "TODO DESCARGADO");
GaleryActivity activity = (GaleryActivity)context;
LinearLayout linearLayout = (LinearLayout)activity.findViewById(R.id.linearLayoutLoader);
for ( int i = 0; i < linearLayout.getChildCount(); i++ ){
View view = linearLayout.getChildAt(i);
view.setVisibility(View.GONE);
}
ViewPager viewPager = (ViewPager)activity.findViewById(R.id.viewPagerGalery);
viewPager.setPageTransformer(true, new ZoomOutPageTransformer());
GaleryPageAdapter galeryPageAdapter = new GaleryPageAdapter(activity.getSupportFragmentManager(), bitmap);
viewPager.setAdapter(galeryPageAdapter);
super.onPostExecute(bitmap);
}
}
| [
"g5@Mario-Alcazar.local"
] | g5@Mario-Alcazar.local |
494bcc7f79ebab1aac58671c22a632f39af16506 | 63696e919cd911d95dadd32e409bd27fd38ec2b9 | /src/ClienteSide/Client.java | d0645e20ee845b4c8506a685ed2608aa52c25af1 | [] | no_license | brunoaandrade/SFA-Share-FilesAplication- | 8e1e5ae0f0f96a8b138a7166a3b6e06c138f341c | 0d83e3291945ecff7d1ccb647e46027f60b4fc95 | refs/heads/master | 2020-05-23T08:18:18.719816 | 2016-10-07T12:53:21 | 2016-10-07T12:53:21 | 70,245,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,613 | 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 ClienteSide;
import Interface.IOperations;
import JPAEntities.Files;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
*
* @author Bruno
*/
public class Client {
private final IOperations stub;
private ClientActions ca;
private final File dir = new File("Keys");
Client(IOperations stub) {
this.stub = stub;
if (!dir.exists()) {
try {
dir.mkdir();
} catch (SecurityException se) {
//handle it
}
}
}
public void menu() {
ca = new ClientActions(stub);
int num = ca.choseMenu();
switch (num) {
case 1:
ca.createAccount();
menu();
break;
case 2:
if (ca.iniciateSession()) {
menu1();
} else {
menu();
}
break;
default:
System.out.println("Not a valid option!");
menu();
}
}
private void menu1() {
System.out.println("• 1 List the existing PBoxes.");
System.out.println("• 2 List my PBox files.");
System.out.println("• 3 Add a protected file to my PBox.");
System.out.println("• 4 Terminate a session with my PBox.");
System.out.println("");
System.out.print("• option:");
Scanner in = new Scanner(System.in);
int num = in.nextInt();
System.out.println("");
switch (num) {
case 1:
ca.listAllPbox();
menu1();
break;
case 3:
ca.addFile();
menu1();
break;
case 2:
List<Files> lf = ca.listFiles();
if (lf.isEmpty()) {
menu1();
} else {
List<String> filesID = new ArrayList<>();
for (Files lf1 : lf) {
filesID.add(lf1.getName());
}
menu2(filesID);
}
break;
case 4:
if(ca.terminateSession())
menu();
menu1();
break;
default:
System.out.println("Not a valid option!");
menu1();
}
}
private void menu2(List<String> filesID) {
System.out.println("• 1 Download File - Get the original file contents of a protected file in my PBox.");
System.out.println("• 2 File sharing Table - List the PBoxes sharing a file of my PBox.");
System.out.println("• 3 Share a file - Share a file in my PBox with other PBoxes.");
System.out.println("• 4 UnShare a file - Unshare a file in my PBox.");
System.out.println("• 5 Delete - Delete a file from my PBoxa file from my PBox.");
System.out.println("• 6 Update File - Upload a file to replace a file that you already have");
System.out.println("• 7 Menu - Go back");
System.out.println("");
System.out.print("• option:");
Scanner in = new Scanner(System.in);
int num = in.nextInt();
System.out.println("");
switch (num) {
case 1:
ca.getFile(filesID);
menu1();
break;
case 2:
ca.shareTableFile(filesID);
menu1();
break;
case 3:
ca.shareFile(filesID);
menu1();
break;
case 4:
ca.unShareFile(filesID);
menu1();
break;
case 5:
ca.deleteFile(filesID);
menu1();
break;
case 6:
ca.updateFile(filesID);
menu1();
break;
case 7:
menu1();
break;
default:
System.out.println("Not a valid option!");
menu2(filesID);
}
}
}
| [
"brunoaandrade@ua.pt"
] | brunoaandrade@ua.pt |
a9341dce9788323ab5f0d6225805cfddd1aaad3b | f2ac4d2d805303f25b27dea84b3afff0da8c7385 | /jeecg/src/main/java/org/jeecgframework/web/system/service/impl/CategoryServiceImpl.java | f06dbb25e1144db442f98333977add2acbf9c88a | [] | no_license | kinky2015/jeecg | 9b7b28c8ab43390668a5164e001297bc5a7e89af | 8b303582ab606c28f661491e329784ea66b69978 | refs/heads/master | 2021-01-10T08:26:20.626309 | 2016-03-28T14:25:29 | 2016-03-28T14:25:29 | 54,897,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,424 | java | package org.jeecgframework.web.system.service.impl;
import java.util.List;
import java.util.Map;
import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
import org.jeecgframework.core.util.YouBianCodeUtil;
import org.jeecgframework.core.util.oConvertUtils;
import org.jeecgframework.web.system.pojo.base.TSCategoryEntity;
import org.jeecgframework.web.system.service.CategoryServiceI;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("tSCategoryService")
@Transactional
public class CategoryServiceImpl extends CommonServiceImpl implements
CategoryServiceI {
// private static final String MAX_SQL = "SELECT MAX(code) FROM t_s_category WHERE parent_code";
@Override
public void saveCategory(TSCategoryEntity category) {
String parentCode = null;
if(category.getParent()!=null&&oConvertUtils.isNotEmpty(category.getParent().getCode())){
parentCode = category.getParent().getCode();
String localMaxCode = getMaxLocalCode(parentCode);
category.setCode(YouBianCodeUtil.getSubYouBianCode(parentCode, localMaxCode));
}else{
String localMaxCode = getMaxLocalCode(null);
category.setParent(null);
category.setCode(YouBianCodeUtil.getNextYouBianCode(localMaxCode));
}
this.save(category);
}
private synchronized String getMaxLocalCode(String parentCode){
if(oConvertUtils.isEmpty(parentCode)){
parentCode = "";
}
int localCodeLength = parentCode.length() + YouBianCodeUtil.zhanweiLength;
StringBuilder sb = new StringBuilder();
sb.append("SELECT code FROM t_s_category");
sb.append(" where LENGTH(code) = ").append(localCodeLength);
if(oConvertUtils.isNotEmpty(parentCode)){
sb.append(" and code like '").append(parentCode).append("%'");
}
sb.append(" ORDER BY code DESC ");
List<Map<String, Object>> objMapList = this.findForJdbc(sb.toString(), 1, 1);
String returnCode = null;
if(objMapList!=null&& objMapList.size()>0){
returnCode = (String)objMapList.get(0).get("code");
}
return returnCode;
}
// /**
// * 获取类型编码 加锁防止并发问题
// *
// * @param category
// * @return
// */
// private synchronized String getCategoryCoade(TSCategoryEntity category) {
// Long maxCode = null;
// //step 1 顶级code只按照序列增长
// if (category.getParent() == null
// || StringUtils.isEmpty(category.getParent().getCode())) {
// category.setParent(null);
// maxCode = this.getCountForJdbc(MAX_SQL + " IS NULL");
// maxCode = maxCode == 0 ? 1 : maxCode + 1;
// return String.format(
// "%0"
// + Integer.valueOf(ResourceUtil
// .getConfigByName("categoryCodeLengthType"))
// + "d", maxCode);
// }
// //step 2按照下级序列向上排序
// TSCategoryEntity parent = this.findUniqueByProperty(TSCategoryEntity.class,"code", category
// .getParent().getCode());
// //防止hibernate缓存持久化异常
// category.setParent(parent);
// maxCode = this.getCountForJdbc(MAX_SQL + " = '"
// + category.getParent().getCode()+"' and code like '"+ category.getParent().getCode()+"%'");
// maxCode = maxCode == 0 ? 1 : Long.valueOf(maxCode.toString()
// .substring(parent.getCode().length())) + 1;
// return parent.getCode()
// + String.format(
// "%0"
// + Integer.valueOf(ResourceUtil
// .getConfigByName("categoryCodeLengthType"))
// + "d", maxCode);
// }
} | [
"kinky2015vip@gmail.com"
] | kinky2015vip@gmail.com |
0555436218b70428f49c33aecdf6d5da24b5846a | 91a178ecf86b2b23313e04d37d42e542dbbc8124 | /src/main/java/booternetes/nativex/KubernetesHints.java | 3841b444e5e973d8dca0882297eef661e1ad1be5 | [
"Apache-2.0"
] | permissive | ahmedbelli/spring-native-kubernetes | 8aaa90134b08e52ebeee323b7714bc14f02089d6 | e8cfbeb2db9e6c6f1787dcc6832bd16e39e82d7c | refs/heads/main | 2023-04-06T06:36:09.193387 | 2021-04-18T07:16:25 | 2021-04-18T07:16:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,222 | java | package booternetes.nativex;
import org.springframework.nativex.hint.AccessBits;
import org.springframework.nativex.hint.TypeHint;
import org.springframework.nativex.type.AccessDescriptor;
import org.springframework.nativex.type.HintDeclaration;
import org.springframework.nativex.type.NativeConfiguration;
import org.springframework.nativex.type.TypeSystem;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* These hints are inspired by <a href="https://github.com/scratches/spring-controller">
* Dr. Dave Syer's sample Kubernetes controller</a> and the configuration therein.
* <p>
* These types work <a href="https://github.com/kubernetes-client/java">in conjunction
* with the autoconfiguration provided by the official Kubernetes Java client</a>, most of
* which is code-generated from Swagger. This support automatically registers any
* code-generated types that have {@link io.swagger.annotations.ApiModel} on it, limiting
* the registration to the code-generated types in the {@link io.kubernetes} package.
* <p>
* This hints class also registers options required to use this with a HTTPS API endpoints
* with custom character sets.
*
* @author Josh Long
* @author Dave Syer
*/
@TypeHint(typeNames = { "io.kubernetes.client.util.Watch$Response" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.util.generic.GenericKubernetesApi$StatusPatch" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.custom.Quantity$QuantityAdapter" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.extended.controller.Controller" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.informer.cache.ProcessorListener" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.custom.IntOrString" }, access = AccessBits.ALL)
@TypeHint(typeNames = { "io.kubernetes.client.custom.IntOrString$IntOrStringAdapter" }, access = AccessBits.ALL)
public class KubernetesHints implements NativeConfiguration {
@Override
public List<HintDeclaration> computeHints(TypeSystem typeSystem) {
List<String> models = typeSystem.findTypesAnnotated("Lio/swagger/annotations/ApiModel;", true);
List<String> adapters = typeSystem.findTypesAnnotated("Lcom/google/gson/annotations/JsonAdapter;", true);
List<String> rl = new ArrayList<String>();
rl.addAll(adapters);
rl.addAll(models);
List<HintDeclaration> ops = Stream
.of("-H:+AddAllCharsets", "--enable-all-security-services", "--enable-https", "--enable-http")
.map(op -> {
HintDeclaration hd = new HintDeclaration();
hd.addOption(op);
return hd;
}).collect(Collectors.toList());
List<HintDeclaration> reflection = new HashSet<>(rl).stream().filter(clzz -> clzz.startsWith("io/kubernetes"))
.map(clazzName -> {
HintDeclaration hd = new HintDeclaration();
hd.addDependantType(clazzName.replace("/", "."), new AccessDescriptor(AccessBits.ALL));
return hd;
}).collect(Collectors.toList());
List<HintDeclaration> merge = new ArrayList<>();
merge.addAll(ops);
merge.addAll(reflection);
return merge;
}
}
| [
"josh@joshlong.com"
] | josh@joshlong.com |
db9ce0d37d27ae72444a39444e2665c31ce6d6cf | 324febcf4a3b7e91ba75996ed106ee8ba963aaa5 | /plantuml-parser-core/src/main/java/com/shuzijun/plantumlparser/core/ParserConfig.java | 49b684c295fde5a751c49f014a182699856c7e31 | [
"Apache-2.0"
] | permissive | ninecloud/plantuml-parser | 15910870abcbb205da9e2ae38658d350dfd6014f | e7122b5bc8fcfb127ac40673051c472c7db6b137 | refs/heads/main | 2023-04-10T16:07:11.826791 | 2021-04-20T03:06:55 | 2021-04-20T03:06:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,507 | java | package com.shuzijun.plantumlparser.core;
import com.github.javaparser.ParserConfiguration;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.*;
/**
* 解析配置
*
* @author shuzijun
*/
public class ParserConfig {
/**
* 解析的文件路径
*/
private Map<String, File> fileMap = new HashMap<>();
/**
* 输出文件路径
*/
private String outFilePath;
private Set<String> fieldModifier = new HashSet<>();
private Set<String> methodModifier = new HashSet<>();
private boolean showPackage = true;
private boolean showConstructors = false;
private ParserConfiguration.LanguageLevel languageLevel = ParserConfiguration.LanguageLevel.JAVA_8;
public String getOutFilePath() {
return outFilePath;
}
public void setOutFilePath(String outFilePath) {
this.outFilePath = outFilePath;
}
public Set<File> getFilePaths() {
return new HashSet<>(fileMap.values());
}
public void addFilePath(String filePath) {
File file = new File(filePath);
if (!file.exists()) {
return;
} else if (file.isDirectory()) {
Collection<File> files = FileUtils.listFiles(file, new String[]{"java"}, Boolean.TRUE);
files.forEach(fileTemp -> fileMap.put(fileTemp.getPath(), fileTemp));
} else if (filePath.endsWith("java")) {
fileMap.put(file.getPath(), file);
}
}
public void addFieldModifier(String modifier) {
fieldModifier.add(modifier);
}
public boolean isFieldModifier(String modifier) {
return fieldModifier.contains(modifier);
}
public void addMethodModifier(String modifier) {
methodModifier.add(modifier);
}
public boolean isMethodModifier(String modifier) {
return methodModifier.contains(modifier);
}
public boolean isShowPackage() {
return showPackage;
}
public void setShowPackage(boolean showPackage) {
this.showPackage = showPackage;
}
public boolean isShowConstructors() {
return showConstructors;
}
public void setShowConstructors(boolean showConstructors) {
this.showConstructors = showConstructors;
}
public ParserConfiguration.LanguageLevel getLanguageLevel() {
return languageLevel;
}
public void setLanguageLevel(ParserConfiguration.LanguageLevel languageLevel) {
this.languageLevel = languageLevel;
}
}
| [
"shuzijun0109@gmail.com"
] | shuzijun0109@gmail.com |
1e6c437cc74687b4ce5c9d4b7b67d56f4eb9b6cf | d2f39db0e322697a3b8f816df47646b9524e5e86 | /src/main/java/com/crud/bets/domain/detail/SlipSettleDetails.java | d06f8907812f7378912364a51efac7dacc5c6424 | [] | no_license | KrzysiekPrzybylski/Sports-Betting | 26a306dcbc4ae453c0cda267d3e77c7e65d61f21 | 76b29af31511a230eaeb3a071816ba80b3451183 | refs/heads/master | 2023-07-01T12:15:14.397353 | 2021-08-03T17:21:00 | 2021-08-03T17:21:00 | 387,822,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 641 | java | package com.crud.bets.domain.detail;
import com.crud.bets.domain.Slip;
import com.sun.istack.NotNull;
import lombok.Builder;
import lombok.Data;
import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
@Entity
@Builder
public class SlipSettleDetails {
@NotNull
@Id
@GeneratedValue
private long id;
@NotNull
private LocalDateTime dateTime;
@NotNull
private BigDecimal stake;
@NotNull
private BigDecimal odds;
@NotNull
private boolean winning;
@NotNull
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "SLIP_ID")
private Slip slip;
}
| [
"krzy.przybylski@gmail.com"
] | krzy.przybylski@gmail.com |
1ce682db0ca5c1be23446ec11b144343943fc152 | 99ecf8fd4223d74da987a7d375e70703d66ac55d | /src/edu/ucla/library/libservices/aeon/vger/generators/BaseGenerator.java | fa2f7dd82b3a0efa2a0197870e1688ad930bbbf3 | [] | no_license | DRickard/AeonRequest | 740c13baedbb8217c14156fa6108da9ab2997d1e | 929dab902cf06b332ba4f5cf0550f8e0ceec7d39 | refs/heads/master | 2023-07-09T04:41:56.595969 | 2016-02-04T18:01:57 | 2016-02-04T18:01:57 | 26,180,397 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 743 | java | package edu.ucla.library.libservices.aeon.vger.generators;
import edu.ucla.library.libservices.aeon.vger.db.source.DataSourceFactory;
import javax.sql.DataSource;
public abstract class BaseGenerator
{
protected DataSource ds;
protected String dbName;
protected String bibID;
public BaseGenerator()
{
super();
}
public void setDbName( String dbName )
{
this.dbName = dbName;
}
public String getDbName()
{
return dbName;
}
public void setBibID( String bibID )
{
this.bibID = bibID;
}
public String getBibID()
{
return bibID;
}
protected void makeConnection()
{
ds = DataSourceFactory.createDataSource( getDbName() );
//ds = DataSourceFactory.createVgerSource();
}
}
| [
"drickard1967@library.ucla.edu"
] | drickard1967@library.ucla.edu |
a4dd92da2e156b9a436a6a42c9baf228a57084a9 | 52e3f67ecf6509fae199e856e8deadc0a8535070 | /app/src/test/java/com/example/jmclaughlin6572/midterm/ExampleUnitTest.java | 9afc426dfea66936ceafa09934f4952bfb701475 | [] | no_license | JoeMcl99/Prog3210MidTerm | 80413b2dbb25c67f8a139e3cf58e3a50926b4caf | 4a254ea83e1e75aefb7353b44ad8627d24bb5b50 | refs/heads/master | 2021-08-31T21:56:03.073959 | 2017-12-23T02:28:26 | 2017-12-23T02:28:26 | 115,045,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.example.jmclaughlin6572.midterm;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"jmclaughlin6572@gmail.com"
] | jmclaughlin6572@gmail.com |
f041e7eca5f33a1a00e65d5516fdb32fd8c48546 | 0929c5d3e5bb793ab3002a388852bc3300d9694c | /noob-ws-core/src/test/java/com/noob/nuxeo/ecm/filemanager/service/extension/TestNoobImporter.java | c46cc23043dcfecff26ed8408346348cabcacf1b | [] | no_license | mbensoltana/noob-project-mbs | f7746d284e6d8b21fe5eeddc178e44a415966386 | 63ac1e7c7a48f61c9a35f640e0714cfb5559e592 | refs/heads/master | 2022-12-07T16:34:28.962959 | 2020-08-21T16:01:43 | 2020-08-21T16:01:43 | 288,176,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,135 | java | package com.noob.nuxeo.ecm.filemanager.service.extension;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.net.URL;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nuxeo.ecm.core.api.Blob;
import org.nuxeo.ecm.core.api.CoreSession;
import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.core.api.impl.blob.URLBlob;
import org.nuxeo.ecm.platform.filemanager.api.FileImporterContext;
import org.nuxeo.ecm.platform.test.PlatformFeature;
import org.nuxeo.runtime.test.runner.Deploy;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.FeaturesRunner;
import org.nuxeo.runtime.test.runner.PartialDeploy;
import org.nuxeo.runtime.test.runner.TargetExtensions;
@RunWith(FeaturesRunner.class)
@Features(PlatformFeature.class)
@Deploy("com.noob.nuxeo.ecm.noob-ws-core")
@Deploy("org.nuxeo.ecm.platform.tag")
@Deploy("org.nuxeo.ecm.platform.rendition.core")
@Deploy("org.nuxeo.ecm.platform.picture.core")
@PartialDeploy(bundle = "studio.extensions.mbensoltana-SANDBOX", extensions = { TargetExtensions.ContentModel.class })
public class TestNoobImporter {
public static final String PATH_WORKSPACE = "/default-domain/workspaces";
@Inject
protected CoreSession session;
@Inject
protected NoobFileImporter noobFileImporter;
@Test
public void testVisualImportType() throws Exception {
assertNotNull(session);
URL resource = getClass().getClassLoader().getResource("images/visualCSV2.jpg");
Blob blob = new URLBlob(resource, "image/jpg");
FileImporterContext context = FileImporterContext.builder(session, blob, "/")
.overwrite(true)
.fileName("visualCSV2.jpg")
.build();
DocumentModel doc = noobFileImporter.createOrUpdate(context);
assertEquals("visual", doc.getType());
assertEquals("visualCSV2.jpg", doc.getProperty("file:content").getValue("name"));
}
}
| [
"69157490+mbensoltana@users.noreply.github.com"
] | 69157490+mbensoltana@users.noreply.github.com |
9045434f6a631266b568cd1d12e26caf8bd37170 | aa4091d23e9b206131426a92c5d278cb4b2e9929 | /app/src/androidTest/java/com/example/vehicleservicemanagementapplication/PostUnitTests.java | 48106660a7a30e2749e51fa2e059b3afa3a7e113 | [] | no_license | Shakil-Ali/Vehicle-Service-Management-Application | 79499cf8d3df592c6464bb72a3356f748270a6a8 | 2e9e9930366ef1af45a7d571215c14b11b52670f | refs/heads/master | 2020-08-20T23:42:34.844497 | 2020-07-10T20:02:17 | 2020-07-10T20:02:17 | 216,078,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,981 | java | package com.example.vehicleservicemanagementapplication;
// https://www.youtube.com/watch?v=_TR6QcRozAg
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
// Post unit tests class
public class PostUnitTests
{
// Variable initialisations
// Set up method (before testing)
@Before
public void setUp() throws Exception
{
// end of setup method
}
// Tear down method (after testing)
@After
public void tearDown() throws Exception
{
// end of tear down method
}
// CURRENTLY NO UNIT TESTS ARE REQUIRED FOR GETTERS AND SETTER
@Test
public void getTitle()
{
}
@Test
public void getMake()
{
}
@Test
public void getModel()
{
}
@Test
public void getTransmission()
{
}
@Test
public void getOil()
{
}
@Test
public void getDescription()
{
}
@Test
public void getNote()
{
}
@Test
public void getPicture()
{
}
@Test
public void getUserId()
{
}
@Test
public void getUserPhoto()
{
}
@Test
public void getTimeStamp()
{
}
@Test
public void getVehicleKey()
{
}
@Test
public void setTitle()
{
}
@Test
public void setMake()
{
}
@Test
public void setModel()
{
}
@Test
public void setTransmission()
{
}
@Test
public void setOil()
{
}
@Test
public void setDescription()
{
}
@Test
public void setNote()
{
}
@Test
public void setPicture()
{
}
@Test
public void setUserId()
{
}
@Test
public void setUserPhoto()
{
}
@Test
public void setTimeStamp()
{
}
@Test
public void setVehicleKey()
{
}
// end of post unit tests class
}
| [
"sali011@gold.ac.uk"
] | sali011@gold.ac.uk |
684c2f231bf28963cda7478e64da8e9bc04334d7 | ef7714c8c3ef7bcd2e631d627739be840718ca07 | /mx/src/ConnectionTest.java | 4b12bfdd83ea02b173934f0e8978388d90551f44 | [] | no_license | miraclemrs/sggmx | f3668981c6c75be35bbe0449f2ee8c3f56ac01ca | 45ad4ace6dacfafe7b6387867d2c58c4b4999e34 | refs/heads/master | 2023-03-14T05:34:32.959473 | 2021-03-09T05:22:45 | 2021-03-09T05:22:45 | 345,892,508 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,433 | java | import org.junit.Test;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
/**
* @author mx
* @create 2021-02-17-7:47 下午
*/
public class ConnectionTest {
@Test
public void test1() throws Exception {
//提供三个连接的基本信息
String url = "jdbc:mysql://localhost:3306/test";
String user = "root";
String password = "8wXPF9dJWRdmoK";
//注册驱动
Class.forName("com.mysql.cj.jdbc.Driver");
//获取连接
Connection connection = DriverManager.getConnection(url, user, password);
System.out.println(connection);
}
@Test
public void test2() throws Exception{
//1.读取文件中的四个基本信息
InputStream is = ConnectionTest.class.getClassLoader().getResourceAsStream("jdbc.properties");
Properties pros = new Properties();
pros.load(is);
String user = pros.getProperty("user");
String password = pros.getProperty("password");
String url = pros.getProperty("url");
String driverClass = pros.getProperty("driverClass");
//2.加载驱动
Class.forName(driverClass);
//3.获取连接
Connection connection = DriverManager.getConnection(url, user, password);
System.out.println(connection);
}
}
| [
"mx@shimengxuandeMacBook-Pro.local"
] | mx@shimengxuandeMacBook-Pro.local |
434a4bd01fee9dbdeb4a360176662e4d84bae7ae | 629984db2f692289247b20b9346b73420b6c1580 | /guts-sandbox/guts-flexdock/src/main/java/net/guts/gui/application/docking/DefaultViewContentFactory.java | fb7bd3e44273a68c4165508ca2f11769a033ce91 | [] | no_license | jfpoilpret/guts | 83a85f85c713412e6a9935ff83caa8a288aad3b1 | b9cd0186754c5d26d7fde7486f30d471f3413792 | refs/heads/master | 2020-12-24T19:28:09.079473 | 2013-06-02T14:26:25 | 2013-06-02T14:26:25 | 56,093,713 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | // Copyright 2009 Jean-Francois Poilpret
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package net.guts.gui.application.docking;
import java.util.Map;
import javax.swing.JComponent;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
@Singleton
class DefaultViewContentFactory implements ViewContentFactory
{
@Inject DefaultViewContentFactory(
Injector injector, @BindViewsMap Map<String, Class<? extends JComponent>> views)
{
_injector = injector;
_views = views;
}
/* (non-Javadoc)
* @see net.guts.gui.application.docking.ViewContentFactory#createContent(java.lang.String)
*/
@Override public JComponent createContent(String id)
{
Class<? extends JComponent> clazz = _views.get(id);
if (clazz != null)
{
return _injector.getInstance(clazz);
}
else
{
return null;
}
}
final private Injector _injector;
final private Map<String, Class<? extends JComponent>> _views;
}
| [
"jfpoilpret@users.noreply.github.com"
] | jfpoilpret@users.noreply.github.com |
237e23ac019249cdc1050339737af48b48f3dceb | f036a4ec319bbb119087da9d52ebd753e0d9059a | /src/test/java/com/joonas/flight/flightinfotable/SmokeTest.java | 086bf8151755751dba4aff6bd85df1b51402fe0e | [] | no_license | jjalonen/FlightListApp | 32d572e91c8b11b4adc16df6a44c43e86be64562 | 61a6ee2f0e5659c4735a22a386133780d1719ebf | refs/heads/master | 2020-12-28T05:42:51.608081 | 2020-02-06T10:40:39 | 2020-02-06T10:40:39 | 238,200,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | package com.joonas.flight.flightinfotable;
import com.joonas.flight.flightinfotable.controller.HomeController;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
class SmokeTest {
@Autowired
private HomeController controller;
@Test
public void contextLoads() throws Exception {
assertThat(controller).isNotNull();
}
}
| [
"joonas.jalzi@gmail.com"
] | joonas.jalzi@gmail.com |
6c3e61523409554e61013d7519d9582a97eee742 | 162fced8b60293404e8a7ea3e6093314f0657d6c | /BmPPmp/src/main/java/com/lti/service/AdminServiceImpl.java | eda4f223b34cb96f19e089f2ccf288267cf765d8 | [] | no_license | SaiCharan87s/BmPPmp | e9890361f49e29a2b1ddac26706904f143cc1ec8 | d4c87aed9522624d2f6db22f5a51d9460f74946c | refs/heads/master | 2023-08-02T14:49:42.070804 | 2021-09-26T07:12:44 | 2021-09-26T07:12:44 | 410,266,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.lti.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lti.dao.AdminDao;
@Service
public class AdminServiceImpl implements AdminService {
@Autowired
AdminDao adminDao;
@Override
public boolean checkAdminForLogin(String email, String password) {
return adminDao.checkAdminForLogin(email, password);
}
}
| [
"mithumarymanoj@gmail.com"
] | mithumarymanoj@gmail.com |
67801b883fdaa598f59c6a152f237c06ebfdb7eb | 4877219d8a61094fae6e8fa7a765d10ed0aae7df | /Students/Voicu Diana - Georgiana/Laboratoare/Laborator11/DragBall/src/DragDemo.java | 63e8e06773fef85513a4e99a19b865e0fd611fb3 | [] | no_license | dianagvoicu/POO2019-30223 | 393c16bb5c7abe4250a7a2ed0e0ddc7fe630cff6 | e3caefda1f1dc81beb3e9369f9c652c4d3128abb | refs/heads/master | 2020-08-13T00:38:39.406372 | 2020-01-11T11:53:49 | 2020-01-11T11:53:49 | 214,875,561 | 0 | 0 | null | 2019-10-13T18:52:23 | 2019-10-13T18:52:23 | null | UTF-8 | Java | false | false | 320 | java | import javax.swing.*;
public class DragDemo{
@SuppressWarnings("deprecation")
public static void main(String[] args) {
JFrame window = new JFrame();
window.setTitle("Drag Demo");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setContentPane(new DragBallPanel());
window.pack();
window.show();
}
} | [
"56352337+dianagvoicu@users.noreply.github.com"
] | 56352337+dianagvoicu@users.noreply.github.com |
c2c329ef24cfec71d764ce8cdaa444a125f46225 | d4f9116fbf67a5ee09ab5e212edf5e56d8c6c3ef | /android/app/src/debug/java/com/providers/ReactNativeFlipper.java | 3916748c2a82a0d8840bba2dd49b0332c613c373 | [] | no_license | motae99/kantaProviders | e03f101891d11bd4b9b48d10565a400f6cbff750 | e737044d2cd114343c279048b2b920fb7ae8ddee | refs/heads/master | 2023-03-23T00:31:30.318625 | 2021-03-19T14:53:40 | 2021-03-19T14:53:40 | 349,442,631 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,264 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.providers;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"motae99@gmail.com"
] | motae99@gmail.com |
cc0b785f5f9c6275f9d13fd21ee4112e6476f7a3 | f519e4f309288b3bfcc1ae431d1a53887068c3c8 | /app/src/main/java/com/roman/writtingassistent3/Day1Task1.java | 622a8887c556dd818bc9d6eaef8ac65490825542 | [] | no_license | rsayed007/WrittingAssistent | 4653c2fb556ba947eed5b1de1ba5bc398fafc618 | 4033ab6ffe733b560e5ce7bb905db7d6856cf2c5 | refs/heads/master | 2020-09-24T05:18:04.789421 | 2019-12-03T17:05:40 | 2019-12-03T17:05:40 | 225,672,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 974 | java | package com.roman.writtingassistent3;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
public class Day1Task1 extends AppCompatActivity {
TextView day_1_tsk1;
private AdView mAdView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_day1_task1);
MobileAds.initialize(this,
"ca-app-pub-5376079706371809~3812378426");
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
day_1_tsk1 = findViewById(R.id.day_1_tsk1);
day_1_tsk1.setMovementMethod(new ScrollingMovementMethod());
}
}
| [
"romansyed007@gmail.com"
] | romansyed007@gmail.com |
d2383e594548100e9fd1958aa244b72600b324d9 | dc2a515a86aa488c1018c35d7cf9963632dc3d8e | /201350109AnsLab3/src/lab3/ChartGenerator.java | 23edbc272392a58e76999012a1f6b5f47138cc33 | [] | no_license | rjesteban/BioInformaticsMiniToolkit | 1de130f6ab994c40556c50f3e14e5c7ab1b6ed80 | 0105d7d532522662780481f42dffe87401d8aba2 | refs/heads/master | 2021-01-18T01:44:59.224110 | 2016-12-11T12:01:09 | 2016-12-11T12:01:09 | 68,633,164 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,313 | 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 lab3;
import java.util.ArrayList;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
/**
*
* @author rjesteban
*/
public class ChartGenerator {
private ArrayList<ChartPanel> charts;
private JFrame frame;
public ChartGenerator (ArrayList<ChartPanel> charts) {
this.charts = charts;
initComponents();
this.frame.setVisible(true);
}
private void initComponents() {
if (charts.size() == 1)
frame = new JFrame("Hydrophobicity Plot");
else
frame = new JFrame("Hydrophobicity Plots");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(800, 800);
JPanel panel = new JPanel();
panel.setSize(frame.getSize());
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for (ChartPanel chart: charts) {
panel.add(chart.getPanel());
}
JScrollPane scrollpane = new JScrollPane(panel);
frame.add(scrollpane);
frame.pack();
}
}
| [
"ajcp.esteban@gmail.com"
] | ajcp.esteban@gmail.com |
1dd223bf09f2f38d5355871dc0624a0734dc1e98 | 8a2dd6ee7720c23e6f68e781d3f10a33dfc376ff | /src/main/java/com/cwgplc/studentregistration/StudentregistrationApplication.java | e7c6682c626ce720309df9cd47e3b9af9e14175b | [] | no_license | Fanibe/academy_students | 48664bdbcf8a2bcbb6b8e7d00b8aea13d602e9db | 75044e30194d4cb986b220396662d19c6485c31e | refs/heads/master | 2023-09-03T13:37:16.496681 | 2021-11-11T07:18:46 | 2021-11-11T07:18:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.cwgplc.studentregistration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class StudentregistrationApplication {
public static void main(String[] args) {
SpringApplication.run(StudentregistrationApplication.class, args);
}
}
| [
"stephen.ubogu@cwg-plc.com"
] | stephen.ubogu@cwg-plc.com |
07dba186ff62d2f73c4bbb9fd712b557cc3d951a | 61bc8a25daa41dd7dd7c8b49712f88a24d17048b | /CS323/src/edu/emory/mathcs/cs323/sort/AbstractSort.java | 040b417cc70834dc874820c42968efc7567b3a95 | [] | no_license | jrbarbati/emory-school-work | be4df95a711f5f05ba6ce5626d780a7fa79ea2fb | babf0cce833bec1b77ed66c6f7a62c444fe49e7e | refs/heads/master | 2020-07-10T06:06:41.849799 | 2019-08-30T04:44:00 | 2019-08-30T04:44:00 | 204,186,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,299 | java | package edu.emory.mathcs.cs323.sort;
import java.util.Comparator;
public abstract class AbstractSort<T extends Comparable<T>> {
protected Comparator<T> comparator;
protected long n_comparisons; // for benchmarking
protected long n_assignments; // for benchmarking
public AbstractSort(Comparator<T> comparator)
{
setComparator(comparator);
resetCounts();
}
public Comparator<T> getComparator() {
return comparator;
}
public void setComparator(Comparator<T> comparator) {
this.comparator = comparator;
}
/**
* Sorts the array[beginIndex:endIndex] in ascending order.
* @param array an array of comparable keys.
* @param beginIndex the index of the first key to be sorted (inclusive).
* @param endIndex the index of the last key to be sorted (exclusive).
*/
abstract public void sort(T[] array, int beginIndex, int endIndex);
/**
* Sorts the array in ascending order.
* @param array an array of comparable keys.
*/
public void sort(T[] array)
{
sort(array, 0, array.length);
}
public void resetCounts()
{
n_comparisons = 0;
n_assignments = 0;
}
/** @return the total number of comparisons performed by this sort. */
public long getComparisonCount()
{
return n_comparisons;
}
/** @return the total number of assignments performed by this sort. */
public long getAssignmentCount()
{
return n_assignments;
}
/**
* @param array an array of comparable keys.
* @param i the index of the first key.
* @param j the index of the second key.
* @return {@code array[i].compareTo(array[j])}
*/
protected int compareTo(T[] array, int i, int j)
{
n_comparisons++;
return comparator.compare(array[i], array[j]);
}
/**
* {@code array[index] = value}
* @param array an array of comparable keys.
* @param index the index of the array to assign.
* @param value the value to be assigned.
*/
protected void assign(T[] array, int index, T value)
{
n_assignments++;
array[index] = value;
}
/**
* Swaps {@code array[i]} and {@code array[j]}.
* @param array an array of comparable keys.
* @param i the index of the first key.
* @param j the index of the second key.
*/
protected void swap(T[] array, int i, int j)
{
T t = array[i];
assign(array, i, array[j]);
assign(array, j, t);
}
}
| [
"JOSEPH_BARBATI1@homedepot.com"
] | JOSEPH_BARBATI1@homedepot.com |
7bc6677f8ae27cf751c22befaa2ae6601d88cfe8 | 538414f61a305cf84e00cbd0f2c154e4fa99ccb7 | /build/javasqlc/src/org/openbravo/erpCommon/utility/reporting/printing/ToolsData.java | 8e75d46e0f67bf5a4a2f1cfb71a066615b832b2c | [] | no_license | q3neeko/openz | 4024d007ef2f1094faad8a8c17db8147e689d0f3 | 050ae0ba7b54ba9276a2fa85ecf5b2ec33954859 | refs/heads/master | 2020-03-29T21:44:56.783387 | 2018-09-26T14:34:00 | 2018-09-26T14:34:00 | 150,385,120 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,369 | java | //Sqlc generated V1.O00-1
package org.openbravo.erpCommon.utility.reporting.printing;
import java.sql.*;
import org.apache.log4j.Logger;
import javax.servlet.ServletException;
import org.openbravo.data.FieldProvider;
import org.openbravo.database.ConnectionProvider;
import org.openbravo.data.UtilSql;
import org.openbravo.data.FResponse;
class ToolsData implements FieldProvider {
static Logger log4j = Logger.getLogger(ToolsData.class);
private String InitRecordNumber="0";
public String adTableId;
public String getInitRecordNumber() {
return InitRecordNumber;
}
public String getField(String fieldName) {
if (fieldName.equalsIgnoreCase("ad_table_id") || fieldName.equals("adTableId"))
return adTableId;
else {
log4j.debug("Field does not exist: " + fieldName);
return null;
}
}
public static String getTableId(ConnectionProvider connectionProvider, String tableName) throws ServletException {
String strSql = "";
strSql = strSql +
" select" +
" ad_table.ad_table_id" +
" from" +
" ad_table" +
" where" +
" LOWER(ad_table.tablename) = LOWER(?)";
ResultSet result;
String strReturn = null;
PreparedStatement st = null;
int iParameter = 0;
try {
st = connectionProvider.getPreparedStatement(strSql);
iParameter++; UtilSql.setValue(st, iParameter, 12, null, tableName);
result = st.executeQuery();
if(result.next()) {
strReturn = UtilSql.getValue(result, "ad_table_id");
}
result.close();
} catch(SQLException e){
log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
throw new ServletException("@CODE=" + e.getSQLState() + "@" + e.getMessage());
} catch(Exception ex){
log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
throw new ServletException("@CODE=@" + ex.getMessage());
} finally {
try {
connectionProvider.releasePreparedStatement(st);
} catch(Exception ignore){
ignore.printStackTrace();
}
}
return(strReturn);
}
public static String isMultiLanguage(ConnectionProvider connectionProvider, String clientId) throws ServletException {
String strSql = "";
strSql = strSql +
" select ismultilingualdocument" +
" from ad_client " +
" where" +
" ad_client_id=?";
ResultSet result;
String strReturn = null;
PreparedStatement st = null;
int iParameter = 0;
try {
st = connectionProvider.getPreparedStatement(strSql);
iParameter++; UtilSql.setValue(st, iParameter, 12, null, clientId);
result = st.executeQuery();
if(result.next()) {
strReturn = UtilSql.getValue(result, "ismultilingualdocument");
}
result.close();
} catch(SQLException e){
log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
throw new ServletException("@CODE=" + e.getSQLState() + "@" + e.getMessage());
} catch(Exception ex){
log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
throw new ServletException("@CODE=@" + ex.getMessage());
} finally {
try {
connectionProvider.releasePreparedStatement(st);
} catch(Exception ignore){
ignore.printStackTrace();
}
}
return(strReturn);
}
}
| [
"neeko@gmx.de"
] | neeko@gmx.de |
317f07ca98cc6af391424df0c0954230ae44ca8c | 8953c846e1c9aa59aa4fa68cb98fe91dfb014e95 | /9/ViewStateInAndroid/app/src/androidTest/java/com/example/x/viewstateinandroid/ExampleInstrumentedTest.java | 188dc977089196dbd6a1686b2db2081e84c111b8 | [] | no_license | tdc197/study-android-project | e327cbed6b15a4e8026c59b0beae027643020ede | 1fd18890cb183bbbe85e556af75241ba34733e32 | refs/heads/master | 2021-10-19T18:33:19.704846 | 2019-02-23T05:53:28 | 2019-02-23T05:53:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | package com.example.x.viewstateinandroid;
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.*;
/**
* 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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.x.viewstateinandroid", appContext.getPackageName());
}
}
| [
"trandinhcong23081997@gmail.com"
] | trandinhcong23081997@gmail.com |
d9d4921a88dc8501e2885030cd2c4f7152c1bff1 | b1239455146a9964e218c0a326dfa3d96bd33e20 | /Backend/src/main/java/com/unep/wcmc/foodnutrition/security/SecurityConfig.java | 01564f6d3a413ea25a258b53046c80fc820868a8 | [] | no_license | unepwcmc/Food-Nutrition | a83cfba571b5007378e431482da26285eaa0bcea | 82aa4ccd8dc90d9e6e960e1a7fcfa23972af7240 | refs/heads/master | 2021-01-24T17:50:48.507566 | 2016-04-07T13:33:24 | 2016-04-07T13:33:24 | 51,439,245 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,359 | java | package com.unep.wcmc.foodnutrition.security;
import com.unep.wcmc.foodnutrition.security.token.TokenProvider;
import com.unep.wcmc.foodnutrition.security.token.XAuthTokenConfigurer;
import com.unep.wcmc.foodnutrition.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.access.AccessDeniedHandlerImpl;
import org.springframework.security.web.access.channel.ChannelProcessingFilter;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
/**
* Configuration responsible for setting all authorized requests as well as login service
*
*/
@Order(1)
@Configuration
@EnableWebSecurity
@EnableSpringDataWebSupport
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserService userService;
@Autowired
private TokenProvider tokenProvider;
@Autowired
private Http401UnauthorizedEntryPoint authenticationEntryPoint;
public SecurityConfig() {
super(true);
}
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
// Security filters
httpSecurity.addFilterBefore(new CORSFilter(), ChannelProcessingFilter.class);
httpSecurity.addFilterBefore(new LoginFilter("/login", tokenProvider,
userService, authenticationManager()), UsernamePasswordAuthenticationFilter.class);
// Security configuration
httpSecurity.exceptionHandling()
.accessDeniedHandler(new AccessDeniedHandlerImpl())
.authenticationEntryPoint(authenticationEntryPoint)
.and().csrf().disable().headers().frameOptions().disable()
.and().headers().cacheControl().disable()
.and().anonymous()
.and().servletApi()
.and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().authorizeRequests()
.antMatchers(HttpMethod.POST, "/login").denyAll()
.and().apply(securityConfigurerAdapter());
// Logout process
LogoutHandler logoutHandler = new LogoutHandler(tokenProvider);
httpSecurity.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout", "POST"))
.logoutSuccessHandler(logoutHandler)
.addLogoutHandler(logoutHandler);
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userService).passwordEncoder(passwordEncoder());
}
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Override
protected UserDetailsService userDetailsService() {
return userService;
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
private XAuthTokenConfigurer securityConfigurerAdapter() {
return new XAuthTokenConfigurer(tokenProvider);
}
}
| [
"rcandidosilva@gmail.com"
] | rcandidosilva@gmail.com |
4e728a8d56eb940da043ff8f8053b88dc0fc3afe | 4280fab34afcd1a8b6e6f5342542240d79a55802 | /src/main/java/com/yingzi/center/breeding/eo/Abortion.java | 2316e2a1c71c341a31d5b90c50bd98cf5962f7a6 | [] | no_license | idiotslkp/gen | b622faf64b02ceeb5d07a2f9199660b4331aff86 | bed49af74857e6c4dc7fcb3bcf6c674bc87a71cc | refs/heads/master | 2020-04-11T20:37:07.966637 | 2018-12-17T05:11:09 | 2018-12-17T05:11:09 | 162,077,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | package com.yingzi.center.breeding.eo;
import javax.persistence.Column;
import javax.persistence.Comment;
import javax.persistence.Table;
import java.lang.reflect.Field;
import java.util.Date;
/**
* Created by user26 on 2018/4/24.
*/
@Comment("流产表")
@Table(name = "bc_female_abortion")
public class Abortion {
// 注意,这里不需要id,
// 默认会生成id dr(删除标识) tenant_id(租户id) create_person create_time update_person update_time
@Column(name = "master_org_id", columnDefinition = "主组织id")
private Long masterOrgId;
@Column(name = "abortiondate", columnDefinition = "流产日期")
private Date abortionDate;
@Column(name = "herd_id", columnDefinition = "档案id")
private Long herdId;
// @Column(name = "event_id", columnDefinition = "事件id")
// private Long eventId;
@Column(name = "deslocation", columnDefinition = "新位置")
private String desLocation;
// 这里演示没有数据库字段名,也能使用的demo,但是为了统一规范,注释不能少.
@Column(columnDefinition = "备注")
private String fcomment;
}
| [
""
] | |
9380f47817b26c5b95fe21559ca545ac5312ea93 | 21e52369c0704f40ef56b92570fe5a4844e2d62c | /src/main/java/cm/elsha/cardreport/config/JacksonConfiguration.java | 08679fd670c885b72050d33d832d18c1007c039e | [] | no_license | BulkSecurityGeneratorProject/reportcard | 674bbb013ec8a921f494a88e1e6af58c36754a0d | 3998b4f96088edd0f6bd90cfa2ae17fa68d368df | refs/heads/master | 2022-12-15T18:01:05.713936 | 2016-10-07T05:57:26 | 2016-10-07T05:57:26 | 296,562,353 | 0 | 0 | null | 2020-09-18T08:33:14 | 2020-09-18T08:33:13 | null | UTF-8 | Java | false | false | 1,777 | java | package cm.elsha.cardreport.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.ZonedDateTimeSerializer;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
public class JacksonConfiguration {
public static final DateTimeFormatter ISO_FIXED_FORMAT =
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withZone(ZoneId.of("Z"));
public static final DateTimeFormatter ISO_DATE_OPTIONAL_TIME =
new DateTimeFormatterBuilder()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.optionalStart()
.appendLiteral('T')
.append(DateTimeFormatter.ISO_TIME)
.toFormatter();
@Autowired
private Jackson2ObjectMapperBuilder builder;
//To be replaced by a Jackson2ObjectMapperBuilderCustomizer in Spring-boot 1.4
@PostConstruct
public void postConstruct() {
this.builder.serializers(new ZonedDateTimeSerializer(ISO_FIXED_FORMAT));
//Will not be needed anymore with SB 1.4 (Jackson > 2.7.1)
this.builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(ISO_DATE_OPTIONAL_TIME));
}
@Bean
public ObjectMapper jacksonObjectMapper() {
return this.builder.createXmlMapper(false).build();
}
}
| [
"shydilaicard@gmail.com"
] | shydilaicard@gmail.com |
ea6c964ba5c52f5ef084b26efaeb6d985f44aed8 | b4d3cacd6ccf3d6fc3df28499641bcb55d8c3a25 | /src/anjaliS/LowerCapitalCoversion.java | 237a2e8efd171d253253089c7e857b5c39a907a6 | [] | no_license | KrishnaKTechnocredits/JAVATechnoOct2020 | 6d0c2b03c09572a22d6126b0bcd8c5b4ac47fb0c | 1f5750b88408f524482e7c1798bd54d9d8852213 | refs/heads/main | 2023-03-15T20:36:09.613633 | 2021-03-10T02:53:26 | 2021-03-10T02:53:26 | 306,812,633 | 0 | 2 | null | 2021-03-10T02:53:27 | 2020-10-24T05:27:27 | Java | UTF-8 | Java | false | false | 670 | java | package anjaliS;
public class LowerCapitalCoversion {
void Word(String word) {
String str = "";
System.out.println("Word is: " + word);
for (int index = 0; index < word.length(); index++) {
char ch = word.charAt(index);
if (Character.isLowerCase(ch))
str += Character.toUpperCase(ch);
else if (Character.isUpperCase(ch))
str += Character.toLowerCase(ch);
else
str += ch;
}
System.out.println("Word converted to: " + str);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
LowerCapitalCoversion lowercapitalcoversion = new LowerCapitalCoversion();
lowercapitalcoversion.Word("tE1GfrEsT");
}
}
| [
"anjalidewesh.shukla@gmail.com"
] | anjalidewesh.shukla@gmail.com |
65ffccd86de71f0eca01a76002c74eb716babc9a | 2ef4b12cac23ef22c71d66be21d2ec3e45edae17 | /GameServer/GamePackets/Login.java | 67bbe44c5bdc779e45ad221fa0a53f5147a9bed1 | [] | no_license | cietwwl/EoMH | f5cc177b7dd19460b5f1753fd38bc95ac8fc6293 | 9401aeed7144f79dce68974ec5ddbb3699956603 | refs/heads/master | 2020-03-14T01:26:41.521990 | 2015-03-05T11:48:40 | 2015-03-05T11:48:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,133 | java | package GameServer.GamePackets;
public class Login {
//tell client the authentication was a huge success
public static final byte[] authSuccess = new byte[] {
(byte)0x46, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xd9, (byte)0x00, (byte)0x1c, (byte)0x00, (byte)0x1c, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x01, (byte)0x45, (byte)0xbb, (byte)0x1f, (byte)0x36, (byte)0xcb, (byte)0xfc, (byte)0x63, (byte)0x3f, (byte)0x11, (byte)0x50, (byte)0xaa, (byte)0xea, (byte)0x3a,
(byte)0x94, (byte)0x60, (byte)0x8e, (byte)0xed, (byte)0x0f, (byte)0x86, (byte)0xd5, (byte)0xb9, (byte)0xf1, (byte)0xd5, (byte)0x62, (byte)0xcf, (byte)0x90, (byte)0x7f, (byte)0x0e, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x0d, (byte)0x87, (byte)0xc0, (byte)0x59, (byte)0x6c, (byte)0xe7, (byte)0xe8, (byte)0xd7, (byte)0xa8, (byte)0xbb, (byte)0xd8, (byte)0xce, (byte)0x15, (byte)0x6d,
(byte)0xac, (byte)0x83, (byte)0x21, (byte)0x4e, (byte)0x84, (byte)0x84, (byte)0x0a, (byte)0x00
};
//empty account - no characters
public static final byte[] account = new byte[] {
(byte)0x44, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x05, (byte)0x00, (byte)0x62, (byte)0x61, (byte)0x75,
(byte)0x6b, (byte)0x32, (byte)0x33, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x6d,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x00, (byte)0x00
};
//authentication failed
public static final byte[] authFail = new byte[] {(byte)0x09, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x03, (byte)0x00, (byte)0x64, (byte)0x00, (byte)0xc9};
}
| [
"sandermol95@hotmail.com"
] | sandermol95@hotmail.com |
4d7c28acbc97520e311b54bc31cc960a95789403 | 820c4444357a2ed38ede517f7dd171495a0a2cc8 | /Muutos-client/src/main/java/de/sonnmatt/muutos/events/BusyEvent.java | 69fdae2e54e96346741e75583a2335085e05aeae | [] | no_license | SaschaMuench/Muutos | e60c2f13cf185f7b1136e24a296e6a0716e354a2 | 4ae17945bda1139313f3d4cb9b9d4480c7f50ea7 | refs/heads/master | 2020-03-19T01:57:31.835100 | 2018-07-14T18:08:28 | 2018-07-14T18:08:28 | 74,029,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | /**
*
*/
package de.sonnmatt.muutos.events;
import com.google.gwt.event.shared.GwtEvent;
/**
* @author MuenSasc
*
*/
public class BusyEvent extends GwtEvent<IBusyEventHandler> {
public enum BusyEvents {
start, end
}
public static Type<IBusyEventHandler> TYPE = new Type<IBusyEventHandler>();
private final BusyEvents eventType;
public BusyEvent(BusyEvents startOrEnd) {
super();
this.eventType = startOrEnd;
}
@Override
public Type<IBusyEventHandler> getAssociatedType() {
return TYPE;
}
@Override
protected void dispatch(IBusyEventHandler handler) {
handler.onBusyChanged(this);
}
public BusyEvents getBusyEventType() {
return this.eventType;
}
}
| [
"muenchs@gmx.net"
] | muenchs@gmx.net |
8bb4e2e649b86d7d18f93fdcc9253ccef795dae3 | d793900c05234f510194ed9ea39334681dc549d5 | /src/main/generated/boilerplate/dao/EmployeeDaoImpl.java | b7ed150267c3a3f49d09fb26efc67461cc1a4c7e | [
"Apache-2.0"
] | permissive | kakusuke/simple-boilerplate | 7533904805eca995542e96a9d29ae3ec672b2b1f | 7d690a38201588924b74e7987ac050a0a3202ce7 | refs/heads/master | 2020-04-18T03:17:32.240392 | 2019-01-23T14:08:48 | 2019-01-23T14:08:48 | 167,193,514 | 0 | 0 | null | 2019-01-23T14:06:57 | 2019-01-23T14:06:57 | null | UTF-8 | Java | false | false | 12,745 | java | package boilerplate.dao;
/** */
@javax.annotation.processing.Generated(value = { "Doma", "2.21.1-SNAPSHOT" }, date = "2019-01-23T22:32:00.070+0900")
public class EmployeeDaoImpl extends org.seasar.doma.internal.jdbc.dao.AbstractDao implements boilerplate.dao.EmployeeDao {
static {
org.seasar.doma.internal.Artifact.validateVersion("2.21.1-SNAPSHOT");
}
private static final java.lang.reflect.Method __method0 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "selectAll");
private static final java.lang.reflect.Method __method1 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "selectById", java.lang.Integer.class);
private static final java.lang.reflect.Method __method2 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "select");
private static final java.lang.reflect.Method __method3 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "insert", boilerplate.entity.Employee.class);
private static final java.lang.reflect.Method __method4 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "update", boilerplate.entity.Employee.class);
private static final java.lang.reflect.Method __method5 = org.seasar.doma.internal.jdbc.dao.AbstractDao.getDeclaredMethod(boilerplate.dao.EmployeeDao.class, "delete", boilerplate.entity.Employee.class);
/** */
public EmployeeDaoImpl() {
super(boilerplate.AppConfig.singleton());
}
/**
* @param connection the connection
*/
public EmployeeDaoImpl(java.sql.Connection connection) {
super(boilerplate.AppConfig.singleton(), connection);
}
/**
* @param dataSource the dataSource
*/
public EmployeeDaoImpl(javax.sql.DataSource dataSource) {
super(boilerplate.AppConfig.singleton(), dataSource);
}
/**
* @param config the configuration
*/
protected EmployeeDaoImpl(org.seasar.doma.jdbc.Config config) {
super(config);
}
/**
* @param config the configuration
* @param connection the connection
*/
protected EmployeeDaoImpl(org.seasar.doma.jdbc.Config config, java.sql.Connection connection) {
super(config, connection);
}
/**
* @param config the configuration
* @param dataSource the dataSource
*/
protected EmployeeDaoImpl(org.seasar.doma.jdbc.Config config, javax.sql.DataSource dataSource) {
super(config, dataSource);
}
@Override
public java.util.List<boilerplate.entity.Employee> selectAll() {
entering("boilerplate.dao.EmployeeDaoImpl", "selectAll");
try {
org.seasar.doma.jdbc.query.SqlFileSelectQuery __query = getQueryImplementors().createSqlFileSelectQuery(__method0);
__query.setMethod(__method0);
__query.setConfig(__config);
__query.setSqlFilePath("META-INF/boilerplate/dao/EmployeeDao/selectAll.sql");
__query.setEntityType(boilerplate.entity._Employee.getSingletonInternal());
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("selectAll");
__query.setResultEnsured(false);
__query.setResultMappingEnsured(false);
__query.setFetchType(org.seasar.doma.FetchType.LAZY);
__query.setQueryTimeout(-1);
__query.setMaxRows(-1);
__query.setFetchSize(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.prepare();
org.seasar.doma.jdbc.command.SelectCommand<java.util.List<boilerplate.entity.Employee>> __command = getCommandImplementors().createSelectCommand(__method0, __query, new org.seasar.doma.internal.jdbc.command.EntityResultListHandler<boilerplate.entity.Employee>(boilerplate.entity._Employee.getSingletonInternal()));
java.util.List<boilerplate.entity.Employee> __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "selectAll", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "selectAll", __e);
throw __e;
}
}
@Override
public boilerplate.entity.Employee selectById(java.lang.Integer id) {
entering("boilerplate.dao.EmployeeDaoImpl", "selectById", id);
try {
org.seasar.doma.jdbc.query.SqlFileSelectQuery __query = getQueryImplementors().createSqlFileSelectQuery(__method1);
__query.setMethod(__method1);
__query.setConfig(__config);
__query.setSqlFilePath("META-INF/boilerplate/dao/EmployeeDao/selectById.sql");
__query.setEntityType(boilerplate.entity._Employee.getSingletonInternal());
__query.addParameter("id", java.lang.Integer.class, id);
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("selectById");
__query.setResultEnsured(false);
__query.setResultMappingEnsured(false);
__query.setFetchType(org.seasar.doma.FetchType.LAZY);
__query.setQueryTimeout(-1);
__query.setMaxRows(-1);
__query.setFetchSize(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.prepare();
org.seasar.doma.jdbc.command.SelectCommand<boilerplate.entity.Employee> __command = getCommandImplementors().createSelectCommand(__method1, __query, new org.seasar.doma.internal.jdbc.command.EntitySingleResultHandler<boilerplate.entity.Employee>(boilerplate.entity._Employee.getSingletonInternal()));
boilerplate.entity.Employee __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "selectById", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "selectById", __e);
throw __e;
}
}
@Override
public java.util.List<boilerplate.entity.Employee> select() {
entering("boilerplate.dao.EmployeeDaoImpl", "select");
try {
org.seasar.doma.jdbc.query.SqlFileSelectQuery __query = getQueryImplementors().createSqlFileSelectQuery(__method2);
__query.setMethod(__method2);
__query.setConfig(__config);
__query.setSqlFilePath("META-INF/boilerplate/dao/EmployeeDao/select.sql");
__query.setEntityType(boilerplate.entity._Employee.getSingletonInternal());
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("select");
__query.setResultEnsured(false);
__query.setResultMappingEnsured(false);
__query.setFetchType(org.seasar.doma.FetchType.LAZY);
__query.setQueryTimeout(-1);
__query.setMaxRows(-1);
__query.setFetchSize(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.prepare();
org.seasar.doma.jdbc.command.SelectCommand<java.util.List<boilerplate.entity.Employee>> __command = getCommandImplementors().createSelectCommand(__method2, __query, new org.seasar.doma.internal.jdbc.command.EntityResultListHandler<boilerplate.entity.Employee>(boilerplate.entity._Employee.getSingletonInternal()));
java.util.List<boilerplate.entity.Employee> __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "select", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "select", __e);
throw __e;
}
}
@Override
public int insert(boilerplate.entity.Employee employee) {
entering("boilerplate.dao.EmployeeDaoImpl", "insert", employee);
try {
if (employee == null) {
throw new org.seasar.doma.DomaNullPointerException("employee");
}
org.seasar.doma.jdbc.query.AutoInsertQuery<boilerplate.entity.Employee> __query = getQueryImplementors().createAutoInsertQuery(__method3, boilerplate.entity._Employee.getSingletonInternal());
__query.setMethod(__method3);
__query.setConfig(__config);
__query.setEntity(employee);
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("insert");
__query.setQueryTimeout(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.setNullExcluded(false);
__query.setIncludedPropertyNames();
__query.setExcludedPropertyNames();
__query.prepare();
org.seasar.doma.jdbc.command.InsertCommand __command = getCommandImplementors().createInsertCommand(__method3, __query);
int __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "insert", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "insert", __e);
throw __e;
}
}
@Override
public int update(boilerplate.entity.Employee employee) {
entering("boilerplate.dao.EmployeeDaoImpl", "update", employee);
try {
if (employee == null) {
throw new org.seasar.doma.DomaNullPointerException("employee");
}
org.seasar.doma.jdbc.query.AutoUpdateQuery<boilerplate.entity.Employee> __query = getQueryImplementors().createAutoUpdateQuery(__method4, boilerplate.entity._Employee.getSingletonInternal());
__query.setMethod(__method4);
__query.setConfig(__config);
__query.setEntity(employee);
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("update");
__query.setQueryTimeout(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.setNullExcluded(false);
__query.setVersionIgnored(false);
__query.setIncludedPropertyNames();
__query.setExcludedPropertyNames();
__query.setUnchangedPropertyIncluded(false);
__query.setOptimisticLockExceptionSuppressed(false);
__query.prepare();
org.seasar.doma.jdbc.command.UpdateCommand __command = getCommandImplementors().createUpdateCommand(__method4, __query);
int __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "update", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "update", __e);
throw __e;
}
}
@Override
public int delete(boilerplate.entity.Employee employee) {
entering("boilerplate.dao.EmployeeDaoImpl", "delete", employee);
try {
if (employee == null) {
throw new org.seasar.doma.DomaNullPointerException("employee");
}
org.seasar.doma.jdbc.query.AutoDeleteQuery<boilerplate.entity.Employee> __query = getQueryImplementors().createAutoDeleteQuery(__method5, boilerplate.entity._Employee.getSingletonInternal());
__query.setMethod(__method5);
__query.setConfig(__config);
__query.setEntity(employee);
__query.setCallerClassName("boilerplate.dao.EmployeeDaoImpl");
__query.setCallerMethodName("delete");
__query.setQueryTimeout(-1);
__query.setSqlLogType(org.seasar.doma.jdbc.SqlLogType.FORMATTED);
__query.setVersionIgnored(false);
__query.setOptimisticLockExceptionSuppressed(false);
__query.prepare();
org.seasar.doma.jdbc.command.DeleteCommand __command = getCommandImplementors().createDeleteCommand(__method5, __query);
int __result = __command.execute();
__query.complete();
exiting("boilerplate.dao.EmployeeDaoImpl", "delete", __result);
return __result;
} catch (java.lang.RuntimeException __e) {
throwing("boilerplate.dao.EmployeeDaoImpl", "delete", __e);
throw __e;
}
}
}
| [
"tasuku@freemind.co.jp"
] | tasuku@freemind.co.jp |
be487c76983891757de903e0e78d47ccc89adba3 | 25c5539e829698eb2718003fca108c609e69ca45 | /src/main/java/huating/com/utils/modelmapper/String2DateConverter.java | d009cbd3b60006247043d9afb7dbe6421d210fea | [] | no_license | kidroger/tankeSsmui | c3cf96cc85bea0949c5561a89e93e1edd98e6f0c | ac48fcf1f0ea2042d5ff9ee8568f4cd9612127c5 | refs/heads/master | 2021-09-17T02:01:22.264007 | 2018-06-26T14:55:54 | 2018-06-26T14:55:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package huating.com.utils.modelmapper;
import huating.com.utils.StringUtils;
import org.modelmapper.AbstractConverter;
import java.util.Date;
public class String2DateConverter extends AbstractConverter<String, Date> {
public String2DateConverter() {
}
protected Date convert(String source) {
return StringUtils.isBlank(source) ? null : DateUtils.stringToDate(source, DateUtils.DATE_TO_STRING_DETAIAL_PATTERN);
}
}
| [
"hn121907@163.com"
] | hn121907@163.com |
3946753ebb29ca3795b00f6c68ad86be4fc87817 | 0b8d8d12d3c3ce920d9d627f18083bf4c4251708 | /module_1/clase_03/Clase03/gen/com/area51/clase03/R.java | c25e79c5c46b40aaf6b9cfad2e93eb7b8eaf07d3 | [] | no_license | MREngineers/android_Group04 | 377a805c5a720698daff11675da86ee4e0339b96 | b8906e38c12ba61638dc214289c8bf46729dfb63 | refs/heads/master | 2020-12-26T01:59:43.069683 | 2014-01-31T20:28:25 | 2014-01-31T20:28:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,219 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.area51.clase03;
public final class R {
public static final class anim {
public static final int animator=0x7f040000;
public static final int animator_set=0x7f040001;
public static final int color_animator=0x7f040002;
public static final int cycle_7=0x7f040003;
public static final int fade=0x7f040004;
public static final int hold=0x7f040005;
public static final int hyperspace_in=0x7f040006;
public static final int hyperspace_out=0x7f040007;
public static final int layout_animation_row_left_slide=0x7f040008;
public static final int layout_animation_row_right_slide=0x7f040009;
public static final int layout_animation_table=0x7f04000a;
public static final int layout_bottom_to_top_slide=0x7f04000b;
public static final int layout_grid_fade=0x7f04000c;
public static final int layout_grid_inverse_fade=0x7f04000d;
public static final int layout_random_fade=0x7f04000e;
public static final int layout_wave_scale=0x7f04000f;
public static final int object_animator=0x7f040010;
public static final int push_left_in=0x7f040011;
public static final int push_left_out=0x7f040012;
public static final int push_up_in=0x7f040013;
public static final int push_up_out=0x7f040014;
public static final int shake=0x7f040015;
public static final int slide_left=0x7f040016;
public static final int slide_right=0x7f040017;
public static final int slide_top_to_bottom=0x7f040018;
public static final int wave_scale=0x7f040019;
public static final int zoom_enter=0x7f04001a;
public static final int zoom_exit=0x7f04001b;
}
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
*/
public static final int activity_horizontal_margin=0x7f050000;
public static final int activity_vertical_margin=0x7f050001;
}
public static final class drawable {
public static final int drawer_shadow=0x7f020000;
public static final int ic_drawer=0x7f020001;
public static final int ic_launcher=0x7f020002;
public static final int icon1=0x7f020003;
public static final int icon2=0x7f020004;
public static final int icon3=0x7f020005;
public static final int iconback=0x7f020006;
public static final int logo=0x7f020007;
public static final int splash=0x7f020008;
public static final int update=0x7f020009;
}
public static final class id {
public static final int action_settings=0x7f090004;
public static final int capaLauncher=0x7f090000;
public static final int content_frame=0x7f090002;
public static final int drawer_layout=0x7f090001;
public static final int left_drawer=0x7f090003;
public static final int update=0x7f090005;
}
public static final class layout {
public static final int activity_launcher=0x7f030000;
public static final int activity_main=0x7f030001;
}
public static final class menu {
public static final int launcher=0x7f080000;
public static final int main=0x7f080001;
}
public static final class string {
public static final int action_settings=0x7f060001;
public static final int app_name=0x7f060000;
public static final int drawer_close=0x7f060006;
public static final int drawer_open=0x7f060005;
public static final int hello_world=0x7f060002;
public static final int nameDisplay=0x7f060004;
public static final int title_activity_main=0x7f060003;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f070000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f070001;
}
}
| [
"segu19@gmail.com"
] | segu19@gmail.com |
a2a4d02d6ed0cb883e89c495c9141f7b865961de | dd8ca9011455d21d811c8cab0564fac0ec894ae0 | /controller/accesses/AccessControllerUpdate.java | 60a047c3b4f1f03527d5e2c6e1a7d935c194ecbe | [] | no_license | billhollow/PW2- | ea4e20bf359a5b95dbd645cc8152ad1005259b1b | 34a928fba45b9f9efb4b9e4eb4fb9ef676b7545a | refs/heads/master | 2020-03-21T13:47:27.211279 | 2018-06-25T17:19:03 | 2018-06-25T17:19:03 | 138,625,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,686 | java | package controller.accesses;
import java.io.IOException;
import javax.servlet.http.*;
import com.google.appengine.api.users.UserServiceFactory;
import java.util.List;
import javax.servlet.*;
import javax.jdo.PersistenceManager;
import model.entity.*;
import controller.PMF;
@SuppressWarnings("serial")
public class AccessControllerUpdate extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
com.google.appengine.api.users.User uGoogle= UserServiceFactory.getUserService().getCurrentUser();
if(uGoogle == null){
RequestDispatcher dp = getServletContext().getRequestDispatcher("/WEB-INF/Views/Errors/Error1.jsp");
dp.forward(request, response);
}
else{
PersistenceManager pm2 = PMF.get().getPersistenceManager();
String query10 = "select from " + User.class.getName() +
" where email=='" + uGoogle.getEmail() + "'" +
" && status==true";
List<User> uSearch = (List<User>) pm2.newQuery(query10).execute();
if(uSearch.isEmpty()){
RequestDispatcher dp = getServletContext().getRequestDispatcher("/WEB-INF/Views/Errors/Error2.jsp");
dp.forward(request, response);
}
else{
String query11 = "select from " + Resource.class.getName() +
" where name=='" + request.getServletPath() + "'" +
" && status==true";
List<Resource> rSearch = (List<Resource>)pm2.newQuery(query11).execute();
if( rSearch.isEmpty()){
RequestDispatcher dp = getServletContext().getRequestDispatcher("/WEB-INF/Views/Errors/Error3.jsp");
dp.forward(request, response);
}
else{
String query12 = "select from " + Access.class.getName() +
" where role==" + uSearch.get(0).getRole() +
" && resource==" + rSearch.get(0).getId() +
" && status==true";
List<Access> aSearch = (List<Access>) pm2.newQuery(query12).execute();
if(aSearch.isEmpty()){
RequestDispatcher dp = getServletContext().getRequestDispatcher("/WEB-INF/Views/Errors/Error4.jsp");
dp.forward(request, response);
}else{
if(request.getParameter("action").equals("updating")){
// create the persistence manager instance
PersistenceManager pm = PMF.get().getPersistenceManager();
//llenando de roles
String query2 = "select from " + Role.class.getName();
List<Role> roles = (List<Role>)pm.newQuery(query2).execute();
request.setAttribute("roles", roles);
//llenando de recursos
String query3 = "select from " + Resource.class.getName();
List<Resource> resources = (List<Resource>)pm.newQuery(query3).execute();
request.setAttribute("resources", resources);
String query = "select from " + Access.class.getName();
List<Access> accesses = (List<Access>)pm.newQuery(query).execute();
for(int i = 0;i<accesses.size() && accesses.get(i) != null;i++){
if(accesses.get(i).getId()== Long.parseLong((request.getParameter("accessId")))){
request.setAttribute("access", accesses.get(i));
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/Views/Accesses/accessUpdate.jsp");
dispatcher.forward(request, response);
break;
}
}
pm.close();
}
else{
Access aux = new Access();
// create the persistence manager instance
PersistenceManager pm = PMF.get().getPersistenceManager();
String query2 = "select from " + Role.class.getName();
List<Role> roles = (List<Role>)pm.newQuery(query2).execute();
String query3 = "select from " + Resource.class.getName();
List<Resource> resources = (List<Resource>)pm.newQuery(query3).execute();
String query = "select from " + Access.class.getName();
List<Access> accesses = (List<Access>)pm.newQuery(query).execute();
for(int i = 0;i<accesses.size() && accesses.get(i) != null;i++){
if(accesses.get(i).getId()== Long.parseLong((request.getParameter("accessId")))){
aux = accesses.get(i);
for(int j = 0;j<roles.size();j++){
if(roles.get(j).getName().equals(request.getParameter("role"))){
aux.setRole(roles.get(j).getId());
break;
}
}
for(int j = 0;j<resources.size();j++){
if(resources.get(j).getName().equals(request.getParameter("resource"))){
aux.setResource(resources.get(j).getId());
break;
}
}
break;
}
}
aux.setStatus(Boolean.valueOf(request.getParameter("status")));
pm.close();
response.sendRedirect("/accesses");
}
}
}
}
}
}
}
| [
"pcruzmam@unsa.edu.pe"
] | pcruzmam@unsa.edu.pe |
28cb012a34a185e2a883e513e4dba8930ffb1cfc | a30af1c7349f6cc8b376b1c378584326deff64c0 | /app/src/main/java/EnlistarJugador.java | 2fe3772908ca878edfb756d50896054406e8cb30 | [] | no_license | eduarcenc/Nivelacion-CC13I04001 | dc6618b67f721fcb81f012490f8183d346c1e835 | eeb48128f8830c97b8aef3d948f0e5ea58c051dc | refs/heads/master | 2020-04-03T03:01:28.729497 | 2018-10-27T14:27:42 | 2018-10-27T14:27:42 | 154,974,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33 | java | public class EnlistarJugador {
}
| [
"jose162911@gmail.com"
] | jose162911@gmail.com |
20c71e4603dd4e66607a35d3f5f788717e4b9004 | 46989ff756035ded10f27371bb26e756c77ce7e5 | /Hibernate/Cascade/hibernate/HibernateTest.java | 0b1a8c4a1432f1fbbfeeaeaf7040a63aa55e20c7 | [] | no_license | silambarasannatesan/Skill_Development | bde3f48a4468502860c35b2e90f010bbf8d120e7 | 981d6c862f88ebe48b828fbe5236f739b8c0600e | refs/heads/main | 2023-06-23T14:38:57.218570 | 2023-06-16T16:17:59 | 2023-06-16T16:17:59 | 351,688,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | package org.siimbu.java.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.siimbu.java.dto.UserDetails;
import org.siimbu.java.dto.Vehicle;
/**
* @author silambarasan
*
*/
public class HibernateTest {
public static void main(String[] args) {
UserDetails user = new UserDetails();
user.setUserName("First User");
Vehicle vehicle = new Vehicle();
vehicle.setVehiclename("Vehicle 1");
user.getVehicle().add(vehicle);
Vehicle vehicle2 = new Vehicle();
vehicle2.setVehiclename("Vehicle 2");
user.getVehicle().add(vehicle2);
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.openSession();
session.beginTransaction();
session.persist(user);
session.getTransaction().commit();
session.close();
}
}
| [
"silambarasanasn@gmail.com"
] | silambarasanasn@gmail.com |
444aa7fc47f02acefd6a271d9a7fbd8ce112c219 | c4ae2a3c582059ec98389b0e705fdc76dfcb0ae2 | /src/main/java/oracle/as/jmx/framework/PortableMBeanFactory.java | 7a3a8a0c03cfbcb892f600881770a74b013f74b8 | [] | no_license | neillin/graalvm-native-microservice | 0402be153868d561af6abe18e1e795c2df664097 | 34e2bc3b84df1a9d72955aca6a1db41975391aaa | refs/heads/master | 2020-06-19T06:08:52.225969 | 2018-09-26T07:14:39 | 2018-09-26T07:14:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package oracle.as.jmx.framework;
import javax.management.MBeanServer;
/**
* A shadow class, causes no mbeans to be loaded and/or registered.
*
* GraalVM doesn't support JMX.
*/
public class PortableMBeanFactory {
public MBeanServer getMBeanServer() {
// Do nothing.
return null;
}
}
| [
"r.rijn@portofrotterdam.com"
] | r.rijn@portofrotterdam.com |
60820fd7774ed0e9ce08c42a84310921e7bc6443 | d5c86a7076b56f4b7af706caf932ca3db566070a | /GLP_Conquest/src/countries/DonaldTrump.java | 7cda29d7a17ea3b9eee547d0686486237a0f8781 | [] | no_license | WilliamBequetRennes/GLP_Conquest | 75173e6bf74ab628c74de2bfbe32e3abfea64170 | 7d39aeaf130c7ceff48bca70b63c16e3bda49bff | refs/heads/master | 2021-05-01T06:37:43.674216 | 2018-04-09T19:56:56 | 2018-04-09T19:56:56 | 121,147,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 711 | java | package countries;
import countries.Leader;
public class DonaldTrump extends Leader{
private final static int NUMBER=1;
private static final int RANGE[]= {0,0,0,0,0,0,0,0};
private static final int MOVEMENT[]= {0,0,0,0,0,0,0,0};
private static float attack[]= {0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f};
private static float defense[]= {0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f};
private static float cost[]= {0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f,0.8f};
private static final float FOOD=1f;
private static final float OIL=1.1f;
private static final float ELECTRICITY=1f;
public DonaldTrump() {
super(NUMBER, RANGE, MOVEMENT, attack, defense, cost, FOOD, OIL, ELECTRICITY);
}
} | [
"35759889+WilliamBequetRennes@users.noreply.github.com"
] | 35759889+WilliamBequetRennes@users.noreply.github.com |
7be0663c0b31bb25242c8904372cf3e99ac02687 | 0c11613c21ebe12f48d6cebb6339887e10e72219 | /rmidemo/src/main/java/com/ggd543/rmi/impl/FlightImpl.java | 8f854f20e289623554406c5ee781bfb3e59c4083 | [] | no_license | mustang2247/demo | a3347a2994448086814383c67757f659208368cd | 35598ed0a3900afc759420b7100a7d310db2597d | refs/heads/master | 2021-05-09T17:28:22.631386 | 2014-06-10T12:03:26 | 2014-06-10T12:03:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,077 | java | package com.ggd543.rmi.impl;
import com.ggd543.rmi.Flight;
import java.io.Serializable;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Date;
/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: 11-9-11
* Time: 下午7:34
* To change this template use File | Settings | File Templates.
*/
public class FlightImpl implements Flight , Serializable {
private String flightNumber;
private Date flightDate;
private String originCity;
private String destCity;
@Override
public String toString(){
return "flightNumber: "+flightNumber+" flightDate: "+flightDate+" originCity: "+originCity+" destCity: "+destCity;
}
@Override
public boolean equals(Object o){
if (o instanceof FlightImpl){
FlightImpl that = (FlightImpl) o;
return that.flightNumber.equals(this.flightNumber);
}else{
return false;
}
}
public FlightImpl(String flightNumber) throws RemoteException{
this.flightNumber = flightNumber;
// UnicastRemoteObject.exportObject(this,0);
}
@Override
public String getFlightNumber() throws RemoteException {
return this.flightNumber;
}
@Override
public void setFlightNumber(String num) throws RemoteException {
this.flightNumber = num;
}
@Override
public String getOriginCity() throws RemoteException {
return this.originCity;
}
@Override
public void setOriginCity(String city) throws RemoteException {
this.originCity = city;
}
@Override
public String getDestCity() throws RemoteException {
return this.destCity;
}
@Override
public void setDestCity(String city) throws RemoteException {
this.destCity = city;
}
@Override
public Date getFlightDate() throws RemoteException {
return this.flightDate;
}
@Override
public void setFlightDate(Date date) throws RemoteException {
this.flightDate = date;
}
}
| [
"ggd543@gmail.com"
] | ggd543@gmail.com |
82c1915dbcbccd0111e86d4512cb47859d38d747 | 39bef83f3a903f49344b907870feb10a3302e6e4 | /Android Studio Projects/bf.io.openshop/src/android/support/v4/view/ViewCompat$ScrollIndicators.java | 79a9861c5f2788c91b5d8566c7bb8279d3451d1c | [] | no_license | Killaker/Android | 456acf38bc79030aff7610f5b7f5c1334a49f334 | 52a1a709a80778ec11b42dfe9dc1a4e755593812 | refs/heads/master | 2021-08-19T06:20:26.551947 | 2017-11-24T22:27:19 | 2017-11-24T22:27:19 | 111,960,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 140 | java | package android.support.v4.view;
import java.lang.annotation.*;
@Retention(RetentionPolicy.SOURCE)
public @interface ScrollIndicators {
}
| [
"ema1986ct@gmail.com"
] | ema1986ct@gmail.com |
051793bc2f741f07394c6bd743a822ede4a553cb | 990768f01efec157994cf048deff6f1fe1c6f7c6 | /app/src/main/java/com/example/login/login_maesto.java | a83a48999fecc1f0db7ec4ffefb4f651e143e38a | [] | no_license | JuanChavezM/Login | bd8e54524d3f4a169d3de605385d3abd58ecfd92 | 30d3e2edb4b3f10be4719d4bc1555115f2530ace | refs/heads/master | 2023-04-11T06:19:27.264249 | 2021-05-01T22:04:26 | 2021-05-01T22:04:26 | 363,515,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,525 | java | package com.example.login;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import java.util.HashMap;
import java.util.Map;
public class login_maesto extends AppCompatActivity {
EditText email, contraseña;
String str_email,str_password;
String url = "http://192.168.1.71/PCL/Login/logearMaestro.php";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_maesto);
email = findViewById(R.id.etemail);
contraseña = findViewById(R.id.etcontraseña);
}
public void Login(View view) {
if(email.getText().toString().equals("")){
Toast.makeText(this, "Enter Email", Toast.LENGTH_SHORT).show();
}
else if(contraseña.getText().toString().equals("")){
Toast.makeText(this, "Enter Password", Toast.LENGTH_SHORT).show();
}
else{
final ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setMessage("Por favor espera...");
progressDialog.show();
str_email = email.getText().toString().trim();
str_password = contraseña.getText().toString().trim();
StringRequest request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
progressDialog.dismiss();
if(response.equalsIgnoreCase("ingresastes correctamente")){
email.setText("");
contraseña.setText("");
startActivity(new Intent(getApplicationContext(),bienvenida_maestro.class));
Toast.makeText(login_maesto.this, response, Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(login_maesto.this, response, Toast.LENGTH_SHORT).show();
}
}
},new Response.ErrorListener(){
@Override
public void onErrorResponse(VolleyError error) {
progressDialog.dismiss();
Toast.makeText(login_maesto.this, error.getMessage().toString(), Toast.LENGTH_SHORT).show();
}
}
){
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String,String> params = new HashMap<String, String>();
params.put("email",str_email);
params.put("contraseña",str_password);
return params;
}
};
RequestQueue requestQueue = Volley.newRequestQueue(login_maesto.this);
requestQueue.add(request);
}
}
public void moveToRegistration(View view) {
startActivity(new Intent(getApplicationContext(), registrar_maestro.class));
finish();
}
} | [
"78819101+JuanChavezM@users.noreply.github.com"
] | 78819101+JuanChavezM@users.noreply.github.com |
b325e7b1d50a20d20b539a8629ced4a4e02b5f7c | 8ac9393062922901eddb9fc18c737d4e08c42d93 | /lite-jvm/src/com/tery/edu/jvm/constant/ConstantPool.java | a79a1256106bedf402c9ef95a9c1224957ed8771 | [] | no_license | tery007/study2017 | e3899932ca5cf5761ace9a1a5c16af69bf3336a5 | f6c0cebd0843106b4590a2b3c12a2b1f9004ee5e | refs/heads/master | 2021-01-01T19:53:19.579904 | 2019-02-01T05:56:41 | 2019-02-01T05:56:41 | 98,709,090 | 6 | 5 | null | null | null | null | GB18030 | Java | false | false | 563 | java | package com.tery.edu.jvm.constant;
import java.util.ArrayList;
import java.util.List;
/**
* @author Create by tery007
* @date 2017年10月9日
* 常量池
*/
public class ConstantPool {
List<ConstantInfo> infos=new ArrayList<>();//与常量项构成组合模式
public void addConstantInfo(ConstantInfo info){
infos.add(info);
}
public ConstantInfo getConstantInfo(int index) {
return infos.get(index);
}
public String getUTF8String(int attrNameIndex) {
Utf8Info info=(Utf8Info)getConstantInfo(attrNameIndex);
return info.getValue();
}
}
| [
"1595414159@qq.com"
] | 1595414159@qq.com |
fb8c960d9edafcbc17029cf72d7d9a3a510e2a70 | 58bc2346e334d015961bcb0bf3b65125ce407e8b | /allDocsReader/src/main/java/com/zapps/docsReaderModule/system/beans/CalloutView/CalloutManager.java | e123379bba20b9aa7dcb1572ecd83a7d12e25222 | [] | no_license | ZeeshanHayat2020/HtmlViewer | e7eeeb0adc40dd9fed7aa1128d15fdee5718c652 | 17b81bf0c33d271982dd86eef5f9891c709c0b31 | refs/heads/master | 2023-04-25T23:18:38.293648 | 2021-06-09T10:47:08 | 2021-06-09T10:47:08 | 350,306,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,178 | java | package com.zapps.docsReaderModule.system.beans.CalloutView;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import com.zapps.docsReaderModule.common.PaintKit;
import com.zapps.docsReaderModule.constant.MainConstant;
import com.zapps.docsReaderModule.system.IControl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class CalloutManager {
private int alpha = 0xFF;
private int color = Color.RED;
private int width = 10;
private int mode = MainConstant.DRAWMODE_NORMAL;
private IControl control;
private HashMap<Integer, List<PathInfo>> mPathMap;
public CalloutManager(IControl control) {
this.control = control;
mPathMap = new HashMap<Integer, List<PathInfo>>();
}
public void drawPath(Canvas canvas, int index, float zoom) {
canvas.scale(zoom, zoom);
List<PathInfo> pathList = mPathMap.get(index);
Paint paint = PaintKit.instance().getPaint();
if (pathList != null) {
for (int i = 0; i < pathList.size(); i++) {
PathInfo pathInfo = pathList.get(i);
paint.setStrokeWidth(pathInfo.width);
paint.setColor(pathInfo.color);
canvas.drawPath(pathInfo.path, paint);
}
}
}
public boolean isPathEmpty() {
return mPathMap.size() == 0;
}
public boolean isPathEmpty(int index) {
return mPathMap.get(index) == null;
}
public List<PathInfo> getPath(int index, boolean assignPath) {
if (assignPath && mPathMap.get(index) == null) {
mPathMap.put(index, new ArrayList<PathInfo>());
}
return mPathMap.get(index);
}
public int getAlpha() {
return alpha;
}
public void setAlpha(int alpha) {
this.alpha = alpha;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public void setDrawingMode(int mode) {
if (mode < MainConstant.DRAWMODE_NORMAL || mode > MainConstant.DRAWMODE_CALLOUTERASE) {
return;
}
this.mode = mode;
}
public int getDrawingMode() {
return mode;
}
public void dispose() {
mPathMap.clear();
mPathMap = null;
control = null;
}
}
| [
"zeeshanhayat61@gmail.com"
] | zeeshanhayat61@gmail.com |
18e474175acd8554ab8917ddcddb33e279c78c92 | ada8e4e920d496bc5bc66026f6369fc5adc81b1b | /BHXH/src/main/java/webservice/BHXH/controller/api/LoactionApiController.java | b8799ab0cb06f6d73600089608d9c1ce6860d621 | [] | no_license | xtung98git/BTWebservice | f6f5b864611b1873884d33176ac9c0a5e1881c76 | 68698e203665c7a5fa7d28312c7fe15921da70e4 | refs/heads/master | 2022-10-21T03:25:25.705225 | 2020-06-12T04:06:46 | 2020-06-12T04:06:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,517 | java | package webservice.BHXH.controller.api;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import webservice.BHXH.model.dto.LocationDto;
import webservice.BHXH.service.DistrictService;
import webservice.BHXH.service.ProvinceService;
import webservice.BHXH.service.VillageService;
@RestController
@RequestMapping("/api/location")
@CrossOrigin(origins = "*", maxAge = -1)
public class LoactionApiController {
@Autowired
private ProvinceService provinceService;
@Autowired
private DistrictService districtService;
@Autowired
private VillageService villageService;
@GetMapping("/getAllProvince")
public @ResponseBody List<LocationDto> getAllProvince() {
return provinceService.getAll();
}
@GetMapping("/getDistrictByProvince")
public @ResponseBody List<LocationDto> getDistrictByProvince(@RequestParam("provinceId") String provinceId) {
return districtService.getByProvince(provinceId);
}
@GetMapping("/getVillageByDistrict")
public @ResponseBody List<LocationDto> getVillageByDistrict(@RequestParam("districtId") String districtId) {
return villageService.getByDistrict(districtId);
}
}
| [
"harpuiasaber@harpuiasaber-Inspiron-5558"
] | harpuiasaber@harpuiasaber-Inspiron-5558 |
48d19b0c214c010117f1d3fc4d465bde584bd7e3 | cac8f27b31418c791230d8acd0af77a645327db9 | /src/loops/two/Loooop.java | 3e7f1cdb85c54ca794e76f63f4f47f6b4911bd01 | [] | no_license | SaidRasinlic/CoreJavaProgramming | 84ecff1f7f73f69f599aeabaddd6dc57106b9f87 | ad773d47d99c5629e6e9581c49aa9e99d2fe1b11 | refs/heads/master | 2022-04-03T03:53:39.679393 | 2020-02-03T23:44:25 | 2020-02-03T23:44:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 783 | java | package loops.two;
import java.util.Scanner;
public class Loooop {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int numberDrawn = reader.nextInt();
int i = 0;
while (true) {
System.out.println("Guess a number: ");
int x = reader.nextInt();
i++;
if (x == numberDrawn) {
break;
} else if (x < numberDrawn) {
System.out.println("The number is greater, guesses made: " + i);
} else {
System.out.println("The number is lesser, guesses made: " + i);
}
}
System.out.println("Congratulations, your guess is correct!");
}
}
| [
"57558480+SaidRasinlic@users.noreply.github.com"
] | 57558480+SaidRasinlic@users.noreply.github.com |
293970c59af4865b7fc089cd84997c79c8e27e3b | 447520f40e82a060368a0802a391697bc00be96f | /apks/comparison_androart/ro.btrl.pay/source/o/EL.java | 5f8a02c9db9d529f65233c3c3e56193082bff107 | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 383 | java | package o;
public class EL
{
public String cardHolderName;
public String cvv;
public String expirationDate;
public String pan;
public EL(String paramString1, String paramString2, String paramString3, String paramString4)
{
this.cardHolderName = paramString1;
this.cvv = paramString2;
this.expirationDate = paramString3;
this.pan = paramString4;
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
78feac996ff829f38ae0a1848c024b1e3a2fab4b | 572f9e3b8cc43263f5ce72c3d091caad6a1abba4 | /server/src/com/cloud/server/auth/LDAPUserAuthenticator.java | 9314ceb096136150e559d30a4f9d77bba7b600ca | [] | no_license | vijayendrabvs/CloudStack | a259b3494f9eceec3787b404f904862b4d8f5033 | cc9351b1741c09041d92f9aee41623c528aee8b2 | refs/heads/master | 2021-01-18T07:39:28.538889 | 2012-01-10T01:07:25 | 2012-01-10T01:07:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,294 | java | /**
* Copyright (C) 2011 Citrix.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
* It is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.cloud.server.auth;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import javax.ejb.Local;
import javax.naming.AuthenticationException;
import javax.naming.ConfigurationException;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants.LDAPParams;
import com.cloud.configuration.Config;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.server.ManagementServer;
import com.cloud.user.UserAccount;
import com.cloud.user.dao.UserAccountDao;
import com.cloud.utils.component.ComponentLocator;
@Local(value={UserAuthenticator.class})
public class LDAPUserAuthenticator extends DefaultUserAuthenticator {
public static final Logger s_logger = Logger.getLogger(LDAPUserAuthenticator.class);
private ConfigurationDao _configDao;
private UserAccountDao _userAccountDao;
@Override
public boolean authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters ) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Retrieving user: " + username);
}
UserAccount user = _userAccountDao.getUserAccount(username, domainId);
if (user == null) {
s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
return false;
}
String url = _configDao.getValue(LDAPParams.hostname.toString());
if (url==null){
s_logger.debug("LDAP authenticator is not configured.");
return false;
}
String port = _configDao.getValue(LDAPParams.port.toString());
String queryFilter = _configDao.getValue(LDAPParams.queryfilter.toString());
String searchBase = _configDao.getValue(LDAPParams.searchbase.toString());
String useSSL = _configDao.getValue(LDAPParams.usessl.toString());
String bindDN = _configDao.getValue(LDAPParams.dn.toString());
String bindPasswd = _configDao.getValue(LDAPParams.passwd.toString());
try {
// get all params
Hashtable<String, String> env = new Hashtable<String, String>(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://" + url + ":" + port);
if (new Boolean(useSSL) == Boolean.TRUE)env.put(Context.SECURITY_PROTOCOL, "ssl");
env.put(Context.SECURITY_PRINCIPAL, bindDN);
env.put(Context.SECURITY_CREDENTIALS, bindPasswd);
// Create the initial context
DirContext ctx = new InitialDirContext(env);
// use this context to search
// substitute the queryFilter with this user info
queryFilter = queryFilter.replaceAll("\\%u", username);
queryFilter = queryFilter.replaceAll("\\%n", user.getFirstname() + " " + user.getLastname());
queryFilter = queryFilter.replaceAll("\\%e", user.getEmail());
SearchControls sc = new SearchControls();
String[] searchFilter = { "dn" };
sc.setReturningAttributes(new String[0]); //return no attributes
sc.setReturningAttributes(searchFilter);
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
sc.setCountLimit(1);
// Search for objects with those matching attributes
NamingEnumeration<SearchResult> answer = ctx.search(searchBase, queryFilter, sc);
SearchResult sr = (SearchResult)answer.next();
String cn = sr.getName();
answer.close();
ctx.close();
s_logger.info("DN from LDAP =" + cn);
// check the password
env = new Hashtable<String, String>(11);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://" + url + ":" + port);
if (new Boolean(useSSL) == Boolean.TRUE)env.put(Context.SECURITY_PROTOCOL, "ssl");
env.put(Context.SECURITY_PRINCIPAL, cn + "," + searchBase);
env.put(Context.SECURITY_CREDENTIALS, password);
// Create the initial context
ctx = new InitialDirContext(env);
ctx.close();
} catch (NamingException ne) {
ne.printStackTrace();
s_logger.warn("Authentication failed due to " + ne.getMessage());
return false;
}
catch (Exception e){
s_logger.warn("Unknown error encountered " + e.getMessage());
return false;
}
// authenticate
return true;
}
public boolean configure(String name, Map<String, Object> params)
throws ConfigurationException {
super.configure(name, params);
ComponentLocator locator = ComponentLocator.getLocator(ManagementServer.Name);
_configDao = locator.getDao(ConfigurationDao.class);
_userAccountDao = locator.getDao(UserAccountDao.class);
return true;
}
}
| [
"abhinandan.prateek@citrix.com"
] | abhinandan.prateek@citrix.com |
3be96f6eb68e9938df6300891e721cf09701c8cc | c94f888541c0c430331110818ed7f3d6b27b788a | /rms/java/src/main/java/com/antgroup/antchain/openapi/rms/models/UpdateStackGeneratedconfigResponse.java | a815317a43e6a2b417c2d2ac6bde03946f68dcc7 | [
"MIT",
"Apache-2.0"
] | permissive | alipay/antchain-openapi-prod-sdk | 48534eb78878bd708a0c05f2fe280ba9c41d09ad | 5269b1f55f1fc19cf0584dc3ceea821d3f8f8632 | refs/heads/master | 2023-09-03T07:12:04.166131 | 2023-09-01T08:56:15 | 2023-09-01T08:56:15 | 275,521,177 | 9 | 10 | MIT | 2021-03-25T02:35:20 | 2020-06-28T06:22:14 | PHP | UTF-8 | Java | false | false | 1,412 | java | // This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.rms.models;
import com.aliyun.tea.*;
public class UpdateStackGeneratedconfigResponse extends TeaModel {
// 请求唯一ID,用于链路跟踪和问题排查
@NameInMap("req_msg_id")
public String reqMsgId;
// 结果码,一般OK表示调用成功
@NameInMap("result_code")
public String resultCode;
// 异常信息的文本描述
@NameInMap("result_msg")
public String resultMsg;
public static UpdateStackGeneratedconfigResponse build(java.util.Map<String, ?> map) throws Exception {
UpdateStackGeneratedconfigResponse self = new UpdateStackGeneratedconfigResponse();
return TeaModel.build(map, self);
}
public UpdateStackGeneratedconfigResponse setReqMsgId(String reqMsgId) {
this.reqMsgId = reqMsgId;
return this;
}
public String getReqMsgId() {
return this.reqMsgId;
}
public UpdateStackGeneratedconfigResponse setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public String getResultCode() {
return this.resultCode;
}
public UpdateStackGeneratedconfigResponse setResultMsg(String resultMsg) {
this.resultMsg = resultMsg;
return this;
}
public String getResultMsg() {
return this.resultMsg;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
e66a910b5f04051b930f7cc5275a2d9ae8ba3016 | 45133ec88186a6a29a7771450394bbe847e7701f | /SocialApp/Ours/app/src/main/java/com/ours/yours/app/entity/Comment.java | 23cf38d3d61734d5bc3e9a02fc1edb5d1e3da188 | [] | no_license | MouChiaHung/App | 81e5884248c9eec1e64453904157628f87000291 | 83d29e60dfb5da2e65d7b4d24560d4de501d8c5e | refs/heads/master | 2020-04-14T20:15:36.530673 | 2019-02-22T02:30:12 | 2019-02-22T02:30:12 | 164,087,199 | 8 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,281 | java | package com.ours.yours.app.entity;
import android.os.Parcel;
import android.os.Parcelable;
import com.orhanobut.logger.Logger;
import com.ours.yours.R;
import java.util.HashMap;
import java.util.Map;
public class Comment implements Parcelable{
public static final String DEFAULT_CARD_ID = "";
public static final String DEFAULT_COMMENT_ID = "";
public static final String DEFAULT_PROFILE_PHOTO_URL = String.valueOf(R.drawable.ic_stub);
public static final String DEFAULT_PROFILE_NAME = "";
public static final String DEFAULT_PROFILE_ID = "";
public static final String DEFAULT_COMMENT = "";
public static final int DEFAULT_DISTANCE = -1;
public static final long DEFAULT_DATE = -1;
/**
* name of fields are same as the name of columns in the table representing a SQL database storing comments
*/
private String CardId;
private String CommentId;
private String ProfilePhoto;
private String ProfileName;
private String ProfileID;
private String Comment;
private int Distance;
private long Date;
public Comment() {}
private Comment(Parcel in) {
CardId = in.readString();
CommentId = in.readString();
ProfilePhoto = in.readString();
ProfileName = in.readString();
ProfileID = in.readString();
Comment = in.readString();
Distance = in.readInt();
Date = in.readLong();
}
public Comment(String cardId, String commentId, String profilePhoto, String profileName, String profileID
, String comment, int distance, long date) {
CardId = cardId;
CommentId = commentId;
ProfilePhoto = profilePhoto;
ProfileName = profileName;
ProfileID = profileID;
Comment = comment;
Distance = distance;
Date = date;
}
/**
* getter
*/
public String getCardId() {
return CardId;
}
public String getCommentId() {
return CommentId;
}
public String getProfilePhoto() {
return ProfilePhoto;
}
public String getProfileName() {
return ProfileName;
}
public String getProfileID() {
return ProfileID;
}
public String getComment() {
return Comment;
}
public int getDistance() {
return Distance;
}
public long getDate() {
return Date;
}
/**
* setter
*/
public void setCardId(String cardId) {
CardId = cardId;
}
public void setCommentId(String commentId) {
CommentId = commentId;
}
public void setProfilePhoto(String profilePhoto) {
ProfilePhoto = profilePhoto;
}
public void setProfileName(String profileName) {
ProfileName = profileName;
}
public void setProfileID(String profileID) {
profileID = profileID;
}
public void setComment(String comment) {
Comment = comment;
}
public void setDistance(int distance) {
Distance = distance;
}
public void setDate(long date) {
Date = date;
}
public void printCommentData(){
Logger.d(">>>");
String log = "... "
+ "CardId:" + getCardId()
+ "\n"
+ "CommentId:" + getCommentId()
+ "\n"
+ "ProfilePhoto:" + getProfilePhoto()
+ "\n"
+ "ProfileName:" + getProfileName()
+ "\n"
+ "ProfileID:" + getProfileID()
+ "\n"
+ "Comment:" + getComment()
+ "\n"
+ "Distance:" + getDistance()
+ "\n"
+ "Date:" + getDate();
Logger.d(log);
}
/**
* serializer
*/
public Map<String, Object> toMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("CardId", this.getCardId());
map.put("CommentId", this.getCommentId());
map.put("ProfilePhoto", this.getProfilePhoto());
map.put("ProfileName", this.getProfileName());
map.put("ProfileID", this.getProfileID());
map.put("Comment", this.getComment());
map.put("Distance", this.getDistance());
map.put("Date", this.getDate());
return map;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(CardId);
dest.writeString(CommentId);
dest.writeString(ProfilePhoto);
dest.writeString(ProfileName);
dest.writeString(ProfileID);
dest.writeString(Comment);
dest.writeInt(Distance);
dest.writeLong(Date);
}
public static final Creator<Comment> CREATOR = new Creator<Comment>() {
public Comment createFromParcel(Parcel in) {
return new Comment(in);
}
public Comment[] newArray(int size) {
return new Comment[size];
}
};
}
| [
"ifeelgooder@gmail.com"
] | ifeelgooder@gmail.com |
0ba73f164df96817199d626765cbf57a13d51846 | 49c3d34e6e6db2df0594134bbcb8a509cb195f0b | /grooo/src/main/java/com/wenym/grooo/utils/stackblur/StackBlurManager.java | 8d03ae3cde8b87e406b64359d556d2a844147d28 | [
"MIT"
] | permissive | yankaics/grooo_android_client | 23165d9db0ca1ebdbb756654c74eddad9f83f646 | 87cb9e97e014ec30ec2f70929fb615bc57d67f9b | refs/heads/master | 2021-01-17T13:43:22.489527 | 2016-04-13T05:42:36 | 2016-04-13T05:42:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,866 | java | /**
* StackBlur v1.0 for Android
*
* @Author: Enrique López Mañas <eenriquelopez@gmail.com>
* http://www.lopez-manas.com
*
* Author of the original algorithm: Mario Klingemann <mario.quasimondo.com>
*
* This is a compromise between Gaussian Blur and Box blur
* It creates much better looking blurs than Box Blur, but is
* 7x faster than my Gaussian Blur implementation.
*
* I called it Stack Blur because this describes best how this
* filter works internally: it creates a kind of moving stack
* of colors whilst scanning through the image. Thereby it
* just has to add one new block of color to the right side
* of the stack and remove the leftmost color. The remaining
* colors on the topmost layer of the stack are either added on
* or reduced by one, depending on if they are on the right or
* on the left side of the stack.
*
* @copyright: Enrique López Mañas
* @license: Apache License 2.0
*/
package com.wenym.grooo.utils.stackblur;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v8.renderscript.RSRuntimeException;
import android.util.Log;
import com.wenym.grooo.BuildConfig;
import java.io.FileOutputStream;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class StackBlurManager {
static final int EXECUTOR_THREADS = Runtime.getRuntime().availableProcessors();
static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(EXECUTOR_THREADS);
private static volatile boolean hasRS = true;
/**
* Original image
*/
private final Bitmap _image;
/**
* Most recent result of blurring
*/
private Bitmap _result;
/**
* Method of blurring
*/
private final BlurProcess _blurProcess;
/**
* Constructor method (basic initialization and construction of the pixel array)
* @param image The image that will be analyed
*/
public StackBlurManager(Bitmap image) {
_image = image;
_blurProcess = new JavaBlurProcess();
}
/**
* Process the image on the given radius. Radius must be at least 1
* @param radius
*/
public Bitmap process(int radius) {
_result = _blurProcess.blur(_image, radius);
return _result;
}
/**
* Returns the blurred image as a bitmap
* @return blurred image
*/
public Bitmap returnBlurredImage() {
return _result;
}
/**
* Save the image into the file system
* @param path The path where to save the image
*/
public void saveIntoFile(String path) {
try {
FileOutputStream out = new FileOutputStream(path);
_result.compress(Bitmap.CompressFormat.PNG, 90, out);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Returns the original image as a bitmap
* @return the original bitmap image
*/
public Bitmap getImage() {
return this._image;
}
/**
* Process the image using a native library
*/
public Bitmap processNatively(int radius) {
NativeBlurProcess blur = new NativeBlurProcess();
_result = blur.blur(_image, radius);
return _result;
}
/**
* Process the image using renderscript if possible
* Fall back to native if renderscript is not available
* @param context renderscript requires an android context
* @param radius
*/
public Bitmap processRenderScript(Context context, float radius) {
BlurProcess blurProcess;
// The renderscript support library doesn't have .so files for ARMv6.
// Remember if there is an error creating the renderscript context,
// and fall back to NativeBlurProcess
if(hasRS) {
try {
blurProcess = new RSBlurProcess(context);
} catch (RSRuntimeException e) {
if(BuildConfig.DEBUG) {
Log.i("StackBlurManager", "Falling back to Native Blur", e);
}
blurProcess = new NativeBlurProcess();
hasRS = false;
}
}
else {
blurProcess = new NativeBlurProcess();
}
_result = blurProcess.blur(_image, radius);
return _result;
}
}
| [
"806478101@qq.com"
] | 806478101@qq.com |
52c286613c357107ca52aebe5feb31b7b38006d0 | 9947349a47a308b76e45efacce004f09f027461b | /src/test/java/com/test/excersice/ExcersiceApplicationTests.java | 4a320dbd727652aa4b941a72089140dbf3dfbe7e | [] | no_license | IsuruAnuradha/TestEx | 1bdfd9086fb940e0674f6557efa61e0fffe78859 | c20053d0b6232f2da03c05d9a2d2b32b8543b15a | refs/heads/master | 2020-04-27T01:42:11.879578 | 2019-03-05T16:20:23 | 2019-03-05T16:20:23 | 173,972,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | package com.singtel.singtelexcersice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SingtelexcersiceApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"Isuruanuradha99@gmail.com"
] | Isuruanuradha99@gmail.com |
568c5f9f72802f6f9b80428cc69c214d82cb3eb5 | 094e1650e2418154762c49b8324259a6bbd88c57 | /src/org/chapter2/ShowProperties.java | 9b65113384cbd0409ec2cb30bb26e8e72eb48e60 | [] | no_license | zhanguohuang/ThinkingInJava | 6bc23e2b628314618edbc4622ea60112e4d63eae | ec5a34609f4e2913ad81fd8692981282143693e3 | refs/heads/master | 2021-01-01T03:34:48.820502 | 2016-05-03T08:46:20 | 2016-05-03T08:46:20 | 57,954,951 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package org.chapter2;
public class ShowProperties {
public static void main(String[] args) {
System.getProperties().list(System.out);
System.out.println(System.getProperty("user.name"));
System.out.println(System.getProperty("java.library.path"));
}
}
| [
"zhanguohuang@szhuarong.com"
] | zhanguohuang@szhuarong.com |
444ec4c8930681312e41d18d300ec8fbb375c98a | 11b7cd2fdd22ce0889fbe98d14a75c964955a35a | /src/elements/AmbientLight.java | 568b2992c971e07f0692e10cb22e1a32b7cded33 | [] | no_license | liorperetz/introSE | 0cc642e5f1de17cb144e24f4797e7b5a17c7a4cf | b6626f3fb2ac301eb1446a2b5e831aeac4d0c3a9 | refs/heads/main | 2023-07-16T16:29:54.993593 | 2021-09-09T12:08:47 | 2021-09-09T12:08:47 | 346,018,481 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 539 | java | package elements;
import primitives.Color;
/**
* AmbientLight class represents the ambient light color in a scene
*
* @author Reuven Klein
* @author Lior Peretz
*/
public class AmbientLight extends Light{
/**
* AmbientLight default constructor
*/
public AmbientLight() {
super(Color.BLACK);
}
/**
* AmbientLight Constructor
* @param iA color's intensity
* @param kA constant for intensity
*/
public AmbientLight(Color iA, double kA) {
super(iA.scale(kA));
}
}
| [
"liorperetz1@gmail.com"
] | liorperetz1@gmail.com |
ac5bd87576172997d0e0526afd1555a73ab967d0 | d320858fd9f9c420050491750b6871d1cb4646e2 | /mapstruct-nested-bean-mappings/src/main/java/org/mapstruct/example/mapper/FishTankMapperExpression.java | 17389c3a33205eae01f3a54b4ae2185679c424e6 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | chenxingxing6/mapstruct-examples | a811619992ca8bb89bcc3d74b066b1f570b726fa | 362a43dff818c35614a5fe5cc216845e1faff77f | refs/heads/master | 2020-05-17T18:31:57.529811 | 2019-03-23T08:11:40 | 2019-03-23T08:11:40 | 183,886,691 | 1 | 0 | NOASSERTION | 2019-04-28T09:27:12 | 2019-04-28T09:27:11 | null | UTF-8 | Java | false | false | 1,616 | java | /**
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/)
* and/or other contributors as indicated by the @authors tag. See the
* copyright.txt file in the distribution for a full listing of all
* contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mapstruct.example.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.example.dto.FishTankDto;
import org.mapstruct.example.model.FishTank;
import org.mapstruct.factory.Mappers;
/**
*
* @author Sjaak Derksen
*/
@Mapper
public interface FishTankMapperExpression {
FishTankMapperExpression INSTANCE = Mappers.getMapper( FishTankMapperExpression.class );
@Mapping(target = "fish.kind", source = "fish.type")
@Mapping(target = "fish.name", expression = "java(\"Jaws\")")
@Mapping(target = "plant", ignore = true )
@Mapping(target = "ornament", ignore = true )
@Mapping(target = "material", ignore = true)
@Mapping(target = "quality.report.organisation.name", expression = "java(\"Dunno\")" )
FishTankDto map(FishTank source);
}
| [
"filip.hrisafov@gmail.com"
] | filip.hrisafov@gmail.com |
3f233161ec4aa9f4a4e5f26180ff2151c4283587 | 49bd45bceb438a377b183f9e50a149093a0034b1 | /modules/org.restlet.ext.osgi/src/org/restlet/ext/osgi/IRestletProvider.java | e32240a0eea15c48699e6f17b79404cef1a35377 | [] | no_license | FantomJAC/restlet-framework-java-old | 56301032e58c0de39ce9a1129cd565ea9a0a1e89 | 727119efea29d7807f534f5f3387064e58840faf | refs/heads/master | 2020-12-25T12:39:46.913414 | 2013-05-15T09:34:55 | 2013-05-15T09:34:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,619 | java | /**
* Copyright 2005-2012 Restlet S.A.S.
*
* The contents of this file are subject to the terms of one of the following
* open source licenses: Apache 2.0 or LGPL 3.0 or LGPL 2.1 or CDDL 1.0 or EPL
* 1.0 (the "Licenses"). You can select the license that you prefer but you may
* not use this file except in compliance with one of these Licenses.
*
* You can obtain a copy of the Apache 2.0 license at
* http://www.opensource.org/licenses/apache-2.0
*
* You can obtain a copy of the LGPL 3.0 license at
* http://www.opensource.org/licenses/lgpl-3.0
*
* You can obtain a copy of the LGPL 2.1 license at
* http://www.opensource.org/licenses/lgpl-2.1
*
* You can obtain a copy of the CDDL 1.0 license at
* http://www.opensource.org/licenses/cddl1
*
* You can obtain a copy of the EPL 1.0 license at
* http://www.opensource.org/licenses/eclipse-1.0
*
* See the Licenses for the specific language governing permissions and
* limitations under the Licenses.
*
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly at
* http://www.restlet.com/products/restlet-framework
*
* Restlet is a registered trademark of Restlet S.A.S.
*/
package org.restlet.ext.osgi;
import org.restlet.Context;
import org.restlet.Restlet;
/**
* This is a common interface for several of the providers. Users are not
* expected to implement this interface, but instead implement one of the
* provider interfaces.
*
* @author Bryan Hunt
*/
public interface IRestletProvider {
Restlet getInboundRoot(Context context);
}
| [
"thierry.boileau@noelios.com"
] | thierry.boileau@noelios.com |
354e5db0f89e10f169c25d1669dec1eb16d78a30 | 08be78ee28957fe393bea727228fbe13e5c00df1 | /modules/rule/modules/data/src/main/java/com/rule/data/engine/functions/time/MONTH.java | d0d84121f81592c077daa6910737df98b3cf42e8 | [] | no_license | javachengwc/java-apply | 432259eadfca88c6f3f2b80aae8e1e8a93df5159 | 98a45c716f18657f0e4181d0c125a73feb402b16 | refs/heads/master | 2023-08-22T12:30:05.708710 | 2023-08-15T08:21:15 | 2023-08-15T08:21:15 | 54,971,501 | 10 | 4 | null | 2022-12-16T11:03:56 | 2016-03-29T11:50:21 | Java | UTF-8 | Java | false | false | 869 | java | package com.rule.data.engine.functions.time;
import com.rule.data.engine.functions.Function;
import com.rule.data.util.DataUtil;
import com.rule.data.exception.RengineException;
import com.rule.data.model.vo.CalInfo;
import com.rule.data.exception.CalculateException;
import com.rule.data.engine.excel.NumberPool;
import java.util.Calendar;
public final class MONTH extends Function {
public static final String NAME = MONTH.class.getSimpleName();
@Override
public Object eval(CalInfo calInfo, Object[] args) throws RengineException, CalculateException {
if (args.length > 0) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(DataUtil.getNumberValue(args[0]).longValue() * 1000);
return new Long((calendar.get(Calendar.MONTH) + 1));
}
return NumberPool.LONG_0;
}
}
| [
"chengwenchao@cd.tuan800.com"
] | chengwenchao@cd.tuan800.com |
502e991e618f409096d650dad803c3579979f198 | e53588eb27f82fbec3b4d4d3ab2c8fa2b34c7968 | /Phantom-AlarmCompute/src/Phantom/AlarmCompute/LogisticsCacheIniter.java | ab0ac939dc49d7bc8a7ceeaf46bf6c1324860226 | [] | no_license | dodolooking/Phantom | ed0f56187e927126e915313e9337233721a72355 | 7fe463a3f68f96c878b87183236efbaedff5de94 | refs/heads/master | 2021-03-27T12:47:57.157515 | 2017-09-08T05:25:49 | 2017-09-08T05:25:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,107 | java | package Phantom.AlarmCompute;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.TimerTask;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class LogisticsCacheIniter extends TimerTask {
private static Log log = LogFactory.getLog(LogisticsCacheIniter.class);
Connection con;
PreparedStatement pre;
ResultSet result;
private static DataSourceFactory pool = DataSourceFactory.getPoolManager("jdbc.properties");;
@Override
public void run() {
// TODO Auto-generated method stub
try {
con = pool.getConnection();
String sql = "select * from B_BUSINESS_POINT";
PreparedStatement point_PreparedStatement = con.prepareStatement(sql);
ResultSet point_result = point_PreparedStatement.executeQuery();
while (point_result.next()) {
log.info("vid: " + point_result.getString(1));
}
point_result.close();
point_PreparedStatement.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"jiabotao@gmail.com"
] | jiabotao@gmail.com |
f9f1ca0d55d60fbf0213e98fc7ac35cc00c49df6 | 9f222b7d29c75e437accffa60afa0ca3b53b9c5f | /natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/GetClassificationsModelOptions.java | ce2edf5020ec657bf6554eb558fee4143decf0f9 | [
"Apache-2.0"
] | permissive | Ayesha20191/java-sdk | a0fd470ff0b24574daca612bbbb92094e581abcd | 978e04a1fcb474cfd74a35f2056dbb180c6d1e36 | refs/heads/master | 2023-08-25T12:18:59.685675 | 2021-09-17T18:09:04 | 2021-09-17T18:09:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,328 | java | /*
* (C) Copyright IBM Corp. 2021.
*
* 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.ibm.watson.natural_language_understanding.v1.model;
import com.ibm.cloud.sdk.core.service.model.GenericModel;
/** The getClassificationsModel options. */
public class GetClassificationsModelOptions extends GenericModel {
protected String modelId;
/** Builder. */
public static class Builder {
private String modelId;
private Builder(GetClassificationsModelOptions getClassificationsModelOptions) {
this.modelId = getClassificationsModelOptions.modelId;
}
/** Instantiates a new builder. */
public Builder() {}
/**
* Instantiates a new builder with required properties.
*
* @param modelId the modelId
*/
public Builder(String modelId) {
this.modelId = modelId;
}
/**
* Builds a GetClassificationsModelOptions.
*
* @return the new GetClassificationsModelOptions instance
*/
public GetClassificationsModelOptions build() {
return new GetClassificationsModelOptions(this);
}
/**
* Set the modelId.
*
* @param modelId the modelId
* @return the GetClassificationsModelOptions builder
*/
public Builder modelId(String modelId) {
this.modelId = modelId;
return this;
}
}
protected GetClassificationsModelOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.modelId, "modelId cannot be empty");
modelId = builder.modelId;
}
/**
* New builder.
*
* @return a GetClassificationsModelOptions builder
*/
public Builder newBuilder() {
return new Builder(this);
}
/**
* Gets the modelId.
*
* <p>ID of the model.
*
* @return the modelId
*/
public String modelId() {
return modelId;
}
}
| [
"kevin.kowalski@ibm.com"
] | kevin.kowalski@ibm.com |
1c84829cd34467a90d45ee669fb5bef7dc3b66cf | 0874d515fb8c23ae10bf140ee5336853bceafe0b | /l2j-universe/java/lineage2/gameserver/model/Summon.java | fc4074cb749ef72c6643eb2d8f68e7a2e31f85ed | [] | no_license | NotorionN/l2j-universe | 8dfe529c4c1ecf0010faead9e74a07d0bc7fa380 | 4d05cbd54f5586bf13e248e9c853068d941f8e57 | refs/heads/master | 2020-12-24T16:15:10.425510 | 2013-11-23T19:35:35 | 2013-11-23T19:35:35 | 37,354,291 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 20,599 | java | /*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package lineage2.gameserver.model;
import gnu.trove.iterator.TIntObjectIterator;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Future;
import lineage2.commons.threading.RunnableImpl;
import lineage2.commons.util.Rnd;
import lineage2.gameserver.Config;
import lineage2.gameserver.ThreadPoolManager;
import lineage2.gameserver.ai.CtrlIntention;
import lineage2.gameserver.ai.SummonAI;
import lineage2.gameserver.dao.EffectsDAO;
import lineage2.gameserver.instancemanager.ReflectionManager;
import lineage2.gameserver.model.Zone.ZoneType;
import lineage2.gameserver.model.actor.recorder.SummonStatsChangeRecorder;
import lineage2.gameserver.model.base.TeamType;
import lineage2.gameserver.model.entity.events.GlobalEvent;
import lineage2.gameserver.model.entity.events.impl.DuelEvent;
import lineage2.gameserver.model.instances.PetInstance;
import lineage2.gameserver.model.items.ItemInstance;
import lineage2.gameserver.model.items.PetInventory;
import lineage2.gameserver.network.serverpackets.AutoAttackStart;
import lineage2.gameserver.network.serverpackets.ExPartyPetWindowAdd;
import lineage2.gameserver.network.serverpackets.ExPartyPetWindowDelete;
import lineage2.gameserver.network.serverpackets.ExPartyPetWindowUpdate;
import lineage2.gameserver.network.serverpackets.L2GameServerPacket;
import lineage2.gameserver.network.serverpackets.NpcInfo;
import lineage2.gameserver.network.serverpackets.PartySpelled;
import lineage2.gameserver.network.serverpackets.PetDelete;
import lineage2.gameserver.network.serverpackets.PetInfo;
import lineage2.gameserver.network.serverpackets.PetItemList;
import lineage2.gameserver.network.serverpackets.PetStatusShow;
import lineage2.gameserver.network.serverpackets.PetStatusUpdate;
import lineage2.gameserver.network.serverpackets.RelationChanged;
import lineage2.gameserver.network.serverpackets.components.SystemMsg;
import lineage2.gameserver.skills.EffectType;
import lineage2.gameserver.skills.effects.EffectTemplate;
import lineage2.gameserver.stats.Env;
import lineage2.gameserver.stats.Stats;
import lineage2.gameserver.taskmanager.DecayTaskManager;
import lineage2.gameserver.templates.item.WeaponTemplate;
import lineage2.gameserver.templates.npc.NpcTemplate;
import lineage2.gameserver.utils.Location;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public abstract class Summon extends Playable
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Field SUMMON_DISAPPEAR_RANGE. (value is 2500)
*/
private static final int SUMMON_DISAPPEAR_RANGE = 2500;
/**
* Field _owner.
*/
private final Player _owner;
/**
* Field _spawnAnimation.
*/
private int _spawnAnimation = 2;
/**
* Field _exp.
*/
protected long _exp = 0;
/**
* Field _sp.
*/
protected int _sp = 0;
/**
* Field _spsCharged. Field _maxLoad.
*/
private int _maxLoad, _spsCharged;
/**
* Field _ssCharged. Field _depressed. Field _follow. Field _defend.
*/
private boolean _follow = true, _depressed = false, _ssCharged = false, _defend = false;
/**
* Field _decayTask.
*/
private Future<?> _decayTask;
/**
* Constructor for Summon.
* @param objectId int
* @param template NpcTemplate
* @param owner Player
*/
public Summon(int objectId, NpcTemplate template, Player owner)
{
super(objectId, template);
_owner = owner;
if (template.getSkills().size() > 0)
{
for (TIntObjectIterator<Skill> iterator = template.getSkills().iterator(); iterator.hasNext();)
{
iterator.advance();
addSkill(iterator.value());
}
}
setXYZ(owner.getX() + Rnd.get(-100, 100), owner.getY() + Rnd.get(-100, 100), owner.getZ());
}
/**
* Method onSpawn.
*/
@Override
protected void onSpawn()
{
super.onSpawn();
_spawnAnimation = 0;
Player owner = getPlayer();
Party party = owner.getParty();
if (party != null)
{
party.broadcastToPartyMembers(owner, new ExPartyPetWindowAdd(this));
}
if (owner.getEffectList().getEffectByStackType("ServitorShare") != null)
{
final Creature SummonEffect = this;
ThreadPoolManager.getInstance().execute(new RunnableImpl()
{
@Override
public void runImpl()
{
final Player owner = getPlayer();
final Skill skl = owner.getEffectList().getEffectByStackType("ServitorShare").getSkill();
long currenttime = owner.getEffectList().getEffectByStackType("ServitorShare").getTime();
long duration = owner.getEffectList().getEffectByStackType("ServitorShare").getDuration();
for(EffectTemplate et : skl.getEffectTemplates())
{
if(et == null || et.getEffectType() != EffectType.ServitorShare)
{
continue;
}
Env env = new Env(owner,SummonEffect,skl);
final Effect effect = et.getEffect(env);
if(effect == null)
{
continue;
}
effect.setCount(1);
effect.setPeriod(duration - currenttime);
effect.schedule();
}
}
});
}
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
}
/**
* Method getAI.
* @return SummonAI
*/
@Override
public SummonAI getAI()
{
if (_ai == null)
{
synchronized (this)
{
if (_ai == null)
{
_ai = new SummonAI(this);
}
}
}
return (SummonAI) _ai;
}
/**
* Method getTemplate.
* @return NpcTemplate
*/
@Override
public NpcTemplate getTemplate()
{
return (NpcTemplate) _template;
}
/**
* Method isUndead.
* @return boolean
*/
@Override
public boolean isUndead()
{
return getTemplate().isUndead();
}
/**
* Method getSummonType.
* @return int
*/
public abstract int getSummonType();
/**
* Method getSummonSkillId.
* @return int
*/
public abstract int getSummonSkillId();
/**
* Method getSummonSkillLvl.
* @return int
*/
public abstract int getSummonSkillLvl();
/**
* Method isMountable.
* @return boolean
*/
public boolean isMountable()
{
return false;
}
/**
* Method getExpForThisLevel.
* @return long
*/
public long getExpForThisLevel()
{
return 0;
}
/**
* Method getExpForNextLevel.
* @return long
*/
public long getExpForNextLevel()
{
return 0;
}
/**
* Method getNpcId.
* @return int
*/
@Override
public int getNpcId()
{
return getTemplate().npcId;
}
/**
* Method getExp.
* @return long
*/
public final long getExp()
{
return _exp;
}
/**
* Method setExp.
* @param exp long
*/
public final void setExp(final long exp)
{
_exp = exp;
}
/**
* Method getSp.
* @return int
*/
public final int getSp()
{
return _sp;
}
/**
* Method setSp.
* @param sp int
*/
public void setSp(final int sp)
{
_sp = sp;
}
/**
* Method getMaxLoad.
* @return int
*/
@Override
public int getMaxLoad()
{
return _maxLoad;
}
/**
* Method setMaxLoad.
* @param maxLoad int
*/
public void setMaxLoad(final int maxLoad)
{
_maxLoad = maxLoad;
}
/**
* Method getBuffLimit.
* @return int
*/
@Override
public int getBuffLimit()
{
Player owner = getPlayer();
return (int) calcStat(Stats.BUFF_LIMIT, owner.getBuffLimit(), null, null);
}
/**
* Method getCurrentFed.
* @return int
*/
public abstract int getCurrentFed();
/**
* Method getMaxFed.
* @return int
*/
public abstract int getMaxFed();
/**
* Method onDeath.
* @param killer Creature
*/
@Override
protected void onDeath(Creature killer)
{
super.onDeath(killer);
startDecay(8500L);
Player owner = getPlayer();
if ((killer == null) || (killer == owner) || (killer == this) || isInZoneBattle() || killer.isInZoneBattle())
{
return;
}
if (killer instanceof Summon)
{
killer = killer.getPlayer();
}
if (killer == null)
{
return;
}
if (killer.isPlayer())
{
Player pk = (Player) killer;
if (isInZone(ZoneType.SIEGE))
{
return;
}
DuelEvent duelEvent = getEvent(DuelEvent.class);
if ((owner.getPvpFlag() > 0) || owner.atMutualWarWith(pk))
{
pk.setPvpKills(pk.getPvpKills() + 1);
}
else if (((duelEvent == null) || (duelEvent != pk.getEvent(DuelEvent.class))) && (getKarma() <= 0))
{
int pkCountMulti = Math.max(pk.getPkKills() / 2, 1);
pk.increaseKarma(Config.KARMA_MIN_KARMA * pkCountMulti);
}
pk.sendChanges();
}
}
/**
* Method startDecay.
* @param delay long
*/
protected void startDecay(long delay)
{
stopDecay();
_decayTask = DecayTaskManager.getInstance().addDecayTask(this, delay);
}
/**
* Method stopDecay.
*/
protected void stopDecay()
{
if (_decayTask != null)
{
_decayTask.cancel(false);
_decayTask = null;
}
}
/**
* Method onDecay.
*/
@Override
protected void onDecay()
{
deleteMe();
}
/**
* Method endDecayTask.
*/
public void endDecayTask()
{
stopDecay();
doDecay();
}
/**
* Method broadcastStatusUpdate.
*/
@Override
public void broadcastStatusUpdate()
{
super.broadcastStatusUpdate();
Player owner = getPlayer();
sendStatusUpdate();
Party party = owner.getParty();
if (party != null)
{
party.broadcastToPartyMembers(owner, new ExPartyPetWindowUpdate(this));
}
}
/**
* Method sendStatusUpdate.
*/
public void sendStatusUpdate()
{
Player owner = getPlayer();
owner.sendPacket(new PetStatusUpdate(this));
}
/**
* Method onDelete.
*/
@Override
protected void onDelete()
{
Player owner = getPlayer();
Party party = owner.getParty();
if (party != null)
{
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
}
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
stopDecay();
super.onDelete();
}
/**
* Method unSummon.
*/
public void unSummon()
{
deleteMe();
}
/**
* Method saveEffects.
*/
public void saveEffects()
{
Player owner = getPlayer();
if (owner == null)
{
return;
}
if (owner.isInOlympiadMode())
{
getEffectList().stopAllEffects();
}
EffectsDAO.getInstance().insert(this);
}
/**
* Method setFollowMode.
* @param state boolean
*/
public void setFollowMode(boolean state)
{
Player owner = getPlayer();
_follow = state;
if (_follow)
{
if (getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, owner, Config.FOLLOW_RANGE);
}
}
else if (getAI().getIntention() == CtrlIntention.AI_INTENTION_FOLLOW)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
}
}
/**
* Method setDefendMode.
* @param state boolean
*/
public void setDefendMode(boolean state)
{
_defend = state;
}
/**
* Method isFollowMode.
* @return boolean
*/
public boolean isFollowMode()
{
return _follow;
}
/**
* Method isFollowMode.
* @return boolean
*/
public boolean isDefendMode()
{
return _defend;
}
/**
* Field _updateEffectIconsTask.
*/
Future<?> _updateEffectIconsTask;
/**
* Method getSummonPoint.
* @return int
*/
public abstract int getSummonPoint();
/**
* Method updateEffectIcons.
*/
@Override
public void updateEffectIcons()
{
super.updateEffectIcons();
updateEffectIconsImpl();
return;
}
/**
* Method updateEffectIconsImpl.
*/
public void updateEffectIconsImpl()
{
Player owner = getPlayer();
PartySpelled ps = new PartySpelled(this, true);
Party party = owner.getParty();
if (party != null)
{
party.broadCast(ps);
}
else
{
owner.sendPacket(ps);
}
}
/**
* Method getControlItemObjId.
* @return int
*/
public int getControlItemObjId()
{
return 0;
}
/**
* Method getInventory.
* @return PetInventory
*/
@Override
public PetInventory getInventory()
{
return null;
}
/**
* Method doPickupItem.
* @param object GameObject
*/
@Override
public void doPickupItem(final GameObject object)
{
}
/**
* Method doRevive.
*/
@Override
public void doRevive()
{
super.doRevive();
setRunning();
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
setFollowMode(true);
}
/**
* Method getActiveWeaponInstance.
* @return ItemInstance
*/
@Override
public ItemInstance getActiveWeaponInstance()
{
return null;
}
/**
* Method getActiveWeaponItem.
* @return WeaponTemplate
*/
@Override
public WeaponTemplate getActiveWeaponItem()
{
return null;
}
/**
* Method getSecondaryWeaponInstance.
* @return ItemInstance
*/
@Override
public ItemInstance getSecondaryWeaponInstance()
{
return null;
}
/**
* Method getSecondaryWeaponItem.
* @return WeaponTemplate
*/
@Override
public WeaponTemplate getSecondaryWeaponItem()
{
return null;
}
/**
* Method displayGiveDamageMessage.
* @param target Creature
* @param damage int
* @param crit boolean
* @param miss boolean
* @param shld boolean
* @param magic boolean
*/
@Override
public abstract void displayGiveDamageMessage(Creature target, int damage, boolean crit, boolean miss, boolean shld, boolean magic);
/**
* Method displayReceiveDamageMessage.
* @param attacker Creature
* @param damage int
*/
@Override
public abstract void displayReceiveDamageMessage(Creature attacker, int damage);
/**
* Method unChargeShots.
* @param spirit boolean
* @return boolean
*/
@Override
public boolean unChargeShots(final boolean spirit)
{
Player owner = getPlayer();
if (spirit)
{
if (_spsCharged != 0)
{
_spsCharged = 0;
owner.autoShot();
return true;
}
}
else if (_ssCharged)
{
_ssCharged = false;
owner.autoShot();
return true;
}
return false;
}
/**
* Method getChargedSoulShot.
* @return boolean
*/
@Override
public boolean getChargedSoulShot()
{
return _ssCharged;
}
/**
* Method getChargedSpiritShot.
* @return int
*/
@Override
public int getChargedSpiritShot()
{
return _spsCharged;
}
/**
* Method chargeSoulShot.
*/
public void chargeSoulShot()
{
_ssCharged = true;
}
/**
* Method chargeSpiritShot.
* @param state int
*/
public void chargeSpiritShot(final int state)
{
_spsCharged = state;
}
/**
* Method getSoulshotConsumeCount.
* @return int
*/
public int getSoulshotConsumeCount()
{
return (getLevel() / 27) + 1;
}
/**
* Method getSpiritshotConsumeCount.
* @return int
*/
public int getSpiritshotConsumeCount()
{
return (getLevel() / 58) + 1;
}
/**
* Method isDepressed.
* @return boolean
*/
public boolean isDepressed()
{
return _depressed;
}
/**
* Method setDepressed.
* @param depressed boolean
*/
public void setDepressed(final boolean depressed)
{
_depressed = depressed;
}
/**
* Method isInRange.
* @return boolean
*/
public boolean isInRange()
{
Player owner = getPlayer();
return getDistance(owner) < SUMMON_DISAPPEAR_RANGE;
}
/**
* Method teleportToOwner.
*/
public void teleportToOwner()
{
Player owner = getPlayer();
setNonAggroTime(System.currentTimeMillis() + Config.NONAGGRO_TIME_ONTELEPORT);
if (owner.isInOlympiadMode())
{
teleToLocation(owner.getLoc(), owner.getReflection());
}
else
{
teleToLocation(Location.findPointToStay(owner, 50, 150), owner.getReflection());
}
if (!isDead() && _follow)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, owner, Config.FOLLOW_RANGE);
}
}
/**
* Method broadcastCharInfo.
*/
public void broadcastCharInfo()
{
Player owner = getPlayer();
for (Player player : World.getAroundPlayers(this))
{
if (player == owner)
{
player.sendPacket(new PetInfo(this).update());
}
else
{
player.sendPacket(new NpcInfo(this, player).update());
}
}
}
/**
* Method sendPetInfo.
*/
public void sendPetInfo()
{
Player owner = getPlayer();
owner.sendPacket(new PetInfo(this).update());
return;
}
/**
* Method getSpawnAnimation.
* @return int
*/
public int getSpawnAnimation()
{
return _spawnAnimation;
}
/**
* Method startPvPFlag.
* @param target Creature
*/
@Override
public void startPvPFlag(Creature target)
{
Player owner = getPlayer();
owner.startPvPFlag(target);
}
/**
* Method getPvpFlag.
* @return int
*/
@Override
public int getPvpFlag()
{
Player owner = getPlayer();
return owner.getPvpFlag();
}
/**
* Method getKarma.
* @return int
*/
@Override
public int getKarma()
{
Player owner = getPlayer();
return owner.getKarma();
}
/**
* Method getTeam.
* @return TeamType
*/
@Override
public TeamType getTeam()
{
Player owner = getPlayer();
return owner.getTeam();
}
/**
* Method getPlayer.
* @return Player
*/
@Override
public Player getPlayer()
{
return _owner;
}
/**
* Method getExpPenalty.
* @return double
*/
public abstract double getExpPenalty();
/**
* Method getStatsRecorder.
* @return SummonStatsChangeRecorder
*/
@Override
public SummonStatsChangeRecorder getStatsRecorder()
{
if (_statsRecorder == null)
{
synchronized (this)
{
if (_statsRecorder == null)
{
_statsRecorder = new SummonStatsChangeRecorder(this);
}
}
}
return (SummonStatsChangeRecorder) _statsRecorder;
}
/**
* Method addPacketList.
* @param forPlayer Player
* @param dropper Creature
* @return List<L2GameServerPacket>
*/
@Override
public List<L2GameServerPacket> addPacketList(Player forPlayer, Creature dropper)
{
List<L2GameServerPacket> list = new ArrayList<L2GameServerPacket>();
Player owner = getPlayer();
if (owner == forPlayer)
{
list.add(new PetInfo(this));
list.add(new PartySpelled(this, true));
if (isPet())
{
list.add(new PetItemList((PetInstance) this));
}
}
else
{
Party party = forPlayer.getParty();
if ((getReflection() == ReflectionManager.GIRAN_HARBOR) && ((owner == null) || (party == null) || (party != owner.getParty())))
{
return list;
}
list.add(new NpcInfo(this, forPlayer));
if ((owner != null) && (party != null) && (party == owner.getParty()))
{
list.add(new PartySpelled(this, true));
}
list.add(RelationChanged.update(forPlayer, this, forPlayer));
}
if (isInCombat())
{
list.add(new AutoAttackStart(getObjectId()));
}
if (isMoving || isFollow)
{
list.add(movePacket());
}
return list;
}
/**
* Method startAttackStanceTask.
*/
@Override
public void startAttackStanceTask()
{
startAttackStanceTask0();
Player player = getPlayer();
if (player != null)
{
player.startAttackStanceTask0();
}
}
/**
* Method getEvent.
* @param eventClass Class<E>
* @return E
*/
@Override
public <E extends GlobalEvent> E getEvent(Class<E> eventClass)
{
Player player = getPlayer();
if (player != null)
{
return player.getEvent(eventClass);
}
return super.getEvent(eventClass);
}
/**
* Method getEvents.
* @return Set<GlobalEvent>
*/
@Override
public Set<GlobalEvent> getEvents()
{
Player player = getPlayer();
if (player != null)
{
return player.getEvents();
}
return super.getEvents();
}
/**
* Method sendReuseMessage.
* @param skill Skill
*/
@Override
public void sendReuseMessage(Skill skill)
{
Player player = getPlayer();
if ((player != null) && isSkillDisabled(skill))
{
player.sendPacket(SystemMsg.THAT_PET_SERVITOR_SKILL_CANNOT_BE_USED_BECAUSE_IT_IS_RECHARGING);
}
}
@Override
public void onActionTarget(final Player player, boolean forced)
{
super.onActionTarget(player, forced);
if(getPlayer() == player)
{
player.sendPacket(new PetInfo(this).update());
if(!player.isActionsDisabled())
{
player.sendPacket(new PetStatusShow(this));
}
}
}
@Override
public void onActionTargeted(final Player player, boolean forced)
{
if(getPlayer() == player)
{
player.sendPacket(new PetInfo(this).update());
if(!player.isActionsDisabled())
{
player.sendPacket(new PetStatusShow(this));
}
}
super.onActionTargeted(player, forced);
}
}
| [
"jmendezsr@gmail.com"
] | jmendezsr@gmail.com |
f5011731f113c1b67e77504e4e677d17659eadd7 | f978486c80d8eb79e5a28bf77b7754cd154f8c13 | /app/src/main/java/soumyadeb/foodsinghadmin/adapters/MenuListRecyclerAdapter.java | 9c18644d237036d97f1a88063c25c2b951aee64e | [] | no_license | android23235616/FoodSinghAdmin | 413297c695f4b38ababd28175de66e2998f417e7 | cee18e0e5b859c52b0aecbb3ddac5e41575fe067 | refs/heads/master | 2021-07-01T11:30:50.453609 | 2017-09-21T05:05:57 | 2017-09-21T05:05:57 | 103,982,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,027 | java | package soumyadeb.foodsinghadmin.adapters;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import soumyadeb.foodsinghadmin.R;
import soumyadeb.foodsinghadmin.Utility;
import soumyadeb.foodsinghadmin.models.Menu;
import soumyadeb.foodsinghadmin.models.Order;
import soumyadeb.foodsinghadmin.ui.EditMenuActivity;
import soumyadeb.foodsinghadmin.ui.OrderDetailActivity;
public class MenuListRecyclerAdapter extends RecyclerView.Adapter<MenuListRecyclerAdapter.MyViewHolder> {
private Context mContext;
private ArrayList<Menu> menuArrayList;
private Utility utility;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView tvName, tvPrice;
public LinearLayout edit, delete;
public View mView;
public MyViewHolder(View mView) {
super(mView);
this.mView = mView;
tvName = (TextView) mView.findViewById(R.id.name);
tvPrice = (TextView) mView.findViewById(R.id.price);
delete = (LinearLayout) mView.findViewById(R.id.delete);
edit = (LinearLayout) mView.findViewById(R.id.edit);
}
}
public MenuListRecyclerAdapter(Context mContext, ArrayList<Menu> menuArrayList)
{
this.mContext=mContext;
this.menuArrayList=menuArrayList;
utility = new Utility(mContext);
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.card_menu,parent,false);
return new MyViewHolder(v);
}
@Override
public void onBindViewHolder(final MyViewHolder holder, final int position)
{
final String name = menuArrayList.get(position).getName();
String price = menuArrayList.get(position).getPrice();
holder.tvName.setText(name);
holder.tvPrice.setText("₹"+price);
holder.delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(mContext, "Delete @ "+position, Toast.LENGTH_LONG).show();
AlertDialog.Builder alert = new AlertDialog.Builder(mContext);
alert.setMessage("Are your sure you want to delete menu item "+name+"?");
alert.setPositiveButton("DELETE", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
utility.deleteMenu(menuArrayList.get(position).getId(), position);
}
});
alert.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//Do nothing.
}
});
alert.show();
}
});
holder.edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, EditMenuActivity.class);
intent.putExtra("id", menuArrayList.get(position).getId());
intent.putExtra("name", menuArrayList.get(position).getName());
intent.putExtra("category", menuArrayList.get(position).getCategory());
intent.putExtra("price", menuArrayList.get(position).getPrice());
mContext.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return menuArrayList.size();
}
} | [
"majumdartanmay68@gmail.com"
] | majumdartanmay68@gmail.com |
3e1b3ee8427a642739c2b91317de674afe589ba9 | fe18260307f8ea49ab32c2c65f264bc765495ccb | /src/view/commands/multiPlayerCommands/SelectOppUserCommand.java | aa12578066f113d34ed13cef0afda27fd81d82fe | [] | no_license | aps2019project/project-16 | 07e70db8a29b276c105c0af352470815b6445f6b | 2172140e40c5af30df82da613220824f3b654d34 | refs/heads/master | 2020-05-02T14:04:57.359272 | 2019-07-08T22:27:25 | 2019-07-08T22:27:25 | 178,000,778 | 7 | 3 | null | 2019-07-05T17:30:00 | 2019-03-27T13:31:58 | Java | UTF-8 | Java | false | false | 580 | java | package view.commands.multiPlayerCommands;
import controllers.MultiPlayerController;
import view.commands.Command;
import view.views.MultiPlayerView;
import java.util.regex.Pattern;
public class SelectOppUserCommand extends Command {
{
name = "select user (opponent username)";
pattern = Pattern.compile("select user (\\w+( \\w+)*)", Pattern.CASE_INSENSITIVE);
}
@Override
public void doIt() {
String opponentUserName = matcher.group(1);
new MultiPlayerController(new MultiPlayerView()).selectOppUser(opponentUserName);
}
}
| [
"ssalimi@ce.sharif.edu"
] | ssalimi@ce.sharif.edu |
b6a48ba90633ab305695560260b413a06af654bf | 99fdea0ea97127439589729bf01313b54221952c | /frame/helper/src/main/java/com/github/robining/helper/net/cookie/SerializableOkHttpCookies.java | 742744a597c7b557d47d76ba96db30007b1b2bd6 | [] | no_license | robining/RobiningAndroid | f157198ed4c7fd7bd0e0331762d1c69c3c646f9a | 4b763ac1fa8586291e9218fdf9ad52b9d3c69e38 | refs/heads/master | 2021-05-06T19:28:04.326266 | 2017-12-21T08:50:43 | 2017-12-21T08:50:43 | 112,130,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,096 | java | package com.github.robining.helper.net.cookie;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import okhttp3.Cookie;
public class SerializableOkHttpCookies implements Serializable {
private transient final Cookie cookies;
private transient Cookie clientCookies;
public SerializableOkHttpCookies(Cookie cookies) {
this.cookies = cookies;
}
public Cookie getCookies() {
Cookie bestCookies = cookies;
if (clientCookies != null) {
bestCookies = clientCookies;
}
return bestCookies;
}
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeObject(cookies.name());
out.writeObject(cookies.value());
out.writeLong(cookies.expiresAt());
out.writeObject(cookies.domain());
out.writeObject(cookies.path());
out.writeBoolean(cookies.secure());
out.writeBoolean(cookies.httpOnly());
out.writeBoolean(cookies.hostOnly());
out.writeBoolean(cookies.persistent());
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
String name = (String) in.readObject();
String value = (String) in.readObject();
long expiresAt = in.readLong();
String domain = (String) in.readObject();
String path = (String) in.readObject();
boolean secure = in.readBoolean();
boolean httpOnly = in.readBoolean();
boolean hostOnly = in.readBoolean();
// boolean persistent = in.readBoolean();
Cookie.Builder builder = new Cookie.Builder();
builder = builder.name(name);
builder = builder.value(value);
builder = builder.expiresAt(expiresAt);
builder = hostOnly ? builder.hostOnlyDomain(domain) : builder.domain(domain);
builder = builder.path(path);
builder = secure ? builder.secure() : builder;
builder = httpOnly ? builder.httpOnly() : builder;
clientCookies =builder.build();
}
} | [
"robining@126.com"
] | robining@126.com |
72859522a4da4db868221de52bb64de7bc7f1334 | c98d8a48aa924cd6192d8816bcb16d5f7cc57b0f | /androjena.test/src/com/hp/hpl/jena/graph/compose/test/TestIntersection.java | ddcea46541aa56ffbb3a050b88db24041c20e05c | [] | no_license | ava14/androjena | 4d7d02f016a05bd26c25a782ad08998db21d9cda | 97038c70fc358e79a8a10cafae893fb4409ec2a6 | refs/heads/master | 2016-08-06T09:44:05.689533 | 2012-04-05T18:38:25 | 2012-04-05T18:38:25 | 35,442,977 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,284 | java | /*
(c) Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
[See end of file]
$Id: TestIntersection.java,v 1.1 2009/06/29 08:55:42 castagna Exp $
*/
package com.hp.hpl.jena.graph.compose.test;
import com.hp.hpl.jena.graph.*;
import com.hp.hpl.jena.graph.compose.Intersection;
import com.hp.hpl.jena.graph.test.*;
import junit.framework.*;
public class TestIntersection extends GraphTestBase
{
public TestIntersection( String name )
{ super( name ); }
public static TestSuite suite()
{ return new TestSuite( TestIntersection.class ); }
public void testIntersection()
{
Graph g1 = graphWith( "x R y; p R q" );
Graph g2 = graphWith( "r A s; x R y" );
Intersection i = new Intersection( g1, g2 );
assertContains( "Intersection", "x R y", i );
assertOmits( "Intersection", i, "p R q" );
assertOmits( "Intersection", i, "r A s" );
if (i.size() != 1)
fail( "oops: size of intersection is not 1" );
i.add( triple( "cats eat cheese" ) );
assertContains( "Intersection.L", "cats eat cheese", g1 );
assertContains( "Intersection.R", "cats eat cheese", g2 );
}
public void testDeleteDoesNotUpdateR()
{
Graph L = graphWith( "a pings b; b pings c; c pings a" );
Graph R = graphWith( "c pings a; b pings c; x captures y" );
Graph join = new Intersection( L, R );
L.getBulkUpdateHandler().delete( join );
assertIsomorphic( "R should not change", graphWith( "c pings a; b pings c; x captures y" ), R );
assertIsomorphic( graphWith( "a pings b" ), L );
}
}
/*
(c) Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
| [
"lorecarra@d606fbb5-c153-6f1d-4536-aea580ca57b0"
] | lorecarra@d606fbb5-c153-6f1d-4536-aea580ca57b0 |
753114fe2e01a2bdcaf93e69a4eaf8258a2c3c2e | 3c5b92ec0bc89ebb5bd5e87ce1a9b189125ca5dd | /src/main/java/org/bestqa/selenium/thirdparty/autoit3/AutoItX.java | d3431c99b88c824110424cf07f803dd1af0154a1 | [] | no_license | carltonqi/selenium-test-framework | 3e3058d8c5fc93e52945e9bab391fd9928935215 | 72624c52496f52d4b059b9df442808812324f3d4 | refs/heads/master | 2020-03-14T22:13:08.209865 | 2018-05-02T08:49:33 | 2018-05-02T08:49:33 | 131,816,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,331 | java | package org.bestqa.selenium.thirdparty.autoit3;
import org.bestqa.selenium.thirdparty.autoit3.LPPOINT;
import com.sun.jna.WString;
/**
* Autoit interfaces by java.
*
*/
public interface AutoItX extends com.sun.jna.Library {
//public static String autoItPath = AutoItX.class.getClassLoader().getResource(ConfigurationSettings.THIRDPARTY_AUTOIT3_DLL).getPath();
//AutoItX INSTANCE = (AutoItX) Native.loadLibrary(autoItPath, AutoItX.class);
public static int AU3_INTDEFAULT = -2147483647;
public void AU3_Init();
public int AU3_error();
public int AU3_AutoItSetOption(WString szOption, int nValue);
public void AU3_BlockInput(int nFlag); // 1 = disable user input, 0 enable
// user input (to have auto it run
// without interference)
public void AU3_CDTray(WString szDrive, WString szAction); // drive: ,"open"
// or "closed"
public void AU3_ClipGet(byte[] szClip, int nBufSize);
public void AU3_ClipPut(WString szClip);
public int AU3_ControlClick(WString szTitle, WString szText, WString szControl, WString szButton, int nNumClicks, int nX, int nY);
public void AU3_ControlCommand(WString szTitle, WString szText, WString szControl, WString szCommand, WString szExtra, byte[] szResult, int nBufSize);
public void AU3_ControlListView(WString szTitle, WString szText, WString szControl, WString szCommand, WString szExtra1, WString szExtra2, byte[] szResult, int nBufSize);
public int AU3_ControlDisable(WString szTitle, WString szText, WString szControl);
public int AU3_ControlEnable(WString szTitle, WString szText, WString szControl);
public int AU3_ControlFocus(WString szTitle, WString szText, WString szControl);
public void AU3_ControlGetFocus(WString szTitle, WString szText, byte[] szControlWithFocus, int nBufSize);
public void AU3_ControlGetHandle(WString szTitle, WString szText, WString szControl, byte[] szRetText, int nBufSize);
public int AU3_ControlGetPosX(WString szTitle, WString szText, WString szControl);
public int AU3_ControlGetPosY(WString szTitle, WString szText, WString szControl);
public int AU3_ControlGetPosHeight(WString szTitle, WString szText, WString szControl);
public int AU3_ControlGetPosWidth(WString szTitle, WString szText, WString szControl);
public void AU3_ControlGetText(WString szTitle, WString szText, WString szControl, byte[] szControlText, int nBufSize);
public int AU3_ControlHide(WString szTitle, WString szText, WString szControl);
public int AU3_ControlMove(WString szTitle, WString szText, WString szControl, int nX, int nY, int nWidth, int nHeight);
public int AU3_ControlSend(WString szTitle, WString szText, WString szControl, WString szSendText, int nMode);
public int AU3_ControlSetText(WString szTitle, WString szText, WString szControl, WString szControlText);
public int AU3_ControlShow(WString szTitle, WString szText, WString szControl);
public void AU3_DriveMapAdd(WString szDevice, WString szShare, int nFlags, WString szUser, WString szPwd, byte[] szResult, int nBufSize);
public int AU3_DriveMapDel(WString szDevice);
public void AU3_DriveMapGet(WString szDevice, byte[] szMapping, int nBufSize);
public int AU3_IniDelete(WString szFilename, WString szSection, WString szKey);
public void AU3_IniRead(WString szFilename, WString szSection, WString szKey, WString szDefault, byte[] szValue, int nBufSize);
public int AU3_IniWrite(WString szFilename, WString szSection, WString szKey, WString szValue);
public int AU3_IsAdmin();
public int AU3_MouseClick(WString szButton, int nX, int nY, int nClicks, int nSpeed);
public int AU3_MouseClickDrag(WString szButton, int nX1, int nY1, int nX2, int nY2, int nSpeed);
public void AU3_MouseDown(WString szButton);
public int AU3_MouseGetCursor();
public int AU3_MouseGetPosX();
public int AU3_MouseGetPosY();
public int AU3_MouseMove(int nX, int nY, int nSpeed);
public void AU3_MouseUp(WString szButton);
public void AU3_MouseWheel(WString szDirection, int nClicks);
public int AU3_Opt(WString szOption, int nValue);
public int AU3_PixelChecksum(int nLeft, int nTop, int nRight, int nBottom, int nStep);
public int AU3_PixelGetColor(int nX, int nY);
public void AU3_PixelSearch(int nLeft, int nTop, int nRight, int nBottom, int nCol, int nVar, int nStep, LPPOINT pPointResult);
public int AU3_ProcessClose(WString szProcess);
public int AU3_ProcessExists(WString szProcess);
public int AU3_ProcessSetPriority(WString szProcess, int nPriority);
public int AU3_ProcessWait(WString szProcess, int nTimeout);
public int AU3_ProcessWaitClose(WString szProcess, int nTimeout);
public int AU3_RegDeleteKey(WString szKeyname);
public int AU3_RegDeleteVal(WString szKeyname, WString szValuename);
public void AU3_RegEnumKey(WString szKeyname, int nInstance, byte[] szResult, int nBufSize);
public void AU3_RegEnumVal(WString szKeyname, int nInstance, byte[] szResult, int nBufSize);
public void AU3_RegRead(WString szKeyname, WString szValuename, byte[] szRetText, int nBufSize);
public int AU3_RegWrite(WString szKeyname, WString szValuename, WString szType, WString szValue);
public int AU3_Run(WString szRun, WString szDir, int nShowFlags);
public int AU3_RunAsSet(WString szUser, WString szDomain, WString szPassword, int nOptions);
public int AU3_RunWait(WString szRun, WString szDir, int nShowFlags);
public void AU3_Send(WString szSendText, int nMode);
public int AU3_Shutdown(int nFlags);
public void AU3_Sleep(int nMilliseconds);
public void AU3_StatusbarGetText(WString szTitle, WString szText, int nPart, byte[] szStatusText, int nBufSize);
public void AU3_ToolTip(WString szTip, int nX, int nY);
public int AU3_WinActive(WString szTitle, WString szText);
public void AU3_WinActivate(WString szTitle, WString szText);
public int AU3_WinClose(WString szTitle, WString szText);
public int AU3_WinExists(WString szTitle, WString szText);
public int AU3_WinGetCaretPosX();
public int AU3_WinGetCaretPosY();
public void AU3_WinGetClassList(WString szTitle, WString szText, byte[] szRetText, int nBufSize);
public int AU3_WinGetClientSizeHeight(WString szTitle, WString szText);
public int AU3_WinGetClientSizeWidth(WString szTitle, WString szText);
public void AU3_WinGetHandle(WString szTitle, WString szText, byte[] szRetText, int nBufSize);
public int AU3_WinGetPosX(WString szTitle, WString szText);
public int AU3_WinGetPosY(WString szTitle, WString szText);
public int AU3_WinGetPosHeight(WString szTitle, WString szText);
public int AU3_WinGetPosWidth(WString szTitle, WString szText);
public void AU3_WinGetProcess(WString szTitle, WString szText, byte[] szRetText, int nBufSize);
public int AU3_WinGetState(WString szTitle, WString szText);
public void AU3_WinGetText(WString szTitle, WString szText, byte[] szRetText, int nBufSize);
public void AU3_WinGetTitle(WString szTitle, WString szText, byte[] szRetText, int nBufSize);
public int AU3_WinKill(WString szTitle, WString szText);
public int AU3_WinMenuSelectItem(WString szTitle, WString szText, WString szItem1, WString szItem2, WString szItem3, WString szItem4, WString szItem5, WString szItem6, WString szItem7, WString szItem8);
public void AU3_WinMinimizeAll();
public void AU3_WinMinimizeAllUndo();
public int AU3_WinMove(WString szTitle, WString szText, int nX, int nY, int nWidth, int nHeight);
public int AU3_WinSetOnTop(WString szTitle, WString szText, int nFlag);
public int AU3_WinSetState(WString szTitle, WString szText, int nFlags);
public int AU3_WinSetTitle(WString szTitle, WString szText, WString szNewTitle);
public int AU3_WinSetTrans(WString szTitle, WString szText, int nTrans);
public int AU3_WinWait(WString szTitle, WString szText, int nTimeout);
public int AU3_WinWaitActive(WString szTitle, WString szText, int nTimeout);
public int AU3_WinWaitClose(WString szTitle, WString szText, int nTimeout);
public int AU3_WinWaitNotActive(WString szTitle, WString szText, int nTimeout);
}
| [
"wqi2@cisco.com"
] | wqi2@cisco.com |
827cf4552e8804871a57f0ed27a6d2618ce6a79f | 6825403c29c0891e9e0e871c0a07888b6036104e | /Main.java | 4867a7f0b8d8817f8d3e0bcee75c5e58c4131658 | [] | no_license | rsindo2025/testplay | 3304b7dfb04414bb1eaa0ad172baeed437a0b9d1 | 97e019581b97eecde8182111eb441dce064dd597 | refs/heads/main | 2023-06-29T14:21:04.735620 | 2021-07-31T10:56:17 | 2021-07-31T10:56:17 | 391,316,361 | 0 | 0 | null | 2021-07-31T10:56:17 | 2021-07-31T09:54:58 | null | UTF-8 | Java | false | false | 136 | java | package code1_2;
public class Main {
public static void main(String[] args) {
int age;
age = 30;
System.out.println(age);
}
}
| [
"rsindo2025@gmail.com"
] | rsindo2025@gmail.com |
accd004ee9a0b27e811750c29236dfd7759547ce | 5bafdf53151ef01b24b4cb07d104ad548bf03ad1 | /src/main/java/com/sobit/webeq/services/users/rest/IUsersServices.java | ee1fb1062e8938d9c904b9032dd20569ceaa0efe | [] | no_license | Sobitsu/WebEQ | 118b59c63bd6153d27f1facd9057f6dce2eb16fa | e45e07c34fd98ce9efd6f29ca8e4530e48e5d919 | refs/heads/master | 2021-01-01T18:42:45.468206 | 2015-08-13T12:15:13 | 2015-08-13T12:15:13 | 40,656,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 594 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.sobit.webeq.services.users.rest;
import javax.ws.rs.core.Response;
import com.sobit.webeq.entities.Users;
public interface IUsersServices {
Response getUser(Integer id);
Response removeUser(Integer id);
Response createUser(Users str);
Response updateUser(Users str);
Response getUser(String keyword, String orderBy, String order, Integer pageNum, Integer pageSize);
}
| [
"akartashova@sobit.su"
] | akartashova@sobit.su |
57e7e86233c470cc8d36447e55db6f27aa061dd1 | 0aba3ca0c2da8626bed808155a854858f93b80e0 | /services/dds/src/main/java/com/huaweicloud/sdk/dds/v3/model/QuerySessionResponse.java | 85592c7f08ca508f0327336a29c3072faacaf85d | [
"Apache-2.0"
] | permissive | LanYus/huaweicloud-sdk-java-v3 | 5b51e0953f5b1a8a5d38bccbaa7389222a8c0ea7 | 761a9c43c0ea287a927707891c529389e43e8280 | refs/heads/master | 2023-05-31T15:46:06.772578 | 2021-06-10T12:06:03 | 2021-06-10T12:06:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,679 | java | package com.huaweicloud.sdk.dds.v3.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Consumer;
import java.util.Objects;
/**
* 会话详细信息列表。
*/
public class QuerySessionResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="id")
private String id;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="active")
private Boolean active;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="operation")
private String operation;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="type")
private String type;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="cost_time")
private String costTime;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="plan_summary")
private String planSummary;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="host")
private String host;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="client")
private String client;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="description")
private String description;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="namespace")
private String namespace;
public QuerySessionResponse withId(String id) {
this.id = id;
return this;
}
/**
* 会话ID。
* @return id
*/
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public QuerySessionResponse withActive(Boolean active) {
this.active = active;
return this;
}
/**
* 当前会话是否活跃。 取值为“true”,表示活跃。 取值为“false”,表示不活跃。
* @return active
*/
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
public QuerySessionResponse withOperation(String operation) {
this.operation = operation;
return this;
}
/**
* 操作。
* @return operation
*/
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public QuerySessionResponse withType(String type) {
this.type = type;
return this;
}
/**
* 操作类型。
* @return type
*/
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public QuerySessionResponse withCostTime(String costTime) {
this.costTime = costTime;
return this;
}
/**
* 运行时间,单位为 ms。
* @return costTime
*/
public String getCostTime() {
return costTime;
}
public void setCostTime(String costTime) {
this.costTime = costTime;
}
public QuerySessionResponse withPlanSummary(String planSummary) {
this.planSummary = planSummary;
return this;
}
/**
* 执行计划描述。
* @return planSummary
*/
public String getPlanSummary() {
return planSummary;
}
public void setPlanSummary(String planSummary) {
this.planSummary = planSummary;
}
public QuerySessionResponse withHost(String host) {
this.host = host;
return this;
}
/**
* 主机。
* @return host
*/
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public QuerySessionResponse withClient(String client) {
this.client = client;
return this;
}
/**
* 客户端地址。
* @return client
*/
public String getClient() {
return client;
}
public void setClient(String client) {
this.client = client;
}
public QuerySessionResponse withDescription(String description) {
this.description = description;
return this;
}
/**
* 连接描述。
* @return description
*/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public QuerySessionResponse withNamespace(String namespace) {
this.namespace = namespace;
return this;
}
/**
* 命名空间。
* @return namespace
*/
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
QuerySessionResponse querySessionResponse = (QuerySessionResponse) o;
return Objects.equals(this.id, querySessionResponse.id) &&
Objects.equals(this.active, querySessionResponse.active) &&
Objects.equals(this.operation, querySessionResponse.operation) &&
Objects.equals(this.type, querySessionResponse.type) &&
Objects.equals(this.costTime, querySessionResponse.costTime) &&
Objects.equals(this.planSummary, querySessionResponse.planSummary) &&
Objects.equals(this.host, querySessionResponse.host) &&
Objects.equals(this.client, querySessionResponse.client) &&
Objects.equals(this.description, querySessionResponse.description) &&
Objects.equals(this.namespace, querySessionResponse.namespace);
}
@Override
public int hashCode() {
return Objects.hash(id, active, operation, type, costTime, planSummary, host, client, description, namespace);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class QuerySessionResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" active: ").append(toIndentedString(active)).append("\n");
sb.append(" operation: ").append(toIndentedString(operation)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" costTime: ").append(toIndentedString(costTime)).append("\n");
sb.append(" planSummary: ").append(toIndentedString(planSummary)).append("\n");
sb.append(" host: ").append(toIndentedString(host)).append("\n");
sb.append(" client: ").append(toIndentedString(client)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"wuchen25@huawei.com"
] | wuchen25@huawei.com |
990dd8bfa3658a2f1a6578ff9d4be5da96d4dc2f | 8db2c83d4a860e323bffd66d635e2511675884be | /src/main/java/br/com/buzzo/domain/Employee.java | 64b7a3682cfe4eddcc674c4335e968496fe294f2 | [] | no_license | buzzo/js-rest-crud | f623504790c21377f8713b38dbc633297e71bee8 | bd5c63956d571c73c44ad1db8fc2d5e466c0882d | refs/heads/master | 2021-01-20T05:07:59.287156 | 2014-12-18T11:36:59 | 2014-12-18T11:36:59 | 25,689,793 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,355 | java | package br.com.buzzo.domain;
public class Employee {
private long id;
private boolean active;
private String code;
private String name;
private String badge;
private String position;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getBadge() {
return badge;
}
public void setBadge(String badge) {
this.badge = badge;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (id ^ (id >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Employee other = (Employee) obj;
if (id != other.id)
return false;
return true;
}
} | [
"andre.buzzo@ericsson.com"
] | andre.buzzo@ericsson.com |
336f3084691ea592d9c0ac59e6751e972d7e1aa2 | 27cdd6335be6c6b5f29ccd7ff75a1383ab21a052 | /src/main/java/com/cybertaotao/repository/Checkcode.java | 01444aa4411b270f83fa48247690f9102456de9e | [] | no_license | sstshenshutao/talkHome | 4e1b75f6caeda9a0ddf4609a2dd30e6b16c53059 | 5304d87f528aff24eac0d1d194c0bad793235723 | refs/heads/master | 2021-05-20T09:23:10.264397 | 2020-04-01T16:00:48 | 2020-04-01T16:00:48 | 252,222,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 65 | java | package com.cybertaotao.repository;
public class Checkcode {
}
| [
"sstbage@gmail.com"
] | sstbage@gmail.com |
b9242ae70b270d937a2cd1431077c4aa9a8b2f09 | 5cc01dec9ec1c6dde262d56d42c40dd8acfe2010 | /PTSCMC/src/java/com/venus/mc/process/equipment/acceptancetest/AcceptanceTestFormAction.java | 18dc6daa05245867245a452cad6bed29e10377ab | [] | no_license | phuongtu1983/mc | 6defa0c94a02e2ff5ce9886ee87a219396d54ac0 | 0966390950a911e9fdb75484701bdede381a3042 | refs/heads/master | 2020-03-11T11:50:15.387384 | 2018-04-18T00:42:25 | 2018-04-18T00:42:25 | 129,980,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,936 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.venus.mc.process.equipment.acceptancetest;
import com.venus.core.util.DateUtil;
import com.venus.core.util.StringUtil;
import com.venus.mc.bean.AcceptanceTestBean;
import com.venus.mc.bean.EmployeeBean;
import com.venus.mc.core.SpineAction;
import com.venus.mc.dao.AcceptanceTestDAO;
import com.venus.mc.dao.EmployeeDAO;
import com.venus.mc.util.Constants;
import com.venus.mc.util.MCUtil;
import com.venus.mc.util.PermissionUtil;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.validator.GenericValidator;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.LabelValueBean;
/**
*
* @author mai vinh loc
*/
public class AcceptanceTestFormAction extends SpineAction {
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
@Override
public boolean doAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession();
AcceptanceTestFormBean formBean = null;
AcceptanceTestBean bean = null;
String atId = request.getParameter("atId");
Integer id = (Integer) session.getAttribute("id");
//session.removeAttribute("id");
if (id != null) {
atId = id + "";
}
if (!GenericValidator.isBlankOrNull(atId)) {
AcceptanceTestDAO requestDAO = new AcceptanceTestDAO();
try {
bean = requestDAO.getAcceptanceTest(Integer.parseInt(atId));
if (bean != null) {
formBean = new AcceptanceTestFormBean(bean);
}
} catch (Exception ex) {
}
}
if (formBean == null) {
formBean = new AcceptanceTestFormBean();
formBean.setCreatedEmp(MCUtil.getMemberID(session));
formBean.setCreatedDate(DateUtil.today("dd/MM/yyyy"));
formBean.setTestDate(DateUtil.today("dd/MM/yyyy"));
}
request.setAttribute(Constants.ACCEPTANCETEST, formBean);
//Employee
EmployeeDAO employeeDAO = new EmployeeDAO();
ArrayList employeeList = null;
try {
employeeList = employeeDAO.getEmployees();
} catch (Exception ex) {
}
ArrayList arrEmployee = new ArrayList();
LabelValueBean value;
value = new LabelValueBean();
value.setLabel(MCUtil.getBundleString("message.employee.select"));
value.setValue("0");
arrEmployee.add(value);
for (int i = 0; i < employeeList.size(); i++) {
EmployeeBean employee = (EmployeeBean) employeeList.get(i);
value = new LabelValueBean();
value.setLabel(String.valueOf(StringUtil.decodeString(employee.getFullname())));
value.setValue(String.valueOf(employee.getEmpId()));
arrEmployee.add(value);
}
request.setAttribute(Constants.EMPLOYEE_LIST, arrEmployee);
ArrayList arrStatus = new ArrayList();
value = new LabelValueBean();
value.setLabel(MCUtil.getBundleString("message.result.select"));
value.setValue("0");
arrStatus.add(value);
value = new LabelValueBean();
value.setLabel(MCUtil.getBundleString("message.acceptancetest.result1"));
value.setValue(AcceptanceTestBean.RESULT1 + "");
arrStatus.add(value);
value = new LabelValueBean();
value.setLabel(MCUtil.getBundleString("message.acceptancetest.result2"));
value.setValue(AcceptanceTestBean.RESULT2 + "");
arrStatus.add(value);
request.setAttribute(Constants.RESULT_LIST, arrStatus);
ArrayList srList;
AcceptanceTestDAO requestDAO = new AcceptanceTestDAO();
try {
srList = requestDAO.getSrListOfOrg(MCUtil.getOrganizationID(session));
srList.add(0, new LabelValueBean(MCUtil.getBundleString("message.surveyreport.select"), "0"));
request.setAttribute(Constants.SURVEYREPORT_LIST, srList);
} catch (Exception ex) {
}
return true;
}
@Override
protected String getFunction() {
return PermissionUtil.FUNC_VIEW + ";" + PermissionUtil.FUNC_EDIT;
}
@Override
protected int getPermit() {
return PermissionUtil.PER_EQUIPMENT_SURVEYREPORT;
}
}
| [
"phuongtu1983@gmail.com"
] | phuongtu1983@gmail.com |
4fd4b7be2aabf2167ba4c0aab30b841ea7bef0a9 | c3d83e791ca37275c9cf557b3d2a4097481ecf68 | /src/classes/Adjusting_Fee.java | d4fcf9db25bbcdc1e6d25e39f19381af2f7b7e78 | [] | no_license | Umakant-gosavi/Gym-Management-System--Java-Project | cd23c1095d1c58e3ea84c1329700bd7c02cc0a56 | bff084947a888bf76c00cdf4a077d64e38e9b388 | refs/heads/main | 2023-08-27T04:32:56.997959 | 2021-10-13T15:10:06 | 2021-10-13T15:10:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,010 | java | package classes;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;
import net.proteanit.sql.DbUtils;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Adjusting_Fee extends JFrame {
Connection con=null;
ResultSet rs=null;
PreparedStatement pst=null;
private JPanel contentPane;
private JTable Fee_Table;
/**
* Launch the application.
*/
public static void main(String[] args) {
try {
//here you can put the selected theme class name in JTattoo
UIManager.setLookAndFeel("com.jtattoo.plaf.mcwin.McWinLookAndFeel");
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Adjusting_Fee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Adjusting_Fee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Adjusting_Fee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Adjusting_Fee.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Adjusting_Fee frame = new Adjusting_Fee();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public void Get_Fee()
{
String sql="Select id as'ID',duration as'Duration(in month)',amount as 'Amount' from fees";
try{
con=Connect.connectDb();
pst=con.prepareStatement(sql);
rs=pst.executeQuery();
Fee_Table.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,e);
}
finally {
try {
pst.close();
rs.close();
con.close();
} catch (Exception e2) {
JOptionPane.showMessageDialog(null, e2);
}
}
}
public Adjusting_Fee() {
setTitle("Mass Gym || Adjust Fee");
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 407, 509);
setLocationRelativeTo(this);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setBounds(0, 0, 398, 47);
panel.setBackground(new Color(135, 206, 250));
contentPane.add(panel);
panel.setLayout(null);
JLabel lblAdjustDuration = new JLabel("Adjust Gym Fee With Duration ");
lblAdjustDuration.setFont(new Font("Times New Roman", Font.BOLD, 20));
lblAdjustDuration.setBounds(49, 11, 296, 25);
panel.add(lblAdjustDuration);
JButton btnNewButton = new JButton("New");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Update_Fee_Value uffv= new Update_Fee_Value();
uffv.btnUpdate.setText("Save");
uffv.lblUpdatingFee.setText("Insert new Duration & Fee");
uffv.ForInsert();
uffv.show();
}
});
btnNewButton.setIcon(new ImageIcon(Adjusting_Fee.class.getResource("/images/add product.png")));
btnNewButton.setBounds(10, 48, 79, 23);
contentPane.add(btnNewButton);
JButton btnUpdate = new JButton("Update");
btnUpdate.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int row=Fee_Table.getSelectedRow();
if(row>0)
{
String table_click=Fee_Table.getModel().getValueAt(row,0).toString();
Update_Fee_Value ufv= new Update_Fee_Value();
ufv.updating_fees(table_click);
ufv.show();
}
else {
JOptionPane.showMessageDialog(Fee_Table, " Please select a row");
}
}
});
btnUpdate.setIcon(new ImageIcon(Adjusting_Fee.class.getResource("/images/updateUser.png")));
btnUpdate.setBounds(93, 48, 95, 23);
contentPane.add(btnUpdate);
JButton btnNewButton_1 = new JButton("Update All");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Update_Overall_Fee update=new Update_Overall_Fee();
update.show();
}
});
btnNewButton_1.setIcon(new ImageIcon(Adjusting_Fee.class.getResource("/images/update.png")));
btnNewButton_1.setBounds(189, 48, 101, 23);
contentPane.add(btnNewButton_1);
JButton btnRefresh = new JButton("Refresh");
btnRefresh.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
Get_Fee();
}
});
btnRefresh.setIcon(new ImageIcon(Adjusting_Fee.class.getResource("/images/refresh.png")));
btnRefresh.setBounds(292, 48, 93, 23);
contentPane.add(btnRefresh);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(4, 74, 381, 400);
contentPane.add(scrollPane);
Fee_Table = new JTable();
Fee_Table.setShowGrid(false);
Fee_Table.setModel(new DefaultTableModel(
new Object[][] {
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null},
},
new String[] {
"New column", "New column", "New column"
}
));
scrollPane.setViewportView(Fee_Table);
Get_Fee();
}
}
| [
"“gosaviumakant84@gmail.com”"
] | “gosaviumakant84@gmail.com” |
e9b3d4bb174e5dc418674aa4d17f104c81146868 | 775f262b3a7f3cf3313871c5b64fab8c4fc625eb | /src/main/java/be/howest/ti/hplusplus/code/stmt/ObserveStmt.java | 6515561dc596a29e9f1e17eab71a0fc8abc07560 | [] | no_license | madewael/hpp | cf2da001a1c5860cb1f766207c04427c8de9a009 | b8c2b1384be5a97f56486ce660fd5abb7be05185 | refs/heads/master | 2021-08-12T07:55:25.653560 | 2017-11-13T15:56:01 | 2017-11-13T15:56:01 | 110,568,970 | 3 | 2 | null | 2019-07-22T17:44:48 | 2017-11-13T15:55:53 | Java | UTF-8 | Java | false | false | 1,192 | java | package be.howest.ti.hplusplus.code.stmt;
import be.howest.ti.hplusplus.code.expr.Expression;
import be.howest.ti.hplusplus.code.expr.MemberSelection;
import be.howest.ti.hplusplus.exceptions.execution.HppExecutionException;
import be.howest.ti.hplusplus.scopes.HppScope;
import be.howest.ti.hplusplus.values.HppFunction;
import be.howest.ti.hplusplus.values.HppObject;
import be.howest.ti.hplusplus.values.HppValue;
public class ObserveStmt extends Statement {
private final Expression observer;
private final Expression subject;
private final String memberName;
public ObserveStmt(Expression observer, Expression subject, String memberName) {
this.observer = observer;
this.subject = subject;
this.memberName = memberName;
}
@Override
public void eval(HppScope<HppValue> scope) {
try {
HppFunction observer = (HppFunction) this.observer.eval(scope);
HppObject subject = this.subject.eval(scope).getObject();
subject.addObserver(memberName, observer);
} catch (ClassCastException ex){
throw new HppExecutionException("Observer should be a function.");
}
}
}
| [
"madewael@vub.ac.be"
] | madewael@vub.ac.be |
243178ba3f66acc9c51c0b4cebafdbf47a6f97ee | 7a040f2565cdc2cbef651c80b1f587c3361e6671 | /src/main/java/pl/sda/Files/simple/SimpleFileWriter.java | bd4c5e6e4dea66618c0d778ec573842a2056012e | [] | no_license | warkoczek/SDA_J19_Files | c816f0997112d41d9eb13771be4aef2304250317 | 2b25118ffd823f418c71d265fb2b80ac41d69f79 | refs/heads/master | 2020-08-02T18:12:24.663489 | 2019-09-28T09:35:02 | 2019-09-28T09:35:02 | 211,460,336 | 0 | 0 | null | 2019-09-28T07:15:16 | 2019-09-28T07:15:15 | null | UTF-8 | Java | false | false | 454 | java | package pl.sda.Files.simple;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class SimpleFileWriter {
void write(String content, String filePath){
try(BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath))) {
bufferedWriter.write(content);
bufferedWriter.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"53393030+warkoczek@users.noreply.github.com"
] | 53393030+warkoczek@users.noreply.github.com |
7804efe4956de5d47a1e431e3434aff95b02e2ce | 1a132432388f4d8eee6fb9c74da8a88b99707c74 | /src/main/java/com/belk/car/app/dao/hibernate/VendorImageEmailNotificationDaoHibernate.java | 67ff2c1361e86232a8f88153b5213115988ae9ec | [] | no_license | Subbareddyg/CARS_new | 7ed525e6f5470427e6343becd62e645e43558a6c | 3024c932b54a7e0d808d887210b819bba2ccd1c1 | refs/heads/master | 2020-03-14T14:27:02.793772 | 2018-04-30T23:25:40 | 2018-04-30T23:25:40 | 131,653,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,680 | java | package com.belk.car.app.dao.hibernate;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.appfuse.dao.hibernate.UniversalDaoHibernate;
import org.appfuse.model.User;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import com.belk.car.app.Constants;
import com.belk.car.app.dao.VendorImageEmailNotificationDao;
import com.belk.car.app.dto.FailedImageDTO;
import com.belk.car.app.dto.RRDCheckEmailNotificationDTO;
import com.belk.car.app.dto.FailedImagesDeptDTO;
public class VendorImageEmailNotificationDaoHibernate extends UniversalDaoHibernate implements
VendorImageEmailNotificationDao {
// Append common query
StringBuffer sbQueryClause = commonQuery();
StringBuffer gruopByQuery = commonGroupByQuery();
/**
* This method populates the failed image details for all the CARS including Regular,Dropship and Outfit.
* This method returns map and this map will be used to send an email notification to all users
* return Map<String, RRDCheckEmailNotificationDTO>
* @author - afurxd2
*/
@Override
public Map<String, RRDCheckEmailNotificationDTO> populateEmailListForAllCARS() {
// finalMap will be used to send an email for all users of Regular,Outfit and Drop ship
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForAllCARS = new HashMap<String, RRDCheckEmailNotificationDTO>();
//populate failed image details for Regular CARS
failedImagesMapForAllCARS = populateEmailDetailsForAllRegularCARS();
//populate failed image details for Drop ship CARS
failedImagesMapForAllCARS = populateEmailDetailsForAllDropshipCARS(failedImagesMapForAllCARS);
//populate failed image details for Outfit CARS
failedImagesMapForAllCARS = populateEmailDetailsForAllOutfitCARS(failedImagesMapForAllCARS);
return failedImagesMapForAllCARS;
}
/**
* This method populates the failed image details for all regular CARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateEmailDetailsForAllRegularCARS() {
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForRegularCARS = new HashMap<String, RRDCheckEmailNotificationDTO>();
failedImagesMapForRegularCARS=populateFailedImageDetailsForRegularCARBuyers();
//failedImagesMapForRegularCARS= populateFailedImageDetailsForRegularCARVendors(failedImagesMapForRegularCARS);
return failedImagesMapForRegularCARS;
}
/**
* This method populates the failed image details for all regular CARs Buyer
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
@SuppressWarnings("unchecked")
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForRegularCARBuyers() {
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForRegularCARBuyers = new HashMap<String, RRDCheckEmailNotificationDTO>();
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append(sbQueryClause);
query.append(" WHERE TRUNC(VI.UPDATED_DATE) = TRUNC(SYSDATE)");
query.append(" AND vi.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED')");
query.append(" AND cu.USER_TYPE_CD IN ('BUYER') AND C.SOURCE_TYPE_CD NOT IN ('DROPSHIP', 'OUTFIT') ");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE)");
query.append(" AND CU.STATUS_CD IN ('ACTIVE') ");
query.append(gruopByQuery);
query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList, failedImagesMapForRegularCARBuyers);
}
/**
* This method populates the failed image details for all regular CARS Vendors
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForRegularCARVendors(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForRegularCARS) {
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append(sbQueryClause);
query.append(" INNER JOIN VENDOR V ON V.VENDOR_ID = VS.VENDOR_ID ");
query.append(" INNER JOIN CAR_USER_VENDOR CUV ON CUV.VENDOR_ID = V.VENDOR_ID AND CUV.CAR_USER_ID = CUD.CAR_USER_ID ");
query.append(" WHERE TRUNC(VI.UPDATED_DATE) = TRUNC(SYSDATE) ");
query.append(" AND vi.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED') ");
query.append(" AND cu.USER_TYPE_CD IN ('VENDOR') AND C.SOURCE_TYPE_CD NOT IN ('DROPSHIP', 'OUTFIT') ");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE) ");
query.append(" AND CU.STATUS_CD IN ('ACTIVE') ");
query.append(gruopByQuery);
query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query
.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList, failedImagesMapForRegularCARS);
}
/**
* This method populates the failed image details for all Drop Ship CARS
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateEmailDetailsForAllDropshipCARS(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForDropShipCARS) {
failedImagesMapForDropShipCARS=populateFailedImageDetailsForDropShipCARBuyers(failedImagesMapForDropShipCARS);
//failedImagesMapForDropShipCARS= populateFailedImageDetailsForDropShipCARVendors(failedImagesMapForDropShipCARS);
return failedImagesMapForDropShipCARS;
}
/**
* This method populates the failed image details for all Drop Ship CAR Buyers
* If image uploaded by Vendor
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForDropShipCARBuyers(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForDropShipCARS) {
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append(sbQueryClause);
query.append(" WHERE TRUNC(VI.UPDATED_DATE) = TRUNC(SYSDATE) ");
query.append(" AND vi.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED')");
query.append(" AND cu.USER_TYPE_CD IN ('BUYER') " +
" AND I.IMAGE_SOURCE_TYPE_CD IN ('BUYER_UPLOADED','VENDOR_UPLOADED') " +
" AND C.SOURCE_TYPE_CD = 'DROPSHIP' ");
query.append(" AND CU.STATUS_CD IN ('ACTIVE') ");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE)");
query.append(gruopByQuery);
query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query
.toString());
//System.out.println("populateFailedImageDetailsForDropShipCARBuyers :"+query.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList,failedImagesMapForDropShipCARS);
}
/**
* This method populates the failed image details for Drop Ship CAR Vendor
* If image uploaded by Vendor
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForDropShipCARVendors(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForDropShipCARS) {
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append(sbQueryClause);
query.append(" INNER JOIN VENDOR V ON V.VENDOR_ID = VS.VENDOR_ID ");
query.append(" INNER JOIN CAR_USER_VENDOR CUV ON CUV.VENDOR_ID = V.VENDOR_ID AND CUV.CAR_USER_ID = CUD.CAR_USER_ID ");
query.append(" where Trunc(vi.updated_date) = TRUNC(SYSDATE) ");
query.append(" AND vi.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED')");
query.append(" AND cu.USER_TYPE_CD IN ('VENDOR') "
+ " AND I.IMAGE_SOURCE_TYPE_CD = 'VENDOR_UPLOADED' "
+ " AND C.SOURCE_TYPE_CD = 'DROPSHIP' ");
query.append(" AND CU.STATUS_CD IN ('ACTIVE') ");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE)");
query.append(gruopByQuery);
query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query
.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList, failedImagesMapForDropShipCARS);
}
/**
* This method populates the failed image details for all Outfit CARS
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateEmailDetailsForAllOutfitCARS(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForOutfitCARS) {
failedImagesMapForOutfitCARS=populateFailedImageDetailsForOutfitCARBuyerAndVendor(failedImagesMapForOutfitCARS);
failedImagesMapForOutfitCARS= populateFailedImageDetailsForOufitCARBuyers(failedImagesMapForOutfitCARS);
return failedImagesMapForOutfitCARS;
}
/**
* This method populates the failed image details for all Outfit CAR Buyer and Vendor
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForOutfitCARBuyerAndVendor(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForOutfitCARS) {
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append("SELECT ")
.append("C.CAR_ID, D.DEPT_CD, dbms_lob.SubStr(wm_concat(DISTINCT D.NAME)), VI.CREATED_BY, CU.USER_TYPE_CD, I.IMAGE_LOCATION,I.DESCR,"
+ " VS.VENDOR_STYLE_NUMBER, VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED, C.EXPECTED_SHIP_DATE,"
+ " VI.COLOR_CODE,I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE, dbms_lob.SubStr(wm_concat(DISTINCT RICF.FEEDBACK)), CU.FIRST_NAME, CU.LAST_NAME ")
.append(" FROM CAR C ")
.append(" INNER JOIN DEPARTMENT D ON D.DEPT_ID = C.DEPT_ID")
.append(" INNER JOIN CAR_IMAGE CI ON C.CAR_ID = CI.CAR_ID")
.append(" INNER JOIN IMAGE I ON CI.IMAGE_ID = I.IMAGE_ID")
.append(" INNER JOIN VENDOR_IMAGE VI ON VI.IMAGE_ID = I.IMAGE_ID")
.append(" INNER JOIN CAR_USER CU ON VI.CREATED_BY = CU.EMAIL_ADDR")
.append(" INNER JOIN VENDOR_STYLE VS ON VS.VENDOR_STYLE_ID = VI.VENDOR_STYLE_ID ")
.append(" INNER JOIN RRD_IMAGE_CHECK RIC ON RIC.VENDOR_IMAGE_ID = VI.VENDOR_IMAGE_ID")
.append(" INNER JOIN RRD_IMAGE_CHECK_FEEDBACK RICF ON RICF.CHECK_ID = RIC.CHECK_ID ");
query.append(" where Trunc(vi.updated_date) = TRUNC(SYSDATE) ");
query.append(" AND vi.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED')");
query.append(" AND I.IMAGE_SOURCE_TYPE_CD IN ('BUYER_UPLOADED','VENDOR_UPLOADED') AND C.SOURCE_TYPE_CD = 'OUTFIT' ");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE)");
query.append(" AND CU.STATUS_CD IN ('ACTIVE') ");
query.append(" GROUP BY C.CAR_ID, D.DEPT_CD, VI.CREATED_BY, CU.USER_TYPE_CD, I.IMAGE_LOCATION,I.DESCR,"
+ " VS.VENDOR_STYLE_NUMBER, VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED, C.EXPECTED_SHIP_DATE,"
+ " VI.COLOR_CODE,I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE, CU.FIRST_NAME, CU.LAST_NAME ");
query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query
.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList, failedImagesMapForOutfitCARS);
}
/**
* This method populates the failed image details for all Outfit CAR Buyers
* @param failedImagesMapForAllCARS
*
* @return Map<String, RRDCheckEmailNotificationDTO>
*/
private Map<String, RRDCheckEmailNotificationDTO> populateFailedImageDetailsForOufitCARBuyers(
Map<String, RRDCheckEmailNotificationDTO> failedImagesMapForOutfitCARS) {
List<RRDCheckEmailNotificationDTO> resultSetList = new ArrayList<RRDCheckEmailNotificationDTO>();
StringBuffer query = new StringBuffer();
query.append("SELECT ")
.append(" DISTINCT C1.CAR_ID, '000' AS DEPT_CD, dbms_lob.SubStr(wm_concat(DISTINCT D.NAME)), CU.EMAIL_ADDR, CU.USER_TYPE_CD,I.IMAGE_LOCATION,I.DESCR,"
+ " VS.VENDOR_STYLE_NUMBER, VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED, C1.EXPECTED_SHIP_DATE, VI.COLOR_CODE," +
" I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE, dbms_lob.SubStr(wm_concat(DISTINCT RICF.FEEDBACK)), CU.FIRST_NAME, CU.LAST_NAME ")
.append(" FROM VENDOR_IMAGE VI ")
.append(" INNER JOIN IMAGE I ON I.IMAGE_ID = VI.IMAGE_ID")
.append(" AND VI.VENDOR_IMAGE_STATUS_CD IN ('MQ_FAILED','CREATIVE_FAILED' )")
.append(" AND TRUNC(VI.UPDATED_DATE) = TRUNC(SYSDATE)")
.append(" INNER JOIN CAR_IMAGE CI ON CI.IMAGE_ID = I.IMAGE_ID")
.append(" INNER JOIN CAR C1 ON C1.CAR_ID = CI.CAR_ID AND C1.SOURCE_TYPE_CD = 'OUTFIT'")
.append(" INNER JOIN CAR_OUTFIT_CHILD COC ON COC.OUTFIT_CAR_ID = C1.CAR_ID ")
.append(" INNER JOIN CAR C2 ON C2.CAR_ID = COC.CHILD_CAR_ID AND C2.STATUS_CD='ACTIVE'")
.append(" INNER JOIN DEPARTMENT D ON C2.DEPT_ID = D.DEPT_ID ")
.append(" INNER JOIN CAR_USER_DEPARTMENT CUD ON D.DEPT_ID = CUD.DEPT_ID ")
.append(" INNER JOIN CAR_USER CU ON CUD.CAR_USER_ID = CU.CAR_USER_ID ")
.append(" INNER JOIN VENDOR_STYLE VS ON VS.VENDOR_STYLE_ID = VI.VENDOR_STYLE_ID ")
.append(" INNER JOIN RRD_IMAGE_CHECK RIC ON RIC.VENDOR_IMAGE_ID = VI.VENDOR_IMAGE_ID ")
.append(" INNER JOIN RRD_IMAGE_CHECK_FEEDBACK RICF ON RICF.CHECK_ID = RIC.CHECK_ID ");
query.append(" WHERE I.IMAGE_SOURCE_TYPE_CD = 'VENDOR_UPLOADED' ");
query.append(" AND CU.USER_TYPE_CD IN ('BUYER')");
query.append(" AND CU.STATUS_CD IN ('ACTIVE')");
query.append(" AND TRUNC(RIC.CREATED_DATE) = TRUNC(SYSDATE) ");
query.append(" GROUP BY C1.CAR_ID,CU.EMAIL_ADDR,CU.USER_TYPE_CD, I.IMAGE_LOCATION,I.DESCR," +
" VS.VENDOR_STYLE_NUMBER, VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED," +
" C1.EXPECTED_SHIP_DATE,VI.COLOR_CODE, I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE," +
" CU.FIRST_NAME, CU.LAST_NAME ");
//query.append(" ORDER BY D.DEPT_CD DESC ");
SessionFactory sf = getHibernateTemplate().getSessionFactory();
Session session = sf.getCurrentSession();
try {
SQLQuery sQuery = (SQLQuery) session.createSQLQuery(query
.toString());
resultSetList = sQuery.list();
} catch (Exception e) {
log.error("Hibernate Exception" + e);
}
return mapDBObjectsToDTO(resultSetList, failedImagesMapForOutfitCARS);
}
/**
* This method creates the common query used among all the methods used for
* populating the vendor image failed details
*
* return commonQuery
*/
private StringBuffer commonQuery() {
// used for appending the common query
StringBuffer commonQuery = new StringBuffer();
commonQuery.append("SELECT C.CAR_ID, D.DEPT_CD, D.NAME, CU.EMAIL_ADDR, CU.USER_TYPE_CD, I.IMAGE_LOCATION, I.DESCR," +
"VS.VENDOR_STYLE_NUMBER, VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED, " +
"C.EXPECTED_SHIP_DATE, VI.COLOR_CODE,I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE, " +
"dbms_lob.SubStr(wm_concat(DISTINCT RICF.FEEDBACK)), CU.FIRST_NAME, CU.LAST_NAME ")
.append(" FROM CAR C ")
.append(" INNER JOIN DEPARTMENT D ON D.DEPT_ID = C.DEPT_ID")
.append(" INNER JOIN CAR_USER_DEPARTMENT CUD ON D.DEPT_ID = CUD.DEPT_ID")
.append(" INNER JOIN CAR_USER CU ON CUD.CAR_USER_ID = CU.CAR_USER_ID")
.append(" INNER JOIN CAR_IMAGE CI ON C.CAR_ID = CI.CAR_ID")
.append(" INNER JOIN IMAGE I ON CI.IMAGE_ID = I.IMAGE_ID")
.append(" INNER JOIN VENDOR_IMAGE VI ON VI.IMAGE_ID = I.IMAGE_ID ")
.append(" INNER JOIN VENDOR_STYLE VS ON VS.VENDOR_STYLE_ID = VI.VENDOR_STYLE_ID")
.append(" INNER JOIN RRD_IMAGE_CHECK RIC ON RIC.VENDOR_IMAGE_ID = VI.VENDOR_IMAGE_ID ")
.append(" INNER JOIN RRD_IMAGE_CHECK_FEEDBACK RICF ON RICF.CHECK_ID = RIC.CHECK_ID ");
return commonQuery;
}
/**
* This method creates the common query used among all the methods used for
* populating the vendor image failed details
*
* return groupByQuery
*/
private StringBuffer commonGroupByQuery() {
// used for appending the common query
StringBuffer groupByQuery = new StringBuffer();
groupByQuery.append(" GROUP BY C.CAR_ID, D.DEPT_CD, D.DEPT_ID,CU.CAR_USER_ID, D.NAME, CU.EMAIL_ADDR, CU.USER_TYPE_CD," +
" I.IMAGE_LOCATION, I.DESCR,VS.VENDOR_STYLE_NUMBER, " +
" VI.VENDOR_IMAGE_STATUS_CD, VI.BUYER_APPROVED,C.EXPECTED_SHIP_DATE, " +
" VI.COLOR_CODE,I.IMAGE_SOURCE_TYPE_CD, RIC.CHECK_TYPE,RICF.CHECK_ID," +
" CU.FIRST_NAME, CU.LAST_NAME, VI.VENDOR_IMAGE_ID,RIC.VENDOR_IMAGE_ID ");
return groupByQuery;
}
/**
* This method maps the result set to DTO
*
* @return Map<String, RRDCheckEmailNotificationDTO\
* >
*/
@SuppressWarnings("rawtypes")
private Map<String, RRDCheckEmailNotificationDTO> mapDBObjectsToDTO(
List resultSetList,Map<String, RRDCheckEmailNotificationDTO> mapUserFailedImages) {
for (Object obj : resultSetList) {
User user = new User();
java.math.BigDecimal bigUserId = (java.math.BigDecimal) Array.get(obj, 0);
Long carId = bigUserId == null ? null : bigUserId.longValue();
Object o = Array.get(obj, 1);
String deptCode="";
if (o.toString().equals("0")) {
deptCode=Constants.OUTFIT_DEPT_NUMBER;
} else {
deptCode = o.toString();
}
String deptName = (String) Array.get(obj, 2);
String emailAddress = (String) Array.get(obj, 3);
String userTypeCode = (String) Array.get(obj, 4);
String imageName = (String) Array.get(obj, 5);
String orignalImage = (String) Array.get(obj, 6);
Object o1 = Array.get(obj, 7);
String venodrImageId = o1.toString();
/*
* java.math.BigDecimal bigimageId = (java.math.BigDecimal)
* Array.get(obj, 6); Long venodrImageId = bigimageId == null ? null
* : bigimageId.longValue();
*/
String vendorImageStatusCode = (String) Array.get(obj, 8);
String buyerApproved = (String) Array.get(obj, 9);
Object update = Array.get(obj, 10);
String expectedDate = update.toString();
DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
Date date = null;
try {
date = inputFormat.parse(expectedDate);
} catch (ParseException e) {
log.error("ParseException Exception" + e);
}
// Format date into output format
DateFormat outputFormat = new SimpleDateFormat("MM-dd-yyyy");
String expectedShipDate = outputFormat.format(date);
// expectedShipDate
Object c = Array.get(obj, 11);
String colorCode = c.toString();
String imageSourceTypeCD = (String) Array.get(obj, 12);
String failureType = (String) Array.get(obj, 13);
Object fr = Array.get(obj, 14);
String failureReasons = fr.toString();
String firstName = (String) Array.get(obj, 15);
String lastName = (String) Array.get(obj, 16);
RRDCheckEmailNotificationDTO rrdCheckEmailNotificationDTO = mapUserFailedImages.get(emailAddress);
if (rrdCheckEmailNotificationDTO != null) {
Map<String, FailedImagesDeptDTO> previousFailedImagesMap = rrdCheckEmailNotificationDTO
.getMapFailedImagesDeptDTO();
FailedImagesDeptDTO previousFailedImagesDeptDTO = previousFailedImagesMap.get(deptCode);
if (previousFailedImagesDeptDTO != null) {
List<FailedImageDTO> failedImageDTOs = previousFailedImagesDeptDTO
.getFailedImagesDTO();
FailedImageDTO failedImageDTO = new FailedImageDTO();
failedImageDTO.setCarId(carId);
failedImageDTO.setColorCode(colorCode);
failedImageDTO.setExpectedShipDate(expectedShipDate);
failedImageDTO.setImageName(imageName);
failedImageDTO.setOriginalName(orignalImage);
failedImageDTO.setVendorStyleNo(venodrImageId.toString());
failedImageDTO.setFailureType(failureType);
failedImageDTO.setFailureReasons(failureReasons);
failedImageDTOs.add(failedImageDTO);
} else {
// create DTO for new dept
List<FailedImageDTO> failedImageDTOList = new ArrayList<FailedImageDTO>();
FailedImageDTO failedImageDTO = new FailedImageDTO();
failedImageDTO.setCarId(carId);
failedImageDTO.setColorCode(colorCode);
failedImageDTO.setExpectedShipDate(expectedShipDate);
failedImageDTO.setImageName(imageName);
failedImageDTO.setOriginalName(orignalImage);
failedImageDTO.setVendorStyleNo(venodrImageId.toString());
failedImageDTO.setFailureType(failureType);
failedImageDTO.setFailureReasons(failureReasons);
failedImageDTOList.add(failedImageDTO);
FailedImagesDeptDTO failedImagesDeptDTO = new FailedImagesDeptDTO();
failedImagesDeptDTO.setDeptCd(deptCode);
failedImagesDeptDTO.setDeptName(deptName);
failedImagesDeptDTO.setFailedImagesDTO(failedImageDTOList);
previousFailedImagesMap.put(deptCode, failedImagesDeptDTO);
}
} else {
// No failed images found for user
List<FailedImageDTO> failedImageDTOList = new ArrayList<FailedImageDTO>();
Map<String, FailedImagesDeptDTO> mapFailedImagesDept = new HashMap<String, FailedImagesDeptDTO>();
RRDCheckEmailNotificationDTO checkEmailNotificationDTO = new RRDCheckEmailNotificationDTO();
FailedImageDTO failedImageDTO = new FailedImageDTO();
failedImageDTO.setCarId(carId);
failedImageDTO.setColorCode(colorCode);
failedImageDTO.setExpectedShipDate(expectedShipDate);
failedImageDTO.setOriginalName(orignalImage);
failedImageDTO.setImageName(imageName);
failedImageDTO.setVendorStyleNo(venodrImageId.toString());
failedImageDTO.setFailureType(failureType);
failedImageDTO.setFailureReasons(failureReasons);
failedImageDTOList.add(failedImageDTO);
FailedImagesDeptDTO failedImagesDeptDTO = new FailedImagesDeptDTO();
failedImagesDeptDTO.setDeptCd(deptCode);
failedImagesDeptDTO.setDeptName(deptName);
failedImagesDeptDTO.setFailedImagesDTO(failedImageDTOList);
mapFailedImagesDept.put(deptCode, failedImagesDeptDTO);
// Set user details
user.setEmailAddress(emailAddress);
user.setUserTypeCd(userTypeCode);
user.setFirstName(firstName);
user.setFirstName(lastName);
checkEmailNotificationDTO.setUserDetailObject(user);
checkEmailNotificationDTO
.setMapFailedImagesDeptDTO(mapFailedImagesDept);
mapUserFailedImages
.put(emailAddress, checkEmailNotificationDTO);
}
}
return mapUserFailedImages;//merge
}
}
| [
"subba_gunjikunta@belk.com"
] | subba_gunjikunta@belk.com |
acd9186e7b267d04f78b1b8470b64d5741c156ea | a64bb1f3e6270ee0dc6a87bd55b60c9781397ad3 | /src/util/IGroup.java | 4729ab507a5bec4d337797fbab305fc5ad7ea45c | [] | no_license | jlucas95/phwar | bcaf76eafc19de22ec5ebe3d323388dc8eb106a8 | dd66cac6b41aa7c097cda6943fa9a1c14dadba4c | refs/heads/master | 2021-07-19T11:57:47.799053 | 2017-10-28T20:57:21 | 2017-10-28T20:57:21 | 104,877,615 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 101 | java | package util;
import java.util.Collection;
public interface IGroup<K, E> extends Collection<E>{
}
| [
"jan-lucas@hetnet.nl"
] | jan-lucas@hetnet.nl |
8a84f8e2a58dac88c8c2f3845b61efe56597bbef | 9a6bbc16b35db8783d2d7fe0a845e92102e881a9 | /src/gov/nbcs/rp/common/tree/TreeNode.java | 3c922caacb90277ffc29cc0fc0720aa48bb966ba | [] | no_license | mingcheong/RollPrj | 7608e05ba21056d2110245213a507f9c533fe935 | a3db125f146f743573a5b808b0ba5fd0006b743f | refs/heads/master | 2020-05-20T03:12:48.430634 | 2012-12-31T00:34:48 | 2012-12-31T00:34:48 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 6,654 | java | package gov.nbcs.rp.common.tree;
import gov.nbcs.rp.common.MyMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* <p>
* Title: 树结点的实现类,方法说明见@see com.jsxcsoft.common.tree.Node
* </p>
* <p>
* Description:
* </p>
* <p>
* Copyright: Copyright (c) 2005
* </p>
* <p>
* Company: 浙江易桥
* </p>
*
* @author 局端财政开发
* @version 1.0
*/
public class TreeNode implements Node, Cloneable {
Map attributes;
Object value;
int level = 0;
/**
* 子树集合
*/
ArrayList children;
/**
* 父结点
*/
Node parent;
private int height = -1;
private int width = 0;
private Map levelNodes = new HashMap();
private Set levelNodesExist = new HashSet();
private Object id;
private Object sortValue;
private String text;
TreeNode(Object id, String text, Object sortValue, Object value,
Map attributes) {
this.value = value;
this.attributes = attributes;
this.id = id;
this.sortValue = sortValue;
this.text = text;
}
TreeNode(Map attributes) {
this(null, null, null, null, attributes);
}
public Iterator getAttributeNames() {
return attributes.keySet().iterator();
}
public Node search(Node node, String attrName, String attrValue) {
Set v = new HashSet(1);
search(node, v, attrName, attrValue);
if (v.size() > 0) {
return (Node) v.iterator().next();
} else {
return node;
}
}
private void search(Node node, Set result, String attrName, String attrValue) {
if (matchAttr(node, attrName, attrValue)) {
result.add(node);
return;
}
for (int i = 0; i < node.getChildrenCount(); i++) {
search(node.getChildAt(i), result, attrName, attrValue);
}
}
protected boolean matchAttr(Node node, String attrName, String attrValue) {
return ((attrName != null) && (attrValue != null))
&& ((TreeNode) node).attributes.containsKey(attrName)
&& ((TreeNode) node).attributes.get(attrName).equals(attrValue);
}
public void append(Node node) {
if (children == null) {
children = new ArrayList();
}
((TreeNode) node).parent = this;
adjustChildLevel((TreeNode) node);
children.add(node);
}
public Object getAttribute(Object key) {
return attributes == null ? null : attributes.get(key);
}
public Map getAttributes() {
return this.attributes;
}
public void setAttribute(Object name, Object value) {
if (attributes == null) {
attributes = new MyMap();
}
attributes.put(name, value);
}
public Object getValue() {
return this.value;
}
public void setValue(Object value) {
this.value = value;
}
public int getNodeType() {
return parent == null ? Node.ROOT : (((children != null) && (children
.size() > 0)) ? Node.BRANCH : Node.LEAF);
}
public int getChildrenCount() {
return children == null ? 0 : children.size();
}
public Node getChildAt(int i) {
return (Node) this.children.get(i);
}
public Node getParent() {
return this.parent;
}
public int getLevel() {
return level;
}
public Object clone() {
Node cloned = new TreeNode(this.id, this.text, this.sortValue,
this.value, this.attributes);
for (int i = 0; i < getChildrenCount(); i++) {
cloned.append((Node) getChildAt(i).clone());
}
return cloned;
}
public boolean equals(Object o) {
if (!(o instanceof TreeNode)) {
return false;
}
TreeNode node = (TreeNode) o;
boolean b = (((this.value == null) && (node.value == null)) || ((this.value != null) && this.value
.equals(node.value)))
&& (o instanceof TreeNode);
if (!b) {
return b;
}
if (attributes != null) {
for (Iterator it = node.attributes.keySet().iterator(); it
.hasNext();) {
String key = it.next().toString();
String value = node.attributes.get(key).toString();
b = b && matchAttr(this, key, value);
}
}
return b;
}
public int getHeight() {
doHeightStatistic(this);
return height;
}
protected void doHeightStatistic(Node node) {
int currentLevel = node.getLevel();
addLevelNode(currentLevel, node);
if ((node.getChildrenCount() == 0) && (currentLevel > height)) {
if (node != this) {
height = currentLevel;
}
} else {
for (int i = 0; i < node.getChildrenCount(); i++) {
doHeightStatistic(node.getChildAt(i));
}
}
}
protected void addLevelNode(int level, Node node) {
Integer key = new Integer(level);
List nodeList = null;
if (this.levelNodes.containsKey(key)) {
nodeList = (List) levelNodes.get(key);
} else {
nodeList = new ArrayList();
}
if (!levelNodesExist.contains(node)) {
nodeList.add(node);
levelNodesExist.add(node);
}
levelNodes.put(key, nodeList);
}
protected void doWidthStatistic(Node node) {
if (node.getNodeType() == Node.LEAF) {
width++;
} else {
for (int i = 0; i < node.getChildrenCount(); i++) {
doWidthStatistic(node.getChildAt(i));
}
}
}
public int getWidth() {
width = 0;
doWidthStatistic(this);
return width;
}
public Node[][] toArray() {
levelNodes.clear();
levelNodesExist.clear();
doHeightStatistic(this);
Node[][] nodes = new Node[levelNodes.size()][];
for (int i = 0; i < nodes.length; i++) {
List list = (List) levelNodes.get(new Integer(i));
if (list != null) {
nodes[i] = new Node[list.size()];
System.arraycopy(list.toArray(), 0, nodes[i], 0,
nodes[i].length);
}
}
return nodes;
}
public void insert(Node child, int i) {
if (this.children == null) {
children = new ArrayList();
}
((TreeNode) child).parent = this;
adjustChildLevel((TreeNode) child);
children.add(i, child);
}
public int indexOf(Node child) {
return this.children == null ? -1 : children.indexOf(child);
}
protected void adjustChildLevel(TreeNode node) {
node.level = ((TreeNode) node.parent).level + 1;
for (int i = 0; i < node.getChildrenCount(); i++) {
adjustChildLevel((TreeNode) node.getChildAt(i));
}
}
public Object getIdentifier() {
// TODO Auto-generated method stub
return this.id;
}
public Object getSortByValue() {
// TODO Auto-generated method stub
return this.sortValue;
}
public String getText() {
return this.text;
}
public void setText(String text) {
this.text = text;
}
public String toString() {
return getText();
}
public boolean deleteSubNode(Node node) {
if (node == null) {
return false;
}
int iCount = getChildrenCount();
if (iCount <= 0) {
return false;
}
for (int i = 0; i < iCount; i++) {
if (getChildAt(i) == node) {
children.remove(i);
return true;
}
}
return false;
}
} | [
"mingcheong83@gmail.com"
] | mingcheong83@gmail.com |
d18ac19b1f96ba57173efd2c896556d09031ee6f | 7120ed04f7d305641529ea82c8642438acec920c | /codeforces/1526/C1.java | a15c704bb55202188f5591c94a8206b38f39417b | [] | no_license | aditya-786/coding-submissions | d1a886f837d25f25bfbabd911b3bc47eb9d5edf8 | eb563f09ca79fdb6a8ffbb22038f5dc35d24b275 | refs/heads/master | 2023-06-27T13:07:39.322504 | 2021-07-24T18:46:57 | 2021-07-24T18:46:57 | 387,923,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,983 | java | import java.util.*;
import java.io.*;
public class Main {
static long startTime = System.currentTimeMillis();
// for global initializations and methods starts here
// global initialisations and methods end here
static void run() {
boolean tc = false;
AdityaFastIO r = new AdityaFastIO();
//FastReader r = new FastReader();
try (OutputStream out = new BufferedOutputStream(System.out)) {
//long startTime = System.currentTimeMillis();
int testcases = tc ? r.ni() : 1;
int tcCounter = 1;
// Hold Here Sparky------------------->>>
// Solution Starts Here
start:
while (testcases-- > 0) {
int n = r.ni();
List<Long> list = new ArrayList<>();
for (int i=0;i<n;i++) list.add(r.nl());
int count = 0;
long sum = 0;
PriorityQueue<Long> pq = new PriorityQueue<>();
for (long ele : list){
if (sum+ele>=0){
sum+=ele;
count++;
if (ele<0) pq.add(ele);
}else{
for (long e : pq){
if (e<ele){
if (sum-e+ele>=0){
sum-=e;
sum+=ele;
pq.remove(e);
pq.add(ele);
break ;
}
}
}
}
}
out.write((count + " ").getBytes());
out.write(("\n").getBytes());
}
// Solution Ends Here
} catch (IOException e) {
e.printStackTrace();
}
}
static class AdityaFastIO {
final private int BUFFER_SIZE = 1 << 16;
private final DataInputStream din;
private final byte[] buffer;
private int bufferPointer, bytesRead;
public BufferedReader br;
public StringTokenizer st;
public AdityaFastIO() {
br = new BufferedReader(new InputStreamReader(System.in));
din = new DataInputStream(System.in);
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public AdityaFastIO(String file_name) throws IOException {
din = new DataInputStream(new FileInputStream(file_name));
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
public String word() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
public String line() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
public String readLine() throws IOException {
byte[] buf = new byte[100000001]; // line length
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n') break;
buf[cnt++] = (byte) c;
}
return new String(buf, 0, cnt);
}
public int ni() throws IOException {
int ret = 0;
byte c = read();
while (c <= ' ') c = read();
boolean neg = (c == '-');
if (neg) c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (neg) return -ret;
return ret;
}
public long nl() throws IOException {
long ret = 0;
byte c = read();
while (c <= ' ') c = read();
boolean neg = (c == '-');
if (neg) c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (neg) return -ret;
return ret;
}
public double nd() throws IOException {
double ret = 0, div = 1;
byte c = read();
while (c <= ' ') c = read();
boolean neg = (c == '-');
if (neg) c = read();
do {
ret = ret * 10 + c - '0';
}
while ((c = read()) >= '0' && c <= '9');
if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10);
if (neg) return -ret;
return ret;
}
private void fillBuffer() throws IOException {
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1) buffer[0] = -1;
}
private byte read() throws IOException {
if (bufferPointer == bytesRead) fillBuffer();
return buffer[bufferPointer++];
}
public void close() throws IOException {
if (din == null) return;
din.close();
}
}
public static void main(String[] args) throws Exception {
run();
}
static long mod = 998244353;
static long modInv(long base, long e) {
long result = 1;
base %= mod;
while (e > 0) {
if ((e & 1) > 0) result = result * base % mod;
base = base * base % mod;
e >>= 1;
}
return result;
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String word() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
String line() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
int ni() {
return Integer.parseInt(word());
}
long nl() {
return Long.parseLong(word());
}
double nd() {
return Double.parseDouble(word());
}
}
static int MOD = (int) (1e9 + 7);
static long powerLL(long x, long n) {
long result = 1;
while (n > 0) {
if (n % 2 == 1) result = result * x % MOD;
n = n / 2;
x = x * x % MOD;
}
return result;
}
static long powerStrings(int i1, int i2) {
String sa = String.valueOf(i1);
String sb = String.valueOf(i2);
long a = 0, b = 0;
for (int i = 0; i < sa.length(); i++) a = (a * 10 + (sa.charAt(i) - '0')) % MOD;
for (int i = 0; i < sb.length(); i++) b = (b * 10 + (sb.charAt(i) - '0')) % (MOD - 1);
return powerLL(a, b);
}
static long gcd(long a, long b) {
if (a == 0) return b;
else return gcd(b % a, a);
}
static long lcm(long a, long b) {
return (a * b) / gcd(a, b);
}
static long lower_bound(List<Long> list, long k) {
int s = 0;
int e = list.size();
while (s != e) {
int mid = (s + e) >> 1;
if (list.get(mid) < k) s = mid + 1;
else e = mid;
}
if (s == list.size()) return -1;
return s;
}
static int upper_bound(List<Long> list, long k) {
int s = 0;
int e = list.size();
while (s != e) {
int mid = (s + e) >> 1;
if (list.get(mid) <= k) s = mid + 1;
else e = mid;
}
if (s == list.size()) return -1;
return s;
}
static void addEdge(ArrayList<ArrayList<Integer>> graph, int edge1, int edge2) {
graph.get(edge1).add(edge2);
graph.get(edge2).add(edge1);
}
public static class Pair implements Comparable<Pair> {
int first;
int second;
public Pair(int first, int second) {
this.first = first;
this.second = second;
}
public String toString() {
return "(" + first + "," + second + ")";
}
public int compareTo(Pair o) {
// TODO Auto-generated method stub
if (this.first != o.first)
return (int) (this.first - o.first);
else return (int) (this.second - o.second);
}
}
public static class PairC<X, Y> implements Comparable<PairC> {
X first;
Y second;
public PairC(X first, Y second) {
this.first = first;
this.second = second;
}
public String toString() {
return "(" + first + "," + second + ")";
}
public int compareTo(PairC o) {
// TODO Auto-generated method stub
return o.compareTo((PairC) first);
}
}
static boolean isCollectionsSorted(List<Long> list) {
if (list.size() == 0 || list.size() == 1) return true;
for (int i = 1; i < list.size(); i++) if (list.get(i) <= list.get(i - 1)) return false;
return true;
}
static boolean isCollectionsSortedReverseOrder(List<Long> list) {
if (list.size() == 0 || list.size() == 1) return true;
for (int i = 1; i < list.size(); i++) if (list.get(i) >= list.get(i - 1)) return false;
return true;
}
} | [
"adityaaggarwal7861@gmail.com"
] | adityaaggarwal7861@gmail.com |
812c285d144258ddce39c36d0204ee06ef8da866 | 99893d3f86127fa056828c71083055212d5cca2d | /app/src/main/java/com/example/burakaydemir/milliyetappandroid/ScrollTextView.java | e28be139da95c9a1ac352d3736d965691a4ca8b8 | [] | no_license | brkaydemir/MilliyetAndroidApp | 0da7373fdc8fa96dc6bf9bc8214e955564a1710d | a2e09d4d09464aec30bc4a93e488a502b848e1c6 | refs/heads/master | 2021-01-10T12:52:35.441055 | 2016-02-15T07:58:41 | 2016-02-15T07:58:41 | 50,179,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,018 | java | package com.example.burakaydemir.milliyetappandroid;
import android.content.Context;
import android.graphics.Rect;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.view.animation.LinearInterpolator;
import android.widget.Scroller;
import android.widget.TextView;
/**
* Created by burak.aydemir on 25.1.2016.
*/
public class ScrollTextView extends TextView {
// scrolling feature
private Scroller mSlr;
// milliseconds for a round of scrolling
private int mRndDuration = 100;
// the X offset when paused
private int mXPaused = 0;
// whether it's being paused
private boolean mPaused = true;
/*
* constructor
*/
public ScrollTextView(Context context) {
this(context, null);
// customize the TextView
setSingleLine();
setEllipsize(null);
setVisibility(INVISIBLE);
}
/*
* constructor
*/
public ScrollTextView(Context context, AttributeSet attrs) {
this(context, attrs, android.R.attr.textViewStyle);
// customize the TextView
setSingleLine();
setEllipsize(null);
setVisibility(INVISIBLE);
}
/*
* constructor
*/
public ScrollTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// customize the TextView
setSingleLine();
setEllipsize(null);
setVisibility(INVISIBLE);
}
/**
* begin to scroll the text from the original position
*/
public void startScroll() {
// begin from the very right side
mXPaused = -1 * getWidth();
// assume it's paused
mPaused = true;
resumeScroll();
}
/**
* resume the scroll from the pausing point
*/
public void resumeScroll() {
if (!mPaused)
return;
// Do not know why it would not scroll sometimes
// if setHorizontallyScrolling is called in constructor.
setHorizontallyScrolling(true);
// use LinearInterpolator for steady scrolling
mSlr = new Scroller(this.getContext(), new LinearInterpolator());
setScroller(mSlr);
int scrollingLen = calculateScrollingLen();
int distance = scrollingLen - (getWidth() + mXPaused);
int duration = (int) (mRndDuration * distance / 100f * 5f);
// int duration = (new Double(mRndDuration * distance * 1.00000
// / scrollingLen)).intValue();
setVisibility(VISIBLE);
mSlr.startScroll(mXPaused, 0, distance, 0, duration);
invalidate();
mPaused = false;
}
/**
* calculate the scrolling length of the text in pixel
*
* @return the scrolling length in pixels
*/
private int calculateScrollingLen() {
TextPaint tp = getPaint();
Rect rect = new Rect();
String strTxt = getText().toString();
tp.getTextBounds(strTxt, 0, strTxt.length(), rect);
return rect.width() + getWidth();
}
/**
* pause scrolling the text
*/
public void pauseScroll() {
if (null == mSlr)
return;
if (mPaused)
return;
mPaused = true;
// abortAnimation sets the current X to be the final X,
// and sets isFinished to be true
// so current position shall be saved
mXPaused = mSlr.getCurrX();
mSlr.abortAnimation();
}
@Override
/*
* override the computeScroll to restart scrolling when finished so as that
* the text is scrolled forever
*/
public void computeScroll() {
super.computeScroll();
if (null == mSlr) return;
if (mSlr.isFinished() && (!mPaused)) {
this.startScroll();
}
}
public int getRndDuration() {
return mRndDuration;
}
public void setRndDuration(int duration) {
this.mRndDuration = duration;
}
public boolean isPaused() {
return mPaused;
}
}
| [
"burak.aydmir@gmail.com"
] | burak.aydmir@gmail.com |
1ce28d26620b98953d380361a69fdbb0fed2a0f7 | 090cfdb3732887c292f0443a034c1b4e7b87338c | /tests/junit/Hauke/ParamTest.java | 59a7e2ff1d0dba36e2d0d1fde0cc88e5c1f8a849 | [] | no_license | Tetr4/MiniJava | 62e3c708cfe66bbae33a552f511f9ad1451ebb9d | 47fe17fa5d58747f0bb928887658abf5f98ecd73 | refs/heads/master | 2020-05-13T05:03:26.708168 | 2015-10-30T17:50:31 | 2015-10-30T17:50:31 | 38,459,591 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | class ParamTest {
public static void main(String[] a){
A x;
x = new A();
x = x.m(0);
}
}
class A {
public A m(int i)
{
return new A();
}
}
| [
"peace-maker@wcfan.de"
] | peace-maker@wcfan.de |
0f11e98b7f86e794682c871bba856ebf66ba47ed | 544145aaea7bf0bb7876e5097a19b90bf9e47a28 | /SensorCloud API/src/microstrain/sensorcloud/exception/InvalidNameException.java | 0fc34f727a59ecc479500be20a3e6b35120369ef | [] | no_license | cjmicro33/SensorCloudJavaAPI | 734eb4b8bde2dcf26509a3a3d0599aad6b3e4380 | 59e7332bddd62c134dd71c373b12e2dae996d35f | refs/heads/master | 2016-09-06T04:30:58.113734 | 2011-11-14T15:07:22 | 2011-11-14T15:07:22 | 2,710,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package microstrain.sensorcloud.exception;
/**
* The user provided an invalid name string.
*
* @author Colin Cavanaugh
*
*/
@SuppressWarnings("serial")
public class InvalidNameException extends InvalidUserInputException {
/**
* @param name invalid name
* @param reason why the name is invalid
*/
public InvalidNameException (String name, String reason) {
super( "Invalid Name: " + name + "\n" + reason );
}
}
| [
"cjcavanaugh@microstrain.com"
] | cjcavanaugh@microstrain.com |
d50ddb54402001463a7de6fadb58b242a4702a5e | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-piclisten/utopia-piclisten-impl/src/main/java/com/voxlearning/utopia/service/piclisten/impl/service/AsyncPiclistenCacheServiceImpl.java | 8b3d64427b1e96f6a79ddb4459ec00a145b1bae1 | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 4,844 | java | package com.voxlearning.utopia.service.piclisten.impl.service;
import com.voxlearning.alps.annotation.cache.CacheSystem;
import com.voxlearning.alps.annotation.remote.ExposeService;
import com.voxlearning.alps.annotation.remote.ExposeServices;
import com.voxlearning.alps.annotation.remote.ServiceVersion;
import com.voxlearning.alps.api.concurrent.AlpsFuture;
import com.voxlearning.alps.cache.redis.command.IRedisCommands;
import com.voxlearning.alps.cache.redis.command.RedisCommandsBuilder;
import com.voxlearning.alps.lang.util.SpringContainerSupport;
import com.voxlearning.alps.remote.core.support.ValueWrapperFuture;
import com.voxlearning.alps.spi.cache.CacheBuilder;
import com.voxlearning.alps.spi.cache.UtopiaCache;
import com.voxlearning.utopia.api.constant.SelfStudyType;
import com.voxlearning.utopia.service.piclisten.api.AsyncPiclistenCacheService;
import com.voxlearning.utopia.service.piclisten.consumer.cache.manager.*;
import lombok.Getter;
import javax.inject.Named;
import java.util.Date;
@Named("com.voxlearning.utopia.service.vendor.impl.service.AsyncVendorCacheServiceImpl")
@ExposeServices({
@ExposeService(interfaceClass = AsyncPiclistenCacheService.class, version = @ServiceVersion(version = "2017.05.16")),
@ExposeService(interfaceClass = AsyncPiclistenCacheService.class, version = @ServiceVersion(version = "2017.12.04"))
})
@Getter
public class AsyncPiclistenCacheServiceImpl extends SpringContainerSupport implements AsyncPiclistenCacheService {
private CParentSelfStudyBookCacheManager parentSelfStudyBookCacheManager;
private ParentShareTextReadLimitCacheManager parentShareTextReadLimitCacheManager;
private StudentGrindEarDayRecordCacheManager studentGrindEarDayRecordCacheManager;
private FollowReadDayReadCacheManager followReadDayReadCacheManager;
private PicListenReportCacheManager picListenReportCacheManager;
private FollowReadShareLikeRankCacheManager followReadShareLikeRankCacheManager;
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
UtopiaCache unflushable = CacheSystem.CBS.getCache("unflushable");
parentSelfStudyBookCacheManager = new CParentSelfStudyBookCacheManager(unflushable);
parentShareTextReadLimitCacheManager = new ParentShareTextReadLimitCacheManager(unflushable);
studentGrindEarDayRecordCacheManager = new StudentGrindEarDayRecordCacheManager(unflushable);
UtopiaCache persistence = CacheSystem.CBS.getCache("persistence");
followReadDayReadCacheManager = new FollowReadDayReadCacheManager(persistence);
CacheBuilder cacheBuilder = CacheSystem.RDS.getCacheBuilder();
RedisCommandsBuilder instance = RedisCommandsBuilder.getInstance();
UtopiaCache parentAppCache = cacheBuilder.getCache("parent-app");
IRedisCommands parentAppRedisCommands = instance.getRedisCommands("parent-app");
picListenReportCacheManager = new PicListenReportCacheManager(parentAppCache, parentAppRedisCommands);
followReadShareLikeRankCacheManager = new FollowReadShareLikeRankCacheManager(parentAppCache, parentAppRedisCommands);
}
@Override
public AlpsFuture<Boolean> CParentSelfStudyBookCacheManager_setParentSeflStudyBook(Long parentId, SelfStudyType selfStudyType, String bookId) {
Boolean b = parentSelfStudyBookCacheManager.setParentSeflStudyBook(parentId, selfStudyType, bookId);
return new ValueWrapperFuture<>(b);
}
@Override
public AlpsFuture<String> CParentSelfStudyBookCacheManager_getParentSelfStudyBook(Long parentId, SelfStudyType selfStudyType) {
String s = parentSelfStudyBookCacheManager.getParentSelfStudyBook(parentId, selfStudyType);
return new ValueWrapperFuture<>(s);
}
@Override
public AlpsFuture<Long> ParentShareTextReadLimitCacheManager_incr(Long parentId, String paragraphId, Long delta) {
Long l = parentShareTextReadLimitCacheManager.incr(parentId, paragraphId, delta);
return new ValueWrapperFuture<>(l);
}
@Override
public AlpsFuture<Long> ParentShareTextReadLimitCacheManager_get(Long parentId, String paragraphId) {
Long l = parentShareTextReadLimitCacheManager.get(parentId, paragraphId);
return new ValueWrapperFuture<>(l);
}
@Override
public AlpsFuture<Boolean> StudentGrindEarDayRecordCacheManager_hasRecord(Long studentId, Date date) {
Boolean b = studentGrindEarDayRecordCacheManager.hasRecord(studentId, date);
return new ValueWrapperFuture<>(b);
}
@Override
public AlpsFuture<Boolean> StudentGrindEarDayRecordCacheManager_todayRecord(Long studentId, Date date) {
studentGrindEarDayRecordCacheManager.todayRecord(studentId, date);
return new ValueWrapperFuture<>(true);
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
dd1f416aaceee83cbb0620f3102e31af6833abcb | adf774827bf4c9b9b44975349ef99f2c45b23a43 | /src/BasicCalendar.java | 552b8f049ba2966b7efeee8102fb7a9f1fb31764 | [] | no_license | askCode/Calendar-Date-Finder-GUI | e6d8b79bc31c773c64912b3061ad50be149fc473 | 103dc4aac3741c0ecf61274e4b309ecac56179a2 | refs/heads/master | 2021-03-12T23:43:02.415822 | 2014-03-13T03:53:10 | 2014-03-13T03:53:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,390 | java | import javax.swing.text.html.StyleSheet;
class BasicCalendar{
public static final int ROWS = 6;
public static final int COLUMNS = 7;
public static final int PADDING = 3;
public static final String FORMAT = "%-" + PADDING + "s";
private DateAD startDay;
private int[][] calendarArray = new int[ROWS][COLUMNS];
public BasicCalendar(){
startDay = new DateAD((short) 1);
setArray();
}
public BasicCalendar(short month){
startDay = new DateAD((short) 1 , month);
setArray();
}
public BasicCalendar(short month, short year){
startDay = new DateAD((short) 1, month, year);
setArray();
}
private void setArray(){
short firstDayOfMonth = startDay.getDayOfWeek();
short lastDayOfMonth = (short) (firstDayOfMonth + DateAD.daysInMonth((short) (startDay.getMonth()), startDay.getYear()));
//short start = (short) (dayOfWeek);
//short stop = (short) (dayOfWeek + daysInMonth);
short dayCount = 1;
short counter = 0;
for (int i = 0; i< ROWS; i++){
for(int j = 0 ; j< COLUMNS; j++){
if (counter >= firstDayOfMonth && counter <= lastDayOfMonth){
calendarArray[i][j] = dayCount;
dayCount++;
}
else
calendarArray[i][j] = 0;
counter++;
}
}
}
public int at(int n, int m){
int dayOfMonth;
try{
dayOfMonth = calendarArray[n][m];
}
catch (Exception e){
return 0;
}
return dayOfMonth;
}
public int[][] getCalendarArray(){
return calendarArray;
}
@Override
public String toString(){
String monYrTxt = DateAD.MONTH_NAMES[startDay.getMonth() - 1] + " " + startDay.getYear();
String weekDayHeader = "";
String monthString = "";
String[] weekArray = {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"};
for (String day : weekArray){
//weekDayHeader += String.format(FORMAT, day);
weekDayHeader += day + " " ;
}
for( int[] week : getCalendarArray()){
for (int day : week){
String days = " ";
if (day == 0 ){
//days = String.format(FORMAT,"");
days += " ";
}
else{
//days = String.format(FORMAT,String.valueOf(day)) ;
days += day;
}
if(day < 10){
days += " ";
}
else{
days += " ";
}
monthString += days;
}
monthString += "\n";
}
String calendarText = String.format("%s%n%n %s%n %s%n",monYrTxt, weekDayHeader, monthString);
return calendarText;
}
} | [
"ajit.musalgavkar@gmail.com"
] | ajit.musalgavkar@gmail.com |
4556c9b2a1f1ca3e62ffbf051a00a6368b07f2b7 | 23dd55c2b28ac517b6d536fa9c9d2657ac163209 | /src/main/java/com/felixpy/codetrial/gateway/domain/User.java | 4bef162c69403dff6f80740d0efbe558610cf58f | [
"MIT"
] | permissive | codetrial/jhipster-gateway | 4e3d9bb050268a3fc7a2e85e3a18b0d54e4a6ced | 91ba760da2865c1d822a739af5443fff789fe057 | refs/heads/master | 2020-04-09T12:46:43.551907 | 2019-03-02T09:35:11 | 2019-03-02T09:35:11 | 160,364,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,668 | java | package com.felixpy.codetrial.gateway.domain;
import com.felixpy.codetrial.gateway.config.Constants;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.validation.constraints.Email;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;
import java.time.Instant;
/**
* A user.
*/
@Entity
@Table(name = "jhi_user")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class User extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
@Column(length = 50, unique = true, nullable = false)
private String login;
@JsonIgnore
@NotNull
@Size(min = 60, max = 60)
@Column(name = "password_hash", length = 60, nullable = false)
private String password;
@Size(max = 50)
@Column(name = "first_name", length = 50)
private String firstName;
@Size(max = 50)
@Column(name = "last_name", length = 50)
private String lastName;
@Email
@Size(min = 5, max = 254)
@Column(length = 254, unique = true)
private String email;
@NotNull
@Column(nullable = false)
private boolean activated = false;
@Size(min = 2, max = 6)
@Column(name = "lang_key", length = 6)
private String langKey;
@Size(max = 256)
@Column(name = "image_url", length = 256)
private String imageUrl;
@Size(max = 20)
@Column(name = "activation_key", length = 20)
@JsonIgnore
private String activationKey;
@Size(max = 20)
@Column(name = "reset_key", length = 20)
@JsonIgnore
private String resetKey;
@Column(name = "reset_date")
private Instant resetDate = null;
@JsonIgnore
@ManyToMany
@JoinTable(
name = "jhi_user_authority",
joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")},
inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")})
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@BatchSize(size = 20)
private Set<Authority> authorities = new HashSet<>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
// Lowercase the login before saving it in database
public void setLogin(String login) {
this.login = StringUtils.lowerCase(login, Locale.ENGLISH);
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public boolean getActivated() {
return activated;
}
public void setActivated(boolean activated) {
this.activated = activated;
}
public String getActivationKey() {
return activationKey;
}
public void setActivationKey(String activationKey) {
this.activationKey = activationKey;
}
public String getResetKey() {
return resetKey;
}
public void setResetKey(String resetKey) {
this.resetKey = resetKey;
}
public Instant getResetDate() {
return resetDate;
}
public void setResetDate(Instant resetDate) {
this.resetDate = resetDate;
}
public String getLangKey() {
return langKey;
}
public void setLangKey(String langKey) {
this.langKey = langKey;
}
public Set<Authority> getAuthorities() {
return authorities;
}
public void setAuthorities(Set<Authority> authorities) {
this.authorities = authorities;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
User user = (User) o;
return !(user.getId() == null || getId() == null) && Objects.equals(getId(), user.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "User{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated='" + activated + '\'' +
", langKey='" + langKey + '\'' +
", activationKey='" + activationKey + '\'' +
"}";
}
}
| [
"felixpy.1993@gmail.com"
] | felixpy.1993@gmail.com |
7dc3635eec5b615cfbb8151adef7f1d0684257b9 | 56065cab1cc5c58297bfeded16ec5ab4505c6baf | /stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/compress/NoCompressedColumnReader.java | 29ec3cae70a21a64ff46519502c8e563927e0023 | [
"Apache-2.0",
"GPL-2.0-only",
"MIT"
] | permissive | javalife0312/kylin | 7dac36110732caf8334712591e94ae31aef0b933 | 32cfe98cc99fec21a5e80826848e9eff3765db10 | refs/heads/master | 2022-02-04T06:15:36.598236 | 2019-07-22T09:28:52 | 2019-07-22T09:28:52 | 126,129,643 | 3 | 0 | Apache-2.0 | 2018-03-26T23:27:33 | 2018-03-21T05:51:26 | Java | UTF-8 | Java | false | false | 2,586 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.kylin.stream.core.storage.columnar.compress;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Iterator;
import org.apache.kylin.stream.core.storage.columnar.ColumnDataReader;
public class NoCompressedColumnReader implements ColumnDataReader {
private ByteBuffer dataBuffer;
private byte[] readBuffer;
private int colDataStartOffset;
private int colValLength;
private int rowCount;
public NoCompressedColumnReader(ByteBuffer dataBuffer, int colDataStartOffset, int colValLength, int rowCount) {
this.dataBuffer = dataBuffer;
this.colDataStartOffset = colDataStartOffset;
this.colValLength = colValLength;
this.rowCount = rowCount;
this.readBuffer = new byte[colValLength];
}
public Iterator<byte[]> iterator() {
return new NoCompressedColumnDataItr();
}
public byte[] read(int rowNum) {
dataBuffer.position(colDataStartOffset + rowNum * colValLength);
dataBuffer.get(readBuffer);
return readBuffer;
}
@Override
public void close() throws IOException {
//do nothing
}
private class NoCompressedColumnDataItr implements Iterator<byte[]> {
private int readRowCount = 0;
public NoCompressedColumnDataItr() {
dataBuffer.position(colDataStartOffset);
}
@Override
public boolean hasNext() {
return readRowCount < rowCount;
}
@Override
public byte[] next() {
dataBuffer.get(readBuffer);
readRowCount++;
return readBuffer;
}
@Override
public void remove() {
throw new UnsupportedOperationException("not supported");
}
}
}
| [
"shaofengshi@apache.org"
] | shaofengshi@apache.org |
ed11c6da62c9c01677cdd67c4243a7bddc4759f3 | 26522e32a2223740af04ba2b1bd8fcd9d184624e | /java-src/test/java/com/zhangliang/leetcode/VerticalOrderTraversalOfABinaryTreeTest.java | b57cbaf6bfbda047cf39266983fc209f23abc6a5 | [] | no_license | zhanglid/coding | 496028e772b3be2ebd57072033ebc07bf9b7f322 | 484bee8b82725814d046c984cec685715e30487e | refs/heads/master | 2023-01-14T18:05:17.844213 | 2021-01-14T02:47:56 | 2021-01-14T02:47:56 | 120,143,573 | 0 | 0 | null | 2023-01-05T05:53:15 | 2018-02-04T00:54:07 | Java | UTF-8 | Java | false | false | 3,245 | java | package com.zhangliang.leetcode;
import static org.junit.Assert.assertArrayEquals;
import java.util.*;
import com.zhangliang.utils.TreeNode;
import org.junit.Test;
public class VerticalOrderTraversalOfABinaryTreeTest {
private int[][] toArray(List<List<Integer>> nums) {
int[][] ans = new int[nums.size()][];
for (int i = 0; i < ans.length; i++) {
ans[i] = new int[nums.get(i).size()];
for (int j = 0; j < ans[i].length; j++) {
ans[i][j] = nums.get(i).get(j);
}
}
return ans;
}
private void assertCorrect(int[][] expected, List<List<Integer>> ans) {
assertArrayEquals(expected, toArray(ans));
}
@Test
public void testCase() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(new TreeNode(new Integer[] { 3, 9, 20, null, null, 15, 7 }));
assertCorrect(new int[][] { { 9 }, { 3, 15 }, { 20 }, { 7 } }, ans);
}
@Test
public void testCase2() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(new TreeNode(new Integer[] { 1, 2, 3, 4, 5, 6, 7 }));
assertCorrect(new int[][] { { 4 }, { 2 }, { 1, 5, 6 }, { 3 }, { 7 } }, ans);
}
@Test
public void errCase() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(
new TreeNode(new Integer[] { 0, 8, 1, null, null, 3, 2, null, 4, 5, null, null, 7, 6 }));
assertCorrect(new int[][] { { 8 }, { 0, 3, 6 }, { 1, 4, 5 }, { 2, 7 } }, ans);
}
@Test
public void errCase2() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(
new TreeNode(new Integer[] { 0, 2, 1, 3, null, null, null, 4, 5, null, 7, 6, null, 10, 8, 11, 9 }));
assertCorrect(new int[][] { { 4, 10, 11 }, { 3, 6, 7 }, { 2, 5, 8, 9 }, { 0 }, { 1 } }, ans);
}
@Test
public void testCase3() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(new TreeNode(
new Integer[] { 0, 5, 1, 9, null, 2, null, null, null, null, 3, 4, 8, 6, null, null, null, 7 }));
assertCorrect(new int[][] { { 9, 7 }, { 5, 6 }, { 0, 2, 4 }, { 1, 3 }, { 8 } }, ans);
}
@Test
public void testCase4() {
VerticalOrderTraversalOfABinaryTree s = new VerticalOrderTraversalOfABinaryTree();
List<List<Integer>> ans = s.verticalTraversal(new TreeNode(new Integer[] { 0, 1, 2, 4, 5, 9, 3, 11, null, null,
10, 15, null, 6, 18, 14, null, null, 21, null, null, 7, 12, null, null, 22, null, null, 24, 13, 8, null,
17, null, null, null, null, null, null, 16, 19, null, null, null, null, 23, 20 }));
assertCorrect(new int[][] { { 22 }, { 14 }, { 11 }, { 4 }, { 1, 15, 13 }, { 0, 5, 9, 7, 16 },
{ 2, 6, 10, 8, 23 }, { 3, 12, 21, 19 }, { 18, 17, 24, 20 } }, ans);
}
}
| [
"dzl199401@126.com"
] | dzl199401@126.com |
daa2e52bc9f1dfaeb4ad5326e6a2557cc6b81b96 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/third-party/other/external-module-0369/src/java/external_module_0369/a/Foo0.java | f4069685ba2bab25d3b1db0df775befd017a70af | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,304 | java | package external_module_0369.a;
import javax.net.ssl.*;
import javax.rmi.ssl.*;
import java.awt.datatransfer.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see javax.management.Attribute
* @see javax.naming.directory.DirContext
* @see javax.net.ssl.ExtendedSSLSession
*/
@SuppressWarnings("all")
public abstract class Foo0<S> implements external_module_0369.a.IFoo0<S> {
javax.rmi.ssl.SslRMIClientSocketFactory f0 = null;
java.awt.datatransfer.DataFlavor f1 = null;
java.beans.beancontext.BeanContext f2 = null;
public S element;
public static Foo0 instance;
public static Foo0 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return null;
}
public String getName() {
return element.toString();
}
public void setName(String string) {
return;
}
public S get() {
return element;
}
public void set(Object element) {
this.element = (S)element;
}
public S call() throws Exception {
return (S)getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
6610af46e03dd4a941ca775b2a5a8a2b8b6eb71b | 641d9905231ad314ddfced7727c790cb137b672f | /src/main/java/pcaknn/Data.java | 11d3b32fd6354ce0ec221eb4d27a212ba3e737c8 | [] | no_license | deansmiller/MLProj | fd01ffc9f962565966e23300dd163a615cebda92 | 1869dce017de6001883c8a3fcdcf3d4be32aea6e | refs/heads/master | 2020-04-19T22:14:21.415233 | 2015-01-23T12:31:51 | 2015-01-23T12:31:51 | 24,050,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,483 | java | package pcaknn;
import Jama.Matrix;
public class Data {
private Matrix data;
private int rows, columns;
private String label;
public Data(double[][] data, int rows, int columns){
this.data = new Matrix(data);
this.rows = rows;
this.columns = columns;
}
public Data(Matrix m){
this.data = m;
this.rows = m.getRowDimension();
this.columns = m.getColumnDimension();
}
public Data(String[][] data, int rows, int columns){
this.rows = rows;
this.columns = columns;
double[][] tmp = new double[rows][columns];
for(int r = 0; r < rows; r++){
for(int c = 0; c < columns; c++){
tmp[r][c] = new Double(data[r][c]);
}
}
this.data = new Matrix(tmp);
}
public int getColumns(){
return columns;
}
public int getRows(){
return rows;
}
public static Data dataFromArray(double[] arr, int rows, int columns){
double[][] tmp = new double[rows][columns];
int index = 0;
for(int row = 0; row < rows; row++){
for(int column = 0; column < columns; column++){
tmp[row][column] = arr[index];
index++;
}
}
return new Data(tmp, rows, columns);
}
public void setLabel(String label){
this.label = label;
}
public String getLabel(){
return label;
}
public void print(){
double[][] d = data.getArray();
for(int i = 0; i < rows; i++){
for(int j = 0; j < columns; j++){
System.out.print(d[i][j] + ",");
}
System.out.println();
}
}
public Matrix getMatrix(){
return data;
}
}
| [
"dean.sylvester.miller@gmail.com"
] | dean.sylvester.miller@gmail.com |
5f16e9ae1b66ff001fc8d2c4ecc7bd93651e2764 | d383d855e48ee2f5da65791f4052533eca339369 | /src/test/java/com/alibaba/druid/bvt/filter/wall/sqlserver/SQLServerWallTest_5.java | 4b5a175c71c681e6fc7baba5d8b3153297ebc5db | [
"Apache-2.0"
] | permissive | liuxing7954/druid-source | 0e2dc0b1a2f498045b8689d6431764f4f4525070 | fc27b5ac4695dc42e1daa62db012adda7c217d36 | refs/heads/master | 2022-12-21T14:53:26.923986 | 2020-02-29T07:15:15 | 2020-02-29T07:15:15 | 243,908,145 | 1 | 1 | NOASSERTION | 2022-12-16T09:54:44 | 2020-02-29T05:07:04 | Java | UTF-8 | Java | false | false | 1,395 | java | /*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.bvt.filter.wall.sqlserver;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.wall.WallProvider;
import com.alibaba.druid.wall.spi.SQLServerWallProvider;
/**
* SQLServerWallTest
*
* @author RaymondXiu
* @version 1.0, 2012-3-18
* @see
*/
public class SQLServerWallTest_5 extends TestCase {
public void test_true() throws Exception {
WallProvider provider = new SQLServerWallProvider();
provider.getConfig().setSelectHavingAlwayTrueCheck(true);
Assert.assertFalse(provider.checkValid(//
"delete t where LEN(HOST_NAME()) > 0"));
Assert.assertEquals(1, provider.getTableStats().size());
Assert.assertTrue(provider.getTableStats().containsKey("t"));
}
}
| [
"jixiaoyi@apexsoft.com.cn"
] | jixiaoyi@apexsoft.com.cn |
95848f7758c7024c33156a11b895ff1cfa2cfbb1 | f6e70ff58d04d6e3b12a0c853641086938e7c456 | /src/Fachadas/IGerenteBase.java | 5db5f6446f4a362dd58a6d5ebd006451061868ea | [] | no_license | fellypeavelino/projetoPSC | 5702467036803848dfab57e05f0d1f0ec9b035bb | fcf0748bd0fce508b9cedcf63907e04e5141a80c | refs/heads/master | 2020-04-24T16:09:24.066900 | 2014-11-07T20:05:58 | 2014-11-07T20:05:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 110 | java | package Fachadas;
import Classes.Gerente;
public interface IGerenteBase extends IBase<Gerente, Integer>{
}
| [
"pedro.felipe@tronst.com.br"
] | pedro.felipe@tronst.com.br |
7309f47c22a6b57ea706a9dda44c020536866e61 | 344c1ab39cf7f9191579ea51623040087fdb295d | /src/main/java/com/example/demo/SsoSampleServerApplication.java | 6b1ab7d8c26594f1cda0d3eec5459309244271dd | [] | no_license | platinasnow/Spring-oauth2-sso-server | 419a486c7367f25c0710b4497865f94df54c35d0 | 5fdecd4c2d1ac177123bac3f58af98c19e257c83 | refs/heads/master | 2023-03-27T05:01:55.750358 | 2018-11-20T09:13:03 | 2018-11-20T09:13:03 | 352,651,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
@SpringBootApplication
@EnableResourceServer
public class SsoSampleServerApplication {
public static void main(String[] args) {
SpringApplication.run(SsoSampleServerApplication.class, args);
}
}
| [
"platinasnow@naver.com"
] | platinasnow@naver.com |
e5d0a4497d68d2b62f78494423f19bb127ff62d4 | 3da2b847c4b40e0c1aadff5ec9506af80b022abc | /src/main/java/ucf/assignments/MainClass.java | 13709b2f2407b9fe1a0074c42c9d720279a7fa45 | [] | no_license | rachelsch1/schwarz-cop3330-assignment4 | d9279fbc94cd74675eb6bbba22136123c29108ee | c2d1e2258d2851a960a791bba1aaeebc68783cf1 | refs/heads/master | 2023-06-07T12:34:21.392430 | 2021-07-06T00:48:13 | 2021-07-06T00:48:13 | 381,807,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package ucf.assignments;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class MainClass extends Application {
public static void main(String[] args) {
/*
create todo list
*/
launch(args);
}
@Override
public void start(Stage primaryStage) {
try {
Parent root = FXMLLoader.load(getClass().getResource("TodoList.fxml"));
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.setTitle("TodoList");
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"schwarz.rachel.e@gmail.com"
] | schwarz.rachel.e@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.