blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2c5170f67a08110126725f281d541cee0fdd750 | 866a321216d1cb2c35b6329d439f3b39e2fe1061 | /webapp/src/Servlets/Unsubscribe.java | fc7f4146ad05078784031714b26d4e5235bcc3f3 | [] | no_license | adnan27/ChatWebApp | bf8cd6fb9dc29c81c396d93caee4091accc7ee40 | 4f5156bd2e9730e9df41887fa51c28c44367a895 | refs/heads/master | 2021-01-17T14:56:34.063181 | 2017-03-06T18:09:52 | 2017-03-06T18:09:52 | 84,102,969 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,940 | java | package Servlets;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
import Globals.AppConstants;
import Globals.Global;
/**
* Servlet implementation class Unsubscribe
* get HTTP request with uri="unsubscribe/channelname/chhhhh;
* remove user subscription to specific channel from database
*/
@WebServlet(
description = "Servlet to add new user",
urlPatterns = {
"/unsubscribe",
"/unsubscribe/*"
})
public class Unsubscribe extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Unsubscribe() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//get username from session
HttpSession session=request.getSession();
String s=session.getAttribute("user").toString();
String nick=Global.USERS.get(s).getNickname();
try {
//Initialize a connection with database
Context context = new InitialContext();
BasicDataSource ds = (BasicDataSource)context.lookup(getServletContext().getInitParameter(AppConstants.DB_DATASOURCE) + AppConstants.OPEN);
Connection conn = ds.getConnection();
//String urii="unsubscribe/channelname/chhhhh;
//save relevant information in variables
String uri = request.getRequestURI();
int descindx=uri.indexOf(AppConstants.UNSUBSCRIBE);
String CH=uri.substring(descindx+AppConstants.UNSUBSCRIBE.length() + 1+12);
//delete subscription from DB
PreparedStatement stmt = conn.prepareStatement(AppConstants.DELETE_SUBSCRIPTON);
stmt.setString(1,nick);
stmt.setString(2,CH);
stmt.executeUpdate();
conn.commit();
stmt.close();
//update user channels
Global.USERS.get(s).DeleteChannels(CH);
//check if the channel is a private one and delete subscription of the other user if its the case
String nick2="";
if(CH.contains("@")){
String users[]=CH.split("@");
if(users[1].equals(nick)){
nick2=users[2];
}else{
nick2=users[1];
}
//delete subscription of the other user from DB
PreparedStatement stmt1 = conn.prepareStatement(AppConstants.DELETE_SUBSCRIPTON);
stmt1.setString(1,nick2);
stmt1.setString(2,CH);
stmt1.executeUpdate();
conn.commit();
stmt1.close();
//update user channels
Global.USERS.get(Global.usernamesNicknamesMap.get(nick2)).DeleteChannels(CH);
//delete channel
PreparedStatement stmt2 = conn.prepareStatement(AppConstants.DELETE_CHANNEL);
stmt2.setString(1,CH);
stmt2.executeUpdate();
conn.commit();
stmt2.close();
}
//send ack to client
PrintWriter writer = response.getWriter();
writer.println("success");
writer.close();
//close connection
conn.close();
}catch (NamingException | SQLException e) {
e.printStackTrace();
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"User@User-PC"
] | User@User-PC |
7425be4c90ec08f9579df25c24734888f197ac67 | 8510169054c24a64a73013663a9aefa41c7f3047 | /app/src/main/java/com/abcew/model/proxy/section1/Client.java | 43bae713798133094b5efc7728cd026f6f0312ae | [] | no_license | joyoyao/Model | f06fb1006784072ff5fc3ad2b69f701d90b1586e | 16b153bdd8013b487384058c4ed6f5a94ecef108 | refs/heads/master | 2020-03-22T10:10:03.469309 | 2016-12-04T08:30:31 | 2016-12-04T08:30:31 | 74,377,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package com.abcew.model.proxy.section1;
/**
* @author cbf4Life cbf4life@126.com
* I'm glad to share my knowledge with you all.
* 场景类
*/
public class Client {
public static void main(String[] args) {
//定义一个痴迷的玩家
IGamePlayer player = new GamePlayer("张三");
//然后再定义一个代练者
IGamePlayer proxy = new GamePlayerProxy(player);
//开始打游戏,记下时间戳
System.out.println("开始时间是:2009-8-25 10:45");
proxy.login("zhangSan", "password");
//开始杀怪
proxy.killBoss();
//升级
proxy.upgrade();
//记录结束游戏时间
System.out.println("结束时间是:2009-8-26 03:40");
}
}
| [
"zaiyongs@gmail.com"
] | zaiyongs@gmail.com |
b223e04e40e3b1e67047ae3a10225827347bfe5f | 85659db6cd40fcbd0d4eca9654a018d3ac4d0925 | /packages/apps/SocialPlus/SocialCard2D/src/com/motorola/mmsp/socialGraph/socialGraphWidget/common/WaitDialog.java | 04f93a0eb115288f49a83f953a49fdd6cbddd470 | [] | no_license | qwe00921/switchui | 28e6e9e7da559c27a3a6663495a5f75593f48fb8 | 6d859b67402fb0cd9f7e7a9808428df108357e4d | refs/heads/master | 2021-01-17T06:34:05.414076 | 2014-01-15T15:40:35 | 2014-01-15T15:40:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package com.motorola.mmsp.socialGraph.socialGraphWidget.common;
import android.app.ProgressDialog;
import android.content.Context;
//maybe delete
public class WaitDialog extends ProgressDialog {
public WaitDialog(Context context) {
super(context);
}
/**
* This hook is called when the user signals the desire to start a search.
*/
@Override
public boolean onSearchRequested() {
return true;
}
}
| [
"cheng.carmark@gmail.com"
] | cheng.carmark@gmail.com |
e40b2b9346811ed166c8a97d5bbb60ecaf78a620 | 95a92a0b1ad90c223e18c414c249ffbebd316d36 | /src/pagina90/exercicio3/A.java | f8cd6f322cf072c56274a0564db03f9200577a31 | [] | no_license | mucheniski/java-se-8-programmer-1 | 0b5285c1455b23c66c87f5dece64674ec60a9066 | bec177aa4994174f499c069745191ebf52956ce5 | refs/heads/master | 2020-09-13T13:51:09.708868 | 2019-12-24T20:24:34 | 2019-12-24T20:24:34 | 222,805,940 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 397 | java | package pagina90.exercicio3;
/*
3) Escolha a opção adequada ao tentar compilar e rodar o
arquivo a seguir:
a) Compila e 100 objetos do tipo B são criados, mas não
podemos falar nada sobre o garbage collector ter jogado os objetos
fora na linha do System.out .
*/
class A {
public static void main(String[] args) {
B[] bs = new B[100];
System.out.println("end!");
}
}
| [
"mucheniski@gmail.com"
] | mucheniski@gmail.com |
352cb70bb97e9cb2005d8ec4f6d88b59118375e7 | f29e821f27f3165ce242db21e6140223498a7c3b | /modules/jersey/src/test/java/org/atmosphere/jersey/MappingResourceTest.java | cfb1c00216ebe6e3a5491c88d222bae09ac06b69 | [] | no_license | mehrdadrafiee/atmosphere | e08eca721930b7d518873b7395b15acb272243e9 | 97993855734903536b046a41b1dbbe3f3558d463 | refs/heads/master | 2021-01-22T13:03:37.112032 | 2014-09-22T21:07:46 | 2014-09-22T21:07:46 | 24,354,618 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,980 | java | /*
* Copyright 2014 Jeanfrancois Arcand
*
* 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.atmosphere.jersey;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.Response;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
/**
* @author paulsandoz
*/
public class MappingResourceTest extends BaseTest {
String getUrlTarget(int port) {
return "http://127.0.0.1:" + port + "/jfarcand@apache.org";
}
@Test(timeOut = 20000, enabled = true)
public void testSpecialCharsMapping() {
logger.info("{}: running test: testSpecialCharsMapping", getClass().getSimpleName());
AsyncHttpClient c = new AsyncHttpClient();
try {
long t1 = System.currentTimeMillis();
Response r = c.prepareGet(urlTarget).execute().get(10, TimeUnit.SECONDS);
assertNotNull(r);
assertEquals(r.getStatusCode(), 200);
String resume = r.getResponseBody();
assertEquals(resume, "");
long current = System.currentTimeMillis() - t1;
assertTrue(current > 5000 && current < 10000);
} catch (Exception e) {
logger.error("test failed", e);
fail(e.getMessage());
}
c.close();
}
}
| [
"jfarcand@apache.org"
] | jfarcand@apache.org |
47badaa6efac71104686a5e28b29c25bb35168b2 | aff91e5bc700d2f7221307cdb59ca248f5438482 | /AircraftDetails/src/com/um21/aircraft/dao/IDao.java | f8b23644be9936cf89be41e17f3a1eda9447034b | [] | no_license | ayyappan26/UM21-SrivasudevanNadarajan | b43f0ea1f9fbf9850babc7f76bd8c4e0e9f4c369 | 7bc3599ae3c0479cd6ae61d069d44f735f8f050e | refs/heads/master | 2023-07-27T06:45:11.585992 | 2021-09-09T05:27:48 | 2021-09-09T05:27:48 | 401,970,097 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package com.um21.aircraft.dao;
import java.sql.SQLException;
public interface IDao
{
public void registerAircraft() throws SQLException;
public void registerSector() throws SQLException;
public void viewSectorDetails() throws SQLException;
}
| [
"ELCOT@Lenovo"
] | ELCOT@Lenovo |
ce057e4ef2a95aa9557b610437baef75e24a65ba | c2fac9618557b73a49fb53e6f19121cdbcfab164 | /src/main/java/org/twister2/perf/io/TwitterInputReader.java | 6f03f72b68eebe89c5f99426ce25489f8145f0d5 | [] | no_license | DSC-SPIDAL/twister-perf | dde81f3445df4b617561f7c971ed5fd1c04d1590 | c4a651a9d4b3cea5b44ffd5e01027398066ce44c | refs/heads/master | 2022-05-28T00:01:39.728543 | 2020-10-21T16:41:13 | 2020-10-21T16:41:13 | 227,462,406 | 0 | 1 | null | 2022-04-12T21:57:53 | 2019-12-11T21:19:17 | Java | UTF-8 | Java | false | false | 2,039 | java | package org.twister2.perf.io;
import edu.iu.dsc.tws.api.comms.structs.Tuple;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Paths;
import java.util.logging.Logger;
/**
* Read a tweetid:time
*/
public class TwitterInputReader {
private static final Logger LOG = Logger.getLogger(TwitterInputReader.class.getName());
/**
* Name of the file to read
*/
private String fileName;
/**
* The input buffer
*/
private ByteBuffer inputBuffer;
/**
* Total bytes read so far
*/
private long totalRead = 0;
/**
* The read channel
*/
private FileChannel rwChannel;
public TwitterInputReader(String file) {
this.fileName = file;
String outFileName = Paths.get(fileName).toString();
try {
rwChannel = new RandomAccessFile(outFileName, "rw").getChannel();
inputBuffer = rwChannel.map(FileChannel.MapMode.READ_ONLY, 0, rwChannel.size());
LOG.info("Reading file: " + fileName + " size: " + rwChannel.size());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public Tuple<BigInteger, Long> next() throws Exception {
try {
if (totalRead < rwChannel.size()) {
// read the size of the big int
int size = inputBuffer.getInt();
byte[] intBuffer = new byte[size];
inputBuffer.get(intBuffer);
BigInteger tweetId = new BigInteger(intBuffer);
long time = inputBuffer.getLong();
totalRead += size + Integer.BYTES + Long.BYTES;
return new Tuple<>(tweetId, time);
}
} catch (IOException e) {
throw new Exception(e);
}
return null;
}
public boolean hasNext() throws Exception {
try {
return totalRead < rwChannel.size();
} catch (IOException e) {
throw new Exception("Failed to read file", e);
}
}
public void close() throws Exception {
rwChannel.force(true);
rwChannel.close();
}
}
| [
"supun06@gmail.com"
] | supun06@gmail.com |
4694b4d24c7709d9ec9d8c2e38f8f28831027486 | b2018d92fdd74823768317307bc8e58087c1c1c9 | /src/com/igomall/entity/InstantMessage.java | a6465a7ac487b5b1f6c802ee94a50a3098a1ea8c | [] | no_license | hyerming/demo123 | 911d124b18934c093ff6c8be3046016d5f64ea61 | b3851e389adf83a2a9523dac631d72ecd5a065e8 | refs/heads/master | 2020-04-28T11:37:22.378116 | 2019-03-09T02:06:32 | 2019-03-09T02:06:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,981 | java |
package com.igomall.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
/**
* Entity - 即时通讯
*
* @author blackboy
* @version 1.0
*/
@Entity
public class InstantMessage extends OrderedEntity<Long> {
private static final long serialVersionUID = 163292786603104144L;
/**
* 类型
*/
public enum Type {
/**
* QQ
*/
qq,
/**
* 阿里旺旺
*/
aliTalk
}
/**
* 名称
*/
@NotEmpty
@Length(max = 200)
@Column(nullable = false)
private String name;
/**
* 类型
*/
@NotNull
@Column(nullable = false)
private InstantMessage.Type type;
/**
* 账号
*/
@NotNull
@Length(max = 200)
@Column(nullable = false)
private String account;
/**
* 店铺
*/
@ManyToOne(fetch = FetchType.LAZY)
private Store store;
/**
* 获取名称
*
* @return 名称
*/
public String getName() {
return name;
}
/**
* 设置名称
*
* @param name
* 名称
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取类型
*
* @return 类型
*/
public InstantMessage.Type getType() {
return type;
}
/**
* 设置类型
*
* @param type
* 类型
*/
public void setType(InstantMessage.Type type) {
this.type = type;
}
/**
* 获取账号
*
* @return 账号
*/
public String getAccount() {
return account;
}
/**
* 设置账号
*
* @param account
* 账号
*/
public void setAccount(String account) {
this.account = account;
}
/**
* 获取店铺
*
* @return 店铺
*/
public Store getStore() {
return store;
}
/**
* 设置店铺
*
* @param store
* 店铺
*/
public void setStore(Store store) {
this.store = store;
}
} | [
"Liziyi521521"
] | Liziyi521521 |
75385d81fc6c80be1d19bf32be50813561610602 | 2f5cd5ba8a78edcddf99c7e3c9c19829f9dbd214 | /java/playgrounds/johannes/src/main/java/playground/johannes/socialnetworks/graph/analysis/CentralityTask.java | 23666e44377d643d7a4d73548ab16083d7d3246f | [] | no_license | HTplex/Storage | 5ff1f23dfe8c05a0a8fe5354bb6bbc57cfcd5789 | e94faac57b42d6f39c311f84bd4ccb32c52c2d30 | refs/heads/master | 2021-01-10T17:43:20.686441 | 2016-04-05T08:56:57 | 2016-04-05T08:56:57 | 55,478,274 | 1 | 1 | null | 2020-10-28T20:35:29 | 2016-04-05T07:43:17 | Java | UTF-8 | Java | false | false | 3,529 | java | /* *********************************************************************** *
* project: org.matsim.*
* CentralityTask.java
* *
* *********************************************************************** *
* *
* copyright : (C) 2010 by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* *********************************************************************** */
package playground.johannes.socialnetworks.graph.analysis;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
import org.apache.log4j.Logger;
import playground.johannes.sna.graph.Graph;
import playground.johannes.sna.graph.analysis.ModuleAnalyzerTask;
/**
* @author illenberger
*
*/
public class CentralityTask extends ModuleAnalyzerTask<Centrality> {
private static final Logger logger = Logger.getLogger(CentralityTask.class);
public static final String CLOSENESS = "closeness";
public static final String BETWEENNESS = "betweenness";
public static final String DIAMETER = "diameter";
public static final String RADIUS = "radius";
private boolean calcBetweenness = true;
private boolean calcAPLDistribution = true;
public CentralityTask() {
setModule(new Centrality());
}
public void setCalcBetweenness(boolean calcBetweenness) {
this.calcBetweenness = calcBetweenness;
}
public void setCalcAPLDistribution(boolean calcAPLDistribution) {
this.calcAPLDistribution = calcAPLDistribution;
}
@Override
public void analyze(Graph graph, Map<String, DescriptiveStatistics> statsMap) {
module.init(graph, calcBetweenness, calcAPLDistribution);
DescriptiveStatistics cDistr = module.closenessDistribution();
statsMap.put(CLOSENESS, cDistr);
printStats(cDistr, CLOSENESS);
DescriptiveStatistics bDistr = module.vertexBetweennessDistribution();
statsMap.put(BETWEENNESS, bDistr);
printStats(bDistr, BETWEENNESS);
statsMap.put("apl", module.getAPL());
printStats(module.getAPL(), "apl");
singleValueStats(DIAMETER, module.diameter(), statsMap);
singleValueStats(RADIUS, new Double(module.radius()), statsMap);
logger.info(String.format("diameter = %1$s, radius = %2$s", module.diameter(), module.radius()));
if(getOutputDirectory() != null) {
try {
writeHistograms(cDistr, "close", 100, 100);
writeHistograms(bDistr, "between", 100, 100);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
| [
"htplex@gmail.com"
] | htplex@gmail.com |
eb919e5366c10d1324241a24c13cc54e2c425e2c | e21d3ae8e47b113a7c27524afd4525cc23130b71 | /IWXXM-JAVA/aero/aixm/CodeFlightStatusType.java | 3f1d3259660f7bf3619cd1d4fc8659c26344dc49 | [] | no_license | blchoy/iwxxm-java | dad020c19a9edb61ab3bc6b04def5579f6cbedca | 7c1b6fb1d0b0e9935a10b8e870b159c86a4ef1bb | refs/heads/master | 2023-05-25T12:14:10.205518 | 2023-05-22T08:40:56 | 2023-05-22T08:40:56 | 97,662,463 | 2 | 1 | null | 2021-11-17T03:40:50 | 2017-07-19T02:09:41 | Java | UTF-8 | Java | false | false | 2,314 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT
// See <a href="https://jaxb.java.net/">https://jaxb.java.net/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.05.22 at 02:50:00 PM HKT
//
package aero.aixm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for CodeFlightStatusType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CodeFlightStatusType">
* <simpleContent>
* <extension base="<http://www.aixm.aero/schema/5.1.1>CodeFlightStatusBaseType">
* <attribute name="nilReason" type="{http://www.opengis.net/gml/3.2}NilReasonEnumeration" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CodeFlightStatusType", propOrder = {
"value"
})
public class CodeFlightStatusType {
@XmlValue
protected String value;
@XmlAttribute(name = "nilReason")
protected String nilReason;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the nilReason property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNilReason() {
return nilReason;
}
/**
* Sets the value of the nilReason property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNilReason(String value) {
this.nilReason = value;
}
}
| [
"blchoy.hko@gmail.com"
] | blchoy.hko@gmail.com |
ffdd37d30c00ac09b81dc65ffc1d1d75fcea0312 | 2a19b2f3eb1ed8a5393676724c77b4f03206dad8 | /src/main/java/org/acord/standards/life/_2/HoldingXLatType.java | d32ceeb531f49c6964929fcc6823b2e6c7534073 | [] | no_license | SamratChatterjee/xsdTowsdl | 489777c2d7d66e8e5379fec49dffe15a19cb5650 | 807f1c948490f2c021dd401ff9dd5937688a24b2 | refs/heads/master | 2021-05-15T03:45:56.250598 | 2017-11-15T10:55:24 | 2017-11-15T10:55:24 | 110,820,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,266 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.11.13 at 07:49:02 PM IST
//
package org.acord.standards.life._2;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Java class for HoldingXLat_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="HoldingXLat_Type">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://ACORD.org/Standards/Life/2}Language" minOccurs="0"/>
* <element ref="{http://ACORD.org/Standards/Life/2}HoldingName" minOccurs="0"/>
* <element ref="{http://ACORD.org/Standards/Life/2}OLifEExtension" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* <attribute name="DataRep" type="{http://ACORD.org/Standards/Life/2}DATAREP_TYPES" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "HoldingXLat_Type", propOrder = {
"language",
"holdingName",
"oLifEExtension"
})
public class HoldingXLatType {
@XmlElement(name = "Language")
protected OLILUCLIENTLANGUAGES language;
@XmlElement(name = "HoldingName")
protected String holdingName;
@XmlElement(name = "OLifEExtension")
protected List<OLifEExtensionType> oLifEExtension;
@XmlAttribute(name = "id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
@XmlAttribute(name = "DataRep")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String dataRep;
/**
* Gets the value of the language property.
*
* @return
* possible object is
* {@link OLILUCLIENTLANGUAGES }
*
*/
public OLILUCLIENTLANGUAGES getLanguage() {
return language;
}
/**
* Sets the value of the language property.
*
* @param value
* allowed object is
* {@link OLILUCLIENTLANGUAGES }
*
*/
public void setLanguage(OLILUCLIENTLANGUAGES value) {
this.language = value;
}
/**
* Gets the value of the holdingName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getHoldingName() {
return holdingName;
}
/**
* Sets the value of the holdingName property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHoldingName(String value) {
this.holdingName = value;
}
/**
* Gets the value of the oLifEExtension property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the oLifEExtension property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOLifEExtension().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link OLifEExtensionType }
*
*
*/
public List<OLifEExtensionType> getOLifEExtension() {
if (oLifEExtension == null) {
oLifEExtension = new ArrayList<OLifEExtensionType>();
}
return this.oLifEExtension;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the dataRep property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDataRep() {
return dataRep;
}
/**
* Sets the value of the dataRep property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDataRep(String value) {
this.dataRep = value;
}
}
| [
"33487722+SamratChatterjee@users.noreply.github.com"
] | 33487722+SamratChatterjee@users.noreply.github.com |
e81a9e46a10548929851260b109a0ac9b4646a97 | 3dfe79e257c2bfe710b342cf67cc22f6692f9c9e | /src/ChapterTwelve/PrintfDemo.java | e216b26ea7948efa73e497c85877080f79a1816d | [] | no_license | Tzeentche/JavaVasiliev | d34dfea60b313030731a576989dd6e3601941593 | 3ca671079e889c038f4f4b2237c726de89d9b34d | refs/heads/master | 2022-02-06T08:52:08.993370 | 2019-08-09T09:58:30 | 2019-08-09T09:58:30 | 198,294,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | package ChapterTwelve;
import java.util.*;
public class PrintfDemo {
public static void main(String[] args) {
String text = "Text string";
double x = 100.0 / 7.0;
double z = 130;
int n = 1234567;
int k = 7654321;
int m = 0xABC;
int l = 0123;
Date now = new Date();
System.out.println("%s\t%d\t%f\n" + text + " " + k + " " + z);
System.out.println("Decimal numbers:\n%1$g\t%2$e\t%1$07.2f\n " + x + " " + z);
System.out.println("Negative numbers: %,(d\n " + n);
System.out.println("Positive numbers: %+,d\n " + k);
System.out.println("16-th value number %x equals 10-th value number %<d\n " + m);
System.out.println("10-th value number %d equals 16-th value number %<X\n " + k);
System.out.println("8-th value number %o equals 10-th value number %<d\n " + l);
System.out.println("Month: %tB\n" + now);
System.out.println("Date: %te\n" + now);
System.out.println("The day of week: %tA\n" + now);
System.out.println("Time: %tT\n" + now);
}
}
| [
"ilyasugako87@gmail.com"
] | ilyasugako87@gmail.com |
cee99e4dce6adeaca41c5654c5385fe9ca7e493e | 2bf30c31677494a379831352befde4a5e3d8ed19 | /exportLibraries/recoverpoint/src/main/java/com/emc/storageos/recoverpoint/requests/CGRequestParams.java | 279f243cd5da6b1979c19b2729692cda3310af90 | [] | no_license | dennywangdengyu/coprhd-controller | fed783054a4970c5f891e83d696a4e1e8364c424 | 116c905ae2728131e19631844eecf49566e46db9 | refs/heads/master | 2020-12-30T22:43:41.462865 | 2015-07-23T18:09:30 | 2015-07-23T18:09:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,237 | java | /*
* Copyright 2015 EMC Corporation
* All Rights Reserved
*/
package com.emc.storageos.recoverpoint.requests;
/**
* Copyright (c) 2013 EMC Corporation
* All Rights Reserved
*
* This software contains the intellectual property of EMC Corporation
* or is licensed to EMC Corporation from third parties. Use of this
* software and the intellectual property contained therein is expressly
* limited to the terms and conditions of the License Agreement under which
* it is provided by or on behalf of EMC.
**/
import java.io.Serializable;
import java.net.URI;
import java.util.List;
/**
* Parameters necessary to create/update a consistency group, given newly created volumes.
* Need enough information to be able to export the volumes to the RPAs and to create the CG.
*
*/
@SuppressWarnings("serial")
public class CGRequestParams implements Serializable {
private boolean isJunitTest;
// Name of the CG Group
private String cgName;
// CG URI
private URI cgUri;
// Project of the source volume
private URI project;
// Tenant making request
private URI tenant;
// Top-level policy for the CG
public CGPolicyParams cgPolicy;
// List of copies
private List<CreateCopyParams> copies;
// List of replication sets that make up this consistency group.
private List<CreateRSetParams> rsets;
public CGRequestParams() {
isJunitTest = false;
}
public boolean isJunitTest() {
return isJunitTest;
}
public void setJunitTest(boolean isJunitTest) {
this.isJunitTest = isJunitTest;
}
public String getCgName() {
return cgName;
}
public void setCgName(String cgName) {
this.cgName = cgName;
}
public URI getCgUri() {
return cgUri;
}
public void setCgUri(URI cgUri) {
this.cgUri = cgUri;
}
public URI getProject() {
return project;
}
public void setProject(URI project) {
this.project = project;
}
public URI getTenant() {
return tenant;
}
public void setTenant(URI tenant) {
this.tenant = tenant;
}
public List<CreateCopyParams> getCopies() {
return copies;
}
public void setCopies(List<CreateCopyParams> copies) {
this.copies = copies;
}
public List<CreateRSetParams> getRsets() {
return rsets;
}
public void setRsets(List<CreateRSetParams> rsets) {
this.rsets = rsets;
}
// The top-level CG policy objects
public static class CGPolicyParams implements Serializable {
public String copyMode;
public Long rpoValue;
public String rpoType;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("\ncgName: " + cgName);
sb.append("\nproject: " + project);
sb.append("\ntenant: " + tenant);
sb.append("\n---------------\n");
if (copies != null) {
for (CreateCopyParams copy : copies) {
sb.append(copy);
sb.append("\n");
}
}
sb.append("\n---------------\n");
if (rsets != null) {
for (CreateRSetParams rset : rsets) {
sb.append(rset);
sb.append("\n");
}
}
sb.append("\n---------------\n");
return sb.toString();
}
}
| [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
9373f0453015c5b1788929cbfae0b2d44f05e8a4 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/85/2243.java | 4f4e0b6f3b406edd90ebad104c6f88f091dcdeed | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
String zs = new String(new char[max + 1]);
int n;
int i;
int j;
int c;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (i = 0;i < n;i++)
{
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
zs = tempVar2.charAt(0);
}
c = 0;
if (((zs.charAt(0) >= 'a') && (zs.charAt(0) <= 'z')) || ((zs.charAt(0) >= 'A') && (zs.charAt(0) <= 'Z')) || zs.charAt(0) == '_')
{
for (j = 1;zs.charAt(j) != '\0';j++)
{
if (((zs.charAt(j) >= 'a') && (zs.charAt(j) <= 'z')) || ((zs.charAt(j) >= 'A') && (zs.charAt(j) <= 'Z')) || (zs.charAt(j) == '_') || ((zs.charAt(j) >= '0') && (zs.charAt(j) <= '9')))
{
c++;
}
}
if (c == zs.length() - 1)
{
System.out.print("yes\n");
}
else
{
System.out.print("no\n");
}
}
else
{
System.out.print("no\n");
}
}
return 0;
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
233aa857d8dd20e7370987cab671086ea4c811a9 | e92cda89f4a32f1e89d5862d0480d2e14c2d64ca | /teams/anatid16_dronesandlaunchers_defend/BotMissile.java | 4bcdf01ed212cfa4c25fe5f7a5491169961b426f | [] | no_license | TheDuck314/battlecode2015 | e2d29e518137c563c265f854a27faba2c78c16cf | 845e52bec1a7cb9f3f7f19a3415b5635d44a2fa6 | refs/heads/master | 2016-09-05T21:26:23.066985 | 2015-02-16T17:34:22 | 2015-02-16T17:34:22 | 28,834,784 | 14 | 5 | null | null | null | null | UTF-8 | Java | false | false | 2,031 | java | package anatid16_dronesandlaunchers_defend;
import battlecode.common.*;
public class BotMissile {
static RobotController rc;
public static void loop(RobotController theRC) throws GameActionException {
rc = theRC;
MissileGuidance.readMissileTarget(rc, rc.getLocation());
// rc.setIndicatorString(0, MissileGuidance.receivedTargetLocation.toString() + " - " + MissileGuidance.receivedTargetID);
// System.out.println("hello");
while (true) {
try {
turn();
} catch (Exception e) {
e.printStackTrace();
}
rc.yield();
}
}
private static void turn() throws GameActionException {
RobotInfo[] adjacentEnemies = rc.senseNearbyRobots(2, rc.getTeam().opponent());
for (int i = adjacentEnemies.length; i-- > 0;) {
if (adjacentEnemies[i].type != RobotType.MISSILE) rc.explode();
}
if (rc.canSenseRobot(MissileGuidance.receivedTargetID)) {
MissileGuidance.receivedTargetLocation = rc.senseRobot(MissileGuidance.receivedTargetID).location;
}
MapLocation here = rc.getLocation();
Direction dir = here.directionTo(MissileGuidance.receivedTargetLocation);
RobotInfo blockage = rc.senseRobotAtLocation(here.add(dir));
if (blockage != null && !blockage.team.equals(rc.getTeam()) && blockage.type != RobotType.MISSILE) {
// System.out.println("exploding at blockage");
rc.explode();
return;
}
if (!rc.isCoreReady()) return;
if (rc.canMove(dir)) {
rc.move(dir);
return;
}
Direction left = dir.rotateLeft();
if (rc.canMove(left)) {
rc.move(left);
return;
}
Direction right = dir.rotateRight();
if (rc.canMove(right)) {
rc.move(right);
return;
}
}
}
| [
"theduck314@gmail.com"
] | theduck314@gmail.com |
8c5004d6390f0cc8b9f3921bce194a11b91805d4 | 20f643a61db5ab891fd9b9d71cad1342b5a46e07 | /app/src/main/java/com/technext/blogger/view/fragment/BloglistPage.java | a0b17df82b9098515c2c9d9cf272e876e8008c1e | [] | no_license | Muhaiminur/TECH_BLOGGER | 29b4df985ae01f17ed5bf17745754ebac4ac453b | 7b639aca681d566141e578e3ee379550701f9c7e | refs/heads/main | 2023-04-15T07:01:11.481179 | 2021-04-25T11:19:22 | 2021-04-25T11:19:22 | 359,435,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,592 | java | package com.technext.blogger.view.fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.technext.blogger.adapter.BloglistAdapter;
import com.technext.blogger.dagger.MyApplication;
import com.technext.blogger.databinding.BloglistPageFragmentBinding;
import com.technext.blogger.library.Utility;
import com.technext.blogger.model.Blog;
import com.technext.blogger.view.activity.AddBlogPage;
import com.technext.blogger.viewmodel.BloglistPageViewModel;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
public class BloglistPage extends Fragment {
List<Blog> blogListModels;
BloglistAdapter bloglistAdapter;
Context context;
@Inject
Utility utility;
BloglistPageFragmentBinding binding;
@Inject
BloglistPageViewModel mViewModel;
public static BloglistPage newInstance() {
return new BloglistPage();
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (binding == null) {
try {
binding = BloglistPageFragmentBinding.inflate(inflater, container, false);
context = getActivity();
//utility = new Utility(context);
initial_list();
binding.homepageAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(context, AddBlogPage.class));
}
});
} catch (Exception e) {
Log.d("Error Line Number", Log.getStackTraceString(e));
}
}
return binding.getRoot();
}
@Override
public void onAttach(@NonNull Context context) {
((MyApplication) getActivity().getApplicationContext()).viewModelComponent.injectblogviewmodel(this);
super.onAttach(context);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//mViewModel = new ViewModelProvider(this).get(BloglistPageViewModel.class);
mViewModel.init();
observeLogin();
//initial_list();
mViewModel.getVolumesResponseLiveData().observe(getViewLifecycleOwner(), new Observer<List<Blog>>() {
@Override
public void onChanged(List<Blog> volumesResponse) {
if (volumesResponse != null) {
Log.d("item change", volumesResponse.size() + "");
blogListModels.clear();
blogListModels.addAll(volumesResponse);
bloglistAdapter.notifyDataSetChanged();
}
}
});
}
private void initial_list() {
try {
//audio book adapter
blogListModels = new ArrayList<>();
bloglistAdapter = new BloglistAdapter(blogListModels, context);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
binding.homepageRecycler.setLayoutManager(mLayoutManager);
binding.homepageRecycler.setItemAnimator(new DefaultItemAnimator());
binding.homepageRecycler.setAdapter(bloglistAdapter);
bloglistAdapter.notifyDataSetChanged();
//get_blog_list();
} catch (Exception e) {
Log.d("Error Line Number", Log.getStackTraceString(e));
}
}
private void observeLogin() {
mViewModel.getProgressbar().observe(getViewLifecycleOwner(), new Observer<Boolean>() {
@Override
public void onChanged(final Boolean progressObserve) {
utility.showToast("paisi");
if (progressObserve) {
//utility.showProgress(false, context.getResources().getString(R.string.loading_string));
} else {
//utility.hideProgress();
}
}
});
}
} | [
"muhaiminurabir@gmail.com"
] | muhaiminurabir@gmail.com |
47a0a68a7509786a8214e7c09f35d96ac43e99a1 | f10a360bf297f320a4eca3ff711615705a3fcbd2 | /gameTest/src/main/java/com/buding/retry/LoadAccountAction.java | bef3ed41689752c654abf6ee16c030396ef09d60 | [] | no_license | panghu0826/zyqp | 2119957bac1ef5f92256d09b25b62661aa980ada | 03dcbb202e9d50b77df1db279f01e789fafcb5b5 | refs/heads/master | 2020-05-22T12:48:40.967025 | 2019-05-13T05:59:53 | 2019-05-13T05:59:53 | 185,728,700 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.buding.retry;
import com.buding.test.Player;
public class LoadAccountAction extends RetryAction {
Player player = null;
public LoadAccountAction(Player player) {
super("注册");
this.player = player;
}
@Override
public void doAct() {
player.loadAccount();
}
@Override
public boolean isDone() {
return player.hasAccount();
}
@Override
public void reset() {
}
}
| [
"xiaokang_0826@163.com"
] | xiaokang_0826@163.com |
f87c80cea891365cfa60ebeda1eadee23a360e2f | f71a7ec87f7e90f8025a3079daced5dbf41aca9c | /sf-pay/src/main/java/com/alipay/api/domain/AlipayEcoMycarTradeOrderQueryModel.java | 618f6f00f56991d8c1425cb7f82e49b76ce4a295 | [] | no_license | luotianwen/yy | 5ff456507e9ee3dc1a890c9bead4491d350f393d | 083a05aac4271689419ee7457cd0727eb10a5847 | refs/heads/master | 2021-01-23T10:34:24.402548 | 2017-10-08T05:03:10 | 2017-10-08T05:03:10 | 102,618,007 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,415 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 交易订单查询接口
*
* @author auto create
* @since 1.0, 2016-12-22 21:53:37
*/
public class AlipayEcoMycarTradeOrderQueryModel extends AlipayObject {
private static final long serialVersionUID = 7494396211895157654L;
/**
* 车主平台交易号,与车主业务平台订单号相同。和trade_no,out_biz_trade_no不能同时为空。
*/
@ApiField("biz_trade_no")
private String bizTradeNo;
/**
* 外部订单号,和biz_trade_no,trade_no不能同时为空
*/
@ApiField("out_biz_trade_no")
private String outBizTradeNo;
/**
* 支付宝交易号。该笔车主平台对应的支付宝交易编号,使用该交易号也可以直接调用支付宝开放平台的交易查询接口查询交易信息。 和biz_trade_no,out_biz_trade_no不能同时为空。
*/
@ApiField("trade_no")
private String tradeNo;
public String getBizTradeNo() {
return this.bizTradeNo;
}
public void setBizTradeNo(String bizTradeNo) {
this.bizTradeNo = bizTradeNo;
}
public String getOutBizTradeNo() {
return this.outBizTradeNo;
}
public void setOutBizTradeNo(String outBizTradeNo) {
this.outBizTradeNo = outBizTradeNo;
}
public String getTradeNo() {
return this.tradeNo;
}
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
}
}
| [
"tw l"
] | tw l |
1923c935392f31b32524990d6a818ee13565876c | 403277853ddaa968e3a082020ff7219353d24e87 | /Shuangge/src/com/shuangge/english/network/ranklist/TaskReqRanklistClass.java | be6412795f9684d72cbf46147f17f676ecf624e1 | [] | no_license | dougisadog/eng | d2bdb4613592574b5ce8332ee9ac126320f10adc | 2a6d3083be1d1974dede04deb94f69643c44b4b3 | refs/heads/master | 2021-01-10T12:19:11.496701 | 2015-12-01T09:33:20 | 2015-12-01T09:33:20 | 47,179,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package com.shuangge.english.network.ranklist;
import com.shuangge.english.cache.GlobalRes;
import com.shuangge.english.config.ConfigConstants;
import com.shuangge.english.entity.server.RestResult;
import com.shuangge.english.entity.server.ranklist.ClassRanklistResult;
import com.shuangge.english.support.http.HttpReqFactory;
import com.shuangge.english.support.service.BaseTask;
public class TaskReqRanklistClass extends BaseTask<Integer, Void, Boolean> {
public TaskReqRanklistClass(int tag, CallbackNoticeView<Void, Boolean> callback, Integer... params) {
super(tag, callback, params);
}
@Override
protected Boolean doInBackground(Integer... params) {
if (ConfigConstants.DEBUG_NO_SERVER) {
return true;
}
ClassRanklistResult result = HttpReqFactory.getServerResultByToken(ClassRanklistResult.class, ConfigConstants.RANK_LIST_CLASS_ALL_URL,
new HttpReqFactory.ReqParam("pageNo", params[0]),
new HttpReqFactory.ReqParam("classNo", params[1]));
if (null != result && result.getCode() == RestResult.C_SUCCESS) {
GlobalRes.getInstance().getBeans().setClassRanklistData(result);
return true;
}
return false;
}
}
| [
"wzc2542736@163.com"
] | wzc2542736@163.com |
5a086176f8291301340f4197a4ffb004048a26bb | 522db0ab1d3183efaf4be1f68b5f02895e65eb24 | /designpattern/thezenofdesignpatterns/template_method/src/main/java/com/company/section3/ConcreteClass2.java | 0cba92c6ee78ff9191029276255627362b7c7abd | [
"Apache-2.0"
] | permissive | zkzong/java | 036ab8c2312f1496f59ea551be8581b3a5e13808 | 9ace636f83234d204383d9b5f43dc86139552d93 | refs/heads/master | 2023-06-24T17:13:05.957929 | 2023-06-15T14:35:03 | 2023-06-15T14:35:03 | 190,161,389 | 0 | 1 | Apache-2.0 | 2022-12-16T11:11:26 | 2019-06-04T08:31:44 | Java | UTF-8 | Java | false | false | 318 | java | package com.company.section3;
/**
* @author cbf4Life cbf4life@126.com
* I'm glad to share my knowledge with you all.
*/
public class ConcreteClass2 extends AbstractClass {
//实现基本方法
protected void doAnything() {
//业务逻辑处理
}
protected void doSomething() {
//业务逻辑处理
}
}
| [
"zongzhankui@hotmail.com"
] | zongzhankui@hotmail.com |
dc90d73f0f472f2c6da50d6523f10f6e2215af1c | 166a99193149ffb70ed0f3c0a3aa7ecb607ba8d7 | /src/lia/Monitor/JiniClient/CommonGUI/Sphere/GridBagPanel.java | 9d198ff72864652f2bdf8ae155ee18ef86411601 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | costing/Monalisa | 735c99ab77a92f908564098a6474d6bb085b2e4f | 2e4ab0fa3e198313397edb5bd1d48549ce138a25 | refs/heads/master | 2021-05-02T12:05:18.501770 | 2020-10-09T20:10:32 | 2020-10-09T20:10:32 | 120,735,433 | 0 | 0 | null | 2018-02-08T08:50:04 | 2018-02-08T08:50:04 | null | UTF-8 | Java | false | false | 7,798 | java | /*
* @(#)GridBagPanel.java
*
* Copyright (c) 1999 Sun Microsystems, Inc. All Rights Reserved.
*
* Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
* modify and redistribute this software in source and binary code form,
* provided that i) this copyright notice and license appear on all copies of
* the software; and ii) Licensee does not utilize the software in a manner
* which is disparaging to Sun.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
* IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
* LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
* LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
* INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
* CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
* OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
* This software is not designed or intended for use in on-line control of
* aircraft, air traffic, aircraft navigation or aircraft communications; or in
* the design, construction, operation or maintenance of any nuclear
* facility. Licensee represents and warrants that it will not use or
* redistribute the Software for such purposes.
*/
package lia.Monitor.JiniClient.CommonGUI.Sphere;
import java.awt.AWTError;
import java.awt.Component;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.LayoutManager;
import javax.swing.JPanel;
/**
* Utility class designed to make it easier to use the
* GridBagLayout layout manager.
*
* @author Vincent Hardy
* @version 1.0, 04/09/1998
* @see j2d.ui.GridBagConstants
*/
public
class GridBagPanel extends JPanel implements GridBagConstants{
/**
* leftMarginDefault declaration
*/
int leftMarginDefault=5;
/**
* topMarginDefault declaration
*/
int topMarginDefault=5;
/**
* Gets the leftMarginDefault property
*
* @return the leftMarginDefault property value
*/
public int getLeftMarginDefault(){
return leftMarginDefault;
}
/**
* Sets the leftMarginDefault property
*
* @param leftMarginDefault the new value
*/
public void setLeftMarginDefault(int leftMarginDefault){
this.leftMarginDefault = leftMarginDefault;
}
/**
* Gets the topMarginDefault property
*
* @return the topMarginDefault property value
*/
public int getTopMarginDefault(){
return topMarginDefault;
}
/**
* Sets the topMarginDefault property
*
* @param topMarginDefault the new value
*/
public void setTopMarginDefault(int topMarginDefault){
this.topMarginDefault = topMarginDefault;
}
/**
* Sets the layout manager to GridBagLayout
*/
public GridBagPanel(){
super(new GridBagLayout());
}
/**
* @exception AwtError as a GridBagPanel can only use a GridBagLayout
*/
public void setLayout(LayoutManager layout){
if(!(layout instanceof GridBagLayout))
throw new AWTError("Should not set layout in a GridBagPanel");
else
super.setLayout(layout);
}
/**
* This version uses default margins. It assumes components are added in
* cells of positive coordinates. Top margin for components added at the top
* is 0. Left margins for components added on the left is 0. Otherwise, top
* and left margins default to the values of the defaultLeftMargin and defaultTopMargin
* properties. Bottom and right margins are always set to 0.
*
* @param cmp Component to add to the panel
* @param gridx x position of the cell into which component should be added
* @param gridy y position of the cell into which component should be added
* @param gridwidth width, in cells, of the space occupied by the component in the grid
* @param gridheight height, in cells, of the space occupied by the component in the grid
* @param anchor placement of the component in its allocated space: WEST, NORTH, SOUTH, NORTHWEST, ...
* @param fill out should the component be resized within its space? NONE, BOTH, HORIZONTAL, VERTICAL.
* @param weightx what amount of extra horizontal space, if any, should be given to this component?
* @param weighty what amount of extra vertical space, if any, should be given to this component?
*/
public void add(Component cmp, int gridx, int gridy,
int gridwidth, int gridheight, int anchor, int fill,
double weightx, double weighty){
Insets insets = new Insets(0,0,0,0);
if(gridx!=0) insets.left = leftMarginDefault;
if(gridy!=0) insets.top = topMarginDefault;
add(this, cmp, gridx, gridy, gridwidth, gridheight, anchor, fill,
weightx, weighty, insets);
}
/**
* @param cmp Component to add to the panel
* @param gridx x position of the cell into which component should be added
* @param gridy y position of the cell into which component should be added
* @param gridwidth width, in cells, of the space occupied by the component in the grid
* @param gridheight height, in cells, of the space occupied by the component in the grid
* @param anchor placement of the component in its allocated space: WEST, NORTH, SOUTH, NORTHWEST, ...
* @param fill out should the component be resized within its space? NONE, BOTH, HORIZONTAL, VERTICAL.
* @param weightx what amount of extra horizontal space, if any, should be given to this component?
* @param weighty what amount of extra vertical space, if any, should be given to this component?
* @param insets margins to add around component within its allocated space.
*/
public void add(Component cmp, int gridx, int gridy,
int gridwidth, int gridheight, int anchor, int fill,
double weightx, double weighty, Insets insets){
add(this, cmp, gridx, gridy, gridwidth, gridheight, anchor, fill,
weightx, weighty, insets);
}
/**
* @param cnt Container to which component is added
* @param cmp Component to add to the panel
* @param gridx x position of the cell into which component should be added
* @param gridy y position of the cell into which component should be added
* @param gridwidth width, in cells, of the space occupied by the component in the grid
* @param gridheight height, in cells, of the space occupied by the component in the grid
* @param anchor placement of the component in its allocated space: WEST, NORTH, SOUTH, NORTHWEST, ...
* @param fill out should the component be resized within its space? NONE, BOTH, HORIZONTAL, VERTICAL.
* @param weightx what amount of extra horizontal space, if any, should be given to this component?
* @param weighty what amount of extra vertical space, if any, should be given to this component?
* @param insets margins to add around component within its allocated space.
*/
public static void add(Container cnt, Component cmp, int gridx, int gridy,
int gridwidth, int gridheight, int anchor, int fill,
double weightx, double weighty, Insets insets){
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = gridx;
constraints.gridy = gridy;
constraints.gridwidth = gridwidth;
constraints.gridheight = gridheight;
constraints.anchor = anchor;
constraints.fill = fill;
constraints.weightx = weightx;
constraints.weighty = weighty;
constraints.insets = insets;
cnt.add(cmp, constraints);
}
}
| [
"juztas@gmail.com"
] | juztas@gmail.com |
4b7e94e4549f8e0db11a6b45d8288c07167a58a3 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-422-12-24-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/rendering/wikimodel/impl/WikiScannerContext_ESTest_scaffolding.java | 22d5289c6b3b248b227ca7b670ea1ea715597c71 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Apr 06 16:41:06 UTC 2020
*/
package org.xwiki.rendering.wikimodel.impl;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class WikiScannerContext_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
7f59c7e1d181592eb568b5ec4f37db1e7bbd6fe6 | 5ac6a77211570002c4ac10e976d91eaf7b9731dd | /merchant/src/org/webpki/saturn/merchant/HomeServlet.java | f14ba6ac70c7382805ab64eb097d79c7506801d7 | [
"Apache-2.0"
] | permissive | rzari/saturn | e2b034a890ffe1dfa7793f692f30060bd2eb6d5a | 2634460875b45974b7330c2024b4d212819e0517 | refs/heads/master | 2020-05-30T05:21:41.682357 | 2019-05-20T19:27:52 | 2019-05-20T19:27:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,721 | java | /*
* Copyright 2015-2018 WebPKI.org (http://webpki.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.webpki.saturn.merchant;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.webpki.webutil.ServletUtil;
public class HomeServlet extends HttpServlet implements MerchantProperties {
private static final long serialVersionUID = 1L;
static String merchantBaseUrl; // For QR and Android only
boolean isTapConnect() {
return false;
}
static boolean getOption(HttpSession session, String name) {
return session.getAttribute(name) != null && (Boolean)session.getAttribute(name);
}
static boolean browserIsSupported(HttpServletRequest request, HttpServletResponse response) throws IOException {
String userAgent = request.getHeader("User-Agent");
if (userAgent.contains(" Chrome/") ||
userAgent.contains(" Edge/") ||
userAgent.contains(" Safari/") ||
userAgent.contains(" Firefox/")) {
return true;
}
ErrorServlet.systemFail(response, "This proof-of-concept site only supports Chrome/Chromium, Safari, Edge and Firefox");
return false;
}
static boolean isAndroid(HttpServletRequest request) {
return request.getHeader("User-Agent").contains("Android");
}
boolean checkBoxGet(HttpSession session, String name) {
boolean argument = false;
if (session.getAttribute(name) == null) {
session.setAttribute(name, argument);
} else {
argument = (Boolean) session.getAttribute(name);
}
return argument;
}
void checkBoxSet(HttpSession session, HttpServletRequest request, String name) {
session.setAttribute(name, request.getParameter(name) != null);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
merchantBaseUrl = ServletUtil.getContextURL(request);
HttpSession session = request.getSession(false);
if (session != null && session.getAttribute(WALLET_REQUEST_SESSION_ATTR) != null) {
session.invalidate();
}
session = request.getSession(true);
if (session.getAttribute(GAS_STATION_SESSION_ATTR) != null) {
session.removeAttribute(GAS_STATION_SESSION_ATTR);
}
session.setAttribute(TAP_CONNECT_MODE_SESSION_ATTR, isTapConnect());
HTML.homePage(response,
checkBoxGet(session, DEBUG_MODE_SESSION_ATTR),
checkBoxGet(session, REFUND_MODE_SESSION_ATTR));
}
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
HttpSession session = request.getSession(true);
checkBoxSet(session, request, DEBUG_MODE_SESSION_ATTR);
checkBoxSet(session, request, REFUND_MODE_SESSION_ATTR);
response.sendRedirect("home");
}
}
| [
"anders.rundgren.net@gmail.com"
] | anders.rundgren.net@gmail.com |
2d802fe0faae825c13c81efd5d49eed86fc57259 | e82c5bb2aca46a66ec1ca97e3844027b33ed0d7e | /src/test/java/tec/uom/se/unit/PrefixTest.java | ad238db41abeaddfd1af7ce06ae2dc6d989158b5 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | ezidio/uom-se | 97222514caa33277d238e373118d8451ffa90092 | f2949856277d36bea0f53ab97d14512b6b5e4f30 | refs/heads/master | 2021-01-01T19:41:50.494688 | 2017-07-18T22:47:36 | 2017-07-18T22:47:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,482 | java | /*
* Units of Measurement Implementation for Java SE
* Copyright (c) 2005-2017, Jean-Marie Dautelle, Werner Keil, V2COM.
*
* 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. Neither the name of JSR-363 nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package tec.uom.se.unit;
import org.junit.Ignore;
import org.junit.Test;
import tec.uom.se.quantity.Quantities;
import javax.measure.Quantity;
import javax.measure.Unit;
import javax.measure.UnitConverter;
import javax.measure.quantity.Length;
import javax.measure.quantity.Mass;
import javax.measure.quantity.Volume;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static tec.uom.se.unit.MetricPrefix.*;
import static tec.uom.se.unit.Units.*;
import java.util.List;
public class PrefixTest {
@Test
public void testKilo() {
// TODO how to handle equals for units?
// assertEquals(KILOGRAM.getSymbol(), KILO(GRAM).getSymbol());
assertEquals(KILOGRAM.toString(), KILO(GRAM).toString());
}
@Test
public void testMega() {
Quantity<Mass> m1 = Quantities.getQuantity(1.0, MEGA(Units.GRAM));
assertEquals(1d, m1.getValue());
assertEquals("Mg", m1.getUnit().toString());
}
@Test
public void testDeci() {
Quantity<Volume> m1 = Quantities.getQuantity(1.0, LITRE);
assertEquals(1d, m1.getValue());
assertEquals("l", m1.getUnit().toString());
Quantity<Volume> m2 = m1.to(DECI(LITRE));
assertEquals(10.0d, m2.getValue());
assertEquals("dl", m2.getUnit().toString());
}
@Test
public void testMilli() {
Quantity<Mass> m1 = Quantities.getQuantity(1.0, MILLI(Units.GRAM));
assertEquals(1d, m1.getValue());
assertEquals("mg", m1.getUnit().toString());
}
@Test
public void testMilli2() {
Quantity<Volume> m1 = Quantities.getQuantity(10, MILLI(LITRE));
assertEquals(10, m1.getValue());
assertEquals("ml", m1.getUnit().toString());
}
@Test
public void testMilli3() {
Quantity<Volume> m1 = Quantities.getQuantity(1.0, LITRE);
assertEquals(1d, m1.getValue());
assertEquals("l", m1.getUnit().toString());
Quantity<Volume> m2 = m1.to(MILLI(LITRE));
assertEquals(1000.0d, m2.getValue());
assertEquals("ml", m2.getUnit().toString());
}
@Test
public void testMilli4() {
Quantity<Volume> m1 = Quantities.getQuantity(1.0, MILLI(LITRE));
assertEquals(1d, m1.getValue());
assertEquals("ml", m1.getUnit().toString());
Quantity<Volume> m2 = m1.to(LITRE);
assertEquals(0.001d, m2.getValue());
assertEquals("l", m2.getUnit().toString());
}
@Test
public void testMicro2() {
Quantity<Length> m1 = Quantities.getQuantity(1.0, Units.METRE);
assertEquals(1d, m1.getValue());
assertEquals("m", m1.getUnit().toString());
Quantity<Length> m2 = m1.to(MICRO(Units.METRE));
assertEquals(1000000.0d, m2.getValue());
assertEquals("µm", m2.getUnit().toString());
}
@Test
public void testNano() {
Quantity<Mass> m1 = Quantities.getQuantity(1.0, Units.GRAM);
assertEquals(1d, m1.getValue());
assertEquals("g", m1.getUnit().toString());
Quantity<Mass> m2 = m1.to(NANO(Units.GRAM));
assertEquals(1000000000.0d, m2.getValue());
assertEquals("ng", m2.getUnit().toString());
}
@Test
public void testNano2() {
Quantity<Length> m1 = Quantities.getQuantity(1.0, Units.METRE);
assertEquals(1d, m1.getValue());
assertEquals("m", m1.getUnit().toString());
Quantity<Length> m2 = m1.to(NANO(Units.METRE));
assertEquals(1000000000.0d, m2.getValue());
assertEquals("nm", m2.getUnit().toString());
}
@Test
public void testHashMapAccessingMap() {
assertThat(LITRE.toString(), is("l"));
assertThat(MILLI(LITRE).toString(), is("ml"));
assertNotNull(MILLI(GRAM).toString(), is("mg"));
}
@Test
public void testSingleOperation() {
assertEquals(MICRO(GRAM), GRAM.divide(1000000));
}
@Test
@Ignore("This is research for https://github.com/unitsofmeasurement/uom-se/issues/164")
public void testNestedOperationsShouldBeSame() {
Unit<Mass> m1 = MICRO(GRAM);
Unit<Mass> m2 = GRAM.divide(1000).divide(1000);
UnitConverter c1 = m1.getConverterTo(m2);
List steps1 = c1.getConversionSteps();
UnitConverter c2 = m2.getConverterTo(m1);
List steps2 = c2.getConversionSteps();
assertEquals(c1, c2);
assertEquals(m1, m2);
}
@Test
public void testNestedOperationsNotTheSame() {
Unit<Mass> m1 = MICRO(GRAM);
Unit<Mass> m2 = GRAM.divide(1000).divide(2000);
UnitConverter c1 = m1.getConverterTo(m2);
List steps1 = c1.getConversionSteps();
UnitConverter c2 = m2.getConverterTo(m1);
List steps2 = c2.getConversionSteps();
assertNotEquals(c1, c2);
assertNotEquals(m1, m2);
}
}
| [
"werner.keil@gmx.net"
] | werner.keil@gmx.net |
9c8554df700540248e8dae9fc4a33b2450cfd2b3 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/16/16_2799ce6a4594a668b4a332dbe78e38206e75abe2/SimpleTime/16_2799ce6a4594a668b4a332dbe78e38206e75abe2_SimpleTime_s.java | 70560299a7788ccaf50883d2ed33c7b9be4890f6 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,879 | java | package quizweb;
import java.sql.Timestamp;
import java.util.Date;
public class SimpleTime {
public static String[] monthStr = {"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
public static String getTime(Timestamp time) {
return getTime(time.getTime());
}
public static String getTime(long time) {
long curTime = new Date().getTime();
return getTimeByDuration(curTime - time);
}
@SuppressWarnings("deprecation")
public static String getTimeByDuration(long durationTime) {
long duration = durationTime;
String retStr = new String();
while (true) {
duration = duration / 1000;
duration = duration / 60;
if (duration == 0) {
retStr = "a few seconds ago";
break;
}
long min = duration % 60;
duration = duration / 60;
if (duration == 0) {
if (min == 1)
retStr = "1 minute ago";
else
retStr = min + " minutes ago";
break;
}
long hour = duration % 24;
duration = duration / 24;
if (duration == 0) {
if (hour == 1) {
retStr = "1 hour ago";
} else {
retStr = hour + " hours ago";
}
break;
}
long day = duration % 30;
duration = duration / 30;
if (duration == 0) {
if (day == 1)
retStr = "1 day ago";
else if (day < 7)
retStr = day + " days ago";
else if (day < 14)
retStr = "1 week ago";
else
retStr = day/7 + " weeks ago";
break;
}
if (duration > 12) {
retStr = "more than 1 year ago";
break;
}
Date oldDate = new Date(new Date().getTime() - durationTime);
retStr = monthStr[oldDate.getMonth()] + "." + " " + oldDate.getDate();
break;
}
return String.format("%-20s", retStr);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
10bdd1d084b4c9af4d75c18d638496909a22372f | 04394e58da3c089b7e520f26f64dd8dfc99838c6 | /java-workspace/java/src/com/bit/day05/prob/BookShop.java | be1c1d4829032b73e3967b7a33769c3b632ea9fe | [] | no_license | Ddock2/Bit-Study2 | be462e11239805472ebbf86c35ffc792eb0b237c | 7dcb18b1c01a5c182f5d7e5a1bc435cf5905fdf9 | refs/heads/master | 2020-04-15T08:17:11.057232 | 2019-05-17T08:46:26 | 2019-05-17T08:46:26 | 164,416,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,092 | java | package com.bit.day05.prob;
import java.util.Scanner;
// Prob2
// Book
public class BookShop {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] titles = {"트와일라잇", "뉴문", "이클립스", "브레이킹던", "아리랑", "젊은그들", "아프니까 청춘이다", "귀천", "태백산맥", "풀하우스"};
String[] authors = {"스테파니메이어", "스테파니메이어", "스테파니메이어", "스테파니메이어", "조정래", "김동인", "김난도", "천상병", "조정래", "원수연"};
Book[] books = new Book[10];
for(int i=0; i<10; i++) {
books[i] = new Book(i+1, titles[i], authors[i]);
}
System.out.print("대여 하고 싶은 책의 번호를 입력하세요 : ");
int bookNo = sc.nextInt();
for(Book b : books) {
if(b.bookNo == bookNo) {
b.rent();
break;
}
}
System.out.println("*****도서 정보 출력하기*****");
displayBooks(books);
sc.close();
}
public static void displayBooks(Book[] books) {
for(Book b : books) {
b.print();
}
}
}
| [
"bmkwak22@gmail.com"
] | bmkwak22@gmail.com |
ababd93298c6546aa70d533f8dd91d32c8842d7d | 1abb500dd743e1c47376ea95dfdbc2f371b87e5e | /src/test/java/com/alibaba/tamper/ConfigTest.java | 53daef6f7017f674e327f4b4594e826f0072f5b7 | [
"Apache-2.0"
] | permissive | sdgdsffdsfff/tamper | 693985c9536926125cec15fc4c3328e1a8fe6706 | 9cc7a59afdd5c20886ac4fc4dbd7ca60f0f9dfc7 | refs/heads/master | 2021-01-15T10:51:29.051669 | 2020-02-15T05:49:43 | 2020-02-15T05:49:43 | 63,648,813 | 0 | 0 | Apache-2.0 | 2020-02-15T05:49:45 | 2016-07-19T01:21:15 | Java | UTF-8 | Java | false | false | 3,313 | java | package com.alibaba.tamper;
import java.util.HashMap;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.junit.Test;
import com.alibaba.tamper.core.config.BeanMappingBehavior;
import com.alibaba.tamper.core.config.BeanMappingConfigHelper;
import com.alibaba.tamper.core.config.BeanMappingField;
import com.alibaba.tamper.core.config.BeanMappingObject;
import com.alibaba.tamper.object.SrcMappingObject;
import com.alibaba.tamper.object.TargetMappingObject;
/**
* @author jianghang 2011-5-27 上午09:26:38
*/
public class ConfigTest extends TestCase {
@Test
public void testFileParse() {
String file = "mapping/config.xml";
BeanMappingConfigHelper.getInstance().registerConfig(file);
BeanMappingObject object = BeanMappingConfigHelper.getInstance().getBeanMappingObject(HashMap.class,
HashMap.class);
assertNull(object);
object = BeanMappingConfigHelper.getInstance().getBeanMappingObject("testConfig");
printObject(object);
assertNotNull(object);
BeanMappingBehavior globalBehavior = BeanMappingConfigHelper.getInstance().getGlobalBehavior();
Assert.assertEquals(globalBehavior.isMappingNullValue(), true);
Assert.assertEquals(globalBehavior.isMappingEmptyStrings(), true);
Assert.assertEquals(globalBehavior.isDebug(), false);
Assert.assertEquals(globalBehavior.isTrimStrings(), true);
BeanMappingBehavior beanBehavior = object.getBehavior();
Assert.assertEquals(beanBehavior.isMappingNullValue(), false);// 覆盖了global
Assert.assertEquals(beanBehavior.isDebug(), true); // 覆盖了global
Assert.assertEquals(beanBehavior.isMappingEmptyStrings(), true); // 继承了global
Assert.assertEquals(beanBehavior.isTrimStrings(), true); // 继承了global
BeanMappingField field = object.getBeanFields().get(0);
BeanMappingBehavior fieldBehavior = field.getBehavior();
Assert.assertEquals(fieldBehavior.isMappingNullValue(), true);// 覆盖了bean
Assert.assertEquals(fieldBehavior.isDebug(), true); // 继承了bean
Assert.assertEquals(fieldBehavior.isMappingEmptyStrings(), true); // 继承了bean
Assert.assertEquals(fieldBehavior.isTrimStrings(), true); // 继承了bean
}
@Test
public void testClassParse() {
Class srcClass = SrcMappingObject.class;
Class targetClass = TargetMappingObject.class;
BeanMappingObject object = BeanMappingConfigHelper.getInstance().getBeanMappingObject(srcClass, targetClass,
true);// 自动注册
assertNotNull(object);
printObject(object);
}
private void printObject(BeanMappingObject object) {
System.out.println(ToStringBuilder.reflectionToString(object, ToStringStyle.MULTI_LINE_STYLE));
for (BeanMappingField field : object.getBeanFields()) {
System.out.println(ToStringBuilder.reflectionToString(field, ToStringStyle.MULTI_LINE_STYLE));
}
}
}
| [
"jianghang115@gmail.com"
] | jianghang115@gmail.com |
ed8306e78dc64306c2c1c57304fa2f6f968419dc | f6151c14700ea51923099b63ff39e2afd196d900 | /test-osgi/src/test/java/org/cache2k/test/osgi/OsgiIT.java | f9cd616023ce0bc8d6e76090f9c163b61095b762 | [
"Apache-2.0"
] | permissive | restmad/cache2k | fa9ca84c40532d9b625343c8563870b5b2937085 | 804e389618e6de75ac4b9a3f6e568e5c7d84e5b6 | refs/heads/master | 2020-03-09T19:22:21.649127 | 2018-04-04T07:15:07 | 2018-04-04T07:15:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,726 | java | package org.cache2k.test.osgi;
/*
* #%L
* cache2k tests for OSGi
* %%
* Copyright (C) 2000 - 2018 headissue GmbH, Munich
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import org.cache2k.Cache;
import org.cache2k.Cache2kBuilder;
import org.cache2k.CacheEntry;
import org.cache2k.CacheManager;
import org.cache2k.configuration.Cache2kConfiguration;
import org.cache2k.event.CacheEntryCreatedListener;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.ops4j.pax.exam.CoreOptions.*;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerMethod;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Test the OSGi enabled bundle. Tests are run via the failsafe maven plugin and not with
* surefire, since these are integration tests. This is critical since we must run
* after the package phase for the the bundle package to exist.
*
* @author Jens Wilke
*/
@org.junit.runner.RunWith(PaxExam.class)
@ExamReactorStrategy(PerMethod.class)
public class OsgiIT {
@Configuration
public Option[] config() {
String _userDir = System.getProperty("user.dir");
String _ownPath = "/test-osgi";
String _workspaceDir = _userDir;
if (_workspaceDir.endsWith(_ownPath)) {
_workspaceDir = _workspaceDir.substring(0,_workspaceDir.length() - _ownPath.length());
}
return options(
bundle("file:///" + _workspaceDir + "/cache2k-all/target/cache2k-all-" + System.getProperty("cache2k.version") + ".jar"),
/*
try to use api and impl directly
https://github.com/cache2k/cache2k/issues/83
bundle("file:///" + _workspaceDir + "/cache2k-api/target/cache2k-api-" + System.getProperty("cache2k.version") + ".jar"),
bundle("file:///" + _workspaceDir + "/cache2k-impl/target/cache2k-impl-" + System.getProperty("cache2k.version") + ".jar"),
*/
junitBundles()
);
}
@Test
public void testSimple() {
CacheManager m = CacheManager.getInstance("testSimple");
Cache<String, String> c =
Cache2kBuilder.of(String.class, String.class)
.manager(m)
.eternal(true)
.build();
c.put("abc", "123");
assertTrue(c.containsKey("abc"));
assertEquals("123", c.peek("abc"));
c.close();
}
@Test
public void testWithAnonBuilder() {
CacheManager m = CacheManager.getInstance("testWithAnonBuilder");
Cache<String, String> c =
new Cache2kBuilder<String, String>() {}
.manager(m)
.eternal(true)
.build();
c.put("abc", "123");
assertTrue(c.containsKey("abc"));
assertEquals("123", c.peek("abc"));
c.close();
}
/**
* Simple test to see whether configuration package is exported.
*/
@Test
public void testConfigurationPackage() {
Cache2kConfiguration<String, String> c =
Cache2kBuilder.of(String.class, String.class)
.eternal(true)
.toConfiguration();
assertTrue(c.isEternal());
}
/**
* Simple test to see whether event package is exported.
*/
@Test
public void testEventPackage() {
CacheManager m = CacheManager.getInstance("testEventPackage");
final AtomicInteger _count = new AtomicInteger();
Cache<String, String> c =
new Cache2kBuilder<String, String>() {}
.manager(m)
.eternal(true)
.addListener(new CacheEntryCreatedListener<String, String>() {
@Override
public void onEntryCreated(final Cache<String, String> cache, final CacheEntry<String, String> entry) {
_count.incrementAndGet();
}
})
.build();
c.put("abc", "123");
assertTrue(c.containsKey("abc"));
assertEquals("123", c.peek("abc"));
assertEquals(1, _count.get());
c.close();
}
@Test
public void testDefaultCacheManager() {
assertEquals("default", CacheManager.getInstance().getName());
}
@Test
public void testConfigFileUsedDifferentManager() {
assertEquals("specialDefaultName", CacheManager.getInstance(OsgiIT.class.getClassLoader()).getName());
}
}
| [
"jw_github@headissue.com"
] | jw_github@headissue.com |
f700fb52266690f8fdd11967b1387bf81fa85f4b | ea37e3a75b1b3eb22a25b7fa053209825042a756 | /src/main/java/com/getinsured/repository/TenantRepository.java | 8ee0f22845d613a4b5495f51d1baf8412a14f053 | [] | no_license | sureshkancherla/advances | e4c3509bf3b2275ff68cdf54f21a850276ef1fd3 | 8d3fc56a738c7f50aad8a89fbe818ce59d09fb63 | refs/heads/master | 2021-08-28T16:38:14.583493 | 2017-12-12T19:39:45 | 2017-12-12T19:39:45 | 113,897,719 | 0 | 0 | null | 2017-12-12T19:39:46 | 2017-12-11T19:11:12 | Java | UTF-8 | Java | false | false | 352 | java | package com.getinsured.repository;
import com.getinsured.domain.Tenant;
import org.springframework.stereotype.Repository;
import org.springframework.data.jpa.repository.*;
/**
* Spring Data JPA repository for the Tenant entity.
*/
@SuppressWarnings("unused")
@Repository
public interface TenantRepository extends JpaRepository<Tenant, Long> {
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
ca02df88379dd3df02e4b5fe0afbc413f5cd21a9 | c6d8dd7aba171163214253a3da841056ea2f6c87 | /serenity-model/src/main/java/net/thucydides/model/output/ResultsOutput.java | 79602a122163b14169c5d6fca85b2ed3db103855 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | serenity-bdd/serenity-core | 602b8369f9527bea21a30104a45ba9b6e4d48238 | ab6eaa5018e467b43e4f099e7682ce2924a9b12f | refs/heads/main | 2023-09-01T22:37:02.079831 | 2023-09-01T17:24:41 | 2023-09-01T17:24:41 | 26,201,720 | 738 | 656 | NOASSERTION | 2023-09-08T14:33:06 | 2014-11-05T03:44:57 | HTML | UTF-8 | Java | false | false | 413 | java | package net.thucydides.model.output;
import jxl.read.biff.BiffException;
import jxl.write.WriteException;
import net.thucydides.model.matchers.SimpleValueMatcher;
import java.io.IOException;
import java.util.List;
public interface ResultsOutput {
void recordResult(List<? extends Object> columnValues,
SimpleValueMatcher... check) throws IOException, WriteException, BiffException;
}
| [
"john.smart@wakaleo.com"
] | john.smart@wakaleo.com |
079630171b3b2b81a79e2073d93ebdc50f251269 | 622259e01d8555d552ddeba045fafe6624d80312 | /edu.harvard.i2b2.eclipse.plugins.workplace/gensrc/edu/harvard/i2b2/crcxmljaxb/datavo/psm/query/InstanceResponseType.java | e0ad3f03223b02a63c8d3e2b8b4d923021fc80fb | [] | no_license | kmullins/i2b2-workbench-old | 93c8e7a3ec7fc70b68c4ce0ae9f2f2c5101f5774 | 8144b0b62924fa8a0e4076bf9672033bdff3b1ff | refs/heads/master | 2021-05-30T01:06:11.258874 | 2015-11-05T18:00:58 | 2015-11-05T18:00:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,480 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.07.21 at 10:39:00 AM EDT
//
package edu.harvard.i2b2.crcxmljaxb.datavo.psm.query;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for instance_responseType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="instance_responseType">
* <complexContent>
* <extension base="{http://www.i2b2.org/xsd/cell/crc/psm/1.1/}responseType">
* <sequence>
* <element name="query_instance" type="{http://www.i2b2.org/xsd/cell/crc/psm/1.1/}query_instanceType" maxOccurs="unbounded"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "instance_responseType", propOrder = {
"queryInstance"
})
public class InstanceResponseType
extends ResponseType
{
@XmlElement(name = "query_instance", required = true)
protected List<QueryInstanceType> queryInstance;
/**
* Gets the value of the queryInstance property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the queryInstance property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getQueryInstance().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link QueryInstanceType }
*
*
*/
public List<QueryInstanceType> getQueryInstance() {
if (queryInstance == null) {
queryInstance = new ArrayList<QueryInstanceType>();
}
return this.queryInstance;
}
}
| [
"Janice@phs000774.partners.org"
] | Janice@phs000774.partners.org |
b83315e2ea7a045964f7840a87fab175857a6acc | 7d1609b510e3c97b2f00568e91cd9a51438275c8 | /Java/Java Fundamentals/02.Java OOP Basics - Jun 2018/01.02.Exercise Defining Classes/src/p08PokemonTrainer2/Trainer.java | a8a3f0f468d3565c7aca9fab5d3bae48dd3639fa | [
"MIT"
] | permissive | mgpavlov/SoftUni | 80a5d2cbd0348e895f6538651e86fcff65dcebf5 | cef1a7e4e475c69bbeb7bfdcaf7b3e64c88d604c | refs/heads/master | 2021-01-24T12:36:57.475329 | 2019-04-30T00:06:15 | 2019-04-30T00:06:15 | 123,138,723 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,286 | java | package p08PokemonTrainer2;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
class Trainer {
private static final int LOST_HEALTH = 10;
private String Name;
private int Badges;
private List<Pokemon> Pokemons;
Trainer(String name, int badges) {
if (this.Pokemons == null) {
this.Pokemons = new ArrayList<>();
}
Name = name;
Badges = badges;
}
int getBadges() {
return this.Badges;
}
void addPokemon(Pokemon pokemon) {
Pokemons.add(pokemon);
}
void analize(String element) {
boolean trainerHasSuchPokemon = this.Pokemons.stream()
.filter(p -> p.getElement().equals(element))
.collect(Collectors.toList()).size() > 0;
if (trainerHasSuchPokemon) {
this.Badges++;
} else {
for (Pokemon pokemon : Pokemons) {
pokemon.setHealth(pokemon.getHealth() - LOST_HEALTH);
}
Pokemons = this.Pokemons.stream().filter(p -> p.getHealth() > 0).collect(Collectors.toList());
}
}
@Override
public String toString() {
return String.format("%s %d %d%n", this.Name, this.Badges, this.Pokemons.size());
}
}
| [
"30524177+mgpavlov@users.noreply.github.com"
] | 30524177+mgpavlov@users.noreply.github.com |
99fcbf705325bd5834c54e4aba2252a0ba070c72 | a0caa255f3dbe524437715adaee2094ac8eff9df | /src/main/java/p000/C0429pv.java | 871a58d3d3b0ea9bd88c497f2b25e972fd4c9c30 | [] | no_license | AndroidTVDeveloper/com.google.android.tvlauncher | 16526208b5b48fd48931b09ed702fe606fe7d694 | 0f959c41bbb5a93e981145f371afdec2b3e207bc | refs/heads/master | 2021-01-26T07:47:23.091351 | 2020-02-26T20:58:19 | 2020-02-26T20:58:19 | 243,363,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | package p000;
import android.os.Parcel;
import android.os.Parcelable;
/* renamed from: pv */
/* compiled from: PG */
public final class C0429pv extends C0445qk {
public static final Parcelable.Creator CREATOR = new C0428pu();
/* renamed from: a */
public String f10190a;
public C0429pv(Parcel parcel) {
super(parcel);
this.f10190a = parcel.readString();
}
public C0429pv(Parcelable parcelable) {
super(parcelable);
}
public final void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeString(this.f10190a);
}
}
| [
"eliminater74@gmail.com"
] | eliminater74@gmail.com |
47cc1658c1b8675374d985d2d4ff7dcf637a0ec5 | 7b935c49a7fc98155136b191f837a7c58a632957 | /java-8-impatient/src/main/java/ch01_lambda/exec/Exec06.java | 1cce3a48ef7beed5a61f2e2022f309659b0e217d | [] | no_license | kwon37xi/research-java8 | 55d89b4f629262053bffc788de0deb5f541fac6a | 8e10a732f8133a0fcd5ecbed59c992014f7bca4a | refs/heads/master | 2020-04-12T02:31:28.176458 | 2018-06-25T13:23:08 | 2018-06-25T13:23:08 | 48,409,215 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 733 | java | package ch01_lambda.exec;
/**
* Callable 사용시에는 Void라 하더라도 lambda 표현식 내에서 return이 필요하다.
*/
public class Exec06 {
public interface RunnableEx {
void run() throws Exception;
}
public static Runnable uncheck(RunnableEx runnableEx) {
return () -> {
try {
runnableEx.run();
} catch (Exception e) {
throw new IllegalStateException(e.getMessage(), e);
}
};
}
public static void main(String[] args) {
new Thread(uncheck(() -> {
System.out.println(Thread.currentThread().getName() + " -> hello world");
Thread.sleep(1000);
})).start();
}
}
| [
"kwon37xi@gmail.com"
] | kwon37xi@gmail.com |
21eaf0e6b7443e2968e492f48507ecfde3e0d0ef | f4b7924a03289706c769aff23abf4cce028de6bc | /smart_logic/src/main/java/plan_pro/modell/balisentechnik_etcs/_1_9_0/TCBezeichnungZUB.java | 4c928f7092eb5b71e5be9db8f3be617fab2c24b5 | [] | no_license | jimbok8/ebd | aa18a2066b4a873bad1551e1578a7a1215de9b8b | 9b0d5197bede5def2972cc44e63ac3711010eed4 | refs/heads/main | 2023-06-17T21:16:08.003689 | 2021-07-05T14:53:38 | 2021-07-05T14:53:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,961 | java | //
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// �nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2020.01.16 um 04:27:51 PM CET
//
package plan_pro.modell.balisentechnik_etcs._1_9_0;
import plan_pro.modell.basistypen._1_9_0.CBasisAttribut;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java-Klasse f�r TCBezeichnung_ZUB complex type.
*
* <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* <complexType name="TCBezeichnung_ZUB">
* <complexContent>
* <extension base="{http://www.plan-pro.org/modell/BasisTypen/1.9.0.2}CBasisAttribut">
* <sequence>
* <element name="Wert" type="{http://www.plan-pro.org/modell/Balisentechnik_ETCS/1.9.0.2}TBezeichnung_ZUB"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TCBezeichnung_ZUB", propOrder = {
"wert"
})
public class TCBezeichnungZUB
extends CBasisAttribut
{
@XmlElement(name = "Wert", required = true, nillable = true)
protected String wert;
/**
* Ruft den Wert der wert-Eigenschaft ab.
*
* @return
* possible object is
* {@link String }
*
*/
public String getWert() {
return wert;
}
/**
* Legt den Wert der wert-Eigenschaft fest.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setWert(String value) {
this.wert = value;
}
}
| [
"iberl@verkehr.tu-darmstadt.de"
] | iberl@verkehr.tu-darmstadt.de |
812efafbbe96a8e82dd1447142d77695abe9572b | b280a34244a58fddd7e76bddb13bc25c83215010 | /scmv6/core-base-utils/src/main/java/com/smate/core/base/utils/wechat/OAuth2Service.java | 92f96cc7fd2e93439eafb7e0f59bec7f3cc90b47 | [] | no_license | hzr958/myProjects | 910d7b7473c33ef2754d79e67ced0245e987f522 | d2e8f61b7b99a92ffe19209fcda3c2db37315422 | refs/heads/master | 2022-12-24T16:43:21.527071 | 2019-08-16T01:46:18 | 2019-08-16T01:46:18 | 202,512,072 | 2 | 3 | null | 2022-12-16T05:31:05 | 2019-08-15T09:21:04 | Java | UTF-8 | Java | false | false | 1,664 | java | package com.smate.core.base.utils.wechat;
import java.util.Map;
/**
* 网页授权服务接口.
*
* @author xys
*
*/
public interface OAuth2Service {
/**
* 获取微信openid.
*
* @param code
* @return
* @throws Exception
*/
public String getWeChatOpenId(String code) throws Exception;
/**
* 获取access_token信息
*
* @param code
* @return
* @throws Exception
*/
public String getWeChatToken() throws Exception;
/**
* 通过access_token和openidList批量用户基本信息
*
* @param code
* @return
* @throws Exception
*/
public Map<String, Object> getWeChatInfos(String token, String userList) throws Exception;
/**
* 通过access_token和openid单个用户基本信息
*
* @param code
* @return
* @throws Exception
*/
public Map<String, Object> getWeChatInfoSingle(String token, String user) throws Exception;
/**
* 公众平台根据openid获取用户信息.
*
* @param token 公众平台token 注意区分用户token
* @param openId
* @return
* @throws Exception
*/
public Map<String, Object> getWeChatInfo(String token, String openId) throws Exception;
/**
* 开放平台根据openid获取用户信息.
*
* @param token 公众平台token 注意区分用户token
* @param openId
* @return
* @throws Exception
*/
public Map<String, Object> getOpenWeChatInfo(String token, String openId) throws Exception;
/**
* 开放平台获取微信数据.
*
* @param code
* @return
* @throws Exception
*/
public Map<String, Object> getOpenWeChatUnionInfo(String code) throws Exception;
}
| [
"zhiranhe@irissz.com"
] | zhiranhe@irissz.com |
226741c70e0f9d8db5cd7f607f30e4b2af7d36ae | 903e9488b0c794494ba25d812d1ad56db429ac62 | /src/main/java/io/github/jhipster/sygi/security/SecurityUtils.java | 6c3e7053779f81f7c7b827be7e53946e448193ca | [] | no_license | BulkSecurityGeneratorProject/sygi-app | 1aa077571a5900e6fb21e0147e3c74ef81cb3e26 | 2e0ee6120babda5bd4673d38daf9f5d84a3b9d09 | refs/heads/master | 2022-12-31T02:07:47.707701 | 2019-07-29T12:59:35 | 2019-07-29T12:59:35 | 296,648,856 | 0 | 0 | null | 2020-09-18T14:45:25 | 2020-09-18T14:45:23 | null | UTF-8 | Java | false | false | 2,997 | java | package io.github.jhipster.sygi.security;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Optional;
/**
* Utility class for Spring Security.
*/
public final class SecurityUtils {
private SecurityUtils() {
}
/**
* Get the login of the current user.
*
* @return the login of the current user.
*/
public static Optional<String> getCurrentUserLogin() {
SecurityContext securityContext = SecurityContextHolder.getContext();
return Optional.ofNullable(securityContext.getAuthentication())
.map(authentication -> {
if (authentication.getPrincipal() instanceof UserDetails) {
UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal();
return springSecurityUser.getUsername();
} else if (authentication.getPrincipal() instanceof String) {
return (String) authentication.getPrincipal();
}
return null;
});
}
/**
* Get the JWT of the current user.
*
* @return the JWT of the current user.
*/
public static Optional<String> getCurrentUserJWT() {
SecurityContext securityContext = SecurityContextHolder.getContext();
return Optional.ofNullable(securityContext.getAuthentication())
.filter(authentication -> authentication.getCredentials() instanceof String)
.map(authentication -> (String) authentication.getCredentials());
}
/**
* Check if a user is authenticated.
*
* @return true if the user is authenticated, false otherwise.
*/
public static boolean isAuthenticated() {
SecurityContext securityContext = SecurityContextHolder.getContext();
return Optional.ofNullable(securityContext.getAuthentication())
.map(authentication -> authentication.getAuthorities().stream()
.noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS)))
.orElse(false);
}
/**
* If the current user has a specific authority (security role).
* <p>
* The name of this method comes from the {@code isUserInRole()} method in the Servlet API.
*
* @param authority the authority to check.
* @return true if the current user has the authority, false otherwise.
*/
public static boolean isCurrentUserInRole(String authority) {
SecurityContext securityContext = SecurityContextHolder.getContext();
return Optional.ofNullable(securityContext.getAuthentication())
.map(authentication -> authentication.getAuthorities().stream()
.anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority)))
.orElse(false);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
9672aa09f54a263d0216401792f70663aad21d59 | 9628053e6d5f4c2bc7df4a32ce1d6d89a0a7a15b | /com.agileapes.motorex.tree/src/main/java/com/agileapes/motorex/tree/traverse/impl/UpGoingNodeTraverseCallbackAdapter.java | 467bde51e603088f16b9763483956be0d12dca0d | [
"MIT"
] | permissive | pooyaho/motorex | 26707ad1444e1ef3c529d1ae9afcabbdd16a769b | 0e432eda9b60c09e9c003580cc51c331a7b0b2ac | refs/heads/master | 2016-09-11T02:45:54.621887 | 2012-12-09T00:34:22 | 2012-12-09T00:34:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,079 | java | /*
* Copyright (c) 2012. AgileApes (http://www.agileapes.scom/), and
* associated organization.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*/
package com.agileapes.motorex.tree.traverse.impl;
import com.agileapes.motorex.tree.traverse.TraverseOrder;
/**
* @author Mohammad Milad Naseri (m.m.naseri@gmail.com)
* @since 1.0 (2012/12/8, 13:21)
*/
public class UpGoingNodeTraverseCallbackAdapter extends NodeTraverseCallbackAdapter {
public UpGoingNodeTraverseCallbackAdapter() {
super(TraverseOrder.UP);
}
}
| [
"m.m.naseri@gmail.com"
] | m.m.naseri@gmail.com |
081cccdf83d1c28c7112b6dca5082b7166eb316e | ba39bfacdd72261fb15d6dc6b93c69e0ff0562f3 | /src/org/apache/pivot/collections/LinkedQueue.java | 0b1ece1d9f98642cdd1d0ba3a2771b90024caa44 | [
"AFL-3.0",
"BSD-3-Clause",
"AFL-2.1",
"Apache-2.0"
] | permissive | andrescabrera/gwt-dojo-toolkit | 4cf0f7bf3061f1f1248dec731aca8d6fd91ac8dc | 4faf915c62871b2267a49ce0cd703dd98d986644 | refs/heads/master | 2020-05-30T03:49:29.199573 | 2013-06-17T10:57:52 | 2013-06-17T10:57:52 | 40,503,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,293 | 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.pivot.collections;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Iterator;
import org.apache.pivot.util.ImmutableIterator;
import org.apache.pivot.util.ListenerList;
/**
* Implementation of the {@link Queue} interface that is backed by a linked
* list.
*/
public class LinkedQueue<T> implements Queue<T>, Serializable {
private static final long serialVersionUID = 1598074020226109253L;
private LinkedList<T> linkedList = new LinkedList<T>();
private transient QueueListenerList<T> queueListeners = new QueueListenerList<T>();
public LinkedQueue() {
this(null);
}
public LinkedQueue(Comparator<T> comparator) {
setComparator(comparator);
}
@Override
public void enqueue(T item) {
if (getComparator() == null) {
linkedList.insert(item, 0);
} else {
linkedList.add(item);
}
queueListeners.itemEnqueued(this, item);
}
@Override
public T dequeue() {
int length = linkedList.getLength();
if (length == 0) {
throw new IllegalStateException("queue is empty");
}
T item = linkedList.remove(length - 1, 1).get(0);
queueListeners.itemDequeued(this, item);
return item;
}
@Override
public T peek() {
T item = null;
int length = linkedList.getLength();
if (length > 0) {
item = linkedList.get(length - 1);
}
return item;
}
@Override
public void clear() {
if (linkedList.getLength() > 0) {
linkedList.clear();
queueListeners.queueCleared(this);
}
}
@Override
public boolean isEmpty() {
return (linkedList.getLength() == 0);
}
@Override
public int getLength() {
return linkedList.getLength();
}
@Override
public Comparator<T> getComparator() {
return linkedList.getComparator();
}
@Override
public void setComparator(Comparator<T> comparator) {
Comparator<T> previousComparator = getComparator();
linkedList.setComparator(comparator);
queueListeners.comparatorChanged(this, previousComparator);
}
@Override
public Iterator<T> iterator() {
return new ImmutableIterator<T>(linkedList.iterator());
}
@Override
public ListenerList<QueueListener<T>> getQueueListeners() {
return queueListeners;
}
}
| [
"georgopoulos.georgios@gmail.com"
] | georgopoulos.georgios@gmail.com |
0a13db76f9ce40c4b0ff729c50b7d1ae3c682791 | f567c98cb401fc7f6ad2439cd80c9bcb45e84ce9 | /src/main/java/com/alipay/api/domain/ArInvoiceLineOpenApiResponse.java | 4554b35d2b0159cfe2d49bb257321379064df51c | [
"Apache-2.0"
] | permissive | XuYingJie-cmd/alipay-sdk-java-all | 0887fa02f857dac538e6ea7a72d4d9279edbe0f3 | dd18a679f7543a65f8eba2467afa0b88e8ae5446 | refs/heads/master | 2023-07-15T23:01:02.139231 | 2021-09-06T07:57:09 | 2021-09-06T07:57:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,714 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 发票行信息
*
* @author auto create
* @since 1.0, 2021-08-20 15:44:15
*/
public class ArInvoiceLineOpenApiResponse extends AlipayObject {
private static final long serialVersionUID = 2521433458739918195L;
/**
* 含税金额
*/
@ApiField("amt")
private MultiCurrencyMoneyOpenApi amt;
/**
* 免税标识
*/
@ApiField("duty_free_flag")
private String dutyFreeFlag;
/**
* 含税单价
*/
@ApiField("incl_tax_unit_amt")
private Long inclTaxUnitAmt;
/**
* 关联的发票ID
*/
@ApiField("invoice_id")
private String invoiceId;
/**
* 发票行iD
*/
@ApiField("invoice_line_id")
private String invoiceLineId;
/**
* 计量单位
*/
@ApiField("measurement_unit")
private String measurementUnit;
/**
* 货物或劳务名称
*/
@ApiField("product_name")
private String productName;
/**
* 规格型号
*/
@ApiField("product_specification")
private String productSpecification;
/**
* 数量
*/
@ApiField("quantity")
private Long quantity;
/**
* 税额
*/
@ApiField("tax_amt")
private MultiCurrencyMoneyOpenApi taxAmt;
/**
* 不含税金额
*/
@ApiField("tax_exclusive_amt")
private MultiCurrencyMoneyOpenApi taxExclusiveAmt;
/**
* 税率
*/
@ApiField("tax_rate")
private Long taxRate;
/**
* 单价
*/
@ApiField("unit_amt")
private Long unitAmt;
public MultiCurrencyMoneyOpenApi getAmt() {
return this.amt;
}
public void setAmt(MultiCurrencyMoneyOpenApi amt) {
this.amt = amt;
}
public String getDutyFreeFlag() {
return this.dutyFreeFlag;
}
public void setDutyFreeFlag(String dutyFreeFlag) {
this.dutyFreeFlag = dutyFreeFlag;
}
public Long getInclTaxUnitAmt() {
return this.inclTaxUnitAmt;
}
public void setInclTaxUnitAmt(Long inclTaxUnitAmt) {
this.inclTaxUnitAmt = inclTaxUnitAmt;
}
public String getInvoiceId() {
return this.invoiceId;
}
public void setInvoiceId(String invoiceId) {
this.invoiceId = invoiceId;
}
public String getInvoiceLineId() {
return this.invoiceLineId;
}
public void setInvoiceLineId(String invoiceLineId) {
this.invoiceLineId = invoiceLineId;
}
public String getMeasurementUnit() {
return this.measurementUnit;
}
public void setMeasurementUnit(String measurementUnit) {
this.measurementUnit = measurementUnit;
}
public String getProductName() {
return this.productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSpecification() {
return this.productSpecification;
}
public void setProductSpecification(String productSpecification) {
this.productSpecification = productSpecification;
}
public Long getQuantity() {
return this.quantity;
}
public void setQuantity(Long quantity) {
this.quantity = quantity;
}
public MultiCurrencyMoneyOpenApi getTaxAmt() {
return this.taxAmt;
}
public void setTaxAmt(MultiCurrencyMoneyOpenApi taxAmt) {
this.taxAmt = taxAmt;
}
public MultiCurrencyMoneyOpenApi getTaxExclusiveAmt() {
return this.taxExclusiveAmt;
}
public void setTaxExclusiveAmt(MultiCurrencyMoneyOpenApi taxExclusiveAmt) {
this.taxExclusiveAmt = taxExclusiveAmt;
}
public Long getTaxRate() {
return this.taxRate;
}
public void setTaxRate(Long taxRate) {
this.taxRate = taxRate;
}
public Long getUnitAmt() {
return this.unitAmt;
}
public void setUnitAmt(Long unitAmt) {
this.unitAmt = unitAmt;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
4e15e9915668ac0bd5f8b84a92c6d2c8decca03d | 702a611aac878e0a64933a86c9fc44568bfecca0 | /spring/src/main/java/com/jt/service/OrderServiceImpl.java | 2a32672c10cfaf4cc5305d51681eb8fa667b9734 | [
"Apache-2.0"
] | permissive | jt120/my-cabin | 404d240b9b4a6111fa5b27b0b67d9754cee68c6c | fa6655999cbf6f1878d48094f7c02af43f30924e | refs/heads/master | 2016-09-08T00:24:16.421015 | 2015-05-27T04:11:28 | 2015-05-27T04:11:28 | 31,362,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | package com.jt.service;
import com.jt.bean.Order;
import com.jt.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
* Created by ze.liu on 2014/7/2.
*/
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderDao orderDao;
@Override
public long add(Order order) {
String replace = UUID.randomUUID().toString().replace("-", "");
order.setOrderNo(replace);
return orderDao.add(order);
}
@Override
public Order findByOrderNo(String orderNo) {
return orderDao.findByOrderNo(orderNo);
}
@Override
public List<Order> findByUserId(long userId) {
return orderDao.findByUserId(userId);
}
}
| [
"jt120lz@gmail.com"
] | jt120lz@gmail.com |
6830f06b67c929aa8946a6f9ca5219720afd770c | 5eae683a6df0c4b97ab1ebcd4724a4bf062c1889 | /bin/ext-accelerator/b2bpunchout/src/org/cxml/TaxInformation.java | d5dcc3c51d6b0848648aa8622a4210b6fc80ecfb | [] | no_license | sujanrimal/GiftCardProject | 1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb | e0398eec9f4ec436d20764898a0255f32aac3d0c | refs/heads/master | 2020-12-11T18:05:17.413472 | 2020-01-17T18:23:44 | 2020-01-17T18:23:44 | 233,911,127 | 0 | 0 | null | 2020-06-18T15:26:11 | 2020-01-14T18:44:18 | null | UTF-8 | Java | false | false | 3,548 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.05.12 at 07:19:30 PM EDT
//
package org.cxml;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"legalName",
"taxID"
})
@XmlRootElement(name = "TaxInformation")
public class TaxInformation {
@XmlAttribute(name = "isExemptFromBackupWithholding")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String isExemptFromBackupWithholding;
@XmlElement(name = "LegalName")
protected LegalName legalName;
@XmlElement(name = "TaxID")
protected List<TaxID> taxID;
/**
* Gets the value of the isExemptFromBackupWithholding property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIsExemptFromBackupWithholding() {
return isExemptFromBackupWithholding;
}
/**
* Sets the value of the isExemptFromBackupWithholding property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIsExemptFromBackupWithholding(String value) {
this.isExemptFromBackupWithholding = value;
}
/**
* Gets the value of the legalName property.
*
* @return
* possible object is
* {@link LegalName }
*
*/
public LegalName getLegalName() {
return legalName;
}
/**
* Sets the value of the legalName property.
*
* @param value
* allowed object is
* {@link LegalName }
*
*/
public void setLegalName(LegalName value) {
this.legalName = value;
}
/**
* Gets the value of the taxID property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the taxID property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTaxID().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TaxID }
*
*
*/
public List<TaxID> getTaxID() {
if (taxID == null) {
taxID = new ArrayList<TaxID>();
}
return this.taxID;
}
}
| [
"travis.d.crawford@accenture.com"
] | travis.d.crawford@accenture.com |
29177443498d4439419b94a122e7beecbaac52fb | 46238e7b847e7445a22d16fa4fd0458eab6a7aff | /src/com/rsia/madura/entity/MPenunjangGroup.java | d2f6edb93b01ec0d888477e011b6fd0275b0d127 | [] | no_license | ok-google/newrsia | 9d4dae59f44c36839ab8212dee4807410cfd4cfd | 81d5f164649ddd2b25a25f6281f03beb940fc49c | refs/heads/master | 2020-03-22T13:08:05.245571 | 2018-07-07T13:48:56 | 2018-07-07T13:48:56 | 140,085,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,308 | java | /*
* @Author: Pradesga Indonesia
* @Date: 2018-05-12 15:40:22
* @Last Modified by: Pradesga Indonesia
* @Last Modified time: 2018-05-12 17:14:43
*/
package com.rsia.madura.entity;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
@Entity
@Table(name="m_penunjangmedis_group")
public class MPenunjangGroup {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="pmedisgroup_id")
private int pmedisgroupID;
@Column(name="pmedisgroup_master")
private String pmedisgroupMaster;
@Column(name="pmedisgroup_detail")
private String pmedisgroupDetail;
@Column(name="pmedisgroup_urut")
private Integer pmedisgroupUrut;
@Column(name="pmedisgroup_aktif")
private String pmedisgroupAktif;
@Column(name="reg_company_id ")
private Integer regCompanyID ;
@Column(name="reg_apps_id ")
private Integer regAppsID ;
public int getPmedisgroupID() {
return this.pmedisgroupID;
}
public void setPmedisgroupID(int pmedisgroupID) {
this.pmedisgroupID = pmedisgroupID;
}
public String getPmedisgroupMaster() {
return this.pmedisgroupMaster;
}
public void setPmedisgroupMaster(String pmedisgroupMaster) {
this.pmedisgroupMaster = pmedisgroupMaster;
}
public String getPmedisgroupDetail() {
return this.pmedisgroupDetail;
}
public void setPmedisgroupDetail(String pmedisgroupDetail) {
this.pmedisgroupDetail = pmedisgroupDetail;
}
public Integer getPmedisgroupUrut() {
return this.pmedisgroupUrut;
}
public void setPmedisgroupUrut(Integer pmedisgroupUrut) {
this.pmedisgroupUrut = pmedisgroupUrut;
}
public String getPmedisgroupAktif() {
return this.pmedisgroupAktif;
}
public void setPmedisgroupAktif(String pmedisgroupAktif) {
this.pmedisgroupAktif = pmedisgroupAktif;
}
public Integer getRegCompanyID() {
return this.regCompanyID;
}
public void setRegCompanyID(Integer regCompanyID) {
this.regCompanyID = regCompanyID;
}
public Integer getRegAppsID() {
return this.regAppsID;
}
public void setRegAppsID(Integer regAppsID) {
this.regAppsID = regAppsID;
}
} | [
"rizkisetiawan.root@gmail.com"
] | rizkisetiawan.root@gmail.com |
76d4ec9ccc829022a36121738e91d93d4fb8b6f2 | bcb3cc7caabb3bd646de46dd191aeeb98b597248 | /src/main/java/com/adanac/demo/captcha/ImagePreProcess.java | 88593b9f9020addd27cc9e010d4bfbced5e471c9 | [] | no_license | adanac/demo-captcha | 35a2e28518578d8c0cf81346f05a6b81723379ed | ba76a9cb537412c0a9f1f42b6ad87ea743d70977 | refs/heads/master | 2021-01-19T02:30:40.926209 | 2016-06-08T09:27:39 | 2016-06-08T09:27:39 | 60,077,598 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,379 | java | package com.adanac.demo.captcha;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.imageio.ImageIO;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
//import org.apache.http.client.HttpClient;
import org.apache.commons.io.IOUtils;
//import org.apache.commons.httpclient.HttpClient;
//import org.apache.commons.httpclient.HttpStatus;
//import org.apache.commons.httpclient.methods.GetMethod;
//import org.apache.commons.io.IOUtils;
public class ImagePreProcess {
public static int isWhite(int colorInt) {
Color color = new Color(colorInt);
if (color.getRed() + color.getGreen() + color.getBlue() > 100) {
return 1;
}
return 0;
}
public static int isBlack(int colorInt) {
Color color = new Color(colorInt);
if (color.getRed() + color.getGreen() + color.getBlue() <= 100) {
return 1;
}
return 0;
}
public static BufferedImage removeBackgroud(String picFile) throws Exception {
BufferedImage img = ImageIO.read(new File(picFile));
int width = img.getWidth();
int height = img.getHeight();
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
if (isWhite(img.getRGB(x, y)) == 1) {
img.setRGB(x, y, Color.WHITE.getRGB());
} else {
img.setRGB(x, y, Color.BLACK.getRGB());
}
}
}
return img;
}
public static List<BufferedImage> splitImage(BufferedImage img) throws Exception {
List<BufferedImage> subImgs = new ArrayList<BufferedImage>();
subImgs.add(img.getSubimage(10, 6, 8, 10));
subImgs.add(img.getSubimage(19, 6, 8, 10));
subImgs.add(img.getSubimage(28, 6, 8, 10));
subImgs.add(img.getSubimage(37, 6, 8, 10));
return subImgs;
}
public static Map<BufferedImage, String> loadTrainData() throws Exception {
Map<BufferedImage, String> map = new HashMap<BufferedImage, String>();
File dir = new File("train");
File[] files = dir.listFiles();
for (File file : files) {
map.put(ImageIO.read(file), file.getName().charAt(0) + "");
}
return map;
}
public static String getSingleCharOcr(BufferedImage img, Map<BufferedImage, String> map) {
String result = "";
int width = img.getWidth();
int height = img.getHeight();
int min = width * height;
for (BufferedImage bi : map.keySet()) {
int count = 0;
Label1: for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
if (isWhite(img.getRGB(x, y)) != isWhite(bi.getRGB(x, y))) {
count++;
if (count >= min)
break Label1;
}
}
}
if (count < min) {
min = count;
result = map.get(bi);
}
}
return result;
}
public static String getAllOcr(String file) throws Exception {
BufferedImage img = removeBackgroud(file);
List<BufferedImage> listImg = splitImage(img);
Map<BufferedImage, String> map = loadTrainData();
String result = "";
for (BufferedImage bi : listImg) {
result += getSingleCharOcr(bi, map);
}
ImageIO.write(img, "JPG", new File("result//" + result + ".jpg"));
return result;
}
public static void downloadImage() {
HttpClient httpClient = new HttpClient();
GetMethod getMethod = new GetMethod("http://www.170.com/businessHall/authImg");
for (int i = 0; i < 30; i++) {
try {
// 执行getMethod
int statusCode = httpClient.executeMethod(getMethod);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + getMethod.getStatusLine());
}
// 读取内容
String picName = "img//" + i + ".jpg";
InputStream inputStream = getMethod.getResponseBodyAsStream();
OutputStream outStream = new FileOutputStream(picName);
IOUtils.copy(inputStream, outStream);
outStream.close();
System.out.println("OK!");
} catch (Exception e) {
e.printStackTrace();
} finally {
// 释放连接
getMethod.releaseConnection();
}
}
}
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
downloadImage();
for (int i = 0; i < 30; ++i) {
String text = getAllOcr("img//" + i + ".jpg");
System.out.println(i + ".jpg = " + text);
}
}
} | [
"adanac@sina.com"
] | adanac@sina.com |
c89089590ccd08f7cea130580c7c6fd3025a5a8d | cc0458b38bf6d7bac7411a9c6fec9bc3b8282d3f | /thirdParty/CSharpParser/src/csmc/javacc/generated/syntaxtree/MoreOrderings.java | 63f4b4b69cda92d9e1b0eb2b0e4cfe458ffccd51 | [] | no_license | RinatGumarov/Code-metrics | 62f99c25b072dd56e9c953d40dac7076a4376180 | 2005b6671c174e09e6ea06431d4711993a33ecb6 | refs/heads/master | 2020-07-12T04:01:47.007860 | 2017-08-08T07:19:26 | 2017-08-08T07:19:26 | 94,275,456 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | //
// Generated by JTB 1.3.2
//
package csmc.javacc.generated.syntaxtree;
/**
* Grammar production:
* f0 -> [ <COMMA> Ordering() MoreOrderings() ]
*/
public class MoreOrderings implements Node {
public NodeOptional f0;
public MoreOrderings(NodeOptional n0) {
f0 = n0;
}
public void accept(csmc.javacc.generated.visitor.Visitor v) {
v.visit(this);
}
public <R,A> R accept(csmc.javacc.generated.visitor.GJVisitor<R,A> v, A argu) {
return v.visit(this,argu);
}
public <R> R accept(csmc.javacc.generated.visitor.GJNoArguVisitor<R> v) {
return v.visit(this);
}
public <A> void accept(csmc.javacc.generated.visitor.GJVoidVisitor<A> v, A argu) {
v.visit(this,argu);
}
}
| [
"tiran678@icloud.com"
] | tiran678@icloud.com |
f933c69e7d943b1fa34adb9b29bcf769c4710e1d | d249ff066f6c4ae99c646ea859d4c8cabe94c27c | /src/test/java/nextstep/web/UserAcceptanceTest.java | 1b93c5001fec23c87e06f9bba1561be7e3650d2d | [] | no_license | CheolHoJung/java-qna-atdd | 4782aa209c409204d45a6c2a6e9046893a9544b7 | aabab2c63498ba6aa5b25a7bb746fca3e6058d30 | refs/heads/master | 2020-05-03T03:49:11.385541 | 2019-04-12T09:39:17 | 2019-04-12T09:39:17 | 178,406,532 | 0 | 0 | null | 2019-03-29T13:03:10 | 2019-03-29T13:03:10 | null | UTF-8 | Java | false | false | 4,313 | java | package nextstep.web;
import nextstep.domain.User;
import nextstep.domain.UserRepository;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.*;
import org.springframework.util.MultiValueMap;
import support.test.AcceptanceTest;
import support.test.HtmlFormDataBuilder;
public class UserAcceptanceTest extends AcceptanceTest {
private static final Logger log = LoggerFactory.getLogger(UserAcceptanceTest.class);
@Autowired
private UserRepository userRepository;
@Test
public void createForm() throws Exception {
ResponseEntity<String> response = template().getForEntity("/users/form", String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
log.debug("body : {}", response.getBody());
}
@Test
public void create() throws Exception {
String userId = "testuser";
HttpEntity<MultiValueMap<String, Object>> request = HtmlFormDataBuilder.urlEncodedForm()
.addParameter("userId", userId)
.addParameter("password", "password")
.addParameter("name", "자바지기")
.addParameter("email", "javajigi@slipp.net")
.build();
ResponseEntity<String> response = template().postForEntity("/users", request, String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FOUND);
softly.assertThat(userRepository.findByUserId(userId).isPresent()).isTrue();
softly.assertThat(response.getHeaders().getLocation().getPath()).startsWith("/users");
}
@Test
public void list() throws Exception {
ResponseEntity<String> response = template().getForEntity("/users", String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
log.debug("body : {}", response.getBody());
softly.assertThat(response.getBody()).contains(selfUser().getEmail());
}
@Test
public void updateForm_no_login() throws Exception {
ResponseEntity<String> response = template().getForEntity(String.format("/users/%d/form", selfUser().getId()),
String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}
@Test
public void updateForm_login() throws Exception {
User loginUser = selfUser();
ResponseEntity<String> response = basicAuthTemplate(loginUser)
.getForEntity(String.format("/users/%d/form", loginUser.getId()), String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
softly.assertThat(response.getBody()).contains(selfUser().getEmail());
}
@Test
public void update_no_login() throws Exception {
ResponseEntity<String> response = update(template());
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
log.debug("body : {}", response.getBody());
}
private ResponseEntity<String> update(TestRestTemplate template) throws Exception {
HttpEntity<MultiValueMap<String, Object>> request = HtmlFormDataBuilder.urlEncodedForm()
.put()
.addParameter("password", "test")
.addParameter("name", "자바지기2")
.addParameter("email", "javajigi@slipp.net")
.build();
return template.postForEntity(String.format("/users/%d", selfUser().getId()), request, String.class);
}
@Test
public void update() throws Exception {
ResponseEntity<String> response = update(basicAuthTemplate());
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FOUND);
softly.assertThat(response.getHeaders().getLocation().getPath()).startsWith("/users");
}
@Test
public void loginForm() {
ResponseEntity<String> response = template().getForEntity("/users/login/form", String.class);
softly.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
softly.assertThat(response.getBody()).contains("/users/login");
log.debug("body : {}", response.getBody());
}
}
| [
"javajigi@gmail.com"
] | javajigi@gmail.com |
4fc7f6fd2c34176e3f56b45c16f2c8681abedf80 | 7ec246471da0dddaa1a857adeb879807be64a0d9 | /src/main/java/programmerzamannow/spring/core/ScopeConfiguration.java | 70cc670848d6f3309183c4c178fb5f7c2c52dea2 | [] | no_license | sandipradana/belajar-spring-dasar | 4f92f9b9aa80bfde72d7b520c3bfb5535ed1eae9 | b6405f1646d224f5eac7dafaa7f0aee03b9fe95e | refs/heads/main | 2023-08-24T08:13:30.563412 | 2021-10-07T17:04:00 | 2021-10-07T17:04:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package programmerzamannow.spring.core;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.CustomScopeConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import programmerzamannow.spring.core.data.Bar;
import programmerzamannow.spring.core.data.Foo;
import programmerzamannow.spring.core.scope.DoubletonScope;
@Slf4j
@Configuration
public class ScopeConfiguration {
@Bean
@Scope("prototype")
public Foo foo(){
log.info("Create new Foo");
return new Foo();
}
@Bean
public CustomScopeConfigurer customScopeConfigurer(){
CustomScopeConfigurer configurer = new CustomScopeConfigurer();
configurer.addScope("doubleton", new DoubletonScope());
return configurer;
}
@Bean
@Scope("doubleton")
public Bar bar(){
log.info("Create new Bar");
return new Bar();
}
}
| [
"echo.khannedy@gmail.com"
] | echo.khannedy@gmail.com |
f843a1c64efaf5ee1327cc8dbfa0d35a3b157994 | 29196e2d4adfb14ddd7c2ca8c1e60f8c10c26dad | /src/main/java/it/csi/appjwebsrv/business/package-info.java | 90915c51580a29813ba54f7db37d8f9a661938f7 | [] | no_license | unica-open/siacbilitf | bbeef5ceca40e9fb83d5b1176e7f54e8d84592bf | 85f3254c05c719a0016fe55cea1a105bcb6b89b2 | refs/heads/master | 2021-01-06T14:51:17.786934 | 2020-03-03T13:27:47 | 2020-03-03T13:27:47 | 241,366,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 219 | java | /*
*SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte
*SPDX-License-Identifier: EUPL-1.2
*/
@javax.xml.bind.annotation.XmlSchema(namespace = "http://business.appjwebsrv.csi.it/")
package it.csi.appjwebsrv.business;
| [
"barbara.malano@csi.it"
] | barbara.malano@csi.it |
0694a18161404a334109b599ff291328e41858dd | 6b4cdc6e5c461ed4ab0490de5a0e7e66a6a7d26f | /OpaArchLib/src/main/java/gov/nara/opa/common/valueobject/export/AccountExportStatusValueObject.java | 811e95b6a57ed1315a1f7253f0102a32177f0a48 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | usnationalarchives/catalog-source | c281dd2963cc204313202c7d9bc2b4e5a942f089 | 74187b9096a388c033ff1f5ca4ec6634b5bba69e | refs/heads/master | 2022-12-23T10:25:40.725697 | 2018-10-01T14:34:56 | 2018-10-01T14:34:56 | 151,100,359 | 5 | 0 | NOASSERTION | 2022-12-16T01:33:10 | 2018-10-01T14:15:31 | Java | UTF-8 | Java | false | false | 3,034 | java | package gov.nara.opa.common.valueobject.export;
import gov.nara.opa.architecture.web.validation.AbstractRequestParameters;
import gov.nara.opa.architecture.web.valueobject.AbstractWebEntityValueObject;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* The main reason this class was added is to allow for
* faster retrieval of account export status information w/o the need to
* populate all fields from the table on every single getAccountStatus
* request
*/
public class AccountExportStatusValueObject extends
AbstractWebEntityValueObject implements AccountExportValueObjectConstants {
private AccountExportStatusEnum requestStatus;
private String errorMessage;
private Integer totalRecordsToBeProcessed;
private Integer totalRecordsProcessed;
private String url;
private Integer accountId;
private Integer exportId;
public AccountExportStatusEnum getRequestStatus() {
return requestStatus;
}
public void setRequestStatus(AccountExportStatusEnum requestStatus) {
this.requestStatus = requestStatus;
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Integer getTotalRecordsToBeProcessed() {
return totalRecordsToBeProcessed;
}
public void setTotalRecordsToBeProcessed(Integer totalRecordsToBeProcessed) {
this.totalRecordsToBeProcessed = totalRecordsToBeProcessed;
}
public Integer getTotalRecordsProcessed() {
return totalRecordsProcessed;
}
public void setTotalRecordsProcessed(Integer totalRecordsProcessed) {
this.totalRecordsProcessed = totalRecordsProcessed;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public Map<String, Object> getDatabaseContent() {
// TODO Auto-generated method stub
return null;
}
@Override
public LinkedHashMap<String, Object> getAspireObjectContent(String action) {
LinkedHashMap<String, Object> aspireContent = new LinkedHashMap<String, Object>();
aspireContent.put(EXPORT_ID_ASP, getExportId());
aspireContent.put(EXPORT_STATUS_ASP, getRequestStatus());
aspireContent.put(EXPORT_DOWNLOAD_URL_ASP, AccountExportValueObjectHelper
.getDownloadUrl(getExportId(), getAccountId(),
AbstractRequestParameters.INTERNAL_API_TYPE, getUrl()));
aspireContent.put(EXPORT_PERCENTAGE_COMPLETE_ASP,
AccountExportValueObjectHelper.getPercentageComplete(
getTotalRecordsToBeProcessed(), getTotalRecordsProcessed()));
if (getErrorMessage() != null) {
aspireContent.put(EXPORT_ERROR_MESSAGE_ASP, getErrorMessage());
}
return aspireContent;
}
public Integer getAccountId() {
return accountId;
}
public void setAccountId(Integer accountId) {
this.accountId = accountId;
}
public Integer getExportId() {
return exportId;
}
public void setExportId(Integer exportId) {
this.exportId = exportId;
}
}
| [
"jason.clingerman@nara.gov"
] | jason.clingerman@nara.gov |
ad99519898984755f7d7f21ce8e8186f7eb23a44 | 385340c9e6ecd942b01d20e335307c1462ecb1b5 | /TeraGame/src/main/java/com/angelis/tera/game/models/creature/Monster.java | d63d830c17b25b73fc75bcc38fa7e96f64c4304f | [] | no_license | simon96523/jenova-project | 2beefdff505458df523da94a6fa51b823d6f0186 | 07169c83790188eb82ad34352a34fb5cb8e7fdf6 | refs/heads/master | 2021-01-15T23:20:55.970410 | 2014-07-16T13:31:08 | 2014-07-16T13:31:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | package com.angelis.tera.game.models.creature;
public class Monster extends TeraCreature {
public Monster(final Integer id) {
super(id);
}
public Monster(final Monster monster) {
super(monster);
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof Monster)) {
return false;
}
return true;
}
}
| [
"mm.chyla@gmail.com"
] | mm.chyla@gmail.com |
dd4295f7cb3560cb926f34ad2286491a16b32433 | 518bf342bc4138982af3e2724e75f1d9ca3ba56c | /solutions/2739. Total Distance Traveled/2739.java | e929cc7f82254285ab078b497ea90846183469fc | [
"MIT"
] | permissive | walkccc/LeetCode | dae85af7cc689882a84ee5011f0a13a19ad97f18 | a27be41c174565d365cbfe785f0633f634a01b2a | refs/heads/main | 2023-08-28T01:32:43.384999 | 2023-08-20T19:00:45 | 2023-08-20T19:00:45 | 172,231,974 | 692 | 302 | MIT | 2023-08-13T14:48:42 | 2019-02-23T15:46:23 | C++ | UTF-8 | Java | false | false | 233 | java | class Solution {
public int distanceTraveled(int mainTank, int additionalTank) {
// M M M M M A M M M M A
// 1 [2 3 4 5] 6 [7 8 9 10] 11
return (mainTank + Math.min((mainTank - 1) / 4, additionalTank)) * 10;
}
}
| [
"me@pengyuc.com"
] | me@pengyuc.com |
8933945d5d7ae8dad55d42e890aee85e290be196 | dc41ef318c2b30b977f0d2ed7a0af5ddf31eaf99 | /joker-engine/src/test/java/cs/bilkent/joker/engine/pipeline/impl/downstreamtuplesender/DownstreamTupleSendersTest.java | 327d11eecb6cdfd8e1b4ccbee40c48b62bc62b54 | [] | no_license | serkan-ozal/joker | 67cf0e498f68e8a31c1aea4f79bce6066dca15b6 | 99df637a4fa645819a24c281fbe87d33d92dfbe8 | refs/heads/master | 2020-12-03T07:54:20.793391 | 2017-06-22T20:50:07 | 2017-06-22T20:50:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,391 | java | package cs.bilkent.joker.engine.pipeline.impl.downstreamtuplesender;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import cs.bilkent.joker.engine.exception.JokerException;
import cs.bilkent.joker.engine.pipeline.DownstreamTupleSenderFailureFlag;
import cs.bilkent.joker.engine.tuplequeue.OperatorTupleQueue;
import cs.bilkent.joker.operator.Tuple;
import cs.bilkent.joker.operator.impl.TuplesImpl;
import cs.bilkent.joker.test.AbstractJokerTest;
import static java.util.Collections.singletonList;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith( MockitoJUnitRunner.class )
public class DownstreamTupleSendersTest extends AbstractJokerTest
{
private final DownstreamTupleSenderFailureFlag failureFlag = new DownstreamTupleSenderFailureFlag();
private final TuplesImpl tuples = new TuplesImpl( 10 );
@Mock
private OperatorTupleQueue operatorTupleQueue;
private int sourcePortIndex1 = 1, sourcePortIndex2 = 2, sourcePortIndex3 = 3, sourcePortIndex4 = 4;
private int destinationPortIndex1 = 4, destinationPortIndex2 = 3, destinationPortIndex3 = 2, destinationPortIndex4 = 1;
@Test
public void testDownstreamTupleSender1 ()
{
sendViaDownstreamTupleSender1( 1 );
}
@Test( expected = JokerException.class )
public void testDownstreamTupleSender1FailureWhenFailureFlagIsSet ()
{
failureFlag.setFailed();
sendViaDownstreamTupleSender1( 0 );
}
private void sendViaDownstreamTupleSender1 ( final int offerResult )
{
final DownstreamTupleSender1 tupleSender = new DownstreamTupleSender1( failureFlag,
sourcePortIndex1,
destinationPortIndex1,
operatorTupleQueue );
addTuple( "key", "val", sourcePortIndex1 );
setMock( sourcePortIndex1, destinationPortIndex1, offerResult );
tupleSender.send( tuples );
verifyMock( "key", "val", destinationPortIndex1 );
}
@Test
public void testDownstreamTupleSenderN ()
{
sendViaDownstreamTupleSenderN( 1 );
}
@Test( expected = JokerException.class )
public void testDownstreamTupleSenderNFailureWhenFailureFlagIsSet ()
{
failureFlag.setFailed();
sendViaDownstreamTupleSenderN( 0 );
}
private void sendViaDownstreamTupleSenderN ( final int offerResult )
{
final DownstreamTupleSenderN tupleSender = new DownstreamTupleSenderN( failureFlag,
new int[] { sourcePortIndex1,
sourcePortIndex2,
sourcePortIndex3,
sourcePortIndex4 },
new int[] { destinationPortIndex1,
destinationPortIndex2,
destinationPortIndex3,
destinationPortIndex4 },
operatorTupleQueue );
addTuple( "key1", "val", sourcePortIndex1 );
addTuple( "key2", "val", sourcePortIndex2 );
addTuple( "key3", "val", sourcePortIndex3 );
addTuple( "key4", "val", sourcePortIndex4 );
setMock( sourcePortIndex1, destinationPortIndex1, offerResult );
setMock( sourcePortIndex2, destinationPortIndex2, offerResult );
setMock( sourcePortIndex3, destinationPortIndex3, offerResult );
setMock( sourcePortIndex4, destinationPortIndex4, offerResult );
tupleSender.send( tuples );
verifyMock( "key1", "val", destinationPortIndex1 );
verifyMock( "key2", "val", destinationPortIndex2 );
verifyMock( "key3", "val", destinationPortIndex3 );
verifyMock( "key4", "val", destinationPortIndex4 );
}
private void addTuple ( final String key, final Object val, final int sourcePortIndex )
{
final Tuple tuple = new Tuple();
tuple.set( key, val );
tuples.add( sourcePortIndex, tuple );
}
private void setMock ( final int sourcePortIndex, final int destinationPortIndex, final int offerResult )
{
when( operatorTupleQueue.offer( destinationPortIndex,
tuples.getTuplesModifiable( sourcePortIndex ),
0 ) ).thenReturn( offerResult );
}
private void verifyMock ( final String key, final Object val, final int destinationPortIndex )
{
final Tuple expected = new Tuple();
expected.set( key, val );
verify( operatorTupleQueue ).offer( destinationPortIndex, singletonList( expected ), 0 );
}
}
| [
"ebkahveci@gmail.com"
] | ebkahveci@gmail.com |
f9f6750e4c7648bd07c5e98fe49b3583af5d2468 | 812dc434dea3b4c718027c6dde1858f0fc966e79 | /app/src/main/java/com/quinn/githubknife/model/GithubService.java | 41c5c01dc8770f9bc341e819eedf234d0deb2e5b | [
"Apache-2.0"
] | permissive | hai8108/WeGit | 705cb26cd17ebc24fc9a1cac45da406f830db965 | f113aea25f2ed6e0a5497076557e4ec1e3ec71ff | refs/heads/master | 2021-01-17T08:52:16.495327 | 2015-11-17T12:56:19 | 2015-11-17T12:56:19 | 46,398,870 | 1 | 0 | null | 2015-11-18T06:06:32 | 2015-11-18T06:06:31 | null | UTF-8 | Java | false | false | 4,626 | java | package com.quinn.githubknife.model;
import com.quinn.httpknife.github.Branch;
import com.quinn.httpknife.github.Empty;
import com.quinn.httpknife.github.Event;
import com.quinn.httpknife.github.RepoSearch;
import com.quinn.httpknife.github.Repository;
import com.quinn.httpknife.github.Token;
import com.quinn.httpknife.github.Tree;
import com.quinn.httpknife.github.User;
import com.quinn.httpknife.github.UserSearch;
import org.json.JSONObject;
import java.util.List;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.DELETE;
import retrofit.http.GET;
import retrofit.http.Header;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Path;
import retrofit.http.Query;
/**
* Created by Quinn on 10/10/15.
*/
public interface GithubService{
// Api about token
@POST("authorizations")
Call<Token> createToken(@Body JSONObject json,@Header("Authorization") String authorization) ;
@GET("authorizations")
Call<List<Token>>listToken(@Header("Authorization") String authorization) ;
@DELETE("authorizations/{id}")
Call<Empty> removeToken(@Header("Authorization") String authorization, @Path("id") String id) ;
//public void removeToken(String username, String password) throws GithubError, AuthError;
//Api about user
@GET("/user")
Call<User> authUser();
@GET("/users/{username}")
Call<User> user(@Path("username") String username);
@GET("/users/{user}/following?per_page=10")
Call<List<User>> follwerings(@Path("user") String user,@Query("page") String page);
@GET("/users/{user}/followers?per_page=10")
Call<List<User>> followers(@Path("user") String user,@Query("page") String page);
@GET("/users/{user}/repos?sort=pushed&per_page=10")
Call<List<Repository>> userRepo(@Path("user") String user,@Query("page") String page);
@GET("/users/{user}/starred?per_page=10")
Call<List<Repository>> starredRepo(@Path("user") String user,@Query("page") String page);
@GET("/users/{user}/events/public?per_page=10")
Call<List<Event>> publicEvent(@Path("user") String user,@Query("page") String page);
@GET("/users/{user}/received_events?per_page=10")
Call<List<Event>> receivedEvent(@Path("user") String user,@Query("page") String page);
@GET("/user/starred/{owner}/{repo}")
Call<Empty> hasStar(@Path("owner") String owner, @Path("repo") String repo);
@PUT("/user/starred/{owner}/{repo}")
Call<Empty> star(@Path("owner") String owner, @Path("repo") String repo);
@DELETE("/user/starred/{owner}/{repo}")
Call<Empty> unStar(@Path("owner") String owner, @Path("repo") String repo);
//Get count of starred repo of someone
@GET("/users/{user}/starred?&per_page=1")
Call<List<Repository>> starredCount(@Path("user") String user);
//Api about repo
@GET("/repos/{owner}/{repo}/stargazers?&per_page=10")
Call<List<User>> stargazers(@Path("owner") String owner, @Path("repo") String repo,@Query("page") String page);
@GET("/repos/{owner}/{repo}/forks?&per_page=10")
Call<List<User>> forkers(@Path("owner") String owner, @Path("repo") String repo,@Query("page") String page);
@GET("/repos/{owner}/{repo}/collaborators?&per_page=10")
Call<List<User>> collaborators(@Path("owner") String owner, @Path("repo") String repo,@Query("page") String page);
@GET("/repos/{owner}/{repo}/branches")
Call<List<Branch>> getBranches(@Path("owner") String owner, @Path("repo") String repo);
@GET("/repos/{owner}/{repo}/git/trees/{sha}?&per_page=10")
Call<Tree> getTree(@Path("owner") String owner, @Path("repo") String repo,@Path("sha") String sha);
@GET("/repos/{owner}/{repo}/forks")
Call<List<Repository>> fork(@Path("owner") String owner, @Path("repo") String repo);
@GET("/repos/{owner}/{repo}/contents/{path}")
Call<String> getRawContent(@Path("owner") String owner, @Path("repo") String repo,@Path("path") String path);
//Api about search
@GET("/search/users?&perpage=10")
Call<UserSearch> searchUser(@Query("q") String q, @Query("page") String page);
@GET("/search/repositories?&per_page=10")
Call<RepoSearch> searchRepo(@Query("q") String q, @Query("page") String page);
//==========
//Api about user-user relation
//==========
@GET("/user/following/{username}")
Call<Empty> hasFollow(@Path("username") String username);
@PUT("/user/following/{username}")
Call<Empty> follow(@Path("username") String username);
@DELETE("/user/following/{username}")
Call<Empty> unFollow(@Path("username") String username);
}
| [
"chenhuazhaoao@gmail.com"
] | chenhuazhaoao@gmail.com |
825f0f8b495d460a996318c530f74e1e25a4199d | 341ed102cd8c2e7ab9e07af58daed3c28253c1c9 | /SistemaFat/SistemaFaturamento/src/gcom/cadastro/empresa/RepositorioEmpresaHBM.java | ff02997609aa392de4ebf54da2fbfd916d072982 | [] | no_license | Relesi/Stream | a2a6772c4775a66a753d5cc830c92f1098329270 | 15710d5a2bfb5e32ff8563b6f2e318079bcf99d5 | refs/heads/master | 2021-01-01T17:40:52.530660 | 2017-08-21T22:57:02 | 2017-08-21T22:57:02 | 98,132,060 | 2 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,153 | java | /*
* Copyright (C) 2007-2007 the GSAN - Sistema Integrado de Gestão de Serviços de Saneamento
*
* This file is part of GSAN, an integrated service management system for Sanitation
*
* GSAN is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* GSAN is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/*
* GSAN - Sistema Integrado de Gestão de Serviços de Saneamento
* Copyright (C) <2007>
* Adriano Britto Siqueira
* Alexandre Santos Cabral
* Ana Carolina Alves Breda
* Ana Maria Andrade Cavalcante
* Aryed Lins de Araújo
* Bruno Leonardo Rodrigues Barros
* Carlos Elmano Rodrigues Ferreira
* Cláudio de Andrade Lira
* Denys Guimarães Guenes Tavares
* Eduardo Breckenfeld da Rosa Borges
* Fabíola Gomes de Araújo
* Flávio Leonardo Cavalcanti Cordeiro
* Francisco do Nascimento Júnior
* Homero Sampaio Cavalcanti
* Ivan Sérgio da Silva Júnior
* José Edmar de Siqueira
* José Thiago Tenório Lopes
* Kássia Regina Silvestre de Albuquerque
* Leonardo Luiz Vieira da Silva
* Márcio Roberto Batista da Silva
* Maria de Fátima Sampaio Leite
* Micaela Maria Coelho de Araújo
* Nelson Mendonça de Carvalho
* Newton Morais e Silva
* Pedro Alexandre Santos da Silva Filho
* Rafael Corrêa Lima e Silva
* Rafael Francisco Pinto
* Rafael Koury Monteiro
* Rafael Palermo de Araújo
* Raphael Veras Rossiter
* Roberto Sobreira Barbalho
* Rodrigo Avellar Silveira
* Rosana Carvalho Barbosa
* Sávio Luiz de Andrade Cavalcante
* Tai Mu Shih
* Thiago Augusto Souza do Nascimento
* Tiago Moreno Rodrigues
* Vivianne Barbosa Sousa
*
* Este programa é software livre; você pode redistribuí-lo e/ou
* modificá-lo sob os termos de Licença Pública Geral GNU, conforme
* publicada pela Free Software Foundation; versão 2 da
* Licença.
* Este programa é distribuído na expectativa de ser útil, mas SEM
* QUALQUER GARANTIA; sem mesmo a garantia implícita de
* COMERCIALIZAÇÃO ou de ADEQUAÇÃO A QUALQUER PROPÓSITO EM
* PARTICULAR. Consulte a Licença Pública Geral GNU para obter mais
* detalhes.
* Você deve ter recebido uma cópia da Licença Pública Geral GNU
* junto com este programa; se não, escreva para Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
package gcom.cadastro.empresa;
import gcom.util.ErroRepositorioException;
import gcom.util.HibernateUtil;
import java.util.Collection;
import org.hibernate.HibernateException;
import org.hibernate.Session;
/**
* < <Descrição da Classe>>
*
* @author Sávio Luiz
*/
public class RepositorioEmpresaHBM implements IRepositorioEmpresa {
private static IRepositorioEmpresa instancia;
/**
* Construtor da classe RepositorioFaturamentoHBM
*/
private RepositorioEmpresaHBM() {
}
/**
* Retorna o valor de instance
*
* @return O valor de instance
*/
public static IRepositorioEmpresa getInstancia() {
if (instancia == null) {
instancia = new RepositorioEmpresaHBM();
}
return instancia;
}
/**
* Pesquisa as empresas que serão processadas no emitir contas
*
* @author Sávio Luiz
* @date 09/01/2007
*
*/
public Collection pesquisarIdsEmpresa()
throws ErroRepositorioException{
Collection retorno = null;
Session session = HibernateUtil.getSession();
String consulta;
try {
consulta = "select emp.id from Empresa emp order by emp.id";
retorno = session.createQuery(consulta).list();
} catch (HibernateException e) {
// levanta a exceção para a próxima camada
throw new ErroRepositorioException(e, "Erro no Hibernate");
} finally {
// fecha a sessão
HibernateUtil.closeSession(session);
}
return retorno;
}
} | [
"renatolessa.2011@hotmail.com"
] | renatolessa.2011@hotmail.com |
17387741d5ba2115b6da0a38b69313597fe5056e | 66c766517e47b855af27641ed1334e1e3576922b | /car-server/web/CarEyeApi/src/com/careye/taxi/domain/IntercomGroupSearch.java | 7171335a38219e5b8b49c5c1b9d65d3a56a685c5 | [] | no_license | vincenlee/Car-eye-server | 21a6c2eda0fd3f096c842fdae6eea4c5af84d22e | 47f45a0596fddf65cda6fb7cf657aa716244e5b5 | refs/heads/master | 2022-05-04T22:09:50.411646 | 2018-09-28T08:03:03 | 2018-09-28T08:03:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,692 | java | package com.careye.taxi.domain;
/**
*
* @项目名称:car-eye
* @类名称:
* @类描述:
* @创建人:ll
* @创建时间:2016-5-5 下午02:03:36
* @修改人:ll
* @修改时间:2016-5-5 下午02:03:36
* @修改备注:
* @version 1.0
*/
public class IntercomGroupSearch {
/****/
private Integer id;
/**车辆id**/
private Integer carid;
private String carnumber;
/**组名称**/
private String name;
/**描述**/
private String remark;
/**创建时间**/
private String createtime;
/**是否为组成员(0否 1是)**/
private Integer isMember;
private String lng;
private String lat;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCarid() {
return carid;
}
public void setCarid(Integer carid) {
this.carid = carid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCreatetime() {
return createtime;
}
public void setCreatetime(String createtime) {
this.createtime = createtime;
}
public Integer getIsMember() {
return isMember;
}
public void setIsMember(Integer isMember) {
this.isMember = isMember;
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng;
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat;
}
public String getCarnumber() {
return carnumber;
}
public void setCarnumber(String carnumber) {
this.carnumber = carnumber;
}
}
| [
"dengtieshan@shenghong-technology.com"
] | dengtieshan@shenghong-technology.com |
196a492ba5c6d574c2f8baef136cc13bbe0c0217 | 29ffa425a2773c0e891e26ee71233d4f66b4f26d | /src/main/java/lekcja5/program1/Program4.java | e5bc7cf25d83693907ec0b0ff7c0f1a9023092e6 | [] | no_license | 1Anina1/project | 927487d9c0c3e223332bb3347bde0ecdc4cc8607 | 4863d84c69115b1ce466f481a99a51af9f7f96d2 | refs/heads/master | 2020-05-31T17:39:54.290916 | 2015-01-21T19:18:33 | 2015-01-21T19:18:33 | 28,411,067 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 827 | java | package lekcja5.program1;
import java.util.Arrays;
/**
* Obliczenia na tablicach
* Author: Amina
*/
public class Program4 {
public static void main(String[] args){
String[] textsArray = new String[3];
String startsWith = "To jest pierwszy";
textsArray[0] = "To jest pierwszy napis";
textsArray[1] = "To jest drugi napis";
textsArray[2] = "To jest trzeci napis";
Words words = new Words();
System.out.println(Arrays.toString(textsArray));
int howManyTextesStartWith = words.howManyWordsStartWith(textsArray, startsWith);
System.out.println("howManyTextesStartWith = " + howManyTextesStartWith);
int howManyCharacters = words.countCharacters(textsArray);
System.out.println("howManyCharacters = " + howManyCharacters);
}
} | [
"michalskidaniel2@gmail.com"
] | michalskidaniel2@gmail.com |
d1236662c838a757ea45fde1ed97e97fd63bd084 | fcaa2e6917b068dd51885a9f59330f6a277fe9cd | /src/main/java/cn/xuetang/common/shiro/realm/CaptchaUsernamePasswordToken.java | 1ec245585508c93772f091b66a6a76a94b97e015 | [] | no_license | pengyq/NutzWx | 2708bca95f8fb50fd2f30c73e944eedae152ab6c | 0805990e65945113f0a674a24c168f7ad202271a | refs/heads/master | 2021-01-17T04:50:49.023856 | 2014-09-29T08:19:05 | 2014-09-29T08:19:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 609 | java | package cn.xuetang.common.shiro.realm;
import org.apache.shiro.authc.UsernamePasswordToken;
public class CaptchaUsernamePasswordToken extends UsernamePasswordToken {
private static final long serialVersionUID = 4676958151524148623L;
private String captcha;
public String getCaptcha() {
return captcha;
}
public void setCaptcha(String captcha) {
this.captcha = captcha;
}
public CaptchaUsernamePasswordToken(String username, String password, boolean rememberMe, String host, String captcha) {
super(username, password, rememberMe, host);
this.captcha = captcha;
}
}
| [
"koukou890@qq.com"
] | koukou890@qq.com |
a0e1f64458b91df97512960c8e1c11e0e24cec27 | 251861f3124c2b5c842c56470a240a88d1f0195d | /spf4j-core/src/main/java/org/spf4j/base/CheckedRunnable.java | 109e1e1f8bfe5b8d3238786601c53b2d3ffb3a06 | [] | no_license | zolyfarkas/spf4j | b8cc01ec017e2d422ef77bac546ce589ab76bc1c | 646004f6ce4a51c164a7736fd96ec788c57b3a5c | refs/heads/master | 2023-08-06T10:21:44.343987 | 2022-12-08T16:58:46 | 2023-07-15T18:06:39 | 7,158,649 | 197 | 40 | null | 2023-07-15T18:06:41 | 2012-12-14T02:06:21 | Java | UTF-8 | Java | false | false | 1,928 | java | /*
* Copyright (c) 2001-2017, Zoltan Farkas All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Additionally licensed with:
*
* 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.spf4j.base;
/**
*
* @author zoly
*/
public abstract class CheckedRunnable<EX extends Exception> extends AbstractRunnable {
public CheckedRunnable(final boolean lenient, final String threadName) {
super(lenient, threadName);
}
public CheckedRunnable(final boolean lenient) {
super(lenient);
}
public CheckedRunnable() {
}
public CheckedRunnable(final String threadName) {
super(threadName);
}
@Override
public abstract void doRun() throws EX;
}
| [
"zolyfarkas@yahoo.com"
] | zolyfarkas@yahoo.com |
820f8f581101aff2b3a8d389d5a044278010169b | 1a821ede149274a5d2fba89620fdd383f288b676 | /personal-web-project/src/main/java/proxy/proxy/RealSubject.java | d60e7b759d720915f809093ec6168744c30f03ef | [] | no_license | liubao19860416/personal-web-project | ce58fe52c779fc742de367028951f1a8401b58ac | 337de5a05551376051a5d751ba094e5ef4341022 | refs/heads/master | 2021-01-10T08:44:41.141554 | 2016-04-09T06:56:53 | 2016-04-09T06:56:53 | 44,898,562 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 199 | java | package proxy.proxy;
public class RealSubject extends Subject {
public RealSubject() {
}
public void request() {
System.out.println("From real subject.");
}
}
| [
"18611478781@163.com"
] | 18611478781@163.com |
1265969ecc9097327d43ba2298e14011972a9293 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/13/13_690d2d7375ebe51fa2926ecd3d540f1e7feb4552/MainRenderer/13_690d2d7375ebe51fa2926ecd3d540f1e7feb4552_MainRenderer_t.java | 087784c34ff60cecf090ddf6258ec775ce221ad6 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,928 | java | package com.benjaminlanders.sloth.renderer;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.benjaminlanders.sloth.SlothMain;
import com.benjaminlanders.sloth.controller.Controller;
import com.benjaminlanders.sloth.helper.Assets;
import com.benjaminlanders.sloth.model.Block;
/**
* Currently a test bed for graphics
* @author Benjamin Landers
*/
public class MainRenderer extends Renderer
{
ShapeRenderer debugRenderer;
public Animator animator;
TextureRegion currentFrame;
float stateTime = 0;
AnimationUnit[] frameUpdater = new AnimationUnit[6];
GraphicEntity entity;
GraphicCharacter player;
Controller controller;
boolean debug =false;
BitmapFont font = new BitmapFont();
public MainRenderer(SpriteBatch batch, SlothMain reference)
{
super(batch, reference);
frameUpdater[0] = new AnimationUnit(0,Animation.NORMAL,Assets.bodyAnim,0,0,true);
entity = new GraphicEntity(frameUpdater);
animator = new Animator();
player = new GraphicCharacter(animator, Assets.bodyAnim, Assets.armAnim, Assets.climbAnim);
controller = new Controller();
debugRenderer = new ShapeRenderer();
}
@Override
public void render(float delta)
{
stateTime += delta;
controller.update();
batch.draw(Assets.getImage(Assets.background), 0,0, SlothMain.width, SlothMain.height);
// currentFrame = Assets.animations[Assets.legsAnim].getKeyFrame(stateTime, true);
animator.render(stateTime);
//player.update(stateTime);
player.left = controller.player.left;
if(controller.player.climbing&&controller.player.y > player.y)
{
player.climb();
}else
if(!(controller.player.walking && controller.player.moving))
{
player.walk();
}else
{
player.stand();
player.units[1].frame = Assets.getAnimation(Assets.armAnim).getKeyFrame(.15f);
player.units[2].frame = Assets.getAnimation(Assets.bodyAnim).getKeyFrame(.001f);
player.units[3].frame = Assets.getAnimation(Assets.armAnim).getKeyFrame(.001f);
}
player.x = controller.player.x;
player.y = controller.player.y;
//player.render(batch);
for(Block block:controller.world.blocks)
{
batch.draw(Assets.getImage(Assets.rock),block.x*SlothMain.width,block.y*SlothMain.height,
block.width*SlothMain.width,block.height*SlothMain.height);
}
for(Block block:controller.world.vines)
{
batch.draw(Assets.getImage(Assets.vine),block.x*SlothMain.width,block.y*SlothMain.height,
block.width*SlothMain.width,block.height*SlothMain.height);
}
player.render(batch);
//entity.render(batch);
//Graphics.draw(batch, Assets.getAnimation(Assets.bodyAnim).getKeyFrame(stateTime, true), .4f, .3f, .1f, 0, true);
//font.draw(batch, "" + Gdx.graphics.getFramesPerSecond(), 400, 300);
batch.end();
if(debug)
{
debugRenderer.begin(ShapeRenderer.ShapeType.Rectangle);
debugRenderer.setColor(Color.RED);
for(Block block:controller.world.blocks)
{
debugRenderer.rect(block.x*SlothMain.width, block.y*SlothMain.height, block.width*SlothMain.width, block.height*SlothMain.height);
}
debugRenderer.setColor(Color.GREEN);
for(Block vine:controller.world.vines)
{
debugRenderer.rect(vine.x*SlothMain.width, vine.y*SlothMain.height, vine.width*SlothMain.width, vine.height*SlothMain.height);
}
//debugRenderer.rect(player.x*SlothMain.width, player.y*SlothMain.height, .1f*player.units[2].frame.getRegionWidth(), .1f*player.units[2].frame.getRegionHeight());
debugRenderer.end();
}
batch.begin();
}
@Override
public boolean isFinished()
{
return false;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1df528f4829a8c34709853bae4eb88d3a07b4e02 | 0cb2a9fa3d0346fed30c9dbc45174af9cfc46f15 | /linkedbicircularview/src/test/java/com/anwesh/uiprojects/linkedbicircularview/ExampleUnitTest.java | 3e0fd3753fc16926a95df2fa2c654e8194e21988 | [] | no_license | Anwesh43/KotlinLinkedBiCircularView | fa022e0ecb4b715ac0125d8c9d179beb58a9bce9 | 267629f619b061e9551de423b4705ad04cbee450 | refs/heads/master | 2020-03-19T13:11:32.066706 | 2018-06-08T04:35:31 | 2018-06-08T04:35:31 | 136,566,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package com.anwesh.uiprojects.linkedbicircularview;
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);
}
} | [
"anweshthecool0@gmail.com"
] | anweshthecool0@gmail.com |
d73994692eade0f964d3665407c76d3436d71889 | 922993618092ccb0c3b4ea389d55e76c7647e00f | /ZWBH-Android/app/src/main/java/com/ruitukeji/zwbh/main/cargoinformation/FillCargoReceiptFormContract.java | 2fdcd86b1b4e940d8b17fb4908bd7bc41008aa91 | [
"Apache-2.0"
] | permissive | 921668753/wztx-shipper-android | 6235f74f79a2afdb8f16cef9a5951ede58aa0168 | 73946a321e065c6d2ed4bd60d09912f058c606e9 | refs/heads/master | 2021-09-10T15:26:37.450248 | 2018-03-28T12:20:58 | 2018-03-28T12:20:58 | 113,812,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package com.ruitukeji.zwbh.main.cargoinformation;
import com.ruitukeji.zwbh.common.BaseNewView;
import com.ruitukeji.zwbh.common.BasePresenter;
/**
* Created by Administrator on 2017/2/15.
*/
public interface FillCargoReceiptFormContract {
interface Presenter extends BasePresenter {
/**
* 填写货物签收单
*/
void postFillCargoReceiptForm(String contactPerson, String contactInformation, String inArea, String detailedAddressInformation, int expressDelivery);
}
interface View extends BaseNewView<Presenter, String> {
}
}
| [
"921668753@qq.com"
] | 921668753@qq.com |
52095180b31b3c6bed0e1376c9602f02197443bf | 87ffe6cef639e2b96b8d5236b5ace57e16499491 | /app/src/main/java/u/aly/as$c.java | 86e2e1834c22becfe4a414acd66037ad4664c73d | [] | no_license | leerduo/FoodsNutrition | 24ffeea902754b84a2b9fbd3299cf4fceb38da3f | a448a210e54f789201566da48cc44eceb719b212 | refs/heads/master | 2020-12-11T05:45:34.531682 | 2015-08-28T04:35:05 | 2015-08-28T04:35:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,074 | java | package u.aly;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
class as$c
extends dj<as>
{
public void a(cy paramcy, as paramas)
{
de localde = (de)paramcy;
localde.a(paramas.a.size());
Iterator localIterator1 = paramas.a.entrySet().iterator();
while (localIterator1.hasNext())
{
Map.Entry localEntry = (Map.Entry)localIterator1.next();
localde.a((String)localEntry.getKey());
((ar)localEntry.getValue()).b(localde);
}
BitSet localBitSet = new BitSet();
if (paramas.c()) {
localBitSet.set(0);
}
if (paramas.d()) {
localBitSet.set(1);
}
localde.a(localBitSet, 2);
if (paramas.c())
{
localde.a(paramas.b.size());
Iterator localIterator2 = paramas.b.iterator();
while (localIterator2.hasNext()) {
((aq)localIterator2.next()).b(localde);
}
}
if (paramas.d()) {
localde.a(paramas.c);
}
}
public void b(cy paramcy, as paramas)
{
int i = 0;
de localde = (de)paramcy;
cv localcv = new cv((byte)11, (byte)12, localde.s());
paramas.a = new HashMap(2 * localcv.c);
for (int j = 0; j < localcv.c; j++)
{
String str = localde.v();
ar localar = new ar();
localar.a(localde);
paramas.a.put(str, localar);
}
paramas.a(true);
BitSet localBitSet = localde.b(2);
if (localBitSet.get(0))
{
cu localcu = new cu((byte)12, localde.s());
paramas.b = new ArrayList(localcu.b);
while (i < localcu.b)
{
aq localaq = new aq();
localaq.a(localde);
paramas.b.add(localaq);
i++;
}
paramas.b(true);
}
if (localBitSet.get(1))
{
paramas.c = localde.v();
paramas.c(true);
}
}
}
/* Location: D:\15036015\反编译\shiwuku\classes_dex2jar.jar
* Qualified Name: u.aly.as.c
* JD-Core Version: 0.7.0-SNAPSHOT-20130630
*/ | [
"1060221762@qq.com"
] | 1060221762@qq.com |
0938c434d5fb68face2ad21605668209a990bce1 | 866f02270d0b2c91194b2ca037e4fd41cf897ab4 | /OldTests/src/test/java/com/tle/webtests/remotetest/integration/moodle/tests/MoodleCALTest.java | 65f62ee50f0d36b47101764551d771a3f004dd16 | [] | no_license | cbeach47/equella-autotests | 3ebe82ab984240431bd22ef50530960235a8e001 | f5698103e681a08cd5f5cfab15af04c89404f2dd | refs/heads/master | 2021-01-21T23:21:05.328860 | 2017-06-22T04:48:58 | 2017-06-22T04:49:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,095 | java | package com.tle.webtests.remotetest.integration.moodle.tests;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.tle.webtests.framework.URLUtils;
import com.tle.webtests.pageobject.DynamicUrlPage;
import com.tle.webtests.pageobject.cal.ActivationsSummaryPage;
import com.tle.webtests.pageobject.cal.CALActivatePage;
import com.tle.webtests.pageobject.cal.CALSummaryPage;
import com.tle.webtests.pageobject.integration.moodle.MoodleCoursePage;
import com.tle.webtests.pageobject.integration.moodle.MoodleLoginPage;
import com.tle.webtests.pageobject.integration.moodle.MoodleResourcePage;
import com.tle.webtests.pageobject.integration.moodle.MoodleSelectionPage;
import com.tle.webtests.pageobject.searching.ItemListPage;
import com.tle.webtests.pageobject.selection.SelectionSession;
import com.tle.webtests.pageobject.viewitem.SummaryPage;
import com.tle.webtests.remotetest.integration.moodle.AbstractMoodleSectionTest;
public class MoodleCALTest extends AbstractMoodleSectionTest
{
private static final String ATTACHMENT_NAME = "page.html";
private static final String COURSE_NAME = "Test Course 1";
private static final int WEEK = 3;
private static final String CAL_ITEM = "Testable CAL Book - Chapter 1";
private final Map<Integer, String> UUID_MAP = ImmutableMap.<Integer, String> builder()
.put(25, "6b303fe3-9885-47b0-9e0c-0b679a200b20").put(26, "72643609-78e0-4a61-8d78-d5251ed82ff1")
.put(27, "82d9a918-200a-4b67-91f0-404c41d23161").build();
@Test
public void activateThenDelete()
{
MoodleCoursePage coursePage = new MoodleLoginPage(context).load().logon("teacher", "``````")
.clickCourse(COURSE_NAME);
coursePage.setEditing(true);
String itemUuid = UUID_MAP.get(getMoodleVersion());
String itemName = CAL_ITEM + " moodle" + getMoodleVersion();
MoodleSelectionPage moodleSelection = coursePage.selectEquellaResource(WEEK);
SelectionSession selectionSession = moodleSelection.equellaSession();
ItemListPage items = selectionSession.homeExactSearch(itemName);
SummaryPage summary = items.getResultForTitle(itemName, 1).viewSummary();
CALSummaryPage calSummaryPage = summary.cal();
CALActivatePage<CALSummaryPage> activatePage = calSummaryPage.activate(1, ATTACHMENT_NAME);
activatePage.setDates(getNowRange());
activatePage.setCitation("Harvard");
calSummaryPage = activatePage.activate();
coursePage = summary.finishSelecting(coursePage);
Assert.assertTrue(coursePage.hasResource(WEEK, ATTACHMENT_NAME));
MoodleResourcePage resource = coursePage.clickResource(WEEK, ATTACHMENT_NAME);
Assert.assertEquals(resource.getDescription(), ", 'Testable CAL Book - Chapter 1 moodle" + getMoodleVersion()
+ "' in");
Map<String, String[]> params = URLUtils.parseParamUrl(resource.getContentUrl(), context.getBaseUrl());
Assert.assertEquals(params.get("$PATH$")[0], "integ/gen/" + itemUuid + "/1/");
Assert.assertTrue(params.containsKey("cf.act"));
logout();
logon("teacher", "``````");
ActivationsSummaryPage activations = DynamicUrlPage
.load(context.getBaseUrl() + "integ/gen/" + itemUuid + "/1/", new SummaryPage(context)).cal()
.activationsTab();
Assert.assertEquals(activations.getStatus(0), "Active");
coursePage = new MoodleLoginPage(context).load().logon("teacher", "``````").clickCourse(COURSE_NAME);
coursePage.setEditing(true);
coursePage.deleteAllForWeek(WEEK);
activations = DynamicUrlPage
.load(context.getBaseUrl() + "integ/gen/" + itemUuid + "/1/", new SummaryPage(context)).cal()
.activationsTab();
Assert.assertEquals(activations.getStatus(0), "Inactive");
}
@Override
public int getWeek()
{
return WEEK;
}
@Override
public String getCourseName()
{
return COURSE_NAME;
}
protected Date[] getNowRange()
{
return getNowRange(TimeZone.getTimeZone("America/Chicago"));
}
protected Date[] getNowRange(TimeZone zone)
{
return com.tle.webtests.pageobject.generic.component.Calendar.getDateRange(zone, false, false);
}
}
| [
"doolse@gmail.com"
] | doolse@gmail.com |
5c7b563b9b702b0dac5ac210454dd43bc9117527 | 8489fb7190fb28db8fefb11773f33c33d3827760 | /_src/S2/VotingSystem - Part 4/src/main/java/com/eduonix/votingsystem/VotingSystemApplication.java | 20f9364bc7946ab0f46179ca28729d8dae4e05d3 | [
"Apache-2.0"
] | permissive | paullewallencom/java-978-1-7893-4177-5 | a5a6337c903feb724f7e5ab447a1a7b1a3d8b86a | 8a06c40b0893c20ec180541ba4c4b25ad8134dd6 | refs/heads/main | 2023-02-06T17:44:03.369161 | 2020-12-27T22:17:13 | 2020-12-27T22:17:13 | 319,389,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package com.eduonix.votingsystem;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class VotingSystemApplication {
public static void main(String[] args) {
SpringApplication.run(VotingSystemApplication.class, args);
}
}
| [
"paullewallencom@users.noreply.github.com"
] | paullewallencom@users.noreply.github.com |
f33f3e2dc933733ce5030465b0a39995dbc17792 | ca7da6499e839c5d12eb475abe019370d5dd557d | /spring-context/src/test/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssemblerTests.java | eec52b4f66d8d6df2eb6736957b23459a886fb0c | [
"Apache-2.0"
] | permissive | yangfancoming/spring-5.1.x | 19d423f96627636a01222ba747f951a0de83c7cd | db4c2cbcaf8ba58f43463eff865d46bdbd742064 | refs/heads/master | 2021-12-28T16:21:26.101946 | 2021-12-22T08:55:13 | 2021-12-22T08:55:13 | 194,103,586 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,081 | java |
package org.springframework.jmx.export.assembler;
import java.lang.reflect.Method;
import java.util.Properties;
import javax.management.modelmbean.ModelMBeanAttributeInfo;
import javax.management.modelmbean.ModelMBeanInfo;
import org.junit.Test;
import org.springframework.jmx.JmxTestBean;
import static org.junit.Assert.*;
public class MethodExclusionMBeanInfoAssemblerTests extends AbstractJmxAssemblerTests {
private static final String OBJECT_NAME = "bean:name=testBean5";
@Override
protected String getObjectName() {
return OBJECT_NAME;
}
@Override
protected int getExpectedOperationCount() {
return 9;
}
@Override
protected int getExpectedAttributeCount() {
return 4;
}
@Override
protected String getApplicationContextPath() {
return "org/springframework/jmx/export/assembler/methodExclusionAssembler.xml";
}
@Override
protected MBeanInfoAssembler getAssembler() {
MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler();
assembler.setIgnoredMethods(new String[] {"dontExposeMe", "setSuperman"});
return assembler;
}
@Test
public void testSupermanIsReadOnly() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
ModelMBeanAttributeInfo attr = info.getAttribute("Superman");
assertTrue(attr.isReadable());
assertFalse(attr.isWritable());
}
/*
* https://opensource.atlassian.com/projects/spring/browse/SPR-2754
*/
@Test
public void testIsNotIgnoredDoesntIgnoreUnspecifiedBeanMethods() throws Exception {
final String beanKey = "myTestBean";
MethodExclusionMBeanInfoAssembler assembler = new MethodExclusionMBeanInfoAssembler();
Properties ignored = new Properties();
ignored.setProperty(beanKey, "dontExposeMe,setSuperman");
assembler.setIgnoredMethodMappings(ignored);
Method method = JmxTestBean.class.getMethod("dontExposeMe");
assertFalse(assembler.isNotIgnored(method, beanKey));
// this bean does not have any ignored methods on it, so must obviously not be ignored...
assertTrue(assembler.isNotIgnored(method, "someOtherBeanKey"));
}
}
| [
"34465021+jwfl724168@users.noreply.github.com"
] | 34465021+jwfl724168@users.noreply.github.com |
8f2858c6614b1240e399630dbb65ed8661669a66 | 1132cef0ea0246b0ef505ee8daa3cdb342499fbc | /LeetCode/src/Hot100/Solution104.java | b2eeb680abb47fc31370f6552df5e2a94ab33ba5 | [] | no_license | zhhaochen/Algorithm | fd92a748fd727700abba8ad92db0d72663058666 | 509a8f29f00ed665182c8314c11c5a67b023701f | refs/heads/master | 2023-07-02T08:14:13.918245 | 2021-08-05T16:31:08 | 2021-08-05T16:31:08 | 288,951,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 278 | java | package Hot100;
import Top100.TreeNode;
public class Solution104 {
public int maxDepth(TreeNode root) {
if (root == null) return 0;
int left = maxDepth(root.left);
int right = maxDepth(root.right);
return Math.max(left, right) + 1;
}
}
| [
"zhhaochen@gmail.com"
] | zhhaochen@gmail.com |
9733302eed0ff9771ae32ec8ff30aa4231436e47 | 8782061b1e1223488a090f9f3f3b8dfe489e054a | /storeMongoDB/projects/ABCD/adangel_pmd/test/2Test.java | cca19bedbf990d90b8af1d45013336b00bc33da0 | [] | no_license | ryosuke-ku/TCS_init | 3cb79a46aa217e62d8fff13d600f2a9583df986c | e1207d68bdc9d2f1eed63ef44a672b5a37b45633 | refs/heads/master | 2020-08-08T18:40:17.929911 | 2019-10-18T01:06:32 | 2019-10-18T01:06:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 699 | java | private static void assertRuleSetReferenceId(final boolean expectedExternal, final String expectedRuleSetFileName,
final boolean expectedAllRules, final String expectedRuleName, final String expectedToString,
final RuleSetReferenceId reference) {
assertEquals("Wrong external", expectedExternal, reference.isExternal());
assertEquals("Wrong RuleSet file name", expectedRuleSetFileName, reference.getRuleSetFileName());
assertEquals("Wrong all Rule reference", expectedAllRules, reference.isAllRules());
assertEquals("Wrong Rule name", expectedRuleName, reference.getRuleName());
assertEquals("Wrong toString()", expectedToString, reference.toString());
}
| [
"naist1020@gmail.com"
] | naist1020@gmail.com |
5f5ca2a914d95a5ba53550508d15880c38a418c3 | 8852329ef35122fbd68e1cd925e74964dec4c852 | /lesson-3-sms-interface/src/main/java/com/dongnaoedu/springcloud/SmsController.java | 3f49ef4ed0c3a2d2db02767e0da42c1cce4c02e0 | [] | no_license | gouyan123/springcloud_1.5.8 | bb4b839a6fb201670f1832887ba3d7cfafabb7e2 | b48024a1e8a87ac8660fd1347815104160d8aa52 | refs/heads/master | 2020-05-04T07:41:41.260753 | 2019-04-12T03:29:28 | 2019-04-12T03:29:28 | 179,033,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.dongnaoedu.springcloud;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource(collectionResourceRel = "sms", path = "sms")
public interface SmsController extends PagingAndSortingRepository<SmsDomain, Long> {
} | [
"2637178209@qq.com"
] | 2637178209@qq.com |
a6493ee4debda32534a93e014e248df4d0dd1db3 | 26ee4581ef0609214fba489fb9aa2c2251eb6459 | /spring-demo-annotation/src/com/code/springdemo/SwimCoach.java | e6dbf500af3eae153b7713fb505f331088a41840 | [] | no_license | Fariha-Arifin/SpringProjects | 8c7f588c500e3d0ab128aaa61a426d312fec86ee | 6d084ea2defeb8ec6bc28997904cf6a198d4916f | refs/heads/master | 2022-12-23T17:28:22.455474 | 2020-10-02T19:40:27 | 2020-10-02T19:40:27 | 300,719,193 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package com.code.springdemo;
import org.springframework.beans.factory.annotation.Value;
public class SwimCoach implements Coach {
@Value("${foo.email}")
private String email;
@Value("${foo.team}")
private String team;
public String getEmail() {
return email;
}
public String getTeam() {
return team;
}
FortuneService fortuneService;
public SwimCoach(FortuneService thefortuneService)
{
fortuneService = thefortuneService;
}
@Override
public String getDailyWorkout() {
// TODO Auto-generated method stub
return "1000 meter swim today";
}
@Override
public String getDailyFortune() {
// TODO Auto-generated method stub
return fortuneService.getFortune();
}
}
| [
"farihaarifin@gmail.com"
] | farihaarifin@gmail.com |
0d1f82dfc8aa2ac0cc4345b762f95d524ae21990 | 1c6fe1c9ad917dc9dacaf03eade82d773ccf3c8a | /acm-common/src/main/java/com/wisdom/base/common/vo/wf/WfFormProcVo.java | 11f27476c03f4b525f5b5e58811a2695ddff63fa | [
"Apache-2.0"
] | permissive | daiqingsong2021/ord_project | 332056532ee0d3f7232a79a22e051744e777dc47 | a8167cee2fbdc79ea8457d706ec1ccd008f2ceca | refs/heads/master | 2023-09-04T12:11:51.519578 | 2021-10-28T01:58:43 | 2021-10-28T01:58:43 | 406,659,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.wisdom.base.common.vo.wf;
import lombok.Data;
@Data
public class WfFormProcVo {
/**
* 流程实例id
*/
private String procInstId;
/**
* 标题
*/
private String title;
/**
* 创建人
*/
private Integer creator;
}
| [
"homeli@126.com"
] | homeli@126.com |
fb1657560202770872bdab6a5d4ee1b4244b4420 | fccf059872ec75b11ffcbf633c5fe36cae1c00b0 | /iloomo/src/main/java/com/iloomo/widget/PTitleBar.java | 83a0da14e9b1cba05994099e97b630aad119b682 | [] | no_license | wupeitao88888/CityAntOld | 4e90b369438badef735dbace4157c58fe2c6ce8b | cfdbbd6b22c8762b5b9f61626fe1d4932fe0533e | refs/heads/master | 2021-01-20T05:19:38.734696 | 2016-08-09T15:53:21 | 2016-08-09T15:53:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,930 | java | package com.iloomo.widget;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.iloomo.paysdk.R;
import com.iloomo.utils.PViewUtil;
/**
* 标题栏
*
* @author wpt
*/
public class PTitleBar extends FrameLayout {
private Context mContext;
private TextView lc_center_menu, lc_right_menu;
private ImageView lc_left_back;
private RelativeLayout lc_left_back_all, lc_center_all, lc_right_all, ll_title, ll_title_content;
private OnClickListener backListenetForUser;
private OnClickListener backListener = new OnClickListener() {
@Override
public void onClick(View v) {
if (backListenetForUser != null) {
backListenetForUser.onClick(v);
} else {
((Activity) mContext).onBackPressed();
}
}
};
public PTitleBar(Context context) {
super(context);
init(context);
}
public PTitleBar(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
private void init(Context context) {
this.mContext = context;
View inflate = View.inflate(context, R.layout.plc_layout_title, null);
ll_title_content = (RelativeLayout) inflate.findViewById(R.id.ll_title_content);
lc_center_menu = (TextView) inflate.findViewById(R.id.title);
lc_left_back = (ImageView) inflate.findViewById(R.id.lc_left_back);
lc_left_back_all = (RelativeLayout) inflate
.findViewById(R.id.lc_left_back_all);
lc_center_all = (RelativeLayout) inflate
.findViewById(R.id.lc_center_all);
lc_right_all = (RelativeLayout) inflate.findViewById(R.id.lc_right_all);
ll_title = (RelativeLayout) inflate.findViewById(R.id.ll_title);
lc_right_menu = (TextView) inflate.findViewById(R.id.lc_right_menu);
lc_left_back_all.setOnClickListener(backListener);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ll_title_content.setPadding(0, (int) PViewUtil.dip2px(context, 25.0f), 0, 0);
} else {
ll_title_content.setPadding(0, 0, 0, 0);
}
addView(inflate);
}
/**
* 设置title背景颜色
*/
public void setBackGb(int color) {
ll_title_content.setBackgroundColor(color);
}
/**
* 设置返回监听
*/
public void setOnclickBackListener(OnClickListener l) {
lc_left_back_all.setOnClickListener(l);
}
/**
* 设置左边的图片
*/
public void setLeftImage(int draw) {
lc_left_back.setBackgroundResource(draw);
}
// /**
// * 旋转-90度
// */
// public void setAnimetion(final int draw) {
//
//
//
// AnimatorSet set = new AnimatorSet();
// set.playTogether(
//// ObjectAnimator.ofFloat(lc_left_back, "rotationX", 0, 360)
//// ObjectAnimator.ofFloat(lc_left_back, "rotationY", 0, 180)
// ObjectAnimator.ofFloat(lc_left_back, "rotation", 0, -90)
//// ObjectAnimator.ofFloat(myView, "translationX", 0, 90),
//// ObjectAnimator.ofFloat(myView, "translationY", 0, 90),
//// ObjectAnimator.ofFloat(myView, "scaleX", 1, 1.5f),
//// ObjectAnimator.ofFloat(myView, "scaleY", 1, 0.5f),
//// ObjectAnimator.ofFloat(myView, "alpha", 1, 0.25f, 1)
// );
// set.setDuration(500).start();
// }
//
// /**
// * 复位
// */
// public void setAnmin() {
// AnimatorSet set = new AnimatorSet();
// set.playTogether(
//// ObjectAnimator.ofFloat(lc_left_back, "rotationX", 0, 360)
//// ObjectAnimator.ofFloat(lc_left_back, "rotationY", 0, 180)
// ObjectAnimator.ofFloat(lc_left_back, "rotation", -90, 0)
//// ObjectAnimator.ofFloat(myView, "translationX", 0, 90),
//// ObjectAnimator.ofFloat(myView, "translationY", 0, 90),
//// ObjectAnimator.ofFloat(myView, "scaleX", 1, 1.5f),
//// ObjectAnimator.ofFloat(myView, "scaleY", 1, 0.5f),
//// ObjectAnimator.ofFloat(myView, "alpha", 1, 0.25f, 1)
// );
// set.setDuration(500).start();
//
// }
/**
* 设置左边的是否显示
*/
public void isLeftVisibility(boolean isVisibit) {
if (isVisibit)
lc_left_back_all.setVisibility(View.VISIBLE);
else
lc_left_back_all.setVisibility(View.GONE);
}
/**
* 设置中间标题是否显示
*/
public void isCenterVisibility(boolean isVisibit) {
if (isVisibit)
lc_center_all.setVisibility(View.VISIBLE);
else
lc_center_all.setVisibility(View.GONE);
}
/**
* 设置中间标题内容
*/
public void setCenterTitle(String msg) {
lc_center_menu.setText(msg);
}
public String getCenterTitle() {
return lc_center_menu.getText().toString();
}
/**
* 设置中间标题内容字体颜色
*/
public void setCenterTitleColor(int msg) {
lc_center_menu.setTextColor(msg);
}
/**
* 设置右边标题内容
*/
public void setRightTitle(String msg) {
lc_right_menu.setText(msg);
lc_right_menu.setVisibility(View.VISIBLE);
}
/**
* 设置右边标题内容字体颜色
*/
public void setRightTitle(int msg) {
lc_right_menu.setTextColor(msg);
}
/**
* 设置右边标题内容
*/
public void setRightTitleListener(OnClickListener l) {
lc_right_all.setOnClickListener(l);
}
}
| [
"admin@example.com"
] | admin@example.com |
e59cf73a9e688a7b70ecb4b8a31aa42444907779 | 37c586e25ff25b0d46da70360fa338b4834a83ba | /mvc-demo/src/main/java/de/chkal/mvc/thymeleaf/CustomThymeleafConfiguration.java | 8bf130a9bb42026fcd13ce958564bd5836feeb36 | [] | no_license | chkal/wjax15-mvc | 6bac84230152db00e7b753f3345f088b88b6a04e | b19d2bb422944233b9314207d78fee8a88b311d6 | refs/heads/master | 2021-01-10T13:43:56.948156 | 2015-11-05T13:22:34 | 2015-11-05T13:22:34 | 43,900,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 859 | java | package de.chkal.mvc.thymeleaf;
import org.glassfish.ozark.engine.ViewEngineConfig;
import org.glassfish.ozark.ext.thymeleaf.DefaultTemplateEngineProducer;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
import org.thymeleaf.templateresolver.TemplateResolver;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.Specializes;
@Specializes
public class CustomThymeleafConfiguration extends DefaultTemplateEngineProducer {
@Produces
@ViewEngineConfig
@Override
public TemplateEngine getTemplateEngine() {
TemplateResolver resolver = new ServletContextTemplateResolver();
// Improved developer experience
resolver.setCacheable( false );
TemplateEngine engine = new TemplateEngine();
engine.setTemplateResolver( resolver );
return engine;
}
}
| [
"christian@kaltepoth.de"
] | christian@kaltepoth.de |
120c969c8606f986c95dba0c40564d01539300c9 | 35b710e9bc210a152cc6cda331e71e9116ba478c | /tc-common/src/main/java/com/topcoder/web/common/model/Notification.java | c8b37e736b6e3193634cc6f4880b1f728861eef5 | [] | no_license | appirio-tech/tc1-tcnode | d17649afb38998868f9a6d51920c4fe34c3e7174 | e05a425be705aca8f530caac1da907d9a6c4215a | refs/heads/master | 2023-08-04T19:58:39.617425 | 2016-05-15T00:22:36 | 2016-05-15T00:22:36 | 56,892,466 | 1 | 8 | null | 2022-04-05T00:47:40 | 2016-04-23T00:27:46 | Java | UTF-8 | Java | false | false | 1,824 | java | package com.topcoder.web.common.model;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* @author dok
* @version $Revision: 64563 $ Date: 2005/01/01 00:00:00
* Create Date: Apr 7, 2006
*/
public class Notification extends Base implements Comparable {
private Integer id;
private String name;
private String status;
private Integer sort;
private NotificationType type;
private Set registrationTypes;
private Set users;
public Notification() {
this.registrationTypes = new HashSet();
this.users = new HashSet();
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public String getStatus() {
return status;
}
public Integer getSort() {
return sort;
}
public NotificationType getType() {
return type;
}
public void setType(NotificationType type) {
this.type = type;
}
public Set getRegistrationTypes() {
return Collections.unmodifiableSet(registrationTypes);
}
public Set getUsers() {
return Collections.unmodifiableSet(users);
}
public void setUsers(Set users) {
this.users = users;
}
public void setId(Integer id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setStatus(String status) {
this.status = status;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public void setRegistrationTypes(Set registrationTypes) {
this.registrationTypes = registrationTypes;
}
public int compareTo(Object o) {
Notification other = (Notification) o;
return getSort().compareTo(other.getSort());
}
}
| [
"dongzhengbin@winterflames-MacBook-Pro.local"
] | dongzhengbin@winterflames-MacBook-Pro.local |
46298b35cb4f006892135e19d64cad68f568d471 | c39cd76699b393a049b1e924a0cac53f024ba5ad | /src/costConfig/form/CostConfigForm.java | a6cd530c40fe26f0080e7d76932f356b7076b695 | [] | no_license | duranto2009/btcl-automation | 402f26dc6d8e745c0e8368c946f74a5eab703015 | 33ffa0b8e488d6a0d13c8f08e6b8058fe1b4764b | refs/heads/master | 2022-02-27T07:38:19.181886 | 2019-09-18T10:42:21 | 2019-09-18T10:42:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,408 | java | package costConfig.form;
import java.util.*;
import org.apache.struts.action.ActionForm;
import util.*;
public class CostConfigForm extends ActionForm {
/**
*
*/
private static final long serialVersionUID = 1L;
public List<RowDTO> rowList;
public List<ColumnDTO> columnList;
public int tableID;
public String [] lowerRangeMb;
public String [] upperRangeMb;
public String [] lowerRangeKm;
public String [] upperRangeKm;
public double[] cost;
public int [] rowIndex;
public int [] columnIndex;
public long rowIDs[];
public long columnIDs[];
public long [] cellIDs;
String activationDate;
public String getActivationDate() {
return activationDate;
}
public void setActivationDate(String activationDate) {
this.activationDate = activationDate;
}
public long[] getCellIDs() {
return cellIDs;
}
public void setCellIDs(long[] cellIDs) {
this.cellIDs = cellIDs;
}
public long[] getRowIDs() {
return rowIDs;
}
public void setRowIDs(long[] rowIDs) {
this.rowIDs = rowIDs;
}
public long[] getColumnIDs() {
return columnIDs;
}
public void setColumnIDs(long[] columnIDs) {
this.columnIDs = columnIDs;
}
public int getTableID() {
return tableID;
}
public void setTableID(int tableID) {
this.tableID = tableID;
}
public RowDTO geRowDTO(int index){
return rowList.get(index);
}
public ColumnDTO getColumnDTO(int index){
return columnList.get(index);
}
public List<RowDTO> getRowList() {
return rowList;
}
public void setRowList(List<RowDTO> rowList) {
this.rowList = rowList;
}
public List<ColumnDTO> getColumnList() {
return columnList;
}
public void setColumnList(List<ColumnDTO> columnList) {
this.columnList = columnList;
}
public int[] getRowIndex() {
return rowIndex;
}
public void setRowIndex(int[] rowIndex) {
this.rowIndex = rowIndex;
}
public int[] getColumnIndex() {
return columnIndex;
}
public void setColumnIndex(int[] columnIndex) {
this.columnIndex = columnIndex;
}
public String[] getUpperRangeMb() {
return upperRangeMb;
}
public void setUpperRangeMb(String[] upperRangeMb) {
this.upperRangeMb = upperRangeMb;
}
public String[] getLowerRangeMb() {
return lowerRangeMb;
}
public void setLowerRangeMb(String[] lowerRangeMb) {
this.lowerRangeMb = lowerRangeMb;
}
public String[] getLowerRangeKm() {
return lowerRangeKm;
}
public void setLowerRangeKm(String[] lowerRangeKm) {
this.lowerRangeKm = lowerRangeKm;
}
public String[] getUpperRangeKm() {
return upperRangeKm;
}
public void setUpperRangeKm(String[] upperRangeKm) {
this.upperRangeKm = upperRangeKm;
}
public double[] getCost() {
return cost;
}
public void setCost(double[] cost) {
this.cost = cost;
}
@Override
public String toString() {
return "CostConfigForm [rowList=" + rowList + ", columnList=" + columnList + ", tableID=" + tableID
+ ", lowerRangeMb=" + Arrays.toString(lowerRangeMb) + ", upperRangeMb=" + Arrays.toString(upperRangeMb)
+ ", lowerRangeKm=" + Arrays.toString(lowerRangeKm) + ", upperRangeKm=" + Arrays.toString(upperRangeKm)
+ ", cost=" + Arrays.toString(cost) + ", rowIndex=" + Arrays.toString(rowIndex) + ", columnIndex="
+ Arrays.toString(columnIndex) + ", rowIDs=" + Arrays.toString(rowIDs) + ", columnIDs="
+ Arrays.toString(columnIDs) + ", cellIDs=" + Arrays.toString(cellIDs) + ", activationDate="
+ activationDate + "]";
}
}
| [
"shariful.bony@gmail.com"
] | shariful.bony@gmail.com |
296c8791818c6d963814c1c437ee20f7b41cced6 | ee461488c62d86f729eda976b421ac75a964114c | /tags/HtmlUnit-2.16/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLQuoteElementTest.java | 9d6c1fdc22557d4bcbad0a41df5c74dd27a6976b | [
"Apache-2.0"
] | permissive | svn2github/htmlunit | 2c56f7abbd412e6d9e0efd0934fcd1277090af74 | 6fc1a7d70c08fb50fef1800673671fd9cada4899 | refs/heads/master | 2023-09-03T10:35:41.987099 | 2015-07-26T13:12:45 | 2015-07-26T13:12:45 | 37,107,064 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,752 | java | /*
* Copyright (c) 2002-2015 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gargoylesoftware.htmlunit.javascript.host.html;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.gargoylesoftware.htmlunit.BrowserRunner;
import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
import com.gargoylesoftware.htmlunit.WebDriverTestCase;
/**
* Tests for {@link HTMLQuoteElement}.
*
* @version $Revision$
* @author Carsten Steul
* @author Ahmed Ashour
*/
@RunWith(BrowserRunner.class)
public class HTMLQuoteElementTest extends WebDriverTestCase {
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = "true",
IE11 = "false")
public void prototypeComparison() throws Exception {
final String html = ""
+ "<html><head><title>foo</title>\n"
+ "<script>\n"
+ " function test() {\n"
+ " alert(document.createElement('blockquote').__proto__ == document.createElement('q').__proto__);\n"
+ " }\n"
+ "</script>\n"
+ "</head>\n"
+ "<body onload='test()'>\n"
+ "</body></html>";
loadPageWithAlerts2(html);
}
}
| [
"asashour@5f5364db-9458-4db8-a492-e30667be6df6"
] | asashour@5f5364db-9458-4db8-a492-e30667be6df6 |
4f89c78ce330133e66b2f0d6875fc6cc4d654745 | 82ab571aca88fbe455a8f42f0e2f0369f556180e | /app/src/main/java/com/colpencil/redwood/bean/PostsComment.java | 147056878fb1e0892413d651c84f8e11ed239f1a | [] | no_license | zsj6102/zz | 61d5c28dc0a0faf53000d4d5c802ba6ab9184d25 | 618bd83fd936870c2458ac5928f75be00add8cdb | refs/heads/master | 2020-12-02T22:55:32.820302 | 2017-07-12T14:48:04 | 2017-07-12T14:48:04 | 96,203,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package com.colpencil.redwood.bean;
import java.io.Serializable;
/**
* @author 陈宝
* @Description:商品评论的实体类
* @Email DramaScript@outlook.com
* @date 2016/7/29
*/
public class PostsComment implements Serializable {
private String re_content;
private String nickname;
private int comment_id;
private String face;
private long time;
private long createtime;
private String member_photo;
public String getRe_content() {
return re_content;
}
public void setRe_content(String re_content) {
this.re_content = re_content;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public int getComment_id() {
return comment_id;
}
public void setComment_id(int comment_id) {
this.comment_id = comment_id;
}
public String getFace() {
return face;
}
public void setFace(String face) {
this.face = face;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public long getCreatetime() {
return createtime;
}
public void setCreatetime(long createtime) {
this.createtime = createtime;
}
public String getMember_photo() {
return member_photo;
}
public void setMember_photo(String member_photo) {
this.member_photo = member_photo;
}
}
| [
"610257110@qq.com"
] | 610257110@qq.com |
eb98c9293c5ff5cd4a0795d218cd15ca5d7a1e8a | cf6c8c741c188c241984494562650799dcab9468 | /src/main/java/tfar/beesourceful/block/CentrifugeBlock.java | 46fd3936c719bf00fa83dd86ff2637d96183da2d | [
"Unlicense"
] | permissive | Tfarcenim/Beesourceful | 4c19b729969407279b49a1db6971fb189a310dfe | 082b13a419c8384362908686e91b68e2b9b5ebed | refs/heads/master | 2020-12-09T17:00:31.537469 | 2020-07-01T15:42:25 | 2020-07-01T15:42:25 | 233,365,070 | 2 | 9 | Unlicense | 2020-11-12T13:38:31 | 2020-01-12T09:04:14 | Java | UTF-8 | Java | false | false | 3,739 | java | package tfar.beesourceful.block;
import tfar.beesourceful.blockentity.CentrifugeBlockEntity;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.stats.Stats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.ItemStackHandler;
import javax.annotation.Nullable;
import java.util.stream.IntStream;
public class CentrifugeBlock extends Block {
public CentrifugeBlock(Properties p_i48440_1_) {
super(p_i48440_1_);
setDefaultState(getDefaultState().with(PROPERTY_FACING, Direction.NORTH).with(PROPERTY_ON,false));
}
public static final DirectionProperty PROPERTY_FACING = BlockStateProperties.FACING;
public static final BooleanProperty PROPERTY_ON = BooleanProperty.create("on");
@Override
public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand p_225533_5_, BlockRayTraceResult p_225533_6_) {
if (!world.isRemote) {
INamedContainerProvider blockEntity = state.getContainer(world,pos);
if (blockEntity != null) {
NetworkHooks.openGui((ServerPlayerEntity) player, blockEntity, pos);
player.addStat(Stats.OPEN_BARREL);
}
}
return ActionResultType.SUCCESS;
}
@Nullable
@Override
public INamedContainerProvider getContainer(BlockState state, World worldIn, BlockPos pos) {
return (INamedContainerProvider)worldIn.getTileEntity(pos);
}
public BlockState rotate(BlockState p_185499_1_, Rotation p_185499_2_) {
return p_185499_1_.with(PROPERTY_FACING, p_185499_2_.rotate(p_185499_1_.get(PROPERTY_FACING)));
}
public BlockState mirror(BlockState p_185471_1_, Mirror p_185471_2_) {
return p_185471_1_.rotate(p_185471_2_.toRotation(p_185471_1_.get(PROPERTY_FACING)));
}
public BlockState getStateForPlacement(BlockItemUseContext p_196258_1_) {
return this.getDefaultState().with(PROPERTY_FACING, p_196258_1_.getNearestLookingDirection().getOpposite());
}
@Override
public void onReplaced(BlockState state1, World world, BlockPos pos, BlockState state, boolean p_196243_5_) {
TileEntity blockEntity = world.getTileEntity(pos);
if (blockEntity instanceof CentrifugeBlockEntity && state.getBlock() != state1.getBlock()){
CentrifugeBlockEntity centrifugeBlockEntity = (CentrifugeBlockEntity)blockEntity;
ItemStackHandler h = centrifugeBlockEntity.h;
IntStream.range(0, h.getSlots()).mapToObj(h::getStackInSlot).filter(s -> !s.isEmpty()).forEach(stack -> InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack));
}
super.onReplaced(state1, world, pos, state, p_196243_5_);
}
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new CentrifugeBlockEntity();
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
builder.add(PROPERTY_FACING,PROPERTY_ON);
}
}
| [
"44327798+Gimpler@users.noreply.github.com"
] | 44327798+Gimpler@users.noreply.github.com |
1f1ee1fc567b71ece6b1726f3e4acf82cc288cea | 1db25343e50c98cdc9199054182b64ec330f86a7 | /projects/OG-Util/src/com/opengamma/extsql/SqlFragment.java | 12a0e48141c324b4281d65520b18d5c33ce85171 | [
"Apache-2.0"
] | permissive | satishv/OG-Platform | 76313090a59a89c4b7b12b93afe6156893b67599 | 1a2f2a7486f8b9bb6b4c545b342581f54c4489c4 | refs/heads/master | 2021-01-17T22:34:04.745012 | 2012-02-02T19:54:01 | 2012-02-02T19:54:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | /**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.extsql;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
/**
* Single fragment in the extsql AST.
*/
abstract class SqlFragment {
/**
* Convert this fragment to SQL, appending it to the specified buffer.
*
* @param buf the buffer to append to, not null
* @param bundle the extsql bundle for context, not null
* @param paramSource the SQL parameters, not null
*/
protected abstract void toSQL(StringBuilder buf, ExtSqlBundle bundle, SqlParameterSource paramSource);
}
| [
"stephen@opengamma.com"
] | stephen@opengamma.com |
1ece46dbb38c505320a54c4f440657fa09d3c9e5 | 4e3c5dc1cfd033b0e7c1bea625f9ee64ae12871a | /com/vungle/publisher/na.java | 9e605f4d92b39765548671c5e1bb7189b90e71d6 | [] | no_license | haphan2014/idle_heroes | ced0f6301b7a618e470ebfa722bef3d4becdb6ba | 5bcc66f8e26bf9273a2a8da2913c27a133b7d60a | refs/heads/master | 2021-01-20T05:01:54.157508 | 2017-08-25T14:06:51 | 2017-08-25T14:06:51 | 101,409,563 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 886 | java | package com.vungle.publisher;
import com.vungle.publisher.mx.C1823a;
import dagger.MembersInjector;
import dagger.internal.Factory;
import dagger.internal.MembersInjectors;
/* compiled from: vungle */
public final class na implements Factory<C1823a> {
static final /* synthetic */ boolean f2612a = (!na.class.desiredAssertionStatus());
private final MembersInjector<C1823a> f2613b;
private na(MembersInjector<C1823a> membersInjector) {
if (f2612a || membersInjector != null) {
this.f2613b = membersInjector;
return;
}
throw new AssertionError();
}
public static Factory<C1823a> m2186a(MembersInjector<C1823a> membersInjector) {
return new na(membersInjector);
}
public final /* synthetic */ Object get() {
return (C1823a) MembersInjectors.injectMembers(this.f2613b, new C1823a());
}
}
| [
"hien.bui@vietis.com.vn"
] | hien.bui@vietis.com.vn |
f2772a7815633a8a82a795491dad41595b9c1ddc | 14f8e80f05020ae0416122248faf0262a2505b4b | /Java/Semester 1 usorteret/Test2/src/application/Rundvisning.java | 6302d68dc5727820b70742c8252d62ebda06a611 | [] | no_license | saphyron/randomstuff | 6befba6ffba0818b8f57683f028b425239cb92a9 | e21ba06758818ab11c28a19a608b3804bd589e3f | refs/heads/main | 2023-05-19T15:59:31.006362 | 2021-06-09T07:57:13 | 2021-06-09T07:57:13 | 360,878,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,260 | java | package application;
/**
* Nedavningsklasse med special attributter
* som dato, tid og antal besøgende
* (double).
*
* @author Gruppe 5
* @see Produkt
*/
import java.time.LocalDate;
import java.time.LocalTime;
public class Rundvisning extends Produkt implements java.io.Serializable {
//Attributter: Imported java.time.LocalDato / LocalTime for at attributter virker.
private LocalDate dato;
private LocalTime tid;
private int besøgende;
private static final int MAKSBESØGENDE = 75;
private static final long serialVersionUID = 123123123;
/**
* Til at skabe et produkt af gruppen rundvisning.
* @param navn som er en string. Nedarvet fra Produkt klassen.
* @param dato != før dagens dato. Dato rundvisning sker.
* @param tid på dagen rundvisning sker.
* @param besøgende TODO
* @param prisliste for at tilkoble den til en prisliste. Nedarvet fra produkt klassen.
* @throws IllegalArgumentException hvis dato er før dagens dato.
* @throws IllegalArgumentException hvis tid er udenfor dags timerne.
*/
public Rundvisning(String navn, LocalDate dato, LocalTime tid, ProduktType produktType) {
super(navn, produktType);
if(dato.isBefore(LocalDate.now())) {
throw new IllegalArgumentException("Fejl! Rundvisning kan ikke ske før dagens dato.");
}
this.dato = dato;
this.tid = tid;
}
//Getters og Setters
public LocalDate getDato() {
return dato;
}
public void setDato(LocalDate dato) {
this.dato = dato;
}
public LocalTime getTid() {
return tid;
}
public void setTid(LocalTime tid) {
this.tid = tid;
}
public int getBesøgende() {
return besøgende;
}
public void setBesøgende(int besøgende) {
if (MAKSBESØGENDE < besøgende) {
throw new IllegalArgumentException("For mange besøgende");
}
this.besøgende = besøgende;
}
public void incrementBesøgende(int increment) {
if (MAKSBESØGENDE < besøgende + increment) {
throw new IllegalArgumentException("For mange besøgende");
}
besøgende = besøgende + increment;
}
@Override
public String[][] getAttributter() {
return new String[][] {
{ "Dato", ""+dato},
{ "Tid", ""+tid},
{ "Besøgende", ""+besøgende},
{ "Max besøgende", ""+MAKSBESØGENDE}
};
}
}
| [
"30288325+saphyron@users.noreply.github.com"
] | 30288325+saphyron@users.noreply.github.com |
5d6a08c24d7c1b2b71a6566639440d3ba1428149 | 2122d24de66635b64ec2b46a7c3f6f664297edc4 | /spring/spring-boot/spring-boot-restful-authorization-sample/src/main/java/com/scienjus/config/Constants.java | 18431d2e08d648a8d1a75f6fbc03c91465996bc9 | [] | no_license | yiminyangguang520/Java-Learning | 8cfecc1b226ca905c4ee791300e9b025db40cc6a | 87ec6c09228f8ad3d154c96bd2a9e65c80fc4b25 | refs/heads/master | 2023-01-10T09:56:29.568765 | 2022-08-29T05:56:27 | 2022-08-29T05:56:27 | 92,575,777 | 5 | 1 | null | 2023-01-05T05:21:02 | 2017-05-27T06:16:40 | Java | UTF-8 | Java | false | false | 453 | java | package com.scienjus.config;
/**
* 常量
*
* @author ScienJus
* @date 2015/7/31.
*/
public class Constants {
/**
* 存储当前登录用户id的字段名
*/
public static final String CURRENT_USER_ID = "CURRENT_USER_ID";
/**
* token有效期(小时)
*/
public static final int TOKEN_EXPIRES_HOUR = 72;
/**
* 存放Authorization的header字段
*/
public static final String AUTHORIZATION = "authorization";
}
| [
"litz-a@glodon.com"
] | litz-a@glodon.com |
8779252cd2be75eb521e76c44587ce386ca9b901 | 0c038f28915632cf0a5076d56b9300f060699cb2 | /core/cas-server-core-services-api/src/main/java/org/apereo/cas/services/PrincipalAttributeRegisteredServiceUsernameProvider.java | 78dbdfb89984d9c0e86fb2ea8b9fb0f4604364e1 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | DeanSun/cas | f33a0f4e71deab87a35bacdb83f8f7928e0c2a36 | 47bd53edc2c003329732878a5073fc8f9db460c7 | refs/heads/master | 2022-11-22T20:16:29.814742 | 2022-11-03T07:57:37 | 2022-11-03T07:57:37 | 91,287,515 | 0 | 0 | Apache-2.0 | 2020-07-23T05:58:26 | 2017-05-15T02:33:26 | Java | UTF-8 | Java | false | false | 6,425 | java | package org.apereo.cas.services;
import org.apereo.cas.authentication.principal.Principal;
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.util.CollectionUtils;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* Determines the username for this registered service based on a principal attribute.
* If the attribute is not found, default principal id is returned.
*
* @author Misagh Moayyed
* @since 4.1.0
*/
@Slf4j
@ToString
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class PrincipalAttributeRegisteredServiceUsernameProvider extends BaseRegisteredServiceUsernameAttributeProvider {
@Serial
private static final long serialVersionUID = -3546719400741715137L;
private String usernameAttribute;
public PrincipalAttributeRegisteredServiceUsernameProvider(final String usernameAttribute,
final String canonicalizationMode) {
super(canonicalizationMode, false, null);
this.usernameAttribute = usernameAttribute;
}
@Override
public String resolveUsernameInternal(final Principal principal, final Service service, final RegisteredService registeredService) {
var principalId = principal.getId();
val originalPrincipalAttributes = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
originalPrincipalAttributes.putAll(principal.getAttributes());
LOGGER.debug("Original principal attributes available for selection of username attribute [{}] are [{}].", this.usernameAttribute, originalPrincipalAttributes);
val releasePolicyAttributes = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
releasePolicyAttributes.putAll(getPrincipalAttributesFromReleasePolicy(principal, service, registeredService));
LOGGER.debug("Attributes resolved by the release policy available for selection of username attribute [{}] are [{}].",
this.usernameAttribute, releasePolicyAttributes);
if (StringUtils.isBlank(this.usernameAttribute)) {
LOGGER.warn("No username attribute is defined for service [{}]. CAS will fall back onto using the default principal id. "
+ "This is likely a mistake in the configuration of the registered service definition.", registeredService.getName());
} else if (releasePolicyAttributes.containsKey(this.usernameAttribute)) {
LOGGER.debug("Attribute release policy for registered service [{}] contains an attribute for [{}]",
registeredService.getServiceId(), this.usernameAttribute);
val value = releasePolicyAttributes.get(this.usernameAttribute);
principalId = CollectionUtils.wrap(value).get(0).toString();
} else if (originalPrincipalAttributes.containsKey(this.usernameAttribute)) {
LOGGER.debug("The selected username attribute [{}] was retrieved as a direct "
+ "principal attribute and not through the attribute release policy for service [{}]. "
+ "CAS is unable to detect new attribute values for [{}] after authentication unless the attribute "
+ "is explicitly authorized for release via the service attribute release policy.",
this.usernameAttribute, service, this.usernameAttribute);
val value = originalPrincipalAttributes.get(this.usernameAttribute);
principalId = CollectionUtils.wrap(value).get(0).toString();
} else {
LOGGER.info("Principal [{}] does not have an attribute [{}] among attributes [{}] so CAS cannot "
+ "provide the user attribute the service expects. "
+ "CAS will instead return the default principal id [{}]. Ensure the attribute selected as the username "
+ "is allowed to be released by the service attribute release policy.", principalId, this.usernameAttribute, releasePolicyAttributes, principalId);
}
LOGGER.debug("Principal id to return for [{}] is [{}]. The default principal id is [{}].", service.getId(), principalId, principal.getId());
return principalId.trim();
}
/**
* Gets principal attributes. Will attempt to locate the principal
* attribute repository from the context if one is defined to use
* that instance to locate attributes. If none is available,
* will use the default principal attributes.
*
* @param principal the principal
* @param service the service
* @param registeredService the registered service
* @return the principal attributes
*/
protected Map<String, List<Object>> getPrincipalAttributesFromReleasePolicy(
final Principal principal, final Service service, final RegisteredService registeredService) {
if (registeredService != null && registeredService.getAccessStrategy().isServiceAccessAllowed()) {
LOGGER.debug("Located service [{}] in the registry. Attempting to resolve attributes for [{}]", registeredService, principal.getId());
if (registeredService.getAttributeReleasePolicy() == null) {
LOGGER.debug("No attribute release policy is defined for [{}]. Returning default principal attributes", service.getId());
return principal.getAttributes();
}
val context = RegisteredServiceAttributeReleasePolicyContext.builder()
.registeredService(registeredService)
.service(service)
.principal(principal)
.build();
return registeredService.getAttributeReleasePolicy().getAttributes(context);
}
LOGGER.debug("Could not locate service [{}] in the registry.", service.getId());
throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE);
}
}
| [
"mm1844@gmail.com"
] | mm1844@gmail.com |
33446f76d0b9d2986b51e2d35c838a9910730198 | 794473ff2ba2749db9c0782f5d281b00dd785a95 | /braches_20171206/qiubaotong-server/qbt-system-web/src/main/java/com/qbt/web/support/impl/FeedbackSupportImpl.java | 7772597a29937197700af64eb8594a893f229cfc | [] | no_license | hexilei/qbt | a0fbc9c1870da1bf1ec24bba0f508841ca1b9750 | 040e5fcc9fbb27d52712cc1678d71693b5c85cce | refs/heads/master | 2021-05-05T23:03:20.377229 | 2018-01-12T03:33:12 | 2018-01-12T03:33:12 | 116,363,833 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | package com.qbt.web.support.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.qbt.common.entity.PageEntity;
import com.qbt.common.util.BeanUtil;
import com.qbt.persistent.entity.Feedback;
import com.qbt.service.FeedbackService;
import com.qbt.web.pojo.feedBack.FeedbackPageReqVo;
import com.qbt.web.pojo.feedBack.FeedbackVo;
import com.qbt.web.support.FeedbackSupport;
@Service
public class FeedbackSupportImpl implements FeedbackSupport{
@Resource
private FeedbackService feedbackService;
@Override
public List<FeedbackVo> findByPage(FeedbackPageReqVo reqVo) {
PageEntity<Feedback> pageEntity = BeanUtil.pageConvert(reqVo, Feedback.class);
List<Feedback> list = feedbackService.findByPage(pageEntity);
List<FeedbackVo> voList = BeanUtil.list2list(list, FeedbackVo.class);
reqVo.setTotalCount(pageEntity.getTotalCount());
return voList;
}
}
| [
"louis.he@missionsky.com"
] | louis.he@missionsky.com |
13c89a84be055aad6d239492a711ad616f00c822 | 5cefafafa516d374fd600caa54956a1de7e4ce7d | /oasis/web/ePolicy/wsPolicy/test/src/com/delphi_tech/ows/common/CustomStatusCodeType.java | cdf50bb2fdf66b28a1507cb9a194cb2f074223c8 | [] | no_license | TrellixVulnTeam/demo_L223 | 18c641c1d842c5c6a47e949595b5f507daa4aa55 | 87c9ece01ebdd918343ff0c119e9c462ad069a81 | refs/heads/master | 2023-03-16T00:32:08.023444 | 2019-04-08T15:46:48 | 2019-04-08T15:46:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,101 | java |
package com.delphi_tech.ows.common;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/**
* <p>Java class for CustomStatusCodeType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CustomStatusCodeType">
* <simpleContent>
* <extension base="<http://www.w3.org/2001/XMLSchema>string">
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CustomStatusCodeType", propOrder = {
"value"
})
public class CustomStatusCodeType
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlValue
protected String value;
@XmlAttribute(name = "name")
protected String name;
/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}
/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}
| [
"athidevwork@gmail.com"
] | athidevwork@gmail.com |
e1d32e4953c1e4d4f0ea3e2fc754991e7cdc52fb | 1c02ea2eb17861a958cc661bb843a00a18582744 | /extension/src/main/java/com/maxdemarzi/posts/PostExceptions.java | 1171e1f8c2579bad0b08d943c7d9e639849aa59f | [
"MIT"
] | permissive | jknack/dating_site | 76c040a39ee0df9fe4d5d40b59a35eeaca7205ce | 6ef4a102a634468694242db4ffa9ff1466b85b6a | refs/heads/master | 2023-05-31T22:17:26.722390 | 2018-08-29T14:48:24 | 2018-08-29T16:11:56 | 146,362,969 | 0 | 0 | MIT | 2018-08-27T22:51:10 | 2018-08-27T22:51:09 | null | UTF-8 | Java | false | false | 495 | java | package com.maxdemarzi.posts;
import com.maxdemarzi.Exceptions;
public class PostExceptions extends Exceptions {
static final Exceptions missingStatusParameter = new Exceptions(400, "Missing status Parameter.");
static final Exceptions emptyStatusParameter = new Exceptions(400, "Empty status Parameter.");
public static final Exceptions postNotFound = new Exceptions(400, "Post not Found.");
PostExceptions(int code, String error) {
super(code, error);
}
}
| [
"maxdemarzi@hotmail.com"
] | maxdemarzi@hotmail.com |
2f2f7d414a5a2ab4576dfda8c1b40e098d768b6d | e8cd24201cbfadef0f267151ea5b8a90cc505766 | /group03/58555264/src/main/java/com/circle/download/DownloadThread.java | bdebd6ac9a2670234630c7c73ac0b481d386d8a1 | [] | no_license | XMT-CN/coding2017-s1 | 30dd4ee886dd0a021498108353c20360148a6065 | 382f6bfeeeda2e76ffe27b440df4f328f9eafbe2 | refs/heads/master | 2021-01-21T21:38:42.199253 | 2017-06-25T07:44:21 | 2017-06-25T07:44:21 | 94,863,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | package com.circle.download;
import com.circle.download.api.Connection;
import com.circle.download.api.ConnectionException;
import com.circle.download.api.DownloadListener;
import java.io.*;
/**
* Created by keweiyang on 2017/3/10.
*/
public class DownloadThread extends Thread {
private Connection conn;
private int startPos;
private int endPos;
static int threadFinished = 0;
private DownloadListener listener;
private int threadNum;
public DownloadThread(Connection conn, int startPos, int endPos, DownloadListener listener, int threadNum) {
this.conn = conn;
this.startPos = startPos;
this.endPos = endPos;
this.listener = listener;
this.threadNum = threadNum;
}
@Override
public void run() {
try {
this.conn.read(startPos, endPos);
} catch (IOException e) {
e.printStackTrace();
} catch (ConnectionException e) {
e.printStackTrace();
} finally {
synchronized (this) {
threadFinished++;
if (threadFinished == threadNum) {
listener.notifyFinished();
}
}
}
System.out.println("线程:" + Thread.currentThread().getId() + " , startPos:" + startPos + ",endPos:" + endPos);
}
}
| [
"542194147@qq.com"
] | 542194147@qq.com |
afe0547ad647fdf1174b93fd2ace8ddc40a1aa4f | d7de50fc318ff59444caabc38d274f3931349f19 | /src/com/fasterxml/jackson/databind/ser/std/StdJdkSerializers.java | ee9669fe95ad4c305b0c54f77897808261824878 | [] | no_license | reverseengineeringer/fr.dvilleneuve.lockito | 7bbd077724d61e9a6eab4ff85ace35d9219a0246 | ad5dbd7eea9a802e5f7bc77e4179424a611d3c5b | refs/heads/master | 2021-01-20T17:21:27.500016 | 2016-07-19T16:23:04 | 2016-07-19T16:23:04 | 63,709,932 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,150 | java | package com.fasterxml.jackson.databind.ser.std;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser.NumberType;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonIntegerFormatVisitor;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URL;
import java.util.Collection;
import java.util.Currency;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map.Entry;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;
public class StdJdkSerializers
{
public static Collection<Map.Entry<Class<?>, Object>> all()
{
HashMap localHashMap = new HashMap();
ToStringSerializer localToStringSerializer = ToStringSerializer.instance;
localHashMap.put(URL.class, localToStringSerializer);
localHashMap.put(URI.class, localToStringSerializer);
localHashMap.put(Currency.class, localToStringSerializer);
localHashMap.put(UUID.class, new UUIDSerializer());
localHashMap.put(Pattern.class, localToStringSerializer);
localHashMap.put(Locale.class, localToStringSerializer);
localHashMap.put(Locale.class, localToStringSerializer);
localHashMap.put(AtomicReference.class, AtomicReferenceSerializer.class);
localHashMap.put(AtomicBoolean.class, AtomicBooleanSerializer.class);
localHashMap.put(AtomicInteger.class, AtomicIntegerSerializer.class);
localHashMap.put(AtomicLong.class, AtomicLongSerializer.class);
localHashMap.put(File.class, FileSerializer.class);
localHashMap.put(Class.class, ClassSerializer.class);
localHashMap.put(Void.TYPE, NullSerializer.class);
return localHashMap.entrySet();
}
public static final class AtomicBooleanSerializer
extends StdScalarSerializer<AtomicBoolean>
{
public AtomicBooleanSerializer()
{
super(false);
}
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
throws JsonMappingException
{
paramJsonFormatVisitorWrapper.expectBooleanFormat(paramJavaType);
}
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
{
return createSchemaNode("boolean", true);
}
public void serialize(AtomicBoolean paramAtomicBoolean, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
throws IOException, JsonGenerationException
{
paramJsonGenerator.writeBoolean(paramAtomicBoolean.get());
}
}
public static final class AtomicIntegerSerializer
extends StdScalarSerializer<AtomicInteger>
{
public AtomicIntegerSerializer()
{
super(false);
}
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
throws JsonMappingException
{
paramJsonFormatVisitorWrapper = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType);
if (paramJsonFormatVisitorWrapper != null) {
paramJsonFormatVisitorWrapper.numberType(JsonParser.NumberType.INT);
}
}
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
{
return createSchemaNode("integer", true);
}
public void serialize(AtomicInteger paramAtomicInteger, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
throws IOException, JsonGenerationException
{
paramJsonGenerator.writeNumber(paramAtomicInteger.get());
}
}
public static final class AtomicLongSerializer
extends StdScalarSerializer<AtomicLong>
{
public AtomicLongSerializer()
{
super(false);
}
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
throws JsonMappingException
{
paramJsonFormatVisitorWrapper = paramJsonFormatVisitorWrapper.expectIntegerFormat(paramJavaType);
if (paramJsonFormatVisitorWrapper != null) {
paramJsonFormatVisitorWrapper.numberType(JsonParser.NumberType.LONG);
}
}
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
{
return createSchemaNode("integer", true);
}
public void serialize(AtomicLong paramAtomicLong, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
throws IOException, JsonGenerationException
{
paramJsonGenerator.writeNumber(paramAtomicLong.get());
}
}
public static final class AtomicReferenceSerializer
extends StdSerializer<AtomicReference<?>>
{
public AtomicReferenceSerializer()
{
super(false);
}
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper paramJsonFormatVisitorWrapper, JavaType paramJavaType)
throws JsonMappingException
{
paramJsonFormatVisitorWrapper.expectAnyFormat(paramJavaType);
}
public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
{
return createSchemaNode("any", true);
}
public void serialize(AtomicReference<?> paramAtomicReference, JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider)
throws IOException, JsonGenerationException
{
paramSerializerProvider.defaultSerializeValue(paramAtomicReference.get(), paramJsonGenerator);
}
}
}
/* Location:
* Qualified Name: com.fasterxml.jackson.databind.ser.std.StdJdkSerializers
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
f6efb352db6103fc2b60c42e442f00a2b1f10922 | 99993cee373542810763c6a037db527b86b0d4ac | /fluent/src/main/java/io/kubernetes/client/openapi/models/V1CapabilitiesBuilder.java | c0ca31a49b9a6f09b57a8af53db8ca7ec158ce0a | [
"Apache-2.0"
] | permissive | saparaj/java | b54c355f2276ac7ac2cd09f2f0cf3212f7c41b2d | a7266c798f16ab01e9ceac441de199bd8a5a839a | refs/heads/master | 2023-08-15T19:35:11.163843 | 2021-10-13T16:53:49 | 2021-10-13T16:53:49 | 269,235,029 | 0 | 0 | Apache-2.0 | 2020-06-04T01:46:44 | 2020-06-04T01:46:43 | null | UTF-8 | Java | false | false | 3,135 | java | package io.kubernetes.client.openapi.models;
import io.kubernetes.client.fluent.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class V1CapabilitiesBuilder extends io.kubernetes.client.openapi.models.V1CapabilitiesFluentImpl<io.kubernetes.client.openapi.models.V1CapabilitiesBuilder> implements io.kubernetes.client.fluent.VisitableBuilder<io.kubernetes.client.openapi.models.V1Capabilities,io.kubernetes.client.openapi.models.V1CapabilitiesBuilder> {
io.kubernetes.client.openapi.models.V1CapabilitiesFluent<?> fluent;
java.lang.Boolean validationEnabled;
public V1CapabilitiesBuilder() {
this(true);
}
public V1CapabilitiesBuilder(java.lang.Boolean validationEnabled) {
this(new V1Capabilities(), validationEnabled);
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1CapabilitiesFluent<?> fluent) {
this(fluent, true);
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1CapabilitiesFluent<?> fluent,java.lang.Boolean validationEnabled) {
this(fluent, new V1Capabilities(), validationEnabled);
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1CapabilitiesFluent<?> fluent,io.kubernetes.client.openapi.models.V1Capabilities instance) {
this(fluent, instance, true);
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1CapabilitiesFluent<?> fluent,io.kubernetes.client.openapi.models.V1Capabilities instance,java.lang.Boolean validationEnabled) {
this.fluent = fluent;
fluent.withAdd(instance.getAdd());
fluent.withDrop(instance.getDrop());
this.validationEnabled = validationEnabled;
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1Capabilities instance) {
this(instance,true);
}
public V1CapabilitiesBuilder(io.kubernetes.client.openapi.models.V1Capabilities instance,java.lang.Boolean validationEnabled) {
this.fluent = this;
this.withAdd(instance.getAdd());
this.withDrop(instance.getDrop());
this.validationEnabled = validationEnabled;
}
public io.kubernetes.client.openapi.models.V1Capabilities build() {
V1Capabilities buildable = new V1Capabilities();
buildable.setAdd(fluent.getAdd());
buildable.setDrop(fluent.getDrop());
return buildable;
}
public boolean equals(java.lang.Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
V1CapabilitiesBuilder that = (V1CapabilitiesBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(fluent, validationEnabled, super.hashCode());
}
}
| [
"bburns@microsoft.com"
] | bburns@microsoft.com |
bc84afe7aae30081af8a2480da18b120df3e9892 | 15efb566b6ede8ff3dd5ac88eb3d391c031b40c0 | /bonita-integration-tests/bonita-integration-tests-services/src/test/java/org/bonitasoft/engine/persistence/PersistenceTestUtil.java | 5abf4559d1777586a11a4ef1f46cf128880fbc1e | [] | no_license | neoludo/bonita-engine | 0b184240231ce400243274a5ce1f7525661411bd | bba8bcebd7965e6ba501d025290f562f30374e8e | refs/heads/master | 2021-01-18T01:07:00.877702 | 2015-04-14T16:50:51 | 2015-04-15T07:04:18 | 34,102,320 | 0 | 0 | null | 2015-04-17T07:18:45 | 2015-04-17T07:18:44 | null | UTF-8 | Java | false | false | 2,473 | java | /**
* Copyright (C) 2015 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.bonitasoft.engine.persistence;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.HashMap;
import java.util.Map;
import org.bonitasoft.engine.persistence.model.Human;
import org.bonitasoft.engine.persistence.model.Parent;
public class PersistenceTestUtil {
protected static void checkHuman(final Human expected, final Human actual) {
assertNotNull(actual);
assertEquals(expected.getId(), actual.getId());
assertEquals(expected.getFirstName(), actual.getFirstName());
assertEquals(expected.getLastName(), actual.getLastName());
assertEquals(expected.getAge(), actual.getAge());
}
protected static Human buildHuman(final Human src) {
final Human human = buildHuman(src.getFirstName(), src.getLastName(), src.getAge());
human.setId(src.getId());
return human;
}
protected static Human buildHuman(final String firstName, final String lastName, final int age) {
final Human human = new Human();
human.setFirstName(firstName);
human.setLastName(lastName);
human.setAge(age);
return human;
}
protected static Parent buildParent(final String firstName, final String lastName, final int age) {
final Parent parent = new Parent();
parent.setFirstName(firstName);
parent.setLastName(lastName);
parent.setAge(age);
return parent;
}
protected static Map<String, Object> getMap(final String key, final Object value) {
final Map<String, Object> map = new HashMap<String, Object>();
map.put(key, value);
return map;
}
}
| [
"emmanuel.duchastenier@bonitasoft.com"
] | emmanuel.duchastenier@bonitasoft.com |
13dfaed5b156dc12e12298d4729444b701701400 | 56864db9eb0f96c03e64dbcb84c6caa104c2097f | /src/main/java/com/example/jaxrs/JaxrsActivator.java | 8e929fa86c5701ddb77d4c2adab9399f71a788ce | [
"MIT"
] | permissive | backpaper0/jakarta-ee-example | df82afec909897b8d0e60a123962ba8b584c12ad | 302f36f2657d7f1d0532e3d130339de3bf4c19eb | refs/heads/master | 2023-08-25T02:00:23.372341 | 2021-09-30T06:12:38 | 2021-09-30T06:12:38 | 324,758,864 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 178 | java | package com.example.jaxrs;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationPath("api")
public class JaxrsActivator extends Application {
}
| [
"backpaper0@gmail.com"
] | backpaper0@gmail.com |
56cd19be0efe70019e48cf2caa67c5a4fdecb491 | 4b5d5dc67970d34e7cb55040e849a9de9d77b612 | /part6_spring_aop/src/robin_permission_check/service/CustomerService.java | 3af499b89457d61669e6003cce50852f32576aa8 | [] | no_license | robin2017/cete28 | 9b74b36bda8139b59394e861b5ab0e446d7cfa2c | 4fe0feb2e890eadceed8d9f858fc55ee8649d1d1 | refs/heads/master | 2021-09-12T14:28:41.993102 | 2018-04-17T16:03:06 | 2018-04-17T16:03:06 | 100,281,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package robin_permission_check.service;
public interface CustomerService {
public void saveObject();
public void updateObject();
public void readObject();
}
| [
"robin.seu@foxmail.com"
] | robin.seu@foxmail.com |
3f2f63502459bf242293ed57cc2bfdcaf2f367a0 | c911cec851122d0c6c24f0e3864cb4c4def0da99 | /com/upsight/android/unitybindingpush/BuildConfig.java | 7c771185e8337bf8ad414ef4e1a11ba800484160 | [] | no_license | riskyend/PokemonGo_RE_0.47.1 | 3a468ad7b6fbda5b4f8b9ace30447db2211fc2ed | 2ca0c6970a909ae5e331a2430f18850948cc625c | refs/heads/master | 2020-01-23T22:04:35.799795 | 2016-11-19T01:01:46 | 2016-11-19T01:01:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | package com.upsight.android.unitybindingpush;
public final class BuildConfig
{
public static final String APPLICATION_ID = "com.upsight.android.unitybindingpush";
public static final String BUILD_TYPE = "release";
public static final boolean DEBUG = false;
public static final String FLAVOR = "";
public static final int VERSION_CODE = 0;
public static final String VERSION_NAME = "4.2.5-cb.5";
}
/* Location: /Users/mohamedtajjiou/Downloads/Rerverse Engeneering/dex2jar-2.0/com.nianticlabs.pokemongo_0.47.1-2016111700_minAPI19(armeabi-v7a)(nodpi)_apkmirror.com (1)-dex2jar.jar!/com/upsight/android/unitybindingpush/BuildConfig.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"mohamedtajjiou@Mohameds-Air.SpeedportEntry2090126200030"
] | mohamedtajjiou@Mohameds-Air.SpeedportEntry2090126200030 |
94e582183ba690087268ab6d34f89a82a64dab5c | a85d2dccd5eab048b22b2d66a0c9b8a3fba4d6c2 | /rebellion_h5_realm/data/scripts/ai/den_of_evil/HestuiGuard.java | ee4daefaa7c1c918f736f199d11a4ac254a80a44 | [] | no_license | netvirus/reb_h5_storm | 96d29bf16c9068f4d65311f3d93c8794737d4f4e | 861f7845e1851eb3c22d2a48135ee88f3dd36f5c | refs/heads/master | 2023-04-11T18:23:59.957180 | 2021-04-18T02:53:10 | 2021-04-18T02:53:10 | 252,070,605 | 0 | 0 | null | 2021-04-18T02:53:11 | 2020-04-01T04:19:39 | HTML | UTF-8 | Java | false | false | 911 | java | package ai.den_of_evil;
import l2r.gameserver.ai.DefaultAI;
import l2r.gameserver.model.Player;
import l2r.gameserver.model.World;
import l2r.gameserver.model.instances.NpcInstance;
import l2r.gameserver.network.serverpackets.components.NpcString;
import l2r.gameserver.scripts.Functions;
/**
* @author VISTALL
* @date 19:24/28.08.2011 Npc Id: 32026 Кричит в чат - если лвл ниже чем 37 включно
*/
public class HestuiGuard extends DefaultAI
{
public HestuiGuard(NpcInstance actor)
{
super(actor);
AI_TASK_DELAY_CURRENT = AI_TASK_ACTIVE_DELAY = AI_TASK_ATTACK_DELAY = 10000L;
}
@Override
protected boolean thinkActive()
{
NpcInstance actor = getActor();
for (Player player : World.getAroundPlayers(actor))
{
if (player.getLevel() <= 37)
Functions.npcSay(actor, NpcString.THIS_PLACE_IS_DANGEROUS_S1, player.getName());
}
return false;
}
}
| [
"l2agedev@gmail.com"
] | l2agedev@gmail.com |
10b87649e344d224daceecfcd6fd42286fb22836 | 0eab961b7cf24b155631983cacadd6405427bffd | /src/test/java/org/clafer/graph/TopologicalSortTest.java | 183f8bf5e177154063441eb843f144b765ad3dcc | [
"MIT"
] | permissive | rkamath3/chocosolver | fd322790c70b27af3a1645dcdeaefe6142eb3444 | 229ab5d3e6a304ccc52eeee0401ee4dade24484a | refs/heads/master | 2020-12-14T06:11:28.248255 | 2015-05-13T16:09:00 | 2015-05-13T16:09:00 | 36,599,453 | 0 | 0 | MIT | 2020-05-11T19:39:52 | 2015-05-31T11:07:19 | Java | UTF-8 | Java | false | false | 2,947 | java | package org.clafer.graph;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.junit.Assert.*;
import org.junit.Test;
/**
*
* @author jimmy
*/
public class TopologicalSortTest {
private static <T> HashSet<T> set(T... items) {
return new HashSet<>(Arrays.asList(items));
}
@Test
public void testSingletonNodes() {
KeyGraph<Character> graph = new KeyGraph<>();
graph.getVertex('a');
graph.getVertex('b');
List<Set<Character>> components = GraphUtil.computeStronglyConnectedComponents(graph);
assertEquals(2, components.size());
}
@Test
public void testSelfReference() {
KeyGraph<Character> graph = new KeyGraph<>();
graph.getVertex('a').addNeighbour(graph.getVertex('b'));
graph.getVertex('b').addNeighbour(graph.getVertex('b'));
graph.getVertex('b').addNeighbour(graph.getVertex('c'));
List<Set<Character>> components = GraphUtil.computeStronglyConnectedComponents(graph);
assertEquals(3, components.size());
assertEquals(set('c'), components.get(0));
assertEquals(set('b'), components.get(1));
assertEquals(set('a'), components.get(2));
}
@Test
public void testCycles() {
KeyGraph<Character> graph = new KeyGraph<>();
graph.getVertex('a').addNeighbour(graph.getVertex('b'));
graph.getVertex('b').addNeighbour(graph.getVertex('c'));
graph.getVertex('c').addNeighbour(graph.getVertex('d'));
graph.getVertex('d').addNeighbour(graph.getVertex('e'));
graph.getVertex('d').addNeighbour(graph.getVertex('b'));
graph.getVertex('f').addNeighbour(graph.getVertex('b'));
graph.getVertex('g').addNeighbour(graph.getVertex('f'));
graph.getVertex('h').addNeighbour(graph.getVertex('b'));
graph.getVertex('i').addNeighbour(graph.getVertex('a'));
graph.getVertex('j').addNeighbour(graph.getVertex('i'));
graph.getVertex('j').addNeighbour(graph.getVertex('g'));
graph.getVertex('j').addNeighbour(graph.getVertex('k'));
graph.getVertex('i').addNeighbour(graph.getVertex('g'));
graph.getVertex('f').addNeighbour(graph.getVertex('j'));
graph.getVertex('e').addNeighbour(graph.getVertex('e'));
graph.getVertex('b').addNeighbour(graph.getVertex('b'));
graph.getVertex('k').addNeighbour(graph.getVertex('a'));
List<Set<Character>> components = GraphUtil.computeStronglyConnectedComponents(graph);
assertEquals(6, components.size());
assertEquals(set('e'), components.get(0));
assertEquals(set('b', 'c', 'd'), components.get(1));
assertEquals(set('a'), components.get(2));
assertEquals(set('k'), components.get(3));
assertEquals(set('f', 'g', 'i', 'j'), components.get(4));
assertEquals(set('h'), components.get(5));
}
}
| [
"paradoxical.reasoning@gmail.com"
] | paradoxical.reasoning@gmail.com |
b0ca5ffac6142318113e76ad6f0f4eb33349f723 | 83943f941708b6db4d2597e3f3b0978bb34cb56d | /services/plansProposalsFacade/plansProposalsFacade-portlet-service/src/main/java/com/ext/portlet/service/persistence/ProposalMoveHistoryActionableDynamicQuery.java | 713ea42ff9bd946b97cd3d501580848910be8e14 | [
"MIT"
] | permissive | jccarrillo/XCoLab | 138b30061867cbba308bcc30057af61d07748198 | 647437de900229d8cb0c4248f99e399cfdddda44 | refs/heads/master | 2021-01-17T09:55:41.848269 | 2016-07-26T09:22:09 | 2016-07-26T09:22:09 | 62,179,305 | 0 | 0 | null | 2016-06-28T22:50:57 | 2016-06-28T22:50:54 | null | UTF-8 | Java | false | false | 804 | java | package com.ext.portlet.service.persistence;
import com.ext.portlet.model.ProposalMoveHistory;
import com.ext.portlet.service.ProposalMoveHistoryLocalServiceUtil;
import com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
/**
* @author Brian Wing Shun Chan
* @generated
*/
public abstract class ProposalMoveHistoryActionableDynamicQuery
extends BaseActionableDynamicQuery {
public ProposalMoveHistoryActionableDynamicQuery()
throws SystemException {
setBaseLocalService(ProposalMoveHistoryLocalServiceUtil.getService());
setClass(ProposalMoveHistory.class);
setClassLoader(com.ext.portlet.service.ClpSerializer.class.getClassLoader());
setPrimaryKeyPropertyName("id_");
}
}
| [
"jobachhu@mit.edu"
] | jobachhu@mit.edu |
6c407ae83bc3e8a7aa9eaf145b8aa7a91496b62e | 8a787e93fea9c334122441717f15bd2f772e3843 | /odfdom/src/main/java/org/odftoolkit/odfdom/dom/attribute/smil/SmilValuesAttribute.java | 37577a8830521f7f98a8e40a00606000b91a34b3 | [
"BSD-3-Clause",
"MIT",
"W3C",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | apache/odftoolkit | 296ea9335bfdd78aa94829c915a6e9c24e5b5166 | 99975f3be40fc1c428167a3db7a9a63038acfa9f | refs/heads/trunk | 2023-07-02T16:30:24.946067 | 2018-10-02T11:11:40 | 2018-10-02T11:11:40 | 5,212,656 | 39 | 45 | Apache-2.0 | 2018-04-11T11:57:17 | 2012-07-28T07:00:12 | Java | UTF-8 | Java | false | false | 2,948 | java | /************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
*
* Use is subject to license terms.
*
* 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. You can also
* obtain a copy of the License at http://odftoolkit.org/docs/license.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
************************************************************************/
/*
* This file is automatically generated.
* Don't edit manually.
*/
package org.odftoolkit.odfdom.dom.attribute.smil;
import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
import org.odftoolkit.odfdom.pkg.OdfAttribute;
import org.odftoolkit.odfdom.pkg.OdfFileDom;
import org.odftoolkit.odfdom.pkg.OdfName;
/**
* DOM implementation of OpenDocument attribute {@odf.attribute smil:values}.
*
*/
public class SmilValuesAttribute extends OdfAttribute {
public static final OdfName ATTRIBUTE_NAME = OdfName.newName(OdfDocumentNamespace.SMIL, "values");
/**
* Create the instance of OpenDocument attribute {@odf.attribute smil:values}.
*
* @param ownerDocument The type is <code>OdfFileDom</code>
*/
public SmilValuesAttribute(OdfFileDom ownerDocument) {
super(ownerDocument, ATTRIBUTE_NAME);
}
/**
* Returns the attribute name.
*
* @return the <code>OdfName</code> for {@odf.attribute smil:values}.
*/
@Override
public OdfName getOdfName() {
return ATTRIBUTE_NAME;
}
/**
* @return Returns the name of this attribute.
*/
@Override
public String getName() {
return ATTRIBUTE_NAME.getLocalName();
}
/**
* Returns the default value of {@odf.attribute smil:values}.
*
* @return the default value as <code>String</code> dependent of its element name
* return <code>null</code> if the default value does not exist
*/
@Override
public String getDefault() {
return null;
}
/**
* Default value indicator. As the attribute default value is dependent from its element, the attribute has only a default, when a parent element exists.
*
* @return <code>true</code> if {@odf.attribute smil:values} has an element parent
* otherwise return <code>false</code> as undefined.
*/
@Override
public boolean hasDefault() {
return false;
}
/**
* @return Returns whether this attribute is known to be of type ID (i.e. xml:id ?)
*/
@Override
public boolean isId() {
return false;
}
}
| [
"dev-null@apache.org"
] | dev-null@apache.org |
161b3fde2fc840e3d4bb774ac9a60e525ac918a5 | 5ecd15baa833422572480fad3946e0e16a389000 | /framework/Synergetics-Open/subsystems/cornerstone/main/api/java/com/volantis/shared/dependency/Freshness.java | 7e92f664f66a30f22851a507f2c232470cb80817 | [] | no_license | jabley/volmobserverce | 4c5db36ef72c3bb7ef20fb81855e18e9b53823b9 | 6d760f27ac5917533eca6708f389ed9347c7016d | refs/heads/master | 2021-01-01T05:31:21.902535 | 2009-02-04T02:29:06 | 2009-02-04T02:29:06 | 38,675,289 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,630 | java | /*
This file is part of Volantis Mobility Server.
Volantis Mobility Server 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.
Volantis Mobility Server 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 Volantis Mobility Server. If not, see <http://www.gnu.org/licenses/>.
*/
/* ----------------------------------------------------------------------------
* (c) Volantis Systems Ltd 2006.
* ----------------------------------------------------------------------------
*/
package com.volantis.shared.dependency;
/**
* An enumeration of the different levels of freshness that a dependency may
* have.
*/
public class Freshness {
/**
* The dependency is fresh as the original source has not changed since
* the dependency was created.
*
* <p>e.g. the dependency was a HTTP response that had a calculated time
* to live of 1 hour and only 20 minutes have elapsed since it was
* created.</p>
*/
public static final Freshness FRESH = new Freshness("FRESH", 0);
/**
* The dependency is unsure about whether its original source has
* changed or not since the dependency was created.
*
* <p>In this case the dependency needs to revalidate itself with its
* origin source to see whether it has changed.</p>
*
* <p>e.g. the dependency was a HTTP response that had a calculated time
* to live of 1 hour and 65 minutes have elapsed since it was created.</p>
*/
public static final Freshness REVALIDATE = new Freshness("REVALIDATE", 1);
/**
* The dependency is stale as the original source has changed since the
* dependency was created.
*
* <p>e.g. the dependency was a HTTP response that could not be cached.</p>
*/
public static final Freshness STALE = new Freshness("STALE", 2);
/**
* The name of the enumeration, for debug only.
*/
private final String name;
/**
* The level of enumeration, used by {@link #combine(Freshness)} to
* determine which enumeration instance to return.
*/
private final int level;
/**
* Initialise.
*
* @param name The name of the enumeration.
* @param level The level.
*/
private Freshness(String name, int level) {
this.name = name;
this.level = level;
}
/**
* Combine this instance with the supplied one.
*
* <p>The rules for combination are as follows:</p>
* <ol>
* <li>If either is {@link #STALE} then the result is {@link #STALE}.</li>
* <li>If either is {@link #REVALIDATE} then the result is {@link #REVALIDATE}.</li>
* <li>Otherwise the result is {@link #FRESH}.</li>
* </ol>
*
* @param freshness The instance with which this is to be combined.
* @return The result of combining.
*/
public Freshness combine(Freshness freshness) {
if (freshness == null) {
throw new IllegalArgumentException("freshness cannot be null");
}
if (level > freshness.level) {
return this;
} else {
return freshness;
}
}
// Javadoc inherited.
public String toString() {
return name;
}
}
| [
"iwilloug@b642a0b7-b348-0410-9912-e4a34d632523"
] | iwilloug@b642a0b7-b348-0410-9912-e4a34d632523 |
5d8efe213cb35fe4ba7a90ead8dc3c9c2a359b25 | 6395a4761617ad37e0fadfad4ee2d98caf05eb97 | /.history/src/main/java/frc/robot/commands/cmdArmDrop_20191112145203.java | 59aaefed08c68d60a1475f9ab50da9bdce5af427 | [] | no_license | iNicole5/Cheesy_Drive | 78383e3664cf0aeca42fe14d583ee4a8af65c1a1 | 80e1593512a92dbbb53ede8a8af968cc1efa99c5 | refs/heads/master | 2020-09-22T06:38:04.415411 | 2019-12-01T00:50:53 | 2019-12-01T00:50:53 | 225,088,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
import frc.robot.Robot;
public class cmdArmDrop extends Command
{
boolean direction;
public cmdClawDrop(boolean direction)
{
requires(Robot.sub_climber);
this.direction = direction;
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute()
{
Robot.sub_climber.ClawRelease(direction);
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
@Override
protected void end() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
}
}
| [
"40499551+iNicole5@users.noreply.github.com"
] | 40499551+iNicole5@users.noreply.github.com |
c37789892a14c3aec868269ddcab316ff2854645 | f2f150013db4269db7a69976575802318fae23e4 | /src/main/java/com/liuyang19900520/shiro/CredentialsMatcher.java | 95465b00ee681f6bd387e78033b1675574670b90 | [] | no_license | liuyang19900520/IOTPage_account | 901ad97862e18675c387175dd87f5ccfd05e0fc3 | 17a6eeff4559907476adb9208bd84622c5f7958b | refs/heads/master | 2021-04-09T10:21:11.767987 | 2018-05-24T12:17:23 | 2018-05-24T12:17:23 | 125,444,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,194 | java | package com.liuyang19900520.shiro;
import com.liuyang19900520.shiro.token.HmacToken;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;
/**
* Created by liuyang on 2018/3/16
* @author liuya
*/
public class CredentialsMatcher extends SimpleCredentialsMatcher {
// token:用户在页面输入的用户名密码,info代表从密码中得到的加数据
@Override
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
// 向下转型
HmacToken userToken = (HmacToken) token;
// 将用户输入的原始密码加密
// 注意token.getPassword()拿到的是一个char[],不能直接用toString(),它底层实现不是我们想的直接字符串,只能强转
// 用户名做为salt
Object tokenCredentials = Encrypt.md5(userToken.getCredentials().toString(), userToken.getPrincipal().toString());
//取得数据库中的密码数据
Object accountCredentials = getCredentials(info);
return equals(tokenCredentials, accountCredentials);
}
}
| [
"liuyang19900520@hotmail.com"
] | liuyang19900520@hotmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.