blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
listlengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e8438e072e772abcc4bbfc80c364571ca6f97e46 | 4aaaa56ad744dfbc562ccab9a7670c30f11f503c | /src/main/java/org/twdata/objects/screen/Game.java | 056fcd076867f1bbc4dccbe952c9201dac23beb3 | []
| no_license | mrdon/twdata-objects | 7402a8ceb7c0ed20eb00d95dd46eabf1ed34f4dd | 85d23b4a00186f317cfc99801fdc8f48fc11b720 | refs/heads/master | 2021-01-19T06:18:01.196592 | 2010-10-21T06:30:37 | 2010-10-21T06:30:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 184 | java | package org.twdata.objects.screen;
/**
*
*/
public class Game
{
public <M extends Screen> M create(Class<M> screenClass, Object... extraArgs)
{
return null;
}
}
| [
"[email protected]"
]
| |
859feddaba60771b0740045efd5c605c525926ef | 3efc2074ee6f64c92c2e0c272153f8d602b65945 | /Muse_Valerio/Muse/unibo/unibo/util/FrameStatistics.java | e00223b66d87e72094d0f523dad973f5b3228c7b | []
| no_license | marconanni/muse3 | 80ea97e2357d42a8426ca565f179ed62ea421dfe | 98004320df6eef09a97915c0c02b1e3146ea2bd1 | refs/heads/master | 2021-01-10T18:44:32.171711 | 2010-03-03T14:44:18 | 2010-03-03T14:44:18 | 34,604,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,374 | java | package unibo.util;
import java.io.IOException;
import javax.media.Buffer;
import javax.media.MediaLocator;
import javax.media.protocol.DataSource;
import unibo.core.CircularBuffer;
import unibo.core.parser.Parser;
import unibo.core.parser.QuickTimeFileParser;
import unibo.core.thread.ParserThread;
import unibo.core.thread.TranscodeThread;
import unibo.core.transcoder.H263toYUVDecoder;
import unibo.core.transcoder.Transcode;
import unibo.core.transcoder.YUVtoH263Encoder;
import com.sun.media.ExtBuffer;
/**
* @author afalchi
*/
public class FrameStatistics {
public static void main(String[] args) {
DataSource ds=new com.sun.media.protocol.file.DataSource();
ds.setLocator(new MediaLocator("file://C:/afalchi/misc/starwars.mov"));
try {
// ***** PARSER *****
Parser qtParser=new QuickTimeFileParser(ds);
ParserThread parserThread=new ParserThread(qtParser,10);
//CircularBuffer buffer=parserThread.getOuputBuffer();
// ***** DECODER DA H263 A YUV *****
Transcode decoder=new H263toYUVDecoder(qtParser.getTrackFormat(0));
TranscodeThread decoderThread=new TranscodeThread(decoder,
parserThread.getOutputBufferSet()[0],
new CircularBuffer(20));
//CircularBuffer buffer=decoderThread.getOuputBuffer();
// ***** ENCODER DA YUV A H263/RTP *****
Transcode encoder=new YUVtoH263Encoder(decoder.getOutputFormat());
TranscodeThread encoderThread=new TranscodeThread(encoder,
decoderThread.getOuputBuffer(),
new CircularBuffer(40));
CircularBuffer buffer=encoderThread.getOuputBuffer();
parserThread.start();
decoderThread.start();
encoderThread.start();
ExtBuffer frame=buffer.getFrame();
int zeroMarkedFrame=0;
int minFrameSize=frame.getLength();
int maxFrameSize=frame.getLength();
int frameAx=frame.getLength();
int frameCounter=1;
if ((frame.getFlags() & Buffer.FLAG_RTP_MARKER)==0) zeroMarkedFrame++;
do {
frame=buffer.getFrame();
if (frame.getLength()>maxFrameSize) maxFrameSize=frame.getLength();
else if (frame.getLength()<minFrameSize) minFrameSize=frame.getLength();
frameCounter++;
frameAx=frameAx+frame.getLength();
if ((frame.getFlags() & Buffer.FLAG_RTP_MARKER)==0) zeroMarkedFrame++;
}
while (!frame.isEOM());
System.out.println("Format: "+frame.getFormat());
System.out.println("Processed frames: "+frameCounter);
System.out.println("min frame size (bytes): "+minFrameSize);
System.out.println("med frame size (bytes): "+frameAx/frameCounter);
System.out.println("max frame size (bytes): "+maxFrameSize);
System.out.println("Zero Marked Frame: "+zeroMarkedFrame);
}
catch (IOException e) {
System.err.println("Init Failed: "+e);
System.exit(1);
}
}
} | [
"pire.dejaco@0b1e5f34-49f6-11de-a65c-33beeba39556"
]
| pire.dejaco@0b1e5f34-49f6-11de-a65c-33beeba39556 |
f76513c6f8f944f1a1080fc5a23304b6e2e70dd0 | a599694ee4c9e59e6a6b29a5fb85e71b8f7ff31f | /onlineshop-master.zip_expanded/onlineshop-master/Shop/src/com/es/eoi/shop/entities/Warehouse.java | 7c5b3835e13f8da7794c0fdf5c8ad5c02e4ce099 | []
| no_license | RubenEsquerdo/repository | 1e6674b4ee248d4e2e6465162d173bfc76ac7678 | 57c793efaafa3753088a242174a1c536320eb606 | refs/heads/master | 2022-08-01T11:05:13.571807 | 2019-08-16T17:40:58 | 2019-08-16T17:40:58 | 199,502,929 | 0 | 0 | null | 2022-06-21T01:40:51 | 2019-07-29T18:01:59 | Java | UTF-8 | Java | false | false | 319 | java | package com.es.eoi.shop.entities;
public class Warehouse {
private Article[] articles;
public Warehouse(int size) {
this.articles = new Article[size];
}
public Article[] getArticles() {
return articles;
}
public void setArticles(Article[] articles) {
this.articles = articles;
}
}
| [
"[email protected]"
]
| |
097ba3aa40b56b0226c5798531871985ac22001e | c2fd778c90371a08f0cd9e1057f58092e83a678f | /keepjob-web/src/main/java/com/keepjob/sys/tag/ToolBarButtonTag.java | 3735172c19dce668239452c4fb2901185228d16f | []
| no_license | Rabbits325LK/KJ | cac65f9a64b67e19cad6bf3a1175d64310b899ba | 4a0046c406f3ae97ca798ad3c238d70aa9544348 | refs/heads/master | 2021-01-10T16:09:20.240039 | 2017-01-10T02:00:06 | 2017-01-10T02:00:06 | 49,947,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,332 | java | package com.keepjob.sys.tag;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
@SuppressWarnings("serial")
public class ToolBarButtonTag extends TagSupport {
private String id;
private String url;
private String name;
private String styleClass;
private String options;
private boolean security = true;
public int doEndTag() throws JspTagException{
ToolBarTag parent = (ToolBarTag)findAncestorWithClass(this, ToolBarTag.class);
parent.addButton(id, name, url, styleClass, options, security);
return EVAL_PAGE;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStyleClass() {
return styleClass;
}
public void setStyleClass(String styleClass) {
this.styleClass = styleClass;
}
public String getOptions() {
return options;
}
public void setOptions(String options) {
this.options = options;
}
public boolean isSecurity() {
return security;
}
public void setSecurity(boolean security) {
this.security = security;
}
}
| [
"[email protected]"
]
| |
71b2cb7ecb891ac961b50f919def473b106d54c0 | 171190208e2ce2d74f0262e05768b6d7921d01d3 | /src/java/listener/DBConnectionListener.java | bf5ab1f562088299220a3b6e371b41f6a1287aad | []
| no_license | huangquanzhi/PizzaOrderingSystem | 7de88fd12b2e3c02d73bebc1d7dea3faf5336210 | b23111a4b0842f27560d7df5680c73d8bb6d42c6 | refs/heads/master | 2021-05-30T19:29:42.800693 | 2015-12-10T18:30:33 | 2015-12-10T18:30:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,320 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package listener;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import model.DBConnection;
/**
* Web application lifecycle listener.
*
* @author Jackie
*/
public class DBConnectionListener implements ServletContextListener {
/**
*
* @param sce
*/
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext sc = sce.getServletContext();
String driver = sc.getInitParameter("driver");
String url = sc.getInitParameter("url");
String db = sc.getInitParameter("database");
String user = sc.getInitParameter("dbusername");
String pass = sc.getInitParameter("dbpassword");
DBConnection dbConn = new DBConnection(driver,url,db,user,pass);
sc.setAttribute("dbConn", dbConn);
}
/**
*
* @param sce
*/
@Override
public void contextDestroyed(ServletContextEvent sce) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}
| [
"[email protected]"
]
| |
b0fda76a4f9fab996cb1ac7fe76e0717ef3f61aa | ae225f848de06c4d96a2490c397908f1a05596c2 | /src/main/java/urszulaslusarz/config/DefaultProfileUtil.java | e10c6df23ba79f3c69ba7fec5a82b92b52364a8c | []
| no_license | UrszulaSlusarz/webapplication | fcf902f6823582b719dd634a8a8c218bc72d5293 | bdd24ee499d040a9dfb70c16db8f573c51fa04f5 | refs/heads/master | 2021-07-05T04:56:58.104738 | 2019-02-16T07:24:51 | 2019-02-16T07:24:51 | 170,975,347 | 0 | 1 | null | 2020-09-18T17:16:07 | 2019-02-16T07:24:41 | Java | UTF-8 | Java | false | false | 1,709 | java | package urszulaslusarz.config;
import io.github.jhipster.config.JHipsterConstants;
import org.springframework.boot.SpringApplication;
import org.springframework.core.env.Environment;
import java.util.*;
/**
* Utility class to load a Spring profile to be used as default
* when there is no <code>spring.profiles.active</code> set in the environment or as command line argument.
* If the value is not available in <code>application.yml</code> then <code>dev</code> profile will be used as default.
*/
public final class DefaultProfileUtil {
private static final String SPRING_PROFILE_DEFAULT = "spring.profiles.default";
private DefaultProfileUtil() {
}
/**
* Set a default to use when no profile is configured.
*
* @param app the Spring application
*/
public static void addDefaultProfile(SpringApplication app) {
Map<String, Object> defProperties = new HashMap<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the <code>application.yml</code> file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put(SPRING_PROFILE_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
app.setDefaultProperties(defProperties);
}
/**
* Get the profiles that are applied else get default profiles.
*
* @param env spring environment
* @return profiles
*/
public static String[] getActiveProfiles(Environment env) {
String[] profiles = env.getActiveProfiles();
if (profiles.length == 0) {
return env.getDefaultProfiles();
}
return profiles;
}
}
| [
"[email protected]"
]
| |
f566f059ab26b942f262f43286f09a2932b3589b | 5314c2bfc6e1fa4b62df6b7ba90bce7bb2d14e79 | /java/algorithms/src/org/parayno/algorithms/unionfind/percolation/PercolationStats.java | 2ac909672a823f9e0e530cf6733c3b384113a3cf | []
| no_license | ferrillgunnel/sandbox | fa185dd8d1d4b6b2104ed1ee5ecda739038845a4 | 9946b462a1486d77b85b46746a37732e34294b48 | refs/heads/master | 2023-03-18T08:26:14.487013 | 2015-11-22T10:45:01 | 2015-11-22T10:45:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,386 | java | package org.parayno.algorithms.unionfind.percolation;
import java.util.Random;
import edu.princeton.cs.algs4.StdStats;
public class PercolationStats {
// private int sum = 0;
private int iterations = 0;
private double[] percolations;
// perform T independent experiments on an N-by-N grid
public PercolationStats(int N, int T) {
if (N <= 0) {
throw new IllegalArgumentException("N must be a positive number. Given:" + N);
}
if (T <= 0) {
throw new IllegalArgumentException("T must be a positive number. Given:" + T);
}
percolations = new double[T];
for (int i = 0; i < T; i++) {
double openSites = 0.0;
Percolation perc = new Percolation(N);
while (!perc.percolates()) {
// Usually this can be a field rather than a method variable
Random rand = new Random();
// nextInt is normally exclusive of the top value,
// so add 1 to make it inclusive
int min = 1;
int x = rand.nextInt((N - min) + 1) + min;
int y = rand.nextInt((N - min) + 1) + min;
// System.out.println("Opening: " + x + "," + y);
if (!perc.isOpen(x, y)) {
perc.open(x, y);
openSites++;
}
// System.out.println("OPEN SITES: " + openSites + ", TOTAL SITES:" + (N * N));
}
// System.out.println("Xt:" + (openSites / (N * N)));
percolations[i] = (openSites / (N * N));
// sum += openSites;
}
iterations = T;
}
// sample mean of percolation threshold
public double mean() {
// return (sum / iterations);
return StdStats.mean(percolations);
}
// sample standard deviation of percolation threshold
public double stddev() {
/*
* double mean = mean(); double sum = 0; for (int i = 0; i < percolations.length; i++) { sum += (percolations[i] - mean)
* * (percolations[i] - mean); } return Math.sqrt((sum / (iterations - 1)));
*/
return StdStats.stddev(percolations);
}
// low endpoint of 95% confidence interval
public double confidenceLo() {
return mean() - ((1.96 * stddev()) / Math.sqrt(iterations));
}
// high endpoint of 95% confidence interval
public double confidenceHi() {
return mean() + ((1.96 * stddev()) / Math.sqrt(iterations));
}
// test client (described below)
public static void main(String[] args) {
if (args.length < 2) {
throw new IllegalArgumentException();
}
int N = Integer.parseInt(args[0]);
int T = Integer.parseInt(args[1]);
if (N <= 0) {
throw new IllegalArgumentException("N must be a positive number. Given:" + N);
}
if (T <= 0) {
throw new IllegalArgumentException("T must be a positive number. Given:" + T);
}
PercolationStats stats = new PercolationStats(Integer.parseInt(args[0]), Integer.parseInt(args[1]));
System.out.println("mean = " + stats.mean());
System.out.println("stddev = " + stats.stddev());
System.out.println("95% confidence interval = " + stats.confidenceLo() + "," + stats.confidenceHi());
}
} | [
"[email protected]"
]
| |
c8106d6953a8ec5dd2696481584144f085027f8e | 5364adf7d5c36161a58a01d1db7ce661cf189e3b | /src/main/java/com/drowsiness/dto/user/UserAuthenDTO.java | a5d9cf73c7997a84d0385b53afbb10bce7453fc1 | []
| no_license | thanhnvse/drowsinesss | de7f625ccfb0d8af2ec17fbffa23656e5e1f8273 | fe7c9aa67b4babcb30642010647f5d9757f34872 | refs/heads/master | 2023-07-20T18:53:50.061701 | 2021-08-20T07:20:26 | 2021-08-20T07:20:26 | 374,088,326 | 0 | 0 | null | 2021-07-12T16:39:11 | 2021-06-05T10:46:27 | Java | UTF-8 | Java | false | false | 741 | java | package com.drowsiness.dto.user;
import com.drowsiness.dto.role.RoleResponseDTO;
import lombok.Data;
import java.util.UUID;
@Data
public class UserAuthenDTO {
private UUID userId;
private String username;
private String fullName;
private String password;
private String email;
private String phoneNumber;
private boolean isActive;
private RoleResponseDTO roleResponseDTO;
public UserAuthenDTO() {
}
public UserAuthenDTO(String username, String fullName, String password, String email, String phoneNumber) {
this.username = username;
this.fullName = fullName;
this.password = password;
this.email = email;
this.phoneNumber = phoneNumber;
}
}
| [
"[email protected]"
]
| |
4c621e5a00d4bed25c8ad1760cb2aa9042d6407d | 58f55235cd0eaa768dadd34bde373ebbb9db33b7 | /lab-3-server/src/test/java/com/anup/springcloudstarter/Lab3ServerApplicationTests.java | 081de958a25441cfbf5b307d2433de05cd24a535 | []
| no_license | anupbansal/Microservices-SpringBoot | 7a06da519a2dddaec4344b76281e86dd35659f74 | e7bc97374de5f7ff4cc54b44750690cfcfa9d0a2 | refs/heads/master | 2020-05-31T12:26:32.200201 | 2017-06-20T20:41:58 | 2017-06-20T20:41:58 | 94,030,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package com.anup.springcloudstarter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class Lab3ServerApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
]
| |
1a081ff4583acb64f1483faa1045731ba5ce306e | d2f840933180c4041f5c103c041909366464661e | /app/src/main/java/net/coding/mart/activity/user/setting/InvoiceMainActivity.java | 46372ce1e01e166eec3080ce29c009af0d8b2f31 | [
"MIT"
]
| permissive | fenildf/Mart-Android | 1374928522e1bcd579d05c60e5104ab33b133c7a | 150e5d9c47d6c20ae114728115ebd6537b8bba2d | refs/heads/master | 2020-03-27T14:47:35.462253 | 2018-05-21T10:22:05 | 2018-05-21T10:22:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | package net.coding.mart.activity.user.setting;
import android.widget.TextView;
import net.coding.mart.R;
import net.coding.mart.common.BackActivity;
import net.coding.mart.common.Global;
import net.coding.mart.common.widget.ListItem1;
import net.coding.mart.json.BaseObserver;
import net.coding.mart.json.Network;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import java.math.BigDecimal;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@EActivity(R.layout.activity_invoice_main)
public class InvoiceMainActivity extends BackActivity {
@ViewById
TextView invoiceAmout, textTip;
@ViewById
ListItem1 invoicing;
@AfterViews
void initInvoiceMainActivity() {
Global.addLinkCustomerService(this, textTip);
invoicing.setTextColor(0xFF999999);
Network.getRetrofit(this)
.getInvoiceAmout()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObserver<BigDecimal>(this) {
@Override
public void onSuccess(BigDecimal data) {
super.onSuccess(data);
invoiceAmout.setText(data.toString());
}
});
}
}
| [
"[email protected]"
]
| |
f675901bb99407ff2e51bb100e5b6700b8c09e2e | bf4e0c29e58aafc7a458b458312e9ab5dc1a2787 | /emprendedores/src/main/java/com/tmi/emprendedores/validator/EmprendimientoValidator.java | 20d69735517f18672717cda56058888aae09db32 | []
| no_license | Fradantim/Emprendedores | ce6565af04c885c2ea92784175e2178e3e7e70f2 | 26e5dedf3d5b85a80535dd30d6de9c3e0c80f506 | refs/heads/master | 2021-06-12T20:20:40.539348 | 2019-10-18T03:38:48 | 2019-10-18T03:38:48 | 188,131,338 | 2 | 0 | null | 2021-04-26T19:15:57 | 2019-05-23T00:16:52 | JavaScript | UTF-8 | Java | false | false | 880 | java | package com.tmi.emprendedores.validator;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import com.tmi.emprendedores.persistence.entities.Emprendimiento;
/**
* Objeto responsable de las validaciones de los campos al crear o modificar Emprendimientos
*/
@Component
public class EmprendimientoValidator extends MyValidator {
@Override
public boolean supports(Class<?> aClass) {
return Emprendimiento.class.equals(aClass);
}
private String[] getCamposNoVacios() {
return new String[] { "nombre", "descripcion"/* ,"link","contacto","localidad" */ };
}
@Override
public void validate(Object o, Errors errors) {
}
public void validateUpdate(Emprendimiento emprendimiento, Errors errors) {
// validacion de campos vacios
rejectIfEmptyOrWhitespace(errors, getCamposNoVacios());
}
} | [
"Fradantim@KL-WIN"
]
| Fradantim@KL-WIN |
c843f5a26a6cde698b6c53a173adcc0b247508a1 | b0f8b727299915423b934dbbebd589fbf95f0b60 | /src/main/java/org/jumutang/project/weixinMng/mallMng/dao/IRegistCodeDao.java | 7859655768a745b889c20edb60f4b8c724b9b38a | []
| no_license | fbion/sinopecGameCt | a1b175fb977c134697300cd78f0851376f6dea5e | 4c08ed3dce5f7c60aef49ca4cda637242164194c | refs/heads/master | 2022-04-08T12:18:34.945863 | 2017-08-18T02:35:25 | 2017-08-18T02:35:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package org.jumutang.project.weixinMng.mallMng.dao;
import java.util.HashMap;
import org.jumutang.project.weixinMng.mallMng.model.RegistCodeMode;
public interface IRegistCodeDao {
// 插入验证码的表
public int insertRegistCodeInfoVolume(HashMap<String, String> amap);
// 查询验证码的表
public RegistCodeMode queryRegistCodeInfo(HashMap<String, String> amap);
}
| [
"[email protected]"
]
| |
142eb7a7ea2bad85687509bb987456e1f070e533 | 96f31cc8e6f504345d74d8e3ed2fb774187a7826 | /app/src/main/java/com/sjw/beautifulapp/bean/EpisodeBean.java | 200ed2941ee77a0ea6d7b0d66f89cd275818dc40 | []
| no_license | FakerCurry/BeautifulApp | 7ba62270355d9307847e3a2ea8c5dd0a555e9800 | 4fe8afd3487c08083ef2064dd32042f6f5f41d53 | refs/heads/master | 2020-04-05T14:31:31.786370 | 2019-03-08T05:24:11 | 2019-03-08T05:24:11 | 156,933,501 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,422 | java | package com.sjw.beautifulapp.bean;
import java.io.Serializable;
/**
* Created by pc on 2018/9/3.
*/
public class EpisodeBean implements Serializable {
private String title;
private String imgUrl;
private String name;
// private String nameImg;
private String time;
private EpisodeDetailBean detailBean;
public EpisodeDetailBean getDetailBean() {
return detailBean;
}
public void setDetailBean(EpisodeDetailBean detailBean) {
this.detailBean = detailBean;
}
// private String timeImg;
// public String getNameImg() {
// return nameImg;
// }
//
// public void setNameImg(String nameImg) {
// this.nameImg = nameImg;
// }
//
// public String getTimeImg() {
// return timeImg;
// }
//
// public void setTimeImg(String timeImg) {
// this.timeImg = timeImg;
// }
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
| [
"[email protected]"
]
| |
d3a981039110cfca36e2bdca01a68a4dd4de24ce | c72d85cfaf53ae1f2fab654b8bb431100d74af08 | /qx-service-queue/code/java/zws/context/BootstrapContextListener.java | c01e899c7b6dbf95983ebc0273cf09bc2edef8ce | []
| no_license | vadeq/repotest | fd11e75008894f1bebbc24d722efc90309fb4b68 | 6e85f316d9cfc138dd5d001cd8f2f345aa682c12 | refs/heads/master | 2021-01-20T05:29:17.633968 | 2011-04-23T02:23:32 | 2011-04-23T02:23:32 | 1,553,934 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,282 | java | package zws.context;
import zws.Server;
import zws.application.Configurator;
import zws.application.Names;
import zws.qx.queue.DaemonQueue;
import zws.recorder.ExecutionRecord;
import zws.repository.ilink3.Ilink3EventListener;
import zws.service.event.watcher.EventWatcherSvc;
import zws.service.recorder.qx.RecorderSvc;
import java.rmi.RemoteException;
import java.util.*;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public final class BootstrapContextListener
implements ServletContextListener {
private ServletContext context = null;
private ArrayList listeners = new ArrayList();
public BootstrapContextListener() {}
//This method is invoked when the Web Application
//has been removed and is no longer able to accept
//requests
public void contextDestroyed(ServletContextEvent event)
{
try {
DaemonQueue.getInstance().stop();
} catch (Exception e1) {
e1.printStackTrace();
}
Ilink3EventListener listener;
for (int i=0; i<listeners.size(); i++) {
try {
listener = (Ilink3EventListener) listeners.get(i);
listener.shutdown();
System.out.println("Event Listner " + listener.getName() + " set to stop.");
} catch (Exception e) {
System.out.println("error while stopping event listner");
}
}
context = null;
}
//This method is invoked when the Web Application
//is ready to service requests
public void contextInitialized(ServletContextEvent event)
{
context = event.getServletContext();
try {
Configurator.load();
archiveStaleProcesses();
DaemonQueue.getInstance().reInstantiate();
}
catch (Exception e) {
e.printStackTrace();
}
// start event listeners
Collection eventList = EventWatcherSvc.getPrototypeNames();
Iterator itr = eventList.iterator();
String listnerName = null;
String state = null;
while(itr.hasNext()) {
listnerName = (String) itr.next();
try {
Ilink3EventListener l = EventWatcherSvc.find(listnerName);
if(null == l) continue;
state = l.getRunningState();
if(!"running".equalsIgnoreCase(state)) {
l.start();
listeners.add(l);
System.out.println("Event Listner " + l.getName() + " started.");
} else {
System.out.println("Event Listner " + l.getName() + " already started.");
}
} catch (Exception e) {
System.out.println("error while starting up event listner");
}
}
System.out.println("DesignState "+ Server.getName() + " Loaded: " + Server.getDescription());
}
private void archiveStaleProcesses() {
ExecutionRecord record = null;
try {
Collection publishingRecords = RecorderSvc.getRecordingsByStatus(Names.PEN_QUEUE_NAMESPACE, Names.STATUS_PUBLISHING);
if(null == publishingRecords || publishingRecords.size() <1) return;
Iterator itr = publishingRecords.iterator();
while(itr.hasNext()){
record = (ExecutionRecord) itr.next();
RecorderSvc.recordEndTime(record.getID(), Names.STATUS_STALE);
System.out.println("Stale process [ "+ record.getID() + "] found.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"ourpc@.(none)"
]
| ourpc@.(none) |
f6c5eda506629e4a070bd78acf51b1cff48eb2e3 | f5e968aae7fbd5bce3e66960988fe3c11000d516 | /src/library/DB_Access/Login.java | f09ee51dd5a01e8a795cf97d63dd551d3aef8dcc | []
| no_license | vynsss/Final-Project-PL | 66cd53ab9b142bccd437499ca01911e2d25f9f3f | 17b53e0d853ec31a49dc15c0e3b9398b427fdb58 | refs/heads/master | 2020-06-08T00:48:18.142275 | 2019-10-30T16:35:28 | 2019-10-30T16:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,291 | java | package library.DB_Access;
import library.Connection.Connection;
import java.sql.*;
public class Login {
Connection connect = new Connection();
private static String user; //to store the user id from the login and be used in other class
//to check whether the there is an user with the name and password entered
public boolean auth(String name, String password){
try {
PreparedStatement prepStat = connect.getPrepstat("SELECT user_id, user_name, pass FROM login " +
"WHERE user_name = ? AND pass = ?");
prepStat.setString(1, name);
prepStat.setString(2, password);
ResultSet myRs = prepStat.executeQuery();
if(myRs.next()){
user = myRs.getString("user_id"); //to store the user id from the logged user
System.out.println("User " + myRs.getString("user_name") + " Successfully Logged In!");
return true;
}
else {
System.out.println("Login Declined!");
return false;
}
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
public String get_userID(){
return user;
}
}
| [
"[email protected]"
]
| |
29e7973f4c4fd72d447cdeec266d9c568865b059 | 508c95b6c3179de4ba9d38eac15a2caf50382b7e | /bundles/org.palladiosimulator.measurementsui.wizard/src/org/palladiosimulator/measurementsui/wizard/main/ServiceLevelObjectiveWizard.java | d4e967a8851244117c87ba8539e9cc0faaf7ddfc | []
| no_license | PalladioSimulator/Palladio-Addons-MeasurementsUI | 8ae9f3bd31de378f83756afa03af71128b7bccf9 | 2bddc45c32de6881ceea5e83ff28d48af8342fa0 | refs/heads/master | 2023-06-20T20:18:33.220519 | 2023-06-04T09:11:30 | 2023-06-20T06:08:29 | 142,024,059 | 0 | 0 | null | 2023-06-20T06:08:30 | 2018-07-23T14:14:49 | Java | UTF-8 | Java | false | false | 5,024 | java | package org.palladiosimulator.measurementsui.wizard.main;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import org.palladiosimulator.measurementsui.wizard.pages.ServiceLevelObjectiveCreationPage;
import org.palladiosimulator.measurementsui.wizard.pages.ServiceLevelObjectiveMeasurementSelectionPage;
import org.palladiosimulator.measurementsui.wizard.pages.ServiceLevelObjectiveThresholdPage;
import org.palladiosimulator.measurementsui.wizardmodel.SloWizardModelManager;
import org.palladiosimulator.measurementsui.wizardmodel.SloWizardModelType;
import org.palladiosimulator.measurementsui.wizardmodel.pages.SloCreationWizardModel;
import org.palladiosimulator.measurementsui.wizardmodel.pages.SloMeasurementSpecSelectionWizardModel;
import org.palladiosimulator.measurementsui.wizardmodel.pages.SloThresholdWizardModel;
import org.palladiosimulator.servicelevelobjective.ServiceLevelObjective;
/**
* This is the wizard for the service level objective creation.
*
* @author Jan Hofmann
* @author Manuel Marroquin
*
*/
public class ServiceLevelObjectiveWizard extends org.eclipse.jface.wizard.Wizard {
private ServiceLevelObjectiveCreationPage sloCreationWizardPage;
private ServiceLevelObjectiveMeasurementSelectionPage sloMspSelectionWizardPage;
private ServiceLevelObjectiveThresholdPage sloThresholdWizardPage;
private PropertyChangeSupport changes = new PropertyChangeSupport(this);
private SloWizardModelManager wizardManager;
private static final String WINDOW_TITLE = "Create a new Service Level Objective";
/**
* returns the first wizard page of the service level objective wizard
*
* @return first wizardpage
*/
public ServiceLevelObjectiveCreationPage getPage1() {
return sloCreationWizardPage;
}
/**
* sets the first wizard page of service level objective wizard
*
* @param page1
* first wizard page
*/
public void setPage1(ServiceLevelObjectiveCreationPage page1) {
this.sloCreationWizardPage = page1;
}
/**
* returns the second wizard page of the standard set wizard
*
* @return second wizardpage
*/
public ServiceLevelObjectiveMeasurementSelectionPage getPage2() {
return sloMspSelectionWizardPage;
}
/**
* sets the second wizard page of the standard set wizard
*
* @param page2
* second wizard page
*/
public void setPage2(ServiceLevelObjectiveMeasurementSelectionPage page2) {
this.sloMspSelectionWizardPage = page2;
}
/**
* returns the third wizard page of the standard set wizard
*
* @return third wizardpage
*/
public ServiceLevelObjectiveThresholdPage getPage3() {
return sloThresholdWizardPage;
}
/**
* sets the third wizard page of the standard set wizard
*
* @param page3
* third wizard page
*/
public void setPage3(ServiceLevelObjectiveThresholdPage page3) {
this.sloThresholdWizardPage = page3;
}
/**
* constructor for the wizard
* @param createNewSlo
* @param selection
*/
public ServiceLevelObjectiveWizard(boolean createNewSlo, ServiceLevelObjective slo) {
wizardManager = new SloWizardModelManager(createNewSlo, slo);
setWindowTitle(WINDOW_TITLE);
sloCreationWizardPage = new ServiceLevelObjectiveCreationPage((SloCreationWizardModel) wizardManager.getWizardModel(SloWizardModelType.SLO_CREATION));
sloMspSelectionWizardPage = new ServiceLevelObjectiveMeasurementSelectionPage((SloMeasurementSpecSelectionWizardModel) wizardManager.getWizardModel(SloWizardModelType.SLO_MEASUREMENT_SPEC));
sloThresholdWizardPage = new ServiceLevelObjectiveThresholdPage((SloThresholdWizardModel) wizardManager.getWizardModel(SloWizardModelType.SLO_THRESHOLDING));
}
/**
* Adds PropertyChangeListener to the propertyChangeSupport
* @param listener the PropertyChangeListener
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
wizardManager.addPropertyChangeListener(listener);
}
@Override
public void addPages() {
addPage(sloCreationWizardPage);
addPage(sloMspSelectionWizardPage);
addPage(sloThresholdWizardPage);
}
@Override
public boolean performFinish() {
sloThresholdWizardPage.finishTresholds();
wizardManager.finish();
changes.firePropertyChange("save", 1, 2);
return true;
}
@Override
public boolean canFinish() {
// // Prevents user from clicking finish if measurement specification was changed
// // which is not valid with current threshold settings
return wizardManager.canFinish() && getContainer().getCurrentPage() != sloMspSelectionWizardPage;
}
}
| [
"[email protected]"
]
| |
1a8d1c77502cc8e3b8f8c2f884973d61156f17eb | 43a7e3ccbc52c295c30e7215b66a97335b863287 | /src/test/java/com/example/kki/web/dto/HelloResponseDtoTest.java | ec89fbadf7ed37ea027630ef84adf55d0ed96329 | []
| no_license | kimkki999/firstservice | ed049741e2eb10175e07f16f7fc3fff584c2d2a3 | 010dc9d752b996d53c12a109339b169ca12b6706 | refs/heads/master | 2023-03-18T10:37:36.022639 | 2021-03-12T06:36:41 | 2021-03-12T06:36:41 | 346,317,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package com.example.kki.web.dto;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class HelloResponseDtoTest {
@Test
public void 롬복_기능_테스트() {
//given
String name = "test";
int amount = 1000;
//when
HelloResponseDto dto = new HelloResponseDto(name, amount);
//then
assertThat(dto.getName()).isEqualTo(name);
assertThat(dto.getAmount()).isEqualTo(amount);
}
} | [
"[email protected]"
]
| |
515114ba7bdf96176dd6489d2eafc55da6af303d | fca6e069c335dc8442618e36d4c0f97ede2c6a06 | /src/com/mixshare/rapid_evolution/data/profile/common/image/Image.java | c3466b7f7ad82ba7968005db1cf0f7d07beafa73 | []
| no_license | divideby0/RapidEvolution3 | 127255648bae55e778321067cd7bb5b979684b2c | f04058c6abfe520442a75b3485147f570f7d538e | refs/heads/master | 2020-03-22T00:56:26.188151 | 2018-06-30T20:41:26 | 2018-06-30T20:41:26 | 139,274,034 | 0 | 0 | null | 2018-06-30T19:19:57 | 2018-06-30T19:19:57 | null | UTF-8 | Java | false | false | 7,127 | java | package com.mixshare.rapid_evolution.data.profile.common.image;
import java.awt.image.BufferedImage;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.Serializable;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import com.mixshare.rapid_evolution.RE3Properties;
import com.mixshare.rapid_evolution.data.DataConstantsHelper;
import com.mixshare.rapid_evolution.data.mined.CommonMiningAPIWrapper;
import com.mixshare.rapid_evolution.data.mined.util.WebHelper;
import com.mixshare.rapid_evolution.data.util.filesystem.FileSystemAccess;
import com.mixshare.rapid_evolution.data.util.image.ImageHelper;
import com.mixshare.rapid_evolution.util.FileUtil;
import com.mixshare.rapid_evolution.util.io.LineReader;
import com.mixshare.rapid_evolution.util.io.LineWriter;
import com.trolltech.qt.gui.QImage;
public class Image implements Serializable {
static private Logger log = Logger.getLogger(Image.class);
static private final long serialVersionUID = 0L;
////////////
// FIELDS //
////////////
private String url;
private String imageFilename;
private byte dataSource;
private boolean disabled;
private String description;
transient private QImage qImage;
transient private BufferedImage bufferedImage;
static {
try{
// in order for the XMLEncoder to skip transient variables, this is needed
BeanInfo info = Introspector.getBeanInfo(Image.class);
PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
for (int i = 0; i < propertyDescriptors.length; ++i) {
PropertyDescriptor pd = propertyDescriptors[i];
if (pd.getName().equals("qImage") || pd.getName().equals("bufferedImage")) {
pd.setValue("transient", Boolean.TRUE);
}
}
} catch (IntrospectionException e) {
log.error("static(): error", e);
}
}
/////////////////
// CONSTRUCTOR //
/////////////////
public Image() { }
public Image(String url, byte dataSource, String description) throws InvalidImageException {
this.url = url;
this.dataSource = dataSource;
this.imageFilename = downloadImage(url);
this.description = description;
if (this.imageFilename == null)
throw new InvalidImageException();
ensureImageFilenameIsRelative();
}
public Image(String url, byte dataSource) throws InvalidImageException {
this.url = url;
this.dataSource = dataSource;
this.imageFilename = downloadImage(url);
if (this.imageFilename == null)
throw new InvalidImageException();
ensureImageFilenameIsRelative();
}
public Image(String url, String imageFilename, byte dataSource) throws InvalidImageException {
this.url = url;
this.dataSource = dataSource;
this.imageFilename = imageFilename;
if (RE3Properties.getBoolean("server_mode")) {
BufferedImage img = FileSystemAccess.getFileSystem().readBufferedImage(imageFilename);
} else {
this.qImage = FileSystemAccess.getFileSystem().readQImage(imageFilename);
}
ensureImageFilenameIsRelative();
}
public Image(String url, String imageFilename, byte dataSource, String description) throws InvalidImageException {
this.url = url;
this.dataSource = dataSource;
this.imageFilename = imageFilename;
this.description = description;
if (RE3Properties.getBoolean("server_mode")) {
BufferedImage img = FileSystemAccess.getFileSystem().readBufferedImage(imageFilename);
} else {
this.qImage = FileSystemAccess.getFileSystem().readQImage(imageFilename);
}
ensureImageFilenameIsRelative();
}
public Image(LineReader lineReader) {
int version = Integer.parseInt(lineReader.getNextLine());
url = lineReader.getNextLine();
imageFilename = lineReader.getNextLine();
dataSource = Byte.parseByte(lineReader.getNextLine());
disabled = Boolean.parseBoolean(lineReader.getNextLine());
description = lineReader.getNextLine();
}
/////////////
// GETTERS //
/////////////
public String getUrl() { return url; }
public byte getDataSource() { return dataSource; }
public String getImageFilename() { return imageFilename; }
public boolean isDisabled() { return disabled; }
public String getDescription() {
if (description == null)
return "";
return description;
}
public QImage getQImage() {
if (qImage == null) {
try {
qImage = FileSystemAccess.getFileSystem().readQImage(imageFilename);
} catch (InvalidImageException e) { }
}
return qImage;
}
public BufferedImage getBufferedImage() {
if (bufferedImage == null) {
try {
bufferedImage = FileSystemAccess.getFileSystem().readBufferedImage(imageFilename);
} catch (InvalidImageException e) { }
}
return bufferedImage;
}
/////////////
// SETTERS //
/////////////
public void setUrl(String url) { this.url = url; }
public void setImageFilename(String imageFilename) {
this.imageFilename = imageFilename;
ensureImageFilenameIsRelative();
}
public void setDataSource(byte dataSource) { this.dataSource = dataSource; }
public void setDescription(String description) { this.description = description; }
public void setDisabled(boolean disabled) { this.disabled = disabled; }
/////////////
// METHODS //
/////////////
private String downloadImage(String url) {
String filename = WebHelper.getUniqueFilenameFromURL(url);
if (filename != null) {
String imageDirectory = CommonMiningAPIWrapper.getMinedDataDirectory(dataSource) + "images/";
String fullPath = imageDirectory + filename;
if (log.isTraceEnabled())
log.trace("downloadImage(): saving imageURL=" + url + ", to local filepath=" + fullPath);
if (ImageHelper.saveImageURL(url, fullPath)) {
if (!RE3Properties.getBoolean("server_mode")) {
try {
qImage = FileSystemAccess.getFileSystem().readQImage(fullPath);
} catch (InvalidImageException e) {
return null;
}
} else {
try {
BufferedImage img = FileSystemAccess.getFileSystem().readBufferedImage(fullPath);
} catch (InvalidImageException e) {
return null;
}
}
return fullPath;
}
}
return null;
}
public String toString() { return url + " (" + DataConstantsHelper.getDataSourceDescription(dataSource) + ")"; }
public boolean equals(Object o) {
if (o instanceof Image) {
Image i = (Image)o;
return url.equals(i.url);
}
return false;
}
public int hashCode() { return url.hashCode(); }
static public void main(String[] args) {
try {
PropertyConfigurator.configureAndWatch("log4j.properties");
// ... for testing...
} catch (Exception e) {
log.error("main(): error", e);
}
}
private void ensureImageFilenameIsRelative() { imageFilename = FileUtil.stripWorkingDirectory(imageFilename); }
public void write(LineWriter writer) {
writer.writeLine("1"); // version
writer.writeLine(url);
writer.writeLine(imageFilename);
writer.writeLine(dataSource);
writer.writeLine(disabled);
writer.writeLine(description);
}
}
| [
"[email protected]"
]
| |
40d7a452b7afe54db3344c31becff15ed63646c5 | 17ae12d052fa1abc7be4ecfa39c86db885e92ad7 | /app/src/androidTest/java/com/diabin/fastec/example/ExampleInstrumentedTest.java | 7bf52fc35bff09f59a80623df5b2e01ac248119c | []
| no_license | liushuai95/FastEC | d0002480f470d4bf34296a6f38da16f1e3cb077b | 7136b2996e56416948e8ad54488500d58826e1db | refs/heads/master | 2020-12-07T21:22:40.684583 | 2020-01-16T01:21:27 | 2020-01-16T01:21:27 | 232,804,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.diabin.fastec.example;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.diabin.fastec.example", appContext.getPackageName());
}
}
| [
"[email protected]"
]
| |
0baed3654807f26051c7ca76bc0c7a21abf2a227 | 2eda641a1cf9345973738399e4382d7c692d4cbf | /src/itens/ItemDoavel.java | 07fa00beeef9f12826b479c550241f8f09db930d | []
| no_license | victorpazb/eDoe.com-master | 45c1c0dfc04bffccc7d01be39ecdac7b74544799 | 650383a9d4d276bae1832d2c4422c5fe23b86d15 | refs/heads/master | 2022-12-03T17:01:05.742223 | 2020-08-07T00:01:43 | 2020-08-07T00:01:43 | 285,694,433 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,526 | java | package itens;
import java.io.Serializable;
import java.util.Arrays;
import util.Validador;
/**
* Classe que representa um item que pode ser doado e adicionado na lista de itens doaveis do doador.
*
* Laboratório de Programação 2 - Projeto Final.
*
* @authors Dacio Bezerra, Felipe Nunes, Victor Paz e Wallyngson Guedes.
*
*/
public class ItemDoavel implements Item, Serializable {
private String nome;
private String[] tags;
private Integer idItem;
private int qtdItem;
private String representacaoUsuario;
private int pontuacao;
private static final long serialVersionUID = 1L;
private Validador validador = new Validador();
/**
* Construtor da classe ItemDoavel.
* @param nome
* @param qtd
* @param tags
* @param idItem
* @param representacaoUsuario
*/
public ItemDoavel(String nome, int qtd, String tags, Integer idItem, String representacaoUsuario) {
this.validador.quantidadeInvalida(qtd);
this.nome = nome;
this.tags = tags.split(",");
this.qtdItem = qtd;
this.idItem = idItem;
this.representacaoUsuario = representacaoUsuario;
}
public int getIdItem() {
return this.idItem;
}
public String getUsuarioVinculado() {
return this.representacaoUsuario;
}
public String[] getTags() {
return this.tags;
}
@Override
public int getPontuacao() {
return this.pontuacao;
}
public void setPontuacao(int pontuacao) {
this.pontuacao += pontuacao;
}
public String getNome() {
return this.nome;
}
public int getQtdItem() {
return qtdItem;
}
public void setQtdItem(int qtdItem) {
this.qtdItem = qtdItem;
}
/**
* Retorna a descricao completa do item.
*/
public String descricaoCompleta() {
return this.nome + " - " + Arrays.toString(tags);
}
/**
* Metodo responsavel por atualizar os valores do item a ser mudado.
*
* @param qtd
* @param tags
* @return
*/
public String atualizaItem(int qtd, String tags) {
if (tags != null && !tags.trim().isEmpty())
this.tags = tags.split(",");
if (qtd > 0)
this.setQtdItem(qtd);
return this.toString();
}
/**
* toString auxiliar para quando se vai realizar uma doação.
*/
public String toStringParaRealizarDoacao(int qtdDoados) {
return null;
}
/**
* Método toString da classe ItemDoavel.
*/
@Override
public String toString() {
return this.idItem + " - " + this.nome + ", tags: " + Arrays.toString(tags) + ", quantidade: " + this.qtdItem;
}
/**
* Método comparador da classe ItemDoavel a partir de sua quantidade.
*/
@Override
public int compareTo(Item other) {
if (this.qtdItem < other.getQtdItem())
return 1;
if (this.qtdItem > other.getQtdItem())
return -1;
return compareToNome(other);
}
/**
* Método comparador da classe ItemDoavel a partir do seu nome.
*/
@Override
public int compareToNome(Item i) {
return this.getNome().compareTo(i.getNome());
}
/**
* hashCode da classe ItemDoavel.
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((idItem == null) ? 0 : idItem.hashCode());
return result;
}
/**
* equals da classe ItemDoavel.
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ItemDoavel other = (ItemDoavel) obj;
if (idItem == null) {
if (other.idItem != null)
return false;
} else if (!idItem.equals(other.idItem))
return false;
return true;
}
} | [
"[email protected]"
]
| |
d0153b3ffbc60a81fe81387203e32f5ce705beac | 036bc96fc2b3d491a61d8179cb19b5efe1100cdf | /jactor-applications/jactor-web/src/main/java/com/github/jactor/rises/web/JactorWeb.java | 6485230d404ba630a686b39f7a5228ed89098c00 | []
| no_license | donhuvy/jactor-rises | 4b27a4e6c87fc350677a2245e6680bb4986aa650 | bda67c26983b4cec4bb0c8ca48c348e714a70cac | refs/heads/master | 2020-03-26T19:52:40.563236 | 2018-07-26T08:39:32 | 2018-07-26T09:44:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,905 | java | package com.github.jactor.rises.web;
import com.github.jactor.rises.commons.framework.SpringBeanNames;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import static java.util.Arrays.stream;
@SpringBootApplication
public class JactorWeb implements WebMvcConfigurer {
private static final Logger LOGGER = LoggerFactory.getLogger(JactorWeb.class);
public @Bean CommandLineRunner commandLineRunner(ApplicationContext applicationContext) {
return args -> inspect(applicationContext, args);
}
private void inspect(ApplicationContext applicationContext, String[] args) {
if (LOGGER.isDebugEnabled()) {
boolean noArgs = args == null || args.length == 0;
String arguments = noArgs ? "without arguments" : "with arguments: " + String.join(" ", args);
LOGGER.debug("Starting jactor-web {}", arguments);
SpringBeanNames springBeanNames = new SpringBeanNames();
stream(applicationContext.getBeanDefinitionNames()).sorted().forEach(springBeanNames::add);
LOGGER.debug("Available beans:");
springBeanNames.getBeanNames().stream().map(name -> "- " + name).forEach(LOGGER::debug);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Available spring beans:");
springBeanNames.getNamesOfSpringBeans().stream().map(name -> "- " + name).forEach(LOGGER::trace);
}
}
}
public static void main(String... args) {
SpringApplication.run(JactorWeb.class, args);
}
}
| [
"[email protected]"
]
| |
71a8e86fce02d21448d112242dac0f4678bde265 | 97b52187257eb6c3c5177cdc098eb784634c555f | /app/src/main/java/io/github/noeppi_noeppi/nodecg_io_android/util/ToJSON.java | f46cdd61ce2d0a79bd3ba3a1c87051393236fab4 | [
"MIT"
]
| permissive | noeppi-noeppi/nodecg-io-android | 677817d363b5e40fba24ef6db9dcc1ab9687ee4d | f1ec983dcbec54aeb34d5ce211750a7c55aba2d4 | refs/heads/master | 2023-02-22T15:07:58.381708 | 2021-01-27T07:41:43 | 2021-01-27T07:41:43 | 312,648,542 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package io.github.noeppi_noeppi.nodecg_io_android.util;
import org.json.JSONException;
import org.json.JSONObject;
public interface ToJSON {
JSONObject toJSON() throws JSONException;
}
| [
"[email protected]"
]
| |
4af8966b70596a312f8507e6f1955aee8f403b52 | 07280b0095b094988fc7046389436592e2f9fbea | /lab2/shoppingservice/demo/src/main/java/nl/sjop/service/ShoppingserviceApplication.java | 0ca37ba6051204e0c1d735da1775071d2c0100e7 | []
| no_license | AMIS-Services/sig-springboot-1 | 29d7553c7f5f13c1533546390700f0219e6084a8 | 74883842649f6d39141f959487d8c0d5d1af4acc | refs/heads/master | 2020-03-27T17:25:04.583307 | 2019-01-25T09:05:14 | 2019-01-25T09:05:14 | 146,850,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package nl.sjop.service;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
//@ComponentScan(basePackages = {"nl.sjop.service"})
public class ShoppingserviceApplication {
public static void main(String[] args) {
SpringApplication.run(ShoppingserviceApplication.class, args);
}
}
| [
"[email protected]"
]
| |
d259fb099333b30f4cc7e14191a1e3a7b333d6a7 | 26baeb33e72cf77cbd9613354ac1993b6f52a313 | /Main.java | 3a01dbf88f19373718b4d2ea68edf8029eb4c16c | []
| no_license | RussellWaterson/multi-threaded-server-assignment | 5543246b5d046bd1cbe6e0ca815cae88b5a0e804 | 30354c5a87da0c01b69fd39d95b89af373beb483 | refs/heads/master | 2020-04-02T06:09:24.643416 | 2018-10-22T11:39:41 | 2018-10-22T11:39:41 | 154,132,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | /**
* @author rjw357 Russell Waterson
*/
public class Main {
public static void main(String[] args) {
MultiThreadedServer server = new MultiThreadedServer(8088);
new Thread(server).start();
try {
System.out.println("Starting server for 30 seconds");
Thread.sleep(30 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Stopping Server");
server.stop();
}
}
| [
"[email protected]"
]
| |
66f2a78dd8b90611341055338c7c80b4db26acc8 | 0a60dc06c3d6e4850d43e6e32d13d9df1a5a88e7 | /src/test/java/com/neuedu/test/CartDaoTest.java | 19f8797d491dd32c82b28dd82d1e5f8a231c831b | []
| no_license | Alanlaosan/Java-businessweb | 5ed5d3c7564e534bc509d5b4d274840a353f52da | 961f7eea09841084631bc457cc0a45ebdcec43bb | refs/heads/master | 2020-03-24T02:36:59.450465 | 2018-08-09T03:10:21 | 2018-08-09T03:10:21 | 142,383,862 | 12 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | package com.neuedu.test;
import com.neuedu.dao.CartDao;
import com.neuedu.dao.impl.jdbc.mybatis.CartDaoMybatisImpl;
import com.neuedu.entity.Cart;
import com.neuedu.entity.Product;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.naming.Name;
import java.util.List;
public class CartDaoTest {
CartDao cartDao/*=null*/;
@Before
public void before() {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
cartDao = applicationContext.getBean(CartDao.class);
}
public void testAddCart() {
Cart cart = new Cart();
Product product = new Product(100, "米", "手机", 7000, "1.0");
cart.setProduct(product);
cart.setProductNum(10);
cartDao.addCart(cart);
/*List<Cart> list= cartDao.findAllCart();
for (Cart s:list
) {System.out.println(s);
}*/
}
@Test
public void testDelectCart(){
cartDao.deleteCart(16);
}
@After
public void destory() {
cartDao = null;
}
}
| [
"[email protected]"
]
| |
d2848ee2eb690e118aa86f6608db29218e011e13 | 39eb53333cadc37c1dae832b4a8d65a879521e12 | /src/main/java/cn/emay/core/sms/repository/impl/SmsMessageEsRepositoryImpl.java | f931a827333ad5047cdea22b77162aa9292397c9 | []
| no_license | emaycn/emay-service | 7db4b6df1743c343128fd4ecdb88ed7284c5255b | 81960b82b8e17bdfc014e183a85951a9e6c5a601 | refs/heads/master | 2023-08-17T05:01:22.889092 | 2020-12-09T04:25:24 | 2020-12-09T04:25:24 | 243,707,733 | 0 | 0 | null | 2023-07-23T07:06:14 | 2020-02-28T07:53:31 | Java | UTF-8 | Java | false | false | 7,408 | java | package cn.emay.core.sms.repository.impl;
import cn.emay.configuration.es.BasePojoEsRepository;
import cn.emay.core.sms.dto.SmsMessageDto;
import cn.emay.core.sms.dto.SmsMessageOperDto;
import cn.emay.core.sms.pojo.SmsMessage;
import cn.emay.core.sms.repository.SmsMessageEsRepository;
import cn.emay.utils.date.DateUtils;
import cn.emay.utils.db.common.Page;
import cn.emay.utils.string.StringUtils;
import com.google.gson.reflect.TypeToken;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@Service
public class SmsMessageEsRepositoryImpl extends BasePojoEsRepository<SmsMessage> implements SmsMessageEsRepository {
@Override
public Page<SmsMessageOperDto> findPage(String batchNo, String appCode, String appKey, Long[] clientid, String content, String reportCode, String mobile,
Integer state, String startTime, String endTime, int start, int limit, boolean isNextPage, Long startId) {
StringBuilder sql = new StringBuilder();
String ens = "G-SM-Cation-SM-G";
sql.append("select * from ").append(ens).append(" where 1=1 ");
if (StringUtils.isNotEmpty(batchNo)) {
sql.append(" and batchNo = '").append(batchNo.trim()).append("' ");
}
if (StringUtils.isNotEmpty(appCode)) {
sql.append(" and appCode = '").append(appCode.trim()).append("' ");
}
if (StringUtils.isNotEmpty(appKey)) {
sql.append(" and appKey = '").append(appKey.trim()).append("' ");
}
if (clientid != null && clientid.length > 0) {
sql.append(" and clientId in ( ").append(org.apache.commons.lang3.StringUtils.join(clientid, ",")).append(") ");
}
if (StringUtils.isNotEmpty(mobile)) {
sql.append(" and mobile = '").append(mobile.trim()).append("' ");
}
if (state != null && state > -1) {
sql.append(" and state = ").append(state).append(" ");
}
if (StringUtils.isNotEmpty(reportCode)) {
sql.append(" and reportCode = '").append(reportCode).append("' ");
}
if (StringUtils.isNotEmpty(content)) {
sql.append(" and content.key like '%").append(content.trim()).append("%' ");
}
if (StringUtils.isNotEmpty(startTime)) {
sql.append(" and submitTime >= '").append(startTime.trim()).append("' ");
}
if (StringUtils.isNotEmpty(endTime)) {
sql.append(" and submitTime <= '").append(endTime.trim()).append("' ");
}
sql.append(" order by id desc ");
String[] indexs = findBetweenDate(startTime, endTime, this.getIndexName());
int count = 0;
List<String> indexNames = new ArrayList<>();
int limitHas = 0;
for (String index : indexs) {
String sqlnew = sql.toString().replace(ens, index);
count += this.queryCount(sqlnew);
if (start < count && limitHas < limit) {
indexNames.add(index);
limitHas = count - start;
}
}
List<SmsMessageOperDto> list = new ArrayList<>();
boolean isNeedStart = true;
for (String indexname : indexNames) {
if (!isNeedStart) {
startId = null;
}
String sqlnew = sql.toString().replace(ens, indexname);
List<SmsMessageOperDto> result = queryListForPage(sqlnew, isNextPage, startId, limit, new TypeToken<List<SmsMessageOperDto>>() {
});
list.addAll(result);
isNeedStart = false;
}
if (list.size() > limit) {
list = list.subList(0, limit);
}
Page<SmsMessageOperDto> page = new Page<>();
page.setNumByStartAndLimit(start, limit, count);
page.setList(list);
return page;
}
@Override
public Page<SmsMessageDto> findClientPage(String appCode, String appKey, Long id, String content, String reportCode, String mobile, Integer state,
String startDate, String endDate, int start, int limit, boolean isNextPage, Long startId) {
StringBuilder sql = new StringBuilder();
String ens = "G-SM-Cation-SM-G";
sql.append("select * from ").append(ens).append(" where 1=1 ");
sql.append(" and clientId = ").append(id).append(" ");
if (StringUtils.isNotEmpty(appCode)) {
sql.append(" and appCode = '").append(appCode).append("' ");
}
if (StringUtils.isNotEmpty(appKey)) {
sql.append(" and appKey = '").append(appKey).append("' ");
}
if (StringUtils.isNotEmpty(mobile)) {
sql.append(" and mobile = '").append(mobile).append("' ");
}
if (StringUtils.isNotEmpty(reportCode)) {
sql.append(" and reportCode = '").append(reportCode).append("' ");
}
if (state != null && state > -1) {
sql.append(" and state = ").append(state).append(" ");
}
if (StringUtils.isNotEmpty(content)) {
sql.append(" and content.key like '%").append(content).append("%' ");
}
if (StringUtils.isNotEmpty(startDate)) {
sql.append(" and submitTime >= '").append(startDate).append("' ");
}
if (StringUtils.isNotEmpty(endDate)) {
sql.append(" and submitTime <= '").append(endDate).append("' ");
}
sql.append(" order by id desc ");
String[] indexs = findBetweenDate(startDate, endDate, this.getIndexName());
int count = 0;
List<String> indexNames = new ArrayList<>();
int limitHas = 0;
for (String index : indexs) {
String sqlnew = sql.toString().replace(ens, index);
count += this.queryCount(sqlnew);
if (start < count && limitHas < limit) {
indexNames.add(index);
limitHas = count - start;
}
}
List<SmsMessageDto> list = new ArrayList<>();
boolean isNeedStart = true;
for (String indexname : indexNames) {
if (!isNeedStart) {
startId = null;
}
String sqlnew = sql.toString().replace(ens, indexname);
List<SmsMessageDto> result = queryListForPage(sqlnew, isNextPage, startId, limit, new TypeToken<List<SmsMessageDto>>() {
});
list.addAll(result);
isNeedStart = false;
}
if (list.size() > limit) {
list = list.subList(0, limit);
}
Page<SmsMessageDto> page = new Page<>();
page.setNumByStartAndLimit(start, limit, count);
page.setList(list);
return page;
}
public String[] findBetweenDate(String beginDate, String endDate, String indexName) {
Date beginTime = DateUtils.parseDate(beginDate, "yyyy-MM-dd HH:mm:ss SSS");
Date endTime = DateUtils.parseDate(endDate, "yyyy-MM-dd HH:mm:ss SSS");
List<String> retList = DateUtils.findMonthBetweenDate(beginTime, endTime);
Collections.reverse(retList);
String[] indexNames = new String[retList.size()];
for (int i = 0; i < retList.size(); i++) {
indexNames[i] = this.getIndexName(retList.get(i));
}
return indexNames;
}
}
| [
"[email protected]"
]
| |
1aeac669c258e883cf65ffe93a261b139d11458a | 4b40e377bc8f22322d8745bd031ab2c42c67402b | /Combination_Employe_BankDetails/src/com/cjc/combi/bank/empl/BankDetails.java | b863091644492362c74d6262b690a1a6b84e1ad3 | []
| no_license | sumitchoudhari0210/Spring | 1f4fd1308e0738b4d8efa440b26f13a59f65c91f | 1acfd5f8b2dc6fd2dc1b1c54ee1aa2dd53a6cd3b | refs/heads/master | 2022-11-25T20:48:43.835945 | 2020-07-31T06:48:09 | 2020-07-31T06:48:09 | 283,961,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 121 | java | package com.cjc.combi.bank.empl;
public class BankDetails {
public BankDetails(){System.out.println("bank Details");}
}
| [
"[email protected]"
]
| |
fd0746a403b358f05ccfb3dc6bbc2f98982e9d4d | 50f3d1fbb3d0ad643aaf9c0718bca635029b1bfa | /src/main/java/com/pce/BookMeTutor/Services/JwtTokenService.java | 0e64bdb857c7996636caeba328e9ade77d1109de | []
| no_license | havenPCE/BookMeTutor-Backend | 68b23e788042d52336ebfa2b8060dffd5827f34f | aa4a55abcf7d6a7f0ef806d1f7603f6313c4d7ce | refs/heads/master | 2021-02-15T18:58:50.353220 | 2020-03-25T01:32:03 | 2020-03-25T01:32:03 | 244,922,881 | 0 | 0 | null | 2020-03-22T03:00:03 | 2020-03-04T14:34:40 | Java | UTF-8 | Java | false | false | 2,058 | java | package com.pce.BookMeTutor.Services;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import com.pce.BookMeTutor.Config.Constants;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
@Service
public class JwtTokenService implements Serializable {
private static final long serialVersionUID = 7368466600566991572L;
public String getUsernameFromToken(String token) {
return getClaimFromToken(token, Claims::getSubject);
}
public Date getExpirationDateFromToken(String token) {
return getClaimFromToken(token, Claims::getExpiration);
}
public <T> T getClaimFromToken(String token,
Function<Claims, T> claimsResolver) {
final Claims claims = getAllClaimsFromToken(token);
return claimsResolver.apply(claims);
}
private Claims getAllClaimsFromToken(String token) {
return Jwts.parser().setSigningKey(Constants.SECRET)
.parseClaimsJws(token).getBody();
}
private Boolean isTokenExpired(String token) {
final Date expiration = getExpirationDateFromToken(token);
return expiration.before(new Date());
}
public String generateToken(UserDetails userDetails) {
Map<String, Object> claims = new HashMap<>();
return doGenerateToken(claims, userDetails.getUsername());
}
private String doGenerateToken(Map<String, Object> claims, String subject) {
return Jwts.builder().setClaims(claims).setSubject(subject)
.setIssuedAt(new Date(System.currentTimeMillis()))
.setExpiration(new Date(
System.currentTimeMillis() + Constants.EXPIRATION_TIME))
.signWith(SignatureAlgorithm.HS512, Constants.SECRET).compact();
}
public Boolean validateToken(String token, UserDetails userDetails) {
final String username = getUsernameFromToken(token);
return (username.equals(userDetails.getUsername())
&& !isTokenExpired(token));
}
}
| [
"Shyam@DESKTOP-8E0R1T7"
]
| Shyam@DESKTOP-8E0R1T7 |
f530777a35b4115fe983dac4308e2528c6bd2421 | df4539abf5d521be6fddd25734ccd7d7ac461428 | /01-JavaSE/day_05/src/Test06_ArraySaveInMemory.java | abc2fb46eec46c59df7c94e322a25c5ab5dabd84 | []
| no_license | muzierixao/Learning-Java | c9bf6d1d020fd5b6e55d99c50172c465ea06fec0 | 893d9a730d6429626d1df5613fa7f81aca5bdd84 | refs/heads/master | 2023-04-18T06:48:46.280665 | 2020-12-27T05:32:02 | 2020-12-27T05:32:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,491 | java | /**
* @author Liu Awen
* @create 2018-05-09 22:46
*/
/*
数组的存储:
1、数组下标为什么从0开始?
下标表示的是这个元素的位置距离首地址的偏移量
2、数组名中存储的是什么
数组名中存储的是数组在堆中一整块区域的首地址
3、数组的元素如何存储
在堆中,依次连续的存储的
说明:
数组名,其实也是变量。
回忆:
变量的声明和初始化
数据类型 变量名 = 变量值;
现在:
int[] array = {1,3,5,7,9};
其中的 int[]也是一种数据类型,数组类型,它是一种引用数据类型
引用,表示引用一个“对象”,引用堆中的一块内存
Java程序是在JVM中运行,JVM中的内存最最主要的两块区域:栈和堆
其中的栈就是存储我们的局部变量(现在见到的变量都是局部变量),
堆中存储的是对象
*/
class Test06_ArraySaveInMemory{
public static void main(String[] args){
int[] array = new int[]{1,3,5,7,9};
//int[] array = {1,3,5,7,9};
System.out.println(array);//打印数组名
//结果:[I@1b6d3586 不同的计算机不同时候运行都不一样的
//这个值是,数组对象的类型@对象的hashCode编码值
//其中[I,表示int[]类型
//15db9742是这个数组对象的hashCode编码值,类似于每个人都有一个身份证号
System.out.println(System.identityHashCode(array));
//460141958
}
} | [
"[email protected]"
]
| |
3b3b2b942f2834e8794ecb31e00578e3b7470e2f | d192fa57ee655146b8c73491e2ec6230e5b07d4a | /src/user/User.java | 2a56e43005be39d144f1b7c1dc087774ff7b3fd4 | []
| no_license | funball99/meidi | cc78c3f016723fde1c78d8d6d97f8928c43379aa | ad67fd846c94bf71bfb1ee31ede8e98ad4af99f2 | refs/heads/master | 2021-01-21T15:18:04.109527 | 2014-09-18T07:53:45 | 2014-09-18T07:53:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package user;
public class User {
private int id;
private String username;
private String nickusername;
private String userpassword;
private String entryTime;
private String branch ; // 所属部门
private String positions ; // 职位
private int usertype; // 所属的组 组的编号 // 系统默认2 为主管组
private String products;
private String phone ;
private String charge ; // 主管
private int statues; // 是否授权 0 没授权, 1 已授权
private int chargeid;
private String location ;
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public int getChargeid() {
return chargeid;
}
public void setChargeid(int chargeid) {
this.chargeid = chargeid;
}
public String getCharge() {
return charge;
}
public void setCharge(String charge) {
this.charge = charge;
}
public int getStatues() {
return statues;
}
public void setStatues(int statues) {
this.statues = statues;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEntryTime() {
return entryTime;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getNickusername() {
return nickusername;
}
public void setNickusername(String nickusername) {
this.nickusername = nickusername;
}
public String getUserpassword() {
return userpassword;
}
public void setUserpassword(String userpassword) {
this.userpassword = userpassword;
}
public String getPositions() {
return positions;
}
public void setPositions(String positions) {
this.positions = positions;
}
public int getUsertype() {
return usertype;
}
public void setUsertype(int usertype) {
this.usertype = usertype;
}
public void setEntryTime(String entryTime) {
this.entryTime = entryTime;
}
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public String getProducts() {
return products;
}
public void setProducts(String products) {
this.products = products;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
| [
"think@Lenovo-PC"
]
| think@Lenovo-PC |
8b10c625fd779aeae03a7d27b67c12e4df009fc3 | 7da67e38da4131c3703b074e196b45227f5883a7 | /src/app/src/main/java/hcmus/student/locationmap/utilities/AddressLine.java | 5a6a6d87f2590f313c2d722656e4a7d8e83b6d3a | []
| no_license | thuy13705/LocationMap | a3df605124fadd26526ddb37654ceb90daf6f693 | d4f675f1b66527f8462aec235f44224949b043d3 | refs/heads/master | 2023-02-16T12:33:16.831683 | 2021-01-15T10:17:36 | 2021-01-15T10:17:36 | 306,342,754 | 0 | 1 | null | 2021-01-15T08:40:20 | 2020-10-22T13:16:25 | Java | UTF-8 | Java | false | false | 861 | java | package hcmus.student.locationmap.utilities;
import android.location.Geocoder;
import android.os.AsyncTask;
import com.google.android.gms.maps.model.LatLng;
public class AddressLine extends AsyncTask<LatLng, Void, String> {
Geocoder geocoder;
OnAddressLineResponse delegate;
public AddressLine(Geocoder geocoder, OnAddressLineResponse delegate) {
this.geocoder = geocoder;
this.delegate = delegate;
}
@Override
protected String doInBackground(LatLng... locations) {
LatLng location = locations[0];
try {
return geocoder.getFromLocation(location.latitude, location.longitude, 1).get(0).getAddressLine(0);
} catch (Exception e) {
return null;
}
}
@Override
protected void onPostExecute(String s) {
delegate.onAddressLineResponse(s);
}
}
| [
"[email protected]"
]
| |
140e42f4eced9de55e7fd8ceac989368a56045ae | b09cd640c6ec294917dcf4bcb5e92733c07a6a6b | /src/com/example/ziacik/DBHelperMath.java | d700e57501a356fba7d6fe1abb826c0fc33a8f7a | []
| no_license | eM-Ce/ziacik | c28031a7914e0ecf6da2140c59326e46882058fc | e38b6ac30abd63f98c7239228206aaca195436d9 | refs/heads/master | 2020-05-29T23:49:14.769092 | 2015-06-24T19:18:51 | 2015-06-24T19:18:51 | 30,351,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,437 | java | package com.example.ziacik;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DBHelperMath extends SQLiteOpenHelper{
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "DBmatematika.db";
private static final String TABLE_MATH = "priklady";
private static final String KEY_ID = "id";
private static final String KEY_NAME = "meno";
private static final String KEY_FIRST = "operand1";
private static final String KEY_SECOND = "operand2";
private static final String KEY_PLUS = "plus";
private static final String KEY_MINUS = "minus";
private static final String KEY_MULTIPLY = "krat";
private static final String KEY_DIVIDE = "deleno";
private static final String KEY_PLUS_LIMIT = "pluslimit";
private static final String KEY_MINUS_LIMIT = "minuslimit";
private static final String KEY_MULTIPLY_LIMIT = "kratlimit";
private static final String KEY_DIVIDE_LIMIT = "delenolimit";
private static final String KEY_PLUS_TIME = "plustime";
private static final String KEY_MINUS_TIME = "minustime";
private static final String KEY_MULTIPLY_TIME = "krattime";
private static final String KEY_DIVIDE_TIME = "delenotime";
public DBHelperMath(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_TABLE = "CREATE TABLE " + TABLE_MATH + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT," + KEY_FIRST + " INTEGER," + KEY_SECOND + " INTEGER,"
+ KEY_PLUS + " FLOAT," + KEY_PLUS_LIMIT + " FLOAT," + KEY_PLUS_TIME + " FLOAT,"
+ KEY_MINUS + " FLOAT," + KEY_MINUS_LIMIT + " FLOAT," + KEY_MINUS_TIME + " FLOAT,"
+ KEY_MULTIPLY + " FLOAT," + KEY_MULTIPLY_LIMIT + " FLOAT," + KEY_MULTIPLY_TIME + " FLOAT,"
+ KEY_DIVIDE + " FLOAT," + KEY_DIVIDE_LIMIT + " FLOAT," + KEY_DIVIDE_TIME + " FLOAT" + ")";
db.execSQL(CREATE_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_MATH);
onCreate(db);
}
public void pridajPriklad(Priklad priklad){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_NAME, priklad.getName());
values.put(KEY_FIRST, priklad.getOp1());
values.put(KEY_SECOND, priklad.getOp2());
values.put(KEY_PLUS, 0);
values.put(KEY_MINUS, 0);
values.put(KEY_MULTIPLY, 0);
values.put(KEY_DIVIDE, 0);
values.put(KEY_PLUS_LIMIT, 0);
values.put(KEY_MINUS_LIMIT, 0);
values.put(KEY_MULTIPLY_LIMIT, 0);
values.put(KEY_DIVIDE_LIMIT, 0);
values.put(KEY_PLUS_TIME, 0);
values.put(KEY_MINUS_TIME, 0);
values.put(KEY_MULTIPLY_TIME, 0);
values.put(KEY_DIVIDE_TIME, 0);
db.insert(TABLE_MATH, null, values);
db.close();
}
public List<Priklad> vsetkyPriklady(String name){
List<Priklad> priklady = new ArrayList<Priklad>();
String selectQuery = "SELECT * FROM " + TABLE_MATH + " WHERE "+ KEY_NAME +" ='" + name + "'";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
if (cursor.moveToFirst()) {
do {
Priklad priklad = new Priklad();
priklad.setID(cursor.getInt(0));
priklad.setName(cursor.getString(1));
priklad.setOp1(cursor.getInt(2));
priklad.setOp2(cursor.getInt(3));
priklad.setPlus(cursor.getInt(4));
priklad.setPlusLimit(cursor.getInt(5));
priklad.setPlusTime(cursor.getInt(6));
priklad.setMinus(cursor.getInt(7));
priklad.setMinusLimit(cursor.getInt(8));
priklad.setMinusTime(cursor.getInt(9));
priklad.setKrat(cursor.getInt(10));
priklad.setKratLimit(cursor.getInt(11));
priklad.setKratTime(cursor.getInt(12));
priklad.setDeleno(cursor.getInt(13));
priklad.setDelenoLimit(cursor.getInt(14));
priklad.setDelenoTime(cursor.getInt(15));
priklady.add(priklad);
} while (cursor.moveToNext());
}
return priklady;
}
public int upravPocetOdpovedi(Priklad priklad){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_PLUS, priklad.getPlus());
values.put(KEY_PLUS_LIMIT, priklad.getPlusLimit());
values.put(KEY_PLUS_TIME, priklad.getPlusTime());
values.put(KEY_MINUS, priklad.getMinus());
values.put(KEY_MINUS_LIMIT, priklad.getMinusLimit());
values.put(KEY_MINUS_TIME, priklad.getMinusTime());
values.put(KEY_MULTIPLY, priklad.getKrat());
values.put(KEY_MULTIPLY_LIMIT, priklad.getKratLimit());
values.put(KEY_MULTIPLY_TIME, priklad.getKratTime());
values.put(KEY_DIVIDE, priklad.getDeleno());
values.put(KEY_DIVIDE_LIMIT, priklad.getDelenoLimit());
values.put(KEY_DIVIDE_TIME, priklad.getDelenoTime());
return db.update(TABLE_MATH, values, KEY_ID + " = ?",
new String[] { String.valueOf(priklad.getID()) });
}
}
| [
"[email protected]"
]
| |
96fdabe758f47ecd209c8c2ffffbc24ef1bf7002 | cd7f0ccffb433d179c711d43c7ad03ee61908cc8 | /build/generated/src/org/apache/jsp/consultar_jsp.java | 9cfb68ff6eedadf11abb18242a3b5ff57f612b58 | []
| no_license | D0u6l45/Cadastro_Crud_java | fd74d737343b11c96a0212ec8b8d1b9691b8394a | bb52e6c1f6703fe398b4fed31712df76c644187d | refs/heads/master | 2022-04-15T19:32:06.327471 | 2020-04-13T01:55:29 | 2020-04-13T01:55:29 | 255,206,260 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,287 | java | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import persistencia.FuncionarioDao;
public final class consultar_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
}
public void _jspDestroy() {
_jspx_tagPool_c_forEach_var_items.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
try{
request.setAttribute("funcionario", new FuncionarioDao().consultar());
}catch(Exception e){
}
out.write("\n");
out.write(" \n");
out.write(" <h1> Consultar banco</h1>\n");
out.write(" <hr/>\n");
out.write(" <table border=\"1\">\n");
out.write(" <tr>\n");
out.write(" <th>Código</th>\n");
out.write(" <th>Nome</th>\n");
out.write(" <th>Login</th>\n");
out.write(" <th>Senha</th>\n");
out.write(" </tr>\n");
out.write(" \n");
out.write(" ");
if (_jspx_meth_c_forEach_0(_jspx_page_context))
return;
out.write("\n");
out.write(" \n");
out.write(" </tr>\n");
out.write(" \n");
out.write(" </table>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_forEach_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
_jspx_th_c_forEach_0.setParent(null);
_jspx_th_c_forEach_0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${funcionario}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
_jspx_th_c_forEach_0.setVar("f");
int[] _jspx_push_body_count_c_forEach_0 = new int[] { 0 };
try {
int _jspx_eval_c_forEach_0 = _jspx_th_c_forEach_0.doStartTag();
if (_jspx_eval_c_forEach_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" <tr>\n");
out.write(" <th>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${f.id}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("</th>\n");
out.write(" <th>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${f.nome}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("</th>\n");
out.write(" <th>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${f.login}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("</th>\n");
out.write(" <th>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${f.senha}", java.lang.String.class, (PageContext)_jspx_page_context, null));
out.write("</th>\n");
out.write(" </tr>\n");
out.write(" \n");
out.write(" ");
int evalDoAfterBody = _jspx_th_c_forEach_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_forEach_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_forEach_0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_forEach_0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_forEach_0.doFinally();
_jspx_tagPool_c_forEach_var_items.reuse(_jspx_th_c_forEach_0);
}
return false;
}
}
| [
"[email protected]"
]
| |
a0a6bad6560819b70879697790efd5f78f699b0a | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/26/org/jfree/chart/plot/CategoryPlot_setDomainGridlinePaint_1605.java | d5015a98ecb3b409aa939965fef407cec8fe3cb1 | []
| no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 4,240 | java |
org jfree chart plot
gener plot data link categori dataset categorydataset
render data item link categori item render categoryitemrender
categori plot categoryplot plot
set paint draw grid line domain
axi send link plot chang event plotchangeev regist listen
param paint paint code code permit
domain gridlin paint getdomaingridlinepaint
set domain gridlin paint setdomaingridlinepaint paint paint
paint
illeg argument except illegalargumentexcept null 'paint' argument
domain gridlin paint domaingridlinepaint paint
notifi listen notifylisten plot chang event plotchangeev
| [
"[email protected]"
]
| |
8d17feb80128eba07d700cca3126080d947e392e | 5b43c1a1e7b0761362c2d6f612b284d3ccfc5b9d | /AndroidMazeApp/src/main/java/falstad/Robot.java | d0d144e1a53241c7b02f102d8d763a22e8019b6c | []
| no_license | rmmaw/AndroidMaze | 652dfe428137e8cb2b9198c404b151ab807660ab | c1bfeb9dea30d17515d4fe2f55732d7959c585c6 | refs/heads/master | 2021-06-27T00:46:20.048599 | 2017-09-14T14:15:17 | 2017-09-14T14:15:17 | 103,421,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,259 | java | package williameskay.cs301.cs.wm.edu.amazebywilliameskayandreillymaw.falstad;
/**
* This interface specifies methods to operate a robot that is inside
* a maze at a particular location and looking in a particular direction.
* An implementing class will support a robot with certain sensors.
* A robot needs to be given an existing maze to be operational.
* It provides an operating platform for a robotdriver that experiences a maze (the real world)
* through the sensors and actors of this robot interface.
*
* Note that a robot may be very limited in its mobility, e.g. only 90 degree left or right turns,
* which makes sense in the artificial terrain of a maze, and its sensing capability,
* e.g. only a sensor on its front or left to detect remote obstacles.
* Left/right is a notion relative to the robot's direction
* or relative to the underlying maze.
* To avoid a confusion, the latter is considered a direction in an absolute sense
* and it may be better to describe it as a cardinal direction
* north, south, east, west than up, down, right, left.
*
* A robot comes with a battery level that is depleted during operations
* such that a robot may actually stop if it runs out of energy.
* This interface supports energy consideration.
* A robot may also stop when hitting an obstacle.
*
* WARNING: the use of CW_BOT/CW_TOP and CardinalDirection in Cells and
* Mazebuilder does not directly match with the MapDrawer
* which draws position (0,0) at the lower left corner, such that
* x values grow towards the right, y values grow towards the top and
* direction SOUTH is towards the top of the display.
* Or in other words, the maze is drawn upside down by the MapDrawer but
* East and West are as one expects it (East to the right, West to the left).
*
* The rotation is calculated with polar coordinates (angle) towards a
* cartesian coordinate system where a southbound direction is (dx,dy)=(0,1).
*
* Implementing classes: movable robots with distance sensors of different kind.
*
* Collaborators: a maze class to be explored, a robotdriver class that operates robot
*
* @author peterkemper
*
*/
public interface Robot {
/**
* Describes all possible turns that a robot can do when it rotates on the spot.
*/
public enum Turn { LEFT, RIGHT, AROUND } ;
/**
* Describes all possible directions from the point of view of the robot,
* i.e., relative to its current forward position.
*/
public enum Direction { LEFT, RIGHT, FORWARD, BACKWARD } ;
/**
* Turn robot on the spot. If robot runs out of energy, it stops and throws an Exception,
* which can be checked by hasStopped() == true and by checking the battery level.
* @throws Exception if the robot stops for lack of energy.
*/
void rotate(Turn turn) throws Exception ;
/**
* Moves robot forward a given number of steps. A step matches a single cell.
* Since a robot may only have a distance sensor in its front.
* If the robot runs out of energy somewhere on its way, it stops,
* which can be checked by hasStopped() == true and by checking the battery level.
* If the robot hits an obstacle like a wall, it remains at the position in front
* of the obstacle but hasStopped() == false.
* @param distance is the number of cells to move in the robot's current forward direction
* @throws Exception if robot hits an obstacle like a wall or border,
* which indicates that current position is not as expected.
* Also thrown if robot runs out of energy.
* @precondition distance >= 0
*/
void move(int distance) throws Exception ;
/**
* Provides the current position as (x,y) coordinates for the maze cell as an array of length 2 with [x,y].
* @postcondition 0 <= x < width, 0 <= y < height of the maze.
* @return array of length 2, x = array[0], y=array[1]
* @throws Exception if position is outside of the maze
*/
int[] getCurrentPosition() throws Exception ;
/**
* Provides the robot with a reference to the maze it is currently in.
* The robot memorizes the maze such that this method is most likely called only once
* and for initialization purposes. The maze serves as the main source of information
* about the current location, the presence of walls, the reaching of an exit.
* @param maze is the current maze
* @precondition maze != null, maze refers to a fully operational, configured maze object
*/
void setMaze(MazeController maze) ;
/**
* Tells if current position is at the goal (the exit). Used to recognize termination of a search.
* @return true if robot is at the goal, false otherwise
*/
boolean isAtExit() ;
/**
* Tells if a sensor can identify the goal in given direction relative to
* the robot's current forward direction from the current position.
* @return true if the goal (here: exit of the maze) is visible in a straight line of sight
* @throws UnsupportedOperationException if robot has no sensor in this direction
*/
boolean canSeeExit(Direction direction) throws UnsupportedOperationException ;
;
/**
* Tells if current position is inside a room.
* @return true if robot is inside a room, false otherwise
* @throws UnsupportedOperationException if not supported by robot
*/
boolean isInsideRoom() throws UnsupportedOperationException ;
/**
* Tells if the robot has a room sensor.
*/
boolean hasRoomSensor() ;
/**
* Provides the current direction as (dx,dy) values for the robot as an array of length 2 with [dx,dy].
* Note that dx,dy are elements of {-1,0,1} and as in bitmasks masks in Cells.java and dirsx,dirsy in MazeBuilder.java.
*
* @return array of length 2, dx = array[0], dy=array[1]
*/
int[] getCurrentDirection() ;
/**
* Returns the current battery level.
* The robot has a given battery level (energy level) that it draws energy from during operations.
* The particular energy consumption is device dependent such that a call for distance2Obstacle may use less energy than a move forward operation.
* If battery level <= 0 then robot stops to function and hasStopped() is true.
* @return current battery level, level is > 0 if operational.
*/
float getBatteryLevel() ;
/**
* Sets the current battery level.
* The robot has a given battery level (energy level) that it draws energy from during operations.
* The particular energy consumption is device dependent such that a call for distance2Obstacle may use less energy than a move forward operation.
* If battery level <= 0 then robot stops to function and hasStopped() is true.
* @param level is the current battery level
* @precondition level >= 0
*/
void setBatteryLevel(float level) ;
/**
* Gives the energy consumption for a full 360 degree rotation.
* Scaling by other degrees approximates the corresponding consumption.
* @return energy for a full rotation
*/
float getEnergyForFullRotation() ;
/**
* Gives the energy consumption for moving forward for a distance of 1 step.
* For simplicity, we assume that this equals the energy necessary
* to move 1 step backwards and that scaling by a larger number of moves is
* approximately the corresponding multiple.
* @return energy for a single step forward
*/
float getEnergyForStepForward() ;
/**
* Tells if the robot has stopped for reasons like lack of energy, hitting an obstacle, etc.
* @return true if the robot has stopped, false otherwise
*/
boolean hasStopped() ;
/**
* Tells the distance to an obstacle (a wall or border) for a the robot's current forward direction.
* Distance is measured in the number of cells towards that obstacle,
* e.g. 0 if current cell has a wall in this direction
* @return number of steps towards obstacle if obstacle is visible
* in a straight line of sight, Integer.MAX_VALUE otherwise
* @throws UnsupportedOperationException if not supported by robot
*/
int distanceToObstacle(Direction direction) throws UnsupportedOperationException ;
/**
* Tells if the robot has a distance sensor for the given direction.
*/
boolean hasDistanceSensor(Direction direction) ;
/**
* Our very own keydown method that will be used to circumvent the keydown method in maze while the
* state is in play mode.
* @param object
* @param key
*/
} | [
"[email protected]"
]
| |
147530ce418cb0246f9d41e89d40897ec183dda1 | dfa040784a04ef9774451c4b2e8f97ae4ba823e4 | /src/com/norman0406/slimgress/API/Knobs/PortalKnobs.java | 4f8118067adaae55d97c303a4bed563ad5f6cc64 | []
| no_license | Norman0406/Slimgress | 37df94a9d62df72c59d76c87a600154415641a24 | 29242f0cba89bebe1e61dd8f239b3ec23e3848bc | refs/heads/master | 2020-05-18T21:57:16.311606 | 2013-08-18T11:51:00 | 2013-08-18T11:51:00 | 11,195,800 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,597 | java | /***********************************************************************
*
* Slimgress: Ingress API for Android
* Copyright (C) 2013 Norman Link <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
***********************************************************************/
package com.norman0406.slimgress.API.Knobs;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
public class PortalKnobs extends Knobs
{
public class Band
{
List<Integer> applicableLevels;
int remaining;
}
private List<Band> mBands;
private boolean mCanPlayerRemoveMod;
private int mMaxModsPerPlayer;
public PortalKnobs(JSONObject json) throws JSONException
{
super(json);
JSONObject resonatorLimits = json.getJSONObject("resonatorLimits");
JSONArray bands = resonatorLimits.getJSONArray("bands");
mBands = new ArrayList<Band>();
for (int i = 0; i < bands.length(); i++) {
JSONObject band = bands.getJSONObject(i);
Band newBand = new Band();
newBand.applicableLevels = getIntArray(band, "applicableLevels");
newBand.remaining = band.getInt("remaining");
mBands.add(newBand);
}
mCanPlayerRemoveMod = json.getBoolean("canPlayerRemoveMod");
mMaxModsPerPlayer = json.getInt("maxModsPerPlayer");
}
public Band getBandForLevel(int level)
{
for (Band band : mBands) {
if (band.applicableLevels.contains((Integer)level))
return band;
}
Log.w("PortalKnobs", "band not found for level: " + level);
return null;
}
public List<Band> getBands()
{
return mBands;
}
public boolean getCanPlayerRemoveMod()
{
return mCanPlayerRemoveMod;
}
public int getMaxModsPerPlayer()
{
return mMaxModsPerPlayer;
}
}
| [
"[email protected]"
]
| |
1c56e492951e5ef4fb8c61bd034abfcbcf3553d3 | 99ef59318418ad90ad45a36441b3558c6ce77a05 | /P6_18.java | b6ccc7e8014da06608677661f884a2caa3401f4b | []
| no_license | mimamoru/java_practice | 5b7a7215a40d1674fde4925edf09571e62b6e975 | 0de5bee97fa42f8c97b014cae3c8ad85e2043c24 | refs/heads/master | 2022-11-15T07:29:49.788118 | 2020-07-12T20:08:13 | 2020-07-12T20:08:13 | 275,496,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | //import java.util.Random;
import java.util.Scanner;
public class P6_18 {
public static void main(String[] args) {
Scanner stdIn=new Scanner(System.in);
int[][] a=new int[4][3];
int[][] b=new int[3][4];
System.out.println("a??");
for(int i=0; i<4; i++){
for(int j=0; j<3; j++){
System.out.print("a["+i+"]["+j+"]?:");
a[i][j]=stdIn.nextInt();
}
}
System.out.println("b??");
for(int i=0; i<3; i++){
for(int j=0; j<4; j++){
System.out.print("b["+i+"]["+j+"]?:");
b[i][j]=stdIn.nextInt();
}
}
int[][] c=new int[4][4];
for(int i=0; i<4; i++){
for(int j=0; j<4; j++){
for(int z=0; z<3; z++){
c[i][j]+=a[i][z]*b[z][j];
}
}
}
for(int[] cc:c){
for(int ccc:cc){
System.out.print(ccc+" ");
}
System.out.println();
}
stdIn.close();
}} | [
"[email protected]"
]
| |
24e3643094c530a6e7e19931d690be5a276b44cd | b6c4030683917fbdaf40652b9e20300a59daf3bb | /src/Selenium12/SadbasicsExp7.java | b5277ab054edbc657855122c3562cddac4f3df9f | []
| no_license | anilkumartesting43/manual-selenium003 | d54a305b6d513cef804bb5d0e3e655c21fec6a56 | 9c76feebb0ab235f3ec3193d6b7409e84ba11cc7 | refs/heads/master | 2021-01-25T23:23:36.776965 | 2020-10-13T10:19:04 | 2020-10-13T10:19:04 | 243,224,779 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,075 | java | package Selenium12;
import java.util.Scanner;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SadbasicsExp7 {
public static void main(String[] args) throws InterruptedException {
Scanner sc =new Scanner(System.in);
System.out.println("jyoti please enter valid URL");
//we are sending data
String act_url=sc.nextLine();
System.out.println("what is your expected output");
String exp_out=sc.nextLine();
//driver path
System.setProperty("webdriver.chrome.driver", "C:\\Users\\ANIL CH\\Downloads\\chromedriver_win32 (4)\\chromedriver.exe");
//create obj
WebDriver driver = new ChromeDriver();
//loade the web site
driver.get(act_url);
//maximize window
driver.manage().window().maximize();
String act_re=driver.getTitle();
System.out.println("the title:"+act_re);
if(act_re.equalsIgnoreCase(exp_out))
{
System.out.println("the test is pass");
}
else
{
System.out.println("the test is faild");
Thread.sleep(2000);
}
//close the active window
//driver.close();
}
}
| [
"[email protected]"
]
| |
b2d3b97acc9006d609ea5af11e403b6d98e211a1 | b84596efa9d8a7eb50b34a4a0478cd0c929acd5b | /POO/src/main/java/oo/aula3/polimorfismo/Motocicleta.java | 4b9b6713e8d11f3de8b33afbf50e60174e0e7c71 | []
| no_license | lanasreis/JAVA-DIO | a2628b286733675c7a0d14adba5e5212d4a6e433 | 471d19f117ccbdf554a129c4a8d2712cd99a9f26 | refs/heads/master | 2023-01-11T02:27:41.437579 | 2020-11-16T18:24:42 | 2020-11-16T18:24:42 | 309,234,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package oo.aula3.polimorfismo;
public class Motocicleta extends Veiculo {
private String cilindradas;
public void setCilindradas(final String cilindradas){
this.cilindradas = cilindradas;
}
public double calculaValorVenal(){
return this.getValorVenal() * 0.03;
}
}
| [
"[email protected]"
]
| |
353bd224efe41d09e4d61958e2127ec85b82944d | 7809d724b3f1cb85833c334f569363897bc99202 | /src/main/java/com/wrbug/wkcwallet/entry/TransactionCountVo.java | d96b69cb752003c86bb3d4771ccad484355b3967 | [
"Apache-2.0"
]
| permissive | GaoZhenGit/wkcwallet-java | 9d5071fb0d65ba5a9ac45e7ca8cf01f5c217dccd | 7c90a398ac29396e3359f182558af401c15c05b3 | refs/heads/master | 2021-04-12T09:30:48.347330 | 2018-04-01T04:40:24 | 2018-04-01T04:40:24 | 126,472,311 | 0 | 0 | Apache-2.0 | 2018-03-23T10:51:04 | 2018-03-23T10:51:03 | null | UTF-8 | Java | false | false | 691 | java | package com.wrbug.wkcwallet.entry;
/**
* TransactionCountVo
*
* @author WrBug
* @since 2018/2/1
*/
public class TransactionCountVo {
/**
* jsonrpc : 2.0
* id : 1
* result : 0x9
*/
private String jsonrpc;
private int id;
private String result;
public String getJsonrpc() {
return jsonrpc;
}
public void setJsonrpc(String jsonrpc) {
this.jsonrpc = jsonrpc;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
| [
"[email protected]"
]
| |
0ac2e22d7af0491fedee2371adc3b434b5987353 | bb2f32df072cd27fa90b0892057e66fec9b569d9 | /Android/GalileoX_CAAD003X_Professional_Android_App_Development/DaggerDemo/app/src/main/java/com/example/robert/daggerdemo/MainActivity.java | f8ca60645e55d42b92499584cb194e868fa7202a | []
| no_license | amerelsayed2020/Learning | 9417777f28b8d5161e6761d98c3e64cd9f998d3a | 689acd3f8de57ce67dc610cae659d88782270668 | refs/heads/master | 2023-04-27T11:34:54.622157 | 2020-07-09T15:40:36 | 2020-07-09T15:40:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,335 | java | package com.example.robert.daggerdemo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import com.example.robert.daggerdemo.data.DataManager;
import com.example.robert.daggerdemo.data.model.User;
import com.example.robert.daggerdemo.di.components.ActivityComponent;
import com.example.robert.daggerdemo.di.components.DaggerActivityComponent;
import com.example.robert.daggerdemo.di.modules.ActivityModule;
import javax.inject.Inject;
public class MainActivity extends AppCompatActivity {
@Inject
DataManager mDataManager;
private ActivityComponent activityComponent;
private TextView mTvUserInfo;
private TextView mTvAccessToken;
public ActivityComponent getActivityComponent() {
if (activityComponent == null) {
activityComponent = DaggerActivityComponent.builder()
.activityModule(new ActivityModule(this))
.applicationComponent(DemoApplication.get(this).getComponent())
.build();
}
return activityComponent;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getActivityComponent().inject(this);
mTvUserInfo = (TextView) findViewById(R.id.tv_user_info);
mTvAccessToken = (TextView) findViewById(R.id.tv_access_token);
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
createUser();
getUser();
mDataManager.saveAccessToken("ASDR12443JFDJF43543J543H3K543");
String token = mDataManager.getAccessToken();
if (token != null) {
mTvAccessToken.setText(token);
}
}
private void createUser() {
try {
mDataManager.createUser(new User("Ali", "1367, Gurgaon, Haryana, India"));
} catch (Exception e) {
e.printStackTrace();
}
}
private void getUser() {
try {
User user = mDataManager.getUser(1L);
mTvUserInfo.setText(user.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
]
| |
3ccbcbb910552a76797fb5ecb0d064acb880b6be | a0a24b9ffe35a9adc23dd6115be0ffeedfca013e | /spring-boot-quickstart/src/main/java/com/pduleba/spring/boot/controller/SpringBootController.java | c5ec3c7418f794ca1b3d3a5b619e6c90c0f9470e | [
"Apache-2.0"
]
| permissive | pduleba/SpringBoot-SL | eca034e7cda837d902e4001c702dc77ede04fd68 | 9f06996b430cbc686b2bd4827cc7ae5bbf2a53fc | refs/heads/master | 2021-05-03T18:55:19.224481 | 2018-02-07T08:38:10 | 2018-02-07T08:38:10 | 120,418,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.pduleba.spring.boot.controller;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.pduleba.spring.boot.model.RestResponse;
@Controller
public class SpringBootController {
@RequestMapping(method = RequestMethod.GET, path = "/controller", produces = { MediaType.APPLICATION_XML_VALUE,
MediaType.APPLICATION_JSON_VALUE })
@ResponseBody
public RestResponse controller(@RequestParam(value = "name", defaultValue = "controller") String name) {
return new RestResponse(name);
}
}
| [
"[email protected]"
]
| |
2a1aa6321ce05c61908d4edd940e6db4b7448da2 | 01a78a76bc376ea078149d9fa663e651602bca1a | /src/main/java/com/chernyak/pattern/model/Resume.java | b51b11754dfef898a77432a882d9ba4519867328 | []
| no_license | barsetca/pattern-template-method | ef74476da7febca14bad8ba01f9ec090f8a6d51e | 99c0946f7e4387b97f20b4bb1ae3fb621175495a | refs/heads/master | 2023-02-15T08:08:08.906662 | 2021-01-13T07:52:56 | 2021-01-13T07:52:56 | 329,233,147 | 0 | 0 | null | 2021-01-13T17:01:17 | 2021-01-13T07:52:46 | Java | UTF-8 | Java | false | false | 1,909 | java | package com.chernyak.pattern.model;
import java.time.LocalDate;
import java.util.Objects;
public class Resume implements Comparable<Resume> {
private String uuid;
private String fullName;
private LocalDate birthday;
private String city;
public Resume(String uuid, String fullName) {
this(uuid, fullName, LocalDate.now(), "");
}
public Resume(String uuid, String fullName, LocalDate birthday, String city) {
this.uuid = uuid;
this.fullName = fullName;
this.birthday = birthday;
this.city = city;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public LocalDate getBirthday() {
return birthday;
}
public void setBirthday(LocalDate birthday) {
this.birthday = birthday;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Resume resume = (Resume) o;
return uuid.equals(resume.uuid) && fullName.equals(resume.fullName) && Objects
.equals(birthday, resume.birthday) && Objects.equals(city, resume.city);
}
@Override
public int hashCode() {
return Objects.hash(uuid, fullName, birthday, city);
}
@Override
public int compareTo(Resume o) {
return fullName.compareTo(o.fullName) == 0 ? uuid.compareTo(o.uuid) : fullName.compareTo(o.fullName);
}
@Override
public String toString() {
return "Resume{" +
"uuid='" + uuid + '\'' +
", fullName='" + fullName + '\'' +
", birthday=" + birthday +
", city='" + city + '\'' +
'}';
}
}
| [
"[email protected]"
]
| |
7ac2595453175ba9c8edc6c8669632ebe6d4c29c | b675761fcbffc6b35dc5937d798997340224126f | /backend/src/main/java/com/fms/inventory_management/repositories/CurrentInventoryRepository.java | eeade74f1c6f60a2c80fe00f0384ee5e2a5a50a1 | []
| no_license | FMS0102/inventory_management | 8de4bf213725184b01d14e8b5c91ec3611863dd0 | 488219c6a58503f3f9f0b0370a04414ca3678319 | refs/heads/main | 2023-08-25T11:50:40.241153 | 2021-10-11T23:30:44 | 2021-10-11T23:30:44 | 415,419,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package com.fms.inventory_management.repositories;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import com.fms.inventory_management.entities.CurrentInventory;
@Repository
public interface CurrentInventoryRepository extends MongoRepository<CurrentInventory, String> {
}
| [
"[email protected]"
]
| |
955b4263eab44db85713c8c4e4938888f517f032 | eb24b2d04f9eb14c83cfdc45af543b7983cf70cd | /ShoppingCart/src/domain/toys/ActionMan.java | 6cd8396ecbbb3707907c54d228cf79cb8183ef86 | []
| no_license | josebarreiro90/Formacao_HIQ_JanAbr2016 | e7ac3ab23a39f86879afc512a5712603e12ed7ca | 470e45e34a243ef8b24b0535c41af261f4332a7e | refs/heads/master | 2021-01-10T09:21:20.110768 | 2016-03-01T20:48:40 | 2016-03-01T20:48:40 | 49,227,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package domain.toys;
public class ActionMan extends Toy {
private final String type;
public ActionMan(int id, String name, float price, int minimunAge,String type) {
super(id, name, price, minimunAge);
this.type=type;
}
public String getType() {
return type;
}
}
| [
"[email protected]"
]
| |
d2892e69b900aff998d9e8a1e38f7d644cad0599 | 065fe62aa6f9004fc91b07e6c676e8d500a47048 | /Server/allDemoGoHere/springbootdemo/main/java/com/is0967/menutri/repositories/IngredientCategoryRepo.java | 7ac19e18ea17237a6438361b289eca22a5bf28af | []
| no_license | huyleonis/Capstone | ee8f185348e6637f0711bf01921e1f1df1f8dab4 | bebe728619453fd1097e373b87828f8c843d9677 | refs/heads/master | 2021-05-16T17:49:32.261190 | 2017-12-12T09:56:59 | 2017-12-12T09:56:59 | 103,046,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | package com.is0967.menutri.repositories;
import com.is0967.menutri.entities.Ingredient;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by NBL.Huyen on 15-02-17.
*/
@Repository
public interface IngredientCategoryRepo extends JpaRepository<Ingredient, Long> {
}
| [
"[email protected]"
]
| |
0661e41f957dbfd9a89718c290c93c16ceac15f2 | f43a0e822d6887e0614bbeb69c06ccdf3b2b2458 | /generated/appengine-endpoints-guice-objectify/src/main/resources/archetype-resources/src/main/java/endpoints/config/ServletsPathForEndpointClassesModule.java | 73d5987c96fbaddc82c0a3b88c13af94b6ff8a4a | []
| no_license | alassane0101/Archetypes | b539068f0f236c7f73b6cd5ca1c42a6f8744bde3 | a3603fcd11ccb45698ea8824ded807974468b663 | refs/heads/master | 2020-06-17T04:39:43.158505 | 2019-02-13T22:17:28 | 2019-02-13T22:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.endpoints.config;
import java.util.List;
import ${package}.guice.utils.ClassFinder;
import com.google.api.server.spi.guice.GuiceSystemServiceServletModule;
import com.googlecode.objectify.ObjectifyFilter;
/**
* This starts in web.xml. All requests are intercepted and sent here.
*/
public class ServletsPathForEndpointClassesModule extends GuiceSystemServiceServletModule {
@Override
public void configureServlets() {
super.configureServlets();
Class<?> endpointsModule = RegisterEndpointsModule.class;
Class<?> servletsPathForEndpointClassesModule = ServletsPathForEndpointClassesModule.class;
List<Class<?>> endpointClasses = ClassFinder.find("${package}.endpoints");
// Remove no @Api endpoint classes from the servlets endpoint
endpointClasses.remove(endpointsModule);
endpointClasses.remove(servletsPathForEndpointClassesModule);
// Endpoints classes
serveGuiceSystemServiceServlet("/_ah/spi/*", endpointClasses);
}
}
| [
"[email protected]"
]
| |
8482c602ca95e6cdad0073818966d542b4340172 | 155c769a79d1c6cda5568eea2192d07f01c47d3e | /RealMadrid/app/src/main/java/com/example/realmadrid/MainActivity.java | fe66e62613d6da460ccfb3971f3c29d512cf9fcc | []
| no_license | ramismonoshev/Real-Madrid- | 1537480219c0ba03617cea190786a62e76f161d3 | 10d8f73bec4a9bb3a3bdfdd4ac79d82874ed7a8a | refs/heads/master | 2023-04-19T12:39:38.745269 | 2021-05-08T08:36:18 | 2021-05-08T08:36:18 | 350,070,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,364 | java | package com.example.realmadrid;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView mywebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mywebView=(WebView) findViewById(R.id.webview);
mywebView.setWebViewClient(new WebViewClient());
mywebView.loadUrl("https://ramismonoshev.github.io/WebORoject/home.html");
WebSettings webSettings=mywebView.getSettings();
webSettings.setJavaScriptEnabled(true);
}
public class mywebClient extends WebViewClient{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon){
super.onPageStarted(view,url,favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view,String url){
view.loadUrl(url);
return true;
}
}
@Override
public void onBackPressed(){
if(mywebView.canGoBack()) {
mywebView.goBack();
}
else{
super.onBackPressed();
}
}
} | [
"[email protected]"
]
| |
515ecfc6f12380f9286f6cc8f7c3da778d08681e | c337f4ee160f73d0b7e74992be0ba00235a8c65c | /MvpFramework/build/generated/source/buildConfig/release/com/tz/architect/mvpframework/BuildConfig.java | 8bea489877ac2eddc9f0530610acef30e1d4c7d9 | []
| no_license | 514721857/Delivery | 30e04b08d2e79c2814ab9c7a1bbf0de8329e876b | 0c1988d8a7070118dec79618ba1b15129d254458 | refs/heads/master | 2020-03-21T00:46:14.611568 | 2018-12-06T14:36:12 | 2018-12-06T14:36:12 | 137,909,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.tz.architect.mvpframework;
public final class BuildConfig {
public static final boolean DEBUG = false;
public static final String APPLICATION_ID = "com.tz.architect.mvpframework";
public static final String BUILD_TYPE = "release";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"[email protected]"
]
| |
e22b853a0e2681b40d0c3b9f30ea371d14e78cb9 | 60b80d80342987e0123a0206bcb204cc18daf1ba | /aws-java-sdk-guardduty/src/main/java/com/amazonaws/services/guardduty/model/DnsRequestAction.java | a2cdf95c3bccf0ce67d7c7d7d61368bea0f2dac6 | [
"Apache-2.0"
]
| permissive | Jayu8/aws-sdk-java | 43084f98cc60de7e917e753fe00e46c6b746a889 | 5ee04c93922ecbabed8bbed237b17db695661900 | refs/heads/master | 2021-06-20T02:15:09.070582 | 2020-04-09T22:55:17 | 2020-04-09T22:55:17 | 254,494,443 | 0 | 0 | Apache-2.0 | 2020-04-09T22:49:35 | 2020-04-09T22:49:34 | null | UTF-8 | Java | false | false | 4,056 | java | /*
* Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.guardduty.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* Contains information about the DNS_REQUEST action described in this finding.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DnsRequestAction" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DnsRequestAction implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* Domain information for the API request.
* </p>
*/
private String domain;
/**
* <p>
* Domain information for the API request.
* </p>
*
* @param domain
* Domain information for the API request.
*/
public void setDomain(String domain) {
this.domain = domain;
}
/**
* <p>
* Domain information for the API request.
* </p>
*
* @return Domain information for the API request.
*/
public String getDomain() {
return this.domain;
}
/**
* <p>
* Domain information for the API request.
* </p>
*
* @param domain
* Domain information for the API request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DnsRequestAction withDomain(String domain) {
setDomain(domain);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDomain() != null)
sb.append("Domain: ").append(getDomain());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DnsRequestAction == false)
return false;
DnsRequestAction other = (DnsRequestAction) obj;
if (other.getDomain() == null ^ this.getDomain() == null)
return false;
if (other.getDomain() != null && other.getDomain().equals(this.getDomain()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDomain() == null) ? 0 : getDomain().hashCode());
return hashCode;
}
@Override
public DnsRequestAction clone() {
try {
return (DnsRequestAction) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.guardduty.model.transform.DnsRequestActionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| [
""
]
| |
deea45482fe1dcb9ff6e409bfa0223ea38276b8a | c51e0e82ebc20126cb3ed95129c2eb46568870db | /Angiev1/src/controller/vtaVenta/CCNotaCredito.java | c23e98a9f6d32f0f072779a78fd59e01adaa8713 | []
| no_license | lu1sm1gu3l/SysSilvestre | 98cee22df0047ec203759e1126af121c1a6794be | 6304458adc28670b9f2947ef7a83be448f2fe1fe | refs/heads/master | 2021-01-16T23:19:34.708621 | 2016-06-23T03:57:24 | 2016-06-23T03:57:24 | 61,769,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,507 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package controller.vtaVenta;
import java.util.List;
import modelo.vtaVenta.datos.CDNotaCredito;
import modelo.vtaVenta.entidad.CEComprobanteVentaMatriz;
import modelo.vtaVenta.entidad.CENotaCredito;
/**
*
* @author Katya
*/
public class CCNotaCredito {
public static String[] InsNotaCredito(CENotaCredito oCENotaCredito,CEComprobanteVentaMatriz oCEComprobanteVentaMatriz,int pIdPunto,int pIdAlmacen)
{
return CDNotaCredito.InsNotaCredito(oCENotaCredito,oCEComprobanteVentaMatriz, pIdPunto,pIdAlmacen);
}
public static boolean UPDNotaCredito(CENotaCredito oCENotaCredito)
{
return CDNotaCredito.UPDNotaCredito(oCENotaCredito);
}
public static int AnularNotaCredito(CENotaCredito oCENotaCredito)
{
return CDNotaCredito.AnularNotaCredito(oCENotaCredito);
}
public static CENotaCredito ListarNotaCredito(int id)
{
return CDNotaCredito.CosultarNotaCreditoPorId(id);
}
public static List<CENotaCredito> BuscarNotaCreditoPorCliente(long id)
{
return CDNotaCredito.ListarNotaCredito("",3,id,0,null);
}
public static List<CENotaCredito> BusqAvanzada(String pDato,int idestado,String pFechaFin)
{
return CDNotaCredito.ListarNotaCredito(pDato,4, 0,idestado,pFechaFin);
}
public static List<CENotaCredito> BusqNum(String pNum)
{
return CDNotaCredito.ListarNotaCredito(pNum,2,0,0,null);
}
}
| [
"[email protected]"
]
| |
30f76bd2d6a07f3ae7d9ec6e661fd7eab7554289 | c02a624ca99f69446078f49402bbdca10f0b350c | /exareme-master/src/main/java/madgik/exareme/master/connector/local/AdpDBQueryExecutorThread.java | 617f5eab235d5b2ac1294eef97a405fc3a7d581a | [
"MIT"
]
| permissive | dbilid/exareme | a9850941cde95713957f76fa051ad696afdff0a3 | 3bd1bfc5b46585277dd560af207bef2241eb8375 | refs/heads/dev | 2020-04-05T22:50:16.160694 | 2016-10-28T11:31:12 | 2016-10-28T11:31:12 | 50,434,886 | 0 | 1 | null | 2016-01-26T14:43:16 | 2016-01-26T14:43:15 | null | UTF-8 | Java | false | false | 1,615 | java | /**
* Copyright MaDgIK Group 2010 - 2015.
*/
package madgik.exareme.master.connector.local;
import com.google.gson.Gson;
import madgik.exareme.common.schema.Partition;
import madgik.exareme.common.schema.PhysicalTable;
import madgik.exareme.master.client.AdpDBClientProperties;
import madgik.exareme.master.connector.AdpDBConnectorUtil;
import madgik.exareme.master.registry.Registry;
import org.apache.log4j.Logger;
import java.io.PipedOutputStream;
import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
/**
* @author heraldkllapi
* @author dimitris
*/
public class AdpDBQueryExecutorThread extends Thread {
private final String queryString;
private final Map<String, Object> alsoIncludeProps;
private final AdpDBClientProperties props;
private final PipedOutputStream out;
private final Set<String> referencedTables;
private Logger log = Logger.getLogger(AdpDBQueryExecutorThread.class);
public AdpDBQueryExecutorThread(String q, Map<String, Object> alsoIncludeProps, AdpDBClientProperties props,
Set<String> referencedTables, PipedOutputStream out) {
this.queryString = q;
this.alsoIncludeProps = alsoIncludeProps;
this.props = props;
this.out = out;
this.referencedTables=referencedTables;
}
@Override
public void run() {
try {
AdpDBConnectorUtil.executeLocalQuery(queryString, referencedTables, 0, props.getDatabase(), alsoIncludeProps, out);
} catch (Exception e) {
log.error("Cannot get results", e);
} finally {
try {
out.flush();
out.close();
} catch (Exception e) {
log.error("Cannot close output", e);
}
}
}
} | [
"[email protected]"
]
| |
95586da7c129b9e57fd6ffb3245a821ed1d0feed | 45dfce274b46a4b3248453e3b242cfca83bbfc1c | /app/src/main/java/com/dudu/huodai/mvp/model/postbean/AdvertSplashBean.java | ab0c4efb9d4d429b674c693cf18766066d94ec3e | []
| no_license | aierlymon/Dudu | 3ec35cb0e4594a99893d60f43f04d620bfac5054 | 8a0c7ef4df1bf5e2f5304d661cd9f313c95efafc | refs/heads/master | 2020-07-06T20:29:24.027660 | 2019-10-08T02:53:05 | 2019-10-08T02:53:17 | 203,130,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.dudu.huodai.mvp.model.postbean;
public class AdvertSplashBean {
private int type;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
| [
"[email protected]"
]
| |
7145d52d1139f8cadb1d66e1338dbf70d9242a56 | 64ac69084e7fb784d29880e25e870a198e622eaf | /Media Library/Podcast.java | 6c428283541ef4a5ddf5b91d6fc449c1396063eb | []
| no_license | vvasired121/CS-121 | 646374722749ea8c01a4495d9beb2ac9662e4546 | b99016714e77bc6fc2fb7df0a417b642fd0c1d7f | refs/heads/master | 2022-11-27T21:45:03.602020 | 2020-07-25T23:36:46 | 2020-07-25T23:36:46 | 282,526,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | /**
* This class encapsulates the data required to represent a podcast in a collection
* of MediaItems. It derives from MediaItem.
* In addition to its superclass attributes, the attributes of a podcast are:
* String: its description, String: its website, String: its date,
* true if it is a video podcast, false otherwise.
**/
public class Podcast extends MediaItem {
String description;
String website;
String date;
boolean isVideo;
public Podcast(String title, String author, String genre, String description,
String website, String date, boolean isVideo){
super(title,author,genre);
this.description = description;
this.website = website;
this.date = date;
this.isVideo = isVideo;
}
public String getDescription(){
return description;
}
public String getWebsite(){
return website;
}
public String getDate(){
return date;
}
public boolean isVideo(){
boolean x = false;
if(isVideo){
x = true;
}
return x;
}
/* TODO: write the isVideo method that returns true if
* this is a video podcast, false otherwise.
*/
public String toString(){
return "Podcast: " + getTitle() + ", " + getAuthor() + ", " + getGenre() + ", " + description + ", " + website + ", " + date + ", " + isVideo;
}
} | [
"[email protected]"
]
| |
a4fc9ab987437aa91723e372bac8c75dfd77f721 | 6285c1a2fd7ca358acd09881f31fab25bcbbe84b | /src/main/java/net/imglib2/algorithm/math/NotEqual.java | fdc5df5b3deaa44a9f857a7b5de60a7bfa5ab2ab | [
"BSD-2-Clause"
]
| permissive | igorpisarev/imglib2-algorithm | 2c2c054533c977676b2cf38e684cdec9a1b3f11b | f20e472836dc7e6c34b85fe0bd49711e2399eb36 | refs/heads/master | 2021-01-09T09:41:01.012112 | 2019-10-23T19:27:47 | 2019-10-23T19:27:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package net.imglib2.algorithm.math;
import java.util.Map;
import net.imglib2.algorithm.math.abstractions.Compare;
import net.imglib2.algorithm.math.abstractions.OFunction;
import net.imglib2.algorithm.math.execution.NotEquality;
import net.imglib2.algorithm.math.execution.Variable;
import net.imglib2.converter.Converter;
import net.imglib2.type.numeric.RealType;
public final class NotEqual extends Compare
{
public NotEqual( final Object o1, final Object o2) {
super( o1, o2 );
}
@Override
public < O extends RealType< O > > NotEquality< O > reInit(
final O tmp,
final Map< String, O > bindings,
final Converter< RealType< ? >, O > converter,
final Map< Variable< O >, OFunction< O > > imgSources )
{
return new NotEquality< O >( tmp.copy(),
this.a.reInit( tmp, bindings, converter, imgSources ),
this.b.reInit( tmp, bindings, converter, imgSources ) );
}
} | [
"[email protected]"
]
| |
13efcefd89b0b0a18985cf4e81643696ba6a410a | fcf2662c6a9ffefe77d682806b20501eee2a960a | /src/demo10_Stream/Test.java | 43b0d5be8f65b6c1a269801801f9c602e5f93f51 | []
| no_license | 516516/JavaBasis | f7336193a3f4d652fe5ed2ad10c0ea2c02715ae7 | 50361eb0d0a77ffc03b0c1be559751785696f86a | refs/heads/master | 2020-04-04T23:51:29.994733 | 2018-12-15T10:35:05 | 2018-12-15T10:35:05 | 156,374,600 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 657 | java | package demo10_Stream;
/**
*@auther:胡波
*@version: 2018年11月25日下午12:09:15
*@description:测试注释的类
*/
class B{
private String name;
public String getName() {
return name;
}
}
public class Test {
/**
* @param args
* @auther: 胡波
* @version: 2018年11月25日下午12:38:20
* @description:main函数
*/
public static void main(String[] args) {
}
/**
* @param a
* @param b
* @return
* @auther: 胡波
* @version: 2018年11月25日下午12:28:07
* @description:测试添加注释
*/
public static B getObject(int a,int b) {
return new B();
}
}
| [
"[email protected]"
]
| |
1490d1c365f879d2b2bb212dc13ada839dd0a549 | 37980086ffb781b7bee47d5b49f98f0347958006 | /src/main/java/com/wechatsell/wechatsell/service/SortRepositoryService.java | c0fbae38348e055121503b21ae440c9c95f7856b | []
| no_license | panjiecai/wechatsell | 31f1a53a8816ddab6dab74f95d0a736956f48301 | 5f21f70b99f12119e96e85a396b6e3d63b1d2b51 | refs/heads/master | 2022-12-22T17:06:50.473117 | 2020-09-27T07:33:24 | 2020-09-27T07:33:24 | 298,977,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package com.wechatsell.wechatsell.service;
import com.wechatsell.wechatsell.dataobject.Sort;
import java.util.List;
/**
*类型表
*/
public interface SortRepositoryService {
//通过id寻找
Sort findOne(int sortId);
//全部
List<Sort> findAll();
//通过编号查询
List<Sort> findBySortTypeIn(List<Integer> sortTypeList);
//存储
Sort save(Sort sort);
}
| [
"[email protected]"
]
| |
7e853e9300a0af322e51c75ed0cb8cb9a233c46e | 0ac05e3da06d78292fdfb64141ead86ff6ca038f | /OSWE/oswe/openCRX/hsqldb-2.6.0/hsqldb/src/org/hsqldb/map/BaseHashMap.java | c9226f469490bcf5971916a84ebefddbad8426d3 | []
| no_license | qoo7972365/timmy | 31581cdcbb8858ac19a8bb7b773441a68b6c390a | 2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578 | refs/heads/master | 2023-07-26T12:26:35.266587 | 2023-07-17T12:35:19 | 2023-07-17T12:35:19 | 353,889,195 | 7 | 1 | null | null | null | null | UTF-8 | Java | false | false | 57,357 | java | /* Copyright (c) 2001-2021, The HSQL Development Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 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.
*
* Neither the name of the HSQL Development Group 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 HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
* 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 org.hsqldb.map;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.concurrent.atomic.AtomicInteger;
import org.hsqldb.lib.ArrayCounter;
import org.hsqldb.lib.ArrayUtil;
import org.hsqldb.lib.ObjectComparator;
import org.hsqldb.lib.PrimitiveIterator;
/**
* Base class for hash tables or sets. The exact type of the structure is
* defined by the constructor. Each instance has at least a keyTable array
* and a HashIndex instance for looking up the keys into this table. Instances
* that are maps also have a valueTable the same size as the keyTable.
*
* Special getOrAddXXX() methods are used for object maps in some subclasses.
*
* @author Fred Toussi (fredt@users dot sourceforge.net)
* @version 2.6.0
* @since 1.7.2
*/
public class BaseHashMap {
/*
data store:
keys: {array of primitive | array of object}
values: {none | array of primitive | array of object} same size as keys
objects support : hashCode(), equals()
implemented types of keyTable:
{objectKeyTable: variable size Object[] array for keys |
intKeyTable: variable size int[] for keys |
longKeyTable: variable size long[] for keys }
implemented types of valueTable:
{objectValueTable: variable size Object[] array for values |
intValueTable: variable size int[] for values |
longValueTable: variable size long[] for values}
valueTable does not exist for sets or for object pools
hash index:
hashTable: fixed size int[] array for hash lookup into keyTable
linkTable: pointer to the next key ; size equal or larger than hashTable
but equal to the valueTable
access count table:
{none |
variable size int[] array for access count} same size as xxxKeyTable
*/
//
protected boolean isIntKey;
protected boolean isLongKey;
protected boolean isObjectKey;
protected boolean isNoValue;
protected boolean isIntValue;
protected boolean isLongValue;
protected boolean isObjectValue;
protected boolean isMultiValue;
protected boolean isTwoObjectValue;
protected boolean isList;
protected boolean isAccessCount;
protected boolean isLastAccessCount;
//
protected HashIndex hashIndex;
//
protected int[] intKeyTable;
protected Object[] objectKeyTable;
protected long[] longKeyTable;
//
protected int[] intValueTable;
protected Object[] objectValueTable;
protected long[] longValueTable;
//
protected int accessMin;
protected AtomicInteger accessCount;
protected int[] accessTable;
protected Object[] objectValueTable2;
//
protected final float loadFactor;
protected final int initialCapacity;
protected int threshold;
protected int maxCapacity;
protected int purgePolicy = NO_PURGE;
protected boolean minimizeOnEmpty;
protected ObjectComparator comparator = ObjectComparator.defaultComparator;
//
protected boolean hasZeroKey;
protected int zeroKeyIndex = -1;
protected int zeroOrNullValueCount;
// keyOrValueTypes
protected static final int noKeyOrValue = 0;
protected static final int intKeyOrValue = 1;
protected static final int longKeyOrValue = 2;
protected static final int objectKeyOrValue = 3;
// purgePolicy
protected static final int NO_PURGE = 0;
protected static final int PURGE_ALL = 1;
protected static final int PURGE_HALF = 2;
//
public static final int ACCESS_MAX = Integer.MAX_VALUE - (1 << 20);
public static final Object[] emptyObjectArray = new Object[]{};
protected BaseHashMap(int initialCapacity, int keyType, int valueType,
boolean hasAccessCount)
throws IllegalArgumentException {
if (initialCapacity <= 0) {
throw new IllegalArgumentException();
}
if (initialCapacity < 4) {
initialCapacity = 4;
} else {
initialCapacity = (int) ArrayUtil.getBinaryNormalisedCeiling(initialCapacity);
}
this.loadFactor = 1; // can use any value if necessary
this.initialCapacity = initialCapacity;
threshold = initialCapacity;
int hashtablesize = (int) (initialCapacity * loadFactor);
if (hashtablesize < 4) {
hashtablesize = 4;
}
hashIndex = new HashIndex(hashtablesize, initialCapacity, true);
int arraySize = threshold;
if (keyType == BaseHashMap.intKeyOrValue) {
isIntKey = true;
intKeyTable = new int[arraySize];
} else if (keyType == BaseHashMap.objectKeyOrValue) {
isObjectKey = true;
objectKeyTable = new Object[arraySize];
} else {
isLongKey = true;
longKeyTable = new long[arraySize];
}
if (valueType == BaseHashMap.intKeyOrValue) {
isIntValue = true;
intValueTable = new int[arraySize];
} else if (valueType == BaseHashMap.objectKeyOrValue) {
isObjectValue = true;
objectValueTable = new Object[arraySize];
} else if (valueType == BaseHashMap.longKeyOrValue) {
isLongValue = true;
longValueTable = new long[arraySize];
} else {
isNoValue = true;
}
isLastAccessCount = hasAccessCount;
if (hasAccessCount) {
accessTable = new int[arraySize];
accessCount = new AtomicInteger();
}
}
protected int getLookup(Object key) {
int hash = comparator.hashCode(key);
int lookup = hashIndex.getLookup(hash);
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) {
Object current = objectKeyTable[lookup];
if (comparator.equals(key, current)) {
break;
}
}
return lookup;
}
protected int getLookup(Object key, int hash) {
int lookup = hashIndex.getLookup(hash);
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) {
Object current = objectKeyTable[lookup];
if (comparator.equals(key, current)) {
break;
}
}
return lookup;
}
protected int getLookup(int key) {
int lookup = hashIndex.getLookup(key);
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) {
int current = intKeyTable[lookup];
if (key == current) {
break;
}
}
return lookup;
}
protected int getLookup(long key) {
int hash = (int) (key >>> 32 ^ key);
int lookup = hashIndex.getLookup(hash);
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) {
long current = longKeyTable[lookup];
if (key == current) {
break;
}
}
return lookup;
}
protected int getObjectLookup(long key) {
int hash = (int) (key >>> 32 ^ key);
int lookup = hashIndex.getLookup(hash);
long tempKey;
for (; lookup >= 0; lookup = hashIndex.getNextLookup(lookup)) {
tempKey = comparator.longKey(objectKeyTable[lookup]);
if (tempKey == key) {
break;
}
}
return lookup;
}
protected PrimitiveIterator getMultiValuesIterator(Object key) {
int lookup = getLookup(key);
ValueCollectionIterator valuesIterator =
new ValueCollectionIterator(key, lookup);
return valuesIterator;
}
protected int multiValueElementCount(Object key) {
int lookup = getLookup(key);
if (lookup == -1) {
return 0;
}
int count = 1;
while (true) {
lookup = BaseHashMap.this.hashIndex.getNextLookup(lookup);
if (lookup == -1) {
break;
}
if (BaseHashMap.this.objectKeyTable[lookup].equals(key)) {
count++;
} else {
break;
}
}
return count;
}
protected int multiValueKeyCount() {
int count = 0;
int lookup = -1;
Object oldKey = null;
for (int index = 0; index < hashIndex.hashTable.length; ) {
if (hashIndex.hashTable[index] < 0) {
index++;
continue;
}
if (lookup < 0) {
lookup = hashIndex.hashTable[index];
} else {
lookup = hashIndex.getNextLookup(lookup);
}
if (lookup < 0) {
index++;
continue;
}
if (!comparator.equals(oldKey, objectKeyTable[lookup])) {
oldKey = objectKeyTable[lookup];
count++;
}
}
return count;
}
/**
* generic method for adding keys and values or updating values
*
* returns existing Object value if any or null
*
* returns
*/
protected Object addOrUpdate(long longKey, long longValue,
Object objectKey, Object objectValue) {
int hash;
if (isObjectKey) {
if (objectKey == null) {
return null;
}
hash = comparator.hashCode(objectKey);
} else {
hash = (int) (longKey >>> 32 ^ longKey);
}
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.hashTable[index];
int lastLookup = -1;
Object returnValue = null;
boolean matched = false;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
if (isObjectKey) {
matched = comparator.equals(objectKeyTable[lookup], objectKey);
} else if (isIntKey) {
matched = longKey == intKeyTable[lookup];
} else if (isLongKey) {
matched = longKey == longKeyTable[lookup];
}
if (matched) {
break;
}
}
if (matched) {
if (isNoValue) {
return Boolean.FALSE;
} else if (isObjectValue) {
returnValue = objectValueTable[lookup];
objectValueTable[lookup] = objectValue;
if (objectValue == null) {
if (returnValue != null) {
zeroOrNullValueCount++;
}
} else {
if (returnValue == null) {
zeroOrNullValueCount--;
}
}
} else if (isIntValue) {
int existing = intValueTable[lookup];
returnValue = existing;
intValueTable[lookup] = (int) longValue;
if (longValue == 0) {
if (existing != 0) {
zeroOrNullValueCount++;
}
} else {
if (existing == 0) {
zeroOrNullValueCount--;
}
}
} else if (isLongValue) {
long existing = longValueTable[lookup];
returnValue = existing;
longValueTable[lookup] = longValue;
if (longValue == 0) {
if (existing != 0) {
zeroOrNullValueCount++;
}
} else {
if (existing == 0) {
zeroOrNullValueCount--;
}
}
}
if (isLastAccessCount) {
accessTable[lookup] = accessCount.incrementAndGet();
} else if (isAccessCount) {
accessTable[lookup]++;
}
return returnValue;
}
if (hashIndex.elementCount >= threshold) {
if (reset()) {
return addOrUpdate(longKey, longValue, objectKey, objectValue);
} else {
throw new NoSuchElementException("BaseHashMap");
}
}
lookup = hashIndex.linkNode(index, lastLookup);
if (isObjectKey) {
objectKeyTable[lookup] = objectKey;
} else if (isIntKey) {
intKeyTable[lookup] = (int) longKey;
if (longKey == 0) {
hasZeroKey = true;
zeroKeyIndex = lookup;
}
} else if (isLongKey) {
longKeyTable[lookup] = longKey;
if (longKey == 0) {
hasZeroKey = true;
zeroKeyIndex = lookup;
}
}
if (isNoValue) {
return Boolean.TRUE;
} else if (isObjectValue) {
objectValueTable[lookup] = objectValue;
if (objectValue == null) {
zeroOrNullValueCount++;
}
} else if (isIntValue) {
intValueTable[lookup] = (int) longValue;
if (longValue == 0) {
zeroOrNullValueCount++;
}
} else if (isLongValue) {
longValueTable[lookup] = longValue;
if (longValue == 0) {
zeroOrNullValueCount++;
}
}
//
if (isLastAccessCount) {
accessTable[lookup] = accessCount.incrementAndGet();
} else if (isAccessCount) {
accessTable[lookup] = 1;
}
return returnValue;
}
/**
* generic method for removing keys
*
* returns existing Object value if any (or Object key if this is a set)
*/
protected Object remove(long longKey, long longValue, Object objectKey,
Object objectValue, boolean matchValue,
boolean removeRow) {
int hash;
if (isObjectKey) {
if (objectKey == null) {
return null;
}
hash = comparator.hashCode(objectKey);
} else {
hash = (int) (longKey >>> 32 ^ longKey);
}
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.hashTable[index];
int lastLookup = -1;
Object returnValue = null;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
boolean matched = false;
if (isObjectKey) {
matched = comparator.equals(objectKeyTable[lookup], objectKey);
} else if (isIntKey) {
matched = longKey == intKeyTable[lookup];
} else if (isLongKey) {
matched = longKey == longKeyTable[lookup];
}
if (matched) {
if (matchValue) {
if (isObjectValue) {
matched = ObjectComparator.defaultComparator.equals(
objectValueTable[lookup], objectValue);
} else if (isIntValue) {
matched = intValueTable[lookup] == longValue;
} else if (isLongKey) {
matched = longValueTable[lookup] == longValue;
}
if (!matched) {
return null;
}
}
break;
}
}
if (lookup < 0) {
if (isNoValue) {
return Boolean.FALSE;
}
return null;
}
if (isObjectKey) {
objectKeyTable[lookup] = null;
} else {
if (longKey == 0) {
hasZeroKey = false;
zeroKeyIndex = -1;
}
if (isIntKey) {
intKeyTable[lookup] = 0;
} else {
longKeyTable[lookup] = 0;
}
}
if (isNoValue) {
returnValue = Boolean.TRUE;
} else if (isObjectValue) {
returnValue = objectValueTable[lookup];
objectValueTable[lookup] = null;
if (returnValue == null) {
zeroOrNullValueCount--;
}
} else if (isIntValue) {
int existing = intValueTable[lookup];
returnValue = existing;
intValueTable[lookup] = 0;
if (existing == 0) {
zeroOrNullValueCount--;
}
} else if (isLongValue) {
long existing = longValueTable[lookup];
returnValue = existing;
longValueTable[lookup] = 0;
if (existing == 0) {
zeroOrNullValueCount--;
}
}
hashIndex.unlinkNode(index, lastLookup, lookup);
if (accessTable != null) {
accessTable[lookup] = 0;
}
if (isList && removeRow) {
removeRow(lookup);
}
if (minimizeOnEmpty && hashIndex.elementCount == 0) {
rehash(initialCapacity);
}
return returnValue;
}
/**
* Single method for adding key / values in multi-value maps.
* Values for each key are clustered.
*/
protected boolean addMultiVal(long longKey, long longValue,
Object objectKey, Object objectValue) {
int hash;
if (isObjectKey) {
if (objectKey == null) {
return false;
}
hash = comparator.hashCode(objectKey);
} else {
hash = (int) (longKey >>> 32 ^ longKey);
}
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.hashTable[index];
int lastLookup = -1;
int matchedKey = -1;
boolean matched = false;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
if (isObjectKey) {
matched = comparator.equals(objectKeyTable[lookup], objectKey);
} else if (isIntKey) {
matched = longKey == intKeyTable[lookup];
} else if (isLongKey) {
matched = longKey == longKeyTable[lookup];
}
if (matched) {
matchedKey = lookup;
} else {
if (matchedKey < 0) {
continue;
} else {
break;
}
}
if (isObjectValue) {
matched = ObjectComparator.defaultComparator.equals(
objectValueTable[lookup], objectValue);
} else if (isIntValue) {
matched = longValue == intValueTable[lookup];
} else if (isLongValue) {
matched = longValue == longValueTable[lookup];
}
if (matched) {
return false;
}
}
if (hashIndex.elementCount >= threshold) {
if (reset()) {
return addMultiVal(longKey, longValue, objectKey, objectValue);
} else {
throw new NoSuchElementException("BaseHashMap");
}
}
lookup = hashIndex.linkNode(index, lastLookup);
// type dependent block
if (isObjectKey) {
objectKeyTable[lookup] = objectKey;
} else if (isIntKey) {
intKeyTable[lookup] = (int) longKey;
if (longKey == 0) {
hasZeroKey = true;
zeroKeyIndex = lookup;
}
} else if (isLongKey) {
longKeyTable[lookup] = longKey;
if (longKey == 0) {
hasZeroKey = true;
zeroKeyIndex = lookup;
}
}
if (isObjectValue) {
objectValueTable[lookup] = objectValue;
if (objectValue == null) {
zeroOrNullValueCount++;
}
} else if (isIntValue) {
intValueTable[lookup] = (int) longValue;
if (longValue == 0) {
zeroOrNullValueCount++;
}
} else if (isLongValue) {
longValueTable[lookup] = longValue;
if (longValue == 0) {
zeroOrNullValueCount++;
}
}
if (isLastAccessCount) {
accessTable[lookup] = accessCount.incrementAndGet();
} else if (isAccessCount) {
accessTable[lookup] = 1;
}
return true;
}
/**
* Single method for removing key / values in multi-value maps.
*/
protected Object removeMultiVal(long longKey, long longValue,
Object objectKey, Object objectValue,
boolean matchValue) {
if (objectKey == null) {
return null;
}
int hash = comparator.hashCode(objectKey);
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.hashTable[index];
int lastLookup = -1;
int matchedKey = -1;
Object returnValue = null;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
boolean matched = false;
if (isObjectKey) {
matched = comparator.equals(objectKeyTable[lookup], objectKey);
if (matched) {
matchedKey = lookup;
} else {
if (matchedKey < 0) {
continue;
} else {
break;
}
}
if (matchValue) {
matched = ObjectComparator.defaultComparator.equals(
objectValueTable[lookup], objectValue);
if (matched) {
objectKeyTable[lookup] = null;
returnValue = objectValueTable[lookup];
objectValueTable[lookup] = null;
if (returnValue == null) {
zeroOrNullValueCount--;
}
hashIndex.unlinkNode(index, lastLookup, lookup);
return returnValue;
} else {
continue;
}
} else {
objectKeyTable[lookup] = null;
returnValue = objectValueTable[lookup];
objectValueTable[lookup] = null;
if (returnValue == null) {
zeroOrNullValueCount--;
}
if (lastLookup > lookup) {
lastLookup = lastLookup;
}
hashIndex.unlinkNode(index, lastLookup, lookup);
if (lastLookup < 0) {
lookup = hashIndex.hashTable[index];
if (lookup < 0) {
break;
}
} else {
lookup = lastLookup;
}
}
}
}
return returnValue;
}
/**
* type specific method for Object sets or Object->Object maps
*/
protected Object removeObject(Object objectKey, boolean removeRow) {
if (objectKey == null) {
return null;
}
int hash = comparator.hashCode(objectKey);
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.hashTable[index];
int lastLookup = -1;
Object returnValue = null;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
if (!comparator.equals(objectKeyTable[lookup], objectKey)) {
continue;
}
returnValue = objectKeyTable[lookup];
objectKeyTable[lookup] = null;
if (accessTable != null) {
accessTable[lookup] = 0;
}
hashIndex.unlinkNode(index, lastLookup, lookup);
if (isObjectValue) {
returnValue = objectValueTable[lookup];
objectValueTable[lookup] = null;
}
if (removeRow) {
removeRow(lookup);
}
return returnValue;
}
// not found
return returnValue;
}
/**
* For object sets using long key attribute of object for equality and
* hash. Used in org.hsqldb.persist.Cache
*/
protected Object addOrRemoveObject(long longKey, Object object,
boolean remove) {
int hash = (int) (longKey >>> 32 ^ longKey);
int index = hashIndex.getHashIndex(hash);
int lookup = hashIndex.getLookup(hash);
int lastLookup = -1;
Object returnValue = null;
for (; lookup >= 0;
lastLookup = lookup,
lookup = hashIndex.getNextLookup(lookup)) {
if (comparator.longKey(objectKeyTable[lookup]) == longKey) {
returnValue = objectKeyTable[lookup];
break;
}
}
if (lookup >= 0) {
if (remove) {
objectKeyTable[lookup] = null;
hashIndex.unlinkNode(index, lastLookup, lookup);
if (accessTable != null) {
accessTable[lookup] = 0;
}
if (minimizeOnEmpty && hashIndex.elementCount == 0) {
rehash(initialCapacity);
}
} else {
objectKeyTable[lookup] = object;
if (isLastAccessCount) {
accessTable[lookup] = accessCount.incrementAndGet();
} else if (isAccessCount) {
accessTable[lookup]++;
}
}
return returnValue;
} else if (remove) {
return null;
}
if (hashIndex.elementCount >= threshold) {
if (reset()) {
return addOrRemoveObject(longKey, object, remove);
} else {
throw new NoSuchElementException("BaseHashMap");
}
}
lookup = hashIndex.linkNode(index, lastLookup);
objectKeyTable[lookup] = object;
if (isLastAccessCount) {
accessTable[lookup] = accessCount.incrementAndGet();
} else if (isAccessCount) {
accessTable[lookup] = 1;
}
return returnValue;
}
protected boolean reset() {
if (maxCapacity == 0 || maxCapacity > threshold) {
rehash(hashIndex.linkTable.length * 2);
return true;
}
switch (purgePolicy) {
case PURGE_ALL :
clear();
return true;
case PURGE_HALF :
clearToHalf();
return true;
case NO_PURGE :
default :
return false;
}
}
/**
* rehash uses existing key and element arrays. key / value pairs are
* put back into the arrays from the top, removing any gaps. any redundant
* key / value pairs duplicated at the end of the array are then cleared.
*
* newCapacity must be larger or equal to existing number of elements.
*/
protected void rehash(int newCapacity) {
int limitLookup = hashIndex.newNodePointer;
boolean oldZeroKey = hasZeroKey;
int oldZeroKeyIndex = zeroKeyIndex;
if (newCapacity < hashIndex.elementCount) {
return;
}
hashIndex.reset((int) (newCapacity * loadFactor), newCapacity);
hasZeroKey = false;
zeroKeyIndex = -1;
threshold = newCapacity;
for (int lookup = -1;
(lookup = nextLookup(lookup, limitLookup, oldZeroKey, oldZeroKeyIndex))
< limitLookup; ) {
long longKey = 0;
long longValue = 0;
Object objectKey = null;
Object objectValue = null;
if (isObjectKey) {
objectKey = objectKeyTable[lookup];
} else if (isIntKey) {
longKey = intKeyTable[lookup];
} else {
longKey = longKeyTable[lookup];
}
if (isObjectValue) {
objectValue = objectValueTable[lookup];
} else if (isIntValue) {
longValue = intValueTable[lookup];
} else if (isLongValue) {
longValue = longValueTable[lookup];
}
if (isMultiValue) {
addMultiVal(longKey, longValue, objectKey, objectValue);
} else {
addOrUpdate(longKey, longValue, objectKey, objectValue);
}
if (accessTable != null) {
accessTable[hashIndex.elementCount - 1] = accessTable[lookup];
}
}
resizeElementArrays(hashIndex.newNodePointer, newCapacity);
}
/**
* resize the arrays containing the key / value data
*/
private void resizeElementArrays(int dataLength, int newLength) {
Object temp;
int usedLength = newLength > dataLength ? dataLength
: newLength;
if (isIntKey) {
temp = intKeyTable;
intKeyTable = new int[newLength];
System.arraycopy(temp, 0, intKeyTable, 0, usedLength);
}
if (isIntValue) {
temp = intValueTable;
intValueTable = new int[newLength];
System.arraycopy(temp, 0, intValueTable, 0, usedLength);
}
if (isLongKey) {
temp = longKeyTable;
longKeyTable = new long[newLength];
System.arraycopy(temp, 0, longKeyTable, 0, usedLength);
}
if (isLongValue) {
temp = longValueTable;
longValueTable = new long[newLength];
System.arraycopy(temp, 0, longValueTable, 0, usedLength);
}
if (objectKeyTable != null) {
temp = objectKeyTable;
objectKeyTable = new Object[newLength];
System.arraycopy(temp, 0, objectKeyTable, 0, usedLength);
}
if (isObjectValue) {
temp = objectValueTable;
objectValueTable = new Object[newLength];
System.arraycopy(temp, 0, objectValueTable, 0, usedLength);
}
if (objectValueTable2 != null) {
temp = objectValueTable2;
objectValueTable2 = new Object[newLength];
System.arraycopy(temp, 0, objectValueTable2, 0, usedLength);
}
if (accessTable != null) {
temp = accessTable;
accessTable = new int[newLength];
System.arraycopy(temp, 0, accessTable, 0, usedLength);
}
}
/**
* clear all the key / value data in a range.
*/
private void clearElementArrays(final int from, final int to) {
if (intKeyTable != null) {
Arrays.fill(intKeyTable, from, to, 0);
} else if (longKeyTable != null) {
Arrays.fill(longKeyTable, from, to, 0);
}
if (objectKeyTable != null) {
Arrays.fill(objectKeyTable, from, to, null);
}
if (intValueTable != null) {
Arrays.fill(intValueTable, from, to, 0);
} else if (longValueTable != null) {
Arrays.fill(longValueTable, from, to, 0);
} else if (objectValueTable != null) {
Arrays.fill(objectValueTable, from, to, null);
}
if (objectValueTable2 != null) {
Arrays.fill(objectValueTable2, from, to, null);
}
if (accessTable != null) {
Arrays.fill(accessTable, from, to, 0);
}
}
/**
* move the elements after a removed key / value pair to fill the gap
*/
void removeFromElementArrays(int size, int lookup) {
if (isIntKey) {
Object array = intKeyTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
intKeyTable[size - 1] = 0;
} else if (isLongKey) {
Object array = longKeyTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
longKeyTable[size - 1] = 0;
}
if (objectKeyTable != null) {
Object array = objectKeyTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
objectKeyTable[size - 1] = null;
}
if (isIntValue) {
Object array = intValueTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
intValueTable[size - 1] = 0;
} else if (isLongValue) {
Object array = longValueTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
longValueTable[size - 1] = 0;
}
if (isObjectValue) {
Object array = objectValueTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
objectValueTable[size - 1] = null;
}
if (objectValueTable2 != null) {
Object array = objectValueTable2;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
objectValueTable2[size - 1] = null;
}
if (accessTable != null) {
Object array = accessTable;
System.arraycopy(array, lookup + 1, array, lookup,
size - lookup - 1);
accessTable[size - 1] = 0;
}
}
/**
* move the elements to create a gap
*/
void insertIntoElementArrays(int size, int lookup) {
if (isIntKey) {
Object array = intKeyTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
intKeyTable[lookup] = 0;
} else if (isLongKey) {
Object array = longKeyTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
longKeyTable[lookup] = 0;
}
if (objectKeyTable != null) {
Object array = objectKeyTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
objectKeyTable[lookup] = null;
}
if (isIntValue) {
Object array = intValueTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
intValueTable[lookup] = 0;
} else if (isLongValue) {
Object array = longValueTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
longValueTable[lookup] = 0;
}
if (isObjectValue) {
Object array = objectValueTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
objectValueTable[lookup] = null;
}
if (objectValueTable2 != null) {
Object array = objectValueTable2;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
objectValueTable2[lookup] = null;
}
if (accessTable != null) {
Object array = accessTable;
System.arraycopy(array, lookup, array, lookup + 1, size - lookup);
accessTable[lookup] = 0;
}
}
/**
* find the next lookup in the key/value tables with an entry
* allows the use of old limit and zero int key attributes
*/
int nextLookup(int lookup, int limitLookup, boolean hasZeroKey,
int zeroKeyIndex) {
for (++lookup; lookup < limitLookup; lookup++) {
if (isObjectKey) {
if (objectKeyTable[lookup] != null) {
return lookup;
}
} else if (isIntKey) {
if (intKeyTable[lookup] != 0) {
return lookup;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return lookup;
}
} else {
if (longKeyTable[lookup] != 0) {
return lookup;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return lookup;
}
}
}
return lookup;
}
/**
* find the next lookup in the key/value tables with an entry
* uses current limits and zero integer key state
*/
protected int nextLookup(int lookup) {
for (++lookup; lookup < hashIndex.newNodePointer; lookup++) {
if (isObjectKey) {
if (objectKeyTable[lookup] != null) {
return lookup;
}
} else if (isIntKey) {
if (intKeyTable[lookup] != 0) {
return lookup;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return lookup;
}
} else {
if (longKeyTable[lookup] != 0) {
return lookup;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return lookup;
}
}
}
return -1;
}
/**
* row already freed of key / element
*/
protected void removeRow(int lookup) {
int size = hashIndex.newNodePointer;
if (size == 0) {
return;
}
hashIndex.removeEmptyNode(lookup);
removeFromElementArrays(size, lookup);
}
protected void insertRow(int lookup) {
if (hashIndex.elementCount >= threshold) {
reset();
}
if (lookup == hashIndex.elementCount) {
return;
}
int size = hashIndex.newNodePointer;
if (size == 0) {
return;
}
insertIntoElementArrays(size, lookup);
hashIndex.insertEmptyNode(lookup);
}
/**
* Clear the map completely.
*/
public void clear() {
if (hashIndex.modified) {
if (accessCount != null) {
accessCount.set(0);
}
accessMin = 0;
hasZeroKey = false;
zeroKeyIndex = -1;
clearElementArrays(0, hashIndex.newNodePointer);
hashIndex.clear();
if (minimizeOnEmpty) {
rehash(initialCapacity);
}
}
}
/**
* Return the max accessCount value for count elements with the lowest
* access count. Always return at least accessMin + 1
*/
protected int getAccessCountCeiling(int count, int margin) {
return ArrayCounter.rank(accessTable, hashIndex.newNodePointer, count,
accessMin, accessCount.get(), margin);
}
/**
* This is called after all elements below count accessCount have been
* removed
*/
protected void setAccessCountFloor(int count) {
accessMin = count;
}
/**
* Clear approximately half elements from the map, starting with
* those with low accessTable ranking.
*
* Only for value maps
*/
private void clearToHalf() {
int count = threshold >> 1;
int margin = threshold >> 8;
if (margin < 64) {
margin = 64;
}
int maxlookup = hashIndex.newNodePointer;
int accessBase = getAccessCountCeiling(count, margin);
for (int lookup = 0; lookup < maxlookup; lookup++) {
Object o = objectKeyTable[lookup];
if (o != null && accessTable[lookup] < accessBase) {
removeObject(o, false);
}
}
accessMin = accessBase;
if (hashIndex.elementCount > threshold - margin) {
clear();
}
}
protected void resetAccessCount() {
int accessMax = accessCount.get();
if (accessMax > 0 && accessMax < ACCESS_MAX) {
return;
}
int limit = hashIndex.getNewNodePointer();
accessMax = 0;
accessMin = Integer.MAX_VALUE;
for (int i = 0; i < limit; i++) {
int access = accessTable[i];
if (access == 0) {
continue;
}
access = (access >>> 2) + 1;
accessTable[i] = access;
if (access > accessMax) {
accessMax = access;
} else if (access < accessMin) {
accessMin = access;
}
}
if (accessMin > accessMax) {
accessMin = accessMax;
}
accessCount.set(accessMax);
}
protected int capacity() {
return hashIndex.linkTable.length;
}
public int size() {
return hashIndex.elementCount;
}
public boolean isEmpty() {
return hashIndex.elementCount == 0;
}
protected boolean containsKey(Object key) {
if (key == null) {
return false;
}
if (hashIndex.elementCount == 0) {
return false;
}
int lookup = getLookup(key, comparator.hashCode(key));
return lookup == -1 ? false
: true;
}
protected boolean containsKey(int key) {
if (hashIndex.elementCount == 0) {
return false;
}
int lookup = getLookup(key);
return lookup == -1 ? false
: true;
}
protected boolean containsKey(long key) {
if (hashIndex.elementCount == 0) {
return false;
}
int lookup = getLookup(key);
return lookup == -1 ? false
: true;
}
protected boolean containsValue(Object value) {
int lookup = 0;
if (hashIndex.elementCount == 0) {
return false;
}
if (value == null) {
for (; lookup < hashIndex.newNodePointer; lookup++) {
if (objectValueTable[lookup] == null) {
if (isObjectKey) {
if (objectKeyTable[lookup] != null) {
return true;
}
} else if (isIntKey) {
if (intKeyTable[lookup] != 0) {
return true;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return true;
}
} else {
if (longKeyTable[lookup] != 0) {
return true;
} else if (hasZeroKey && lookup == zeroKeyIndex) {
return true;
}
}
}
}
} else {
for (; lookup < hashIndex.newNodePointer; lookup++) {
if (value.equals(objectValueTable[lookup])) {
return true;
}
}
}
return false;
}
protected boolean containsValue(int value) {
if (value == 0) {
return zeroOrNullValueCount > 0;
}
for (int lookup = 0; lookup < hashIndex.newNodePointer; lookup++) {
if (intValueTable[lookup] == value) {
return true;
}
}
return false;
}
protected boolean containsValue(long value) {
if (value == 0) {
return zeroOrNullValueCount > 0;
}
for (int lookup = 0; lookup < hashIndex.newNodePointer; lookup++) {
if (longValueTable[lookup] == value) {
return true;
}
}
return false;
}
protected Object[] toArray(boolean keys) {
Object[] array = new Object[size()];
return toArray(array, keys);
}
protected <T> T[] multiValueKeysToArray(T[] array) {
int size = this.multiValueKeyCount();
if (array.length < size) {
array = (T[]) Array.newInstance(array.getClass().getComponentType(),
size);
}
PrimitiveIterator it = new MultiValueKeyIterator();
int index = 0;
while (it.hasNext()) {
array[index] = (T) it.next();
index++;
}
return array;
}
protected <T> T[] toArray(T[] array, boolean keys) {
if (array.length < size()) {
array = (T[]) Array.newInstance(array.getClass().getComponentType(),
size());
}
int limit = hashIndex.getNewNodePointer();
int index = 0;
Object[] table = keys ? objectKeyTable :
objectValueTable;
for (int i = 0; i < limit; i++) {
T o = (T) table[i];
if (o != null) {
array[index++] = o;
}
}
return array;
}
protected int[] toIntArray(int[] array, boolean keys) {
if (array.length < size()) {
array = new int[size()];
}
PrimitiveIterator it = new BaseHashIterator(keys);
for (int i = 0; i < array.length; i++) {
int value = it.nextInt();
array[i] = value;
}
return array;
}
protected long[] toLongArray(long[] array, boolean keys) {
if (array.length < size()) {
array = new long[size()];
}
PrimitiveIterator it = new BaseHashIterator(keys);
for (int i = 0; i < array.length; i++) {
long value = it.nextInt();
array[i] = value;
}
return array;
}
/**
* Iterator for accessing the values for a single key in MultiValueHashMap
* Currently only for object maps
*/
protected class ValueCollectionIterator implements PrimitiveIterator {
int lookup = -1;
Object key;
ValueCollectionIterator(Object key, int lookup) {
this.key = key;
this.lookup = lookup;
}
public boolean hasNext() {
return lookup != -1;
}
public Object next() throws NoSuchElementException {
if (lookup == -1) {
throw new NoSuchElementException();
}
Object value = BaseHashMap.this.objectValueTable[lookup];
lookup = BaseHashMap.this.hashIndex.getNextLookup(lookup);
if (lookup != -1) {
Object nextKey = BaseHashMap.this.objectKeyTable[lookup];
if (!comparator.equals(nextKey, key)) {
lookup = -1;
}
}
return value;
}
public int nextInt() throws NoSuchElementException {
throw new NoSuchElementException("Hash Iterator");
}
public long nextLong() throws NoSuchElementException {
throw new NoSuchElementException("Hash Iterator");
}
public void remove() throws NoSuchElementException {
throw new NoSuchElementException("Hash Iterator");
}
}
protected class MultiValueKeyIterator implements PrimitiveIterator {
int index = 0;
int lookup = -1;
boolean removed;
Object oldKey;
public MultiValueKeyIterator() {
if (hashIndex.elementCount > 0) {
toNextLookup();
}
}
private void toNextLookup() {
for (; index < hashIndex.hashTable.length; ) {
if (hashIndex.hashTable[index] < 0) {
index++;
continue;
}
if (lookup < 0) {
lookup = hashIndex.hashTable[index];
} else {
lookup = hashIndex.getNextLookup(lookup);
}
if (lookup < 0) {
index++;
continue;
}
if (comparator.equals(oldKey, objectKeyTable[lookup])) {
continue;
}
break;
}
}
public boolean hasNext() {
return lookup != -1;
}
public Object next() throws NoSuchElementException {
if (lookup < 0) {
throw new NoSuchElementException("Hash Iterator");
}
Object value = objectKeyTable[lookup];
toNextLookup();
oldKey = value;
return value;
}
public int nextInt() throws NoSuchElementException {
throw new NoSuchElementException("Hash Iterator");
}
public long nextLong() throws NoSuchElementException {
throw new NoSuchElementException("Hash Iterator");
}
public void remove() throws NoSuchElementException {
removeMultiVal(0, 0, oldKey, null, false);
oldKey = null;
}
}
/**
* Iterator returns Object, int or long and is used both for keys and
* values
*/
protected class BaseHashIterator implements PrimitiveIterator {
protected boolean keys;
protected int lookup = -1;
protected int counter;
protected boolean removed;
/**
* default is iterator for values
*/
public BaseHashIterator() {
}
public BaseHashIterator(boolean keys) {
this.keys = keys;
if (!keys && isNoValue) {
throw new RuntimeException("Hash Iterator");
}
}
public void reset() {
this.lookup = -1;
this.counter = 0;
this.removed = false;
}
public boolean hasNext() {
return counter < hashIndex.elementCount;
}
public Object next() throws NoSuchElementException {
if (keys) {
if (isIntKey) {
return nextInt();
} else if (isLongKey) {
return nextLong();
}
} else {
if (isIntValue) {
return nextInt();
} else if (isLongValue) {
return nextLong();
}
}
removed = false;
if (hasNext()) {
counter++;
lookup = nextLookup(lookup);
if (keys) {
return objectKeyTable[lookup];
} else {
return objectValueTable[lookup];
}
}
throw new NoSuchElementException("Hash Iterator");
}
public int nextInt() throws NoSuchElementException {
if ((keys && !isIntKey) || (!keys && !isIntValue)) {
throw new NoSuchElementException("Hash Iterator");
}
removed = false;
if (hasNext()) {
counter++;
lookup = nextLookup(lookup);
if (keys) {
return intKeyTable[lookup];
} else {
return intValueTable[lookup];
}
}
throw new NoSuchElementException("Hash Iterator");
}
public long nextLong() throws NoSuchElementException {
if ((keys && !isLongKey) || (!keys && !isLongValue)) {
throw new NoSuchElementException("Hash Iterator");
}
removed = false;
if (hasNext()) {
counter++;
lookup = nextLookup(lookup);
return keys ? longKeyTable[lookup]
: longValueTable[lookup];
}
throw new NoSuchElementException("Hash Iterator");
}
public void remove() throws NoSuchElementException {
if (removed) {
throw new NoSuchElementException("Hash Iterator");
}
counter--;
removed = true;
if (BaseHashMap.this.isObjectKey) {
if (isMultiValue) {
removeMultiVal(0, 0, objectKeyTable[lookup],
objectValueTable[lookup], true);
} else {
BaseHashMap.this.remove(0, 0, objectKeyTable[lookup],
null, false, true);
}
} else if (isIntKey) {
BaseHashMap.this.remove(intKeyTable[lookup], 0, null, null,
false, true);
} else {
BaseHashMap.this.remove(longKeyTable[lookup], 0, null, null,
false, true);
}
if (isList) {
lookup--;
}
}
public int getAccessCount() {
if (removed || accessTable == null) {
throw new NoSuchElementException();
}
return accessTable[lookup];
}
public void setAccessCount(int count) {
if (removed || accessTable == null) {
throw new NoSuchElementException();
}
accessTable[lookup] = count;
}
public int getLookup() {
return lookup;
}
}
public BaseHashMap clone() {
BaseHashMap copy = null;
try {
copy = (BaseHashMap) super.clone();
} catch (CloneNotSupportedException e) {}
copy.hashIndex = hashIndex.clone();
if (intKeyTable != null) {
copy.intKeyTable = intKeyTable.clone();
}
if (objectKeyTable != null) {
copy.objectKeyTable = objectKeyTable.clone();
}
if (longKeyTable != null) {
copy.longKeyTable = longKeyTable.clone();
}
if (intValueTable != null) {
copy.intValueTable = intValueTable.clone();
}
if (objectValueTable != null) {
copy.objectValueTable = objectValueTable.clone();
}
if (longValueTable != null) {
copy.longValueTable = longValueTable.clone();
}
if (accessTable != null) {
copy.accessTable = accessTable.clone();
}
if (objectValueTable2 != null) {
copy.objectValueTable2 = objectValueTable2.clone();
}
return copy;
}
BaseHashMap duplicate() {
return null;
}
}
| [
"t0984456716"
]
| t0984456716 |
0045941f171b87a6d818f98a8c49c8a2d17b8d7c | c732c4378462ecb49193bd872725149b98832d3f | /src/br/chainResponsability/IDesconto.java | 685222c2ebddca5705e4e2f3b8c728653a13c44e | []
| no_license | willdjames/design-pattern | bdf404377a343371242ecb1e3181b65176064b80 | c489bcfc4ef65cd0b54bebba9d11e0c500dd20a5 | refs/heads/master | 2020-04-12T17:23:36.184871 | 2018-12-29T19:28:41 | 2018-12-29T19:28:41 | 162,642,963 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 191 | java | package br.chainResponsability;
import br.strategy.Orcamento;
public interface IDesconto {
double descontar(Orcamento orcamento);
void setProximoDesconto(IDesconto desconto);
}
| [
"[email protected]"
]
| |
aabf8bdc7eea00f9cf27f7fdb40e39ae21272dc4 | d16f17f3b9d0aa12c240d01902a41adba20fad12 | /src/leetcode/leetcode12xx/leetcode1296/Solution.java | e61be9b64534be8d9e5b754fe464e79f28c41193 | []
| no_license | redsun9/leetcode | 79f9293b88723d2fd123d9e10977b685d19b2505 | 67d6c16a1b4098277af458849d352b47410518ee | refs/heads/master | 2023-06-23T19:37:42.719681 | 2023-06-09T21:11:39 | 2023-06-09T21:11:39 | 242,967,296 | 38 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,499 | java | package leetcode.leetcode12xx.leetcode1296;
import java.util.ArrayDeque;
import java.util.Arrays;
public class Solution {
public boolean isPossibleDivide(int[] nums, int k) {
int n = nums.length;
if (n == 0) return true;
if (n % k != 0) return false;
Arrays.sort(nums);
ArrayDeque<Pair> deque = new ArrayDeque<>(k);
int i = 0;
int waitingTotal = 0;
int prev = 0;
while (i < n) {
int curr = nums[i];
int cnt = 0;
while (i < n && nums[i] == curr) {
i++;
cnt++;
}
if (curr != prev + 1) {
if (waitingTotal != 0) return false;
deque.addLast(new Pair(curr, cnt));
} else {
if (cnt < waitingTotal) return false;
if (!deque.isEmpty() && deque.peekFirst().val == curr - k + 1) {
Pair pair = deque.pollFirst();
waitingTotal -= pair.cnt;
cnt -= pair.cnt;
}
if (waitingTotal < cnt) {
deque.addLast(new Pair(curr, cnt - waitingTotal));
}
}
waitingTotal = cnt;
prev = curr;
}
return waitingTotal == 0;
}
private static class Pair {
private int val, cnt;
public Pair(int val, int cnt) {
this.val = val;
this.cnt = cnt;
}
}
}
| [
"[email protected]"
]
| |
78bb32d05b5d9bbe01358b3ed7e3930f0f9f3e39 | 1e7f68d62f0b9408054a7ddee252a02d94bf93fc | /CommModule/src/ca/uhn/hl7v2/model/v26/group/RQI_I01_PROVIDER.java | b639520f975b735a14cda7ba1105debc1ad5a269 | []
| no_license | sac10nikam/TX | 8b296211601cddead3749e48876e3851e867b07d | e5a5286f1092ce720051036220e1780ba3408893 | refs/heads/master | 2021-01-15T16:00:19.517997 | 2013-01-21T09:38:09 | 2013-01-21T09:38:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,421 | java | /*
* This class is an auto-generated source file for a HAPI
* HL7 v2.x standard structure class.
*
* For more information, visit: http://hl7api.sourceforge.net/
*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* (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.mozilla.org/MPL/
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the
* specific language governing rights and limitations under the License.
*
* The Original Code is "[file_name]". Description:
* "[one_line_description]"
*
* The Initial Developer of the Original Code is University Health Network. Copyright (C)
* 2012. All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* Alternatively, the contents of this file may be used under the terms of the
* GNU General Public License (the "GPL"), in which case the provisions of the GPL are
* applicable instead of those above. If you wish to allow use of your version of this
* file only under the terms of the GPL and not to allow others to use your version
* of this file under the MPL, indicate your decision by deleting the provisions above
* and replace them with the notice and other provisions required by the GPL License.
* If you do not delete the provisions above, a recipient may use your version of
* this file under either the MPL or the GPL.
*
*/
package ca.uhn.hl7v2.model.v26.group;
import ca.uhn.hl7v2.model.v26.segment.*;
import java.util.List;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import ca.uhn.hl7v2.model.*;
import net.newel.android.Log;
import ca.uhn.hl7v2.util.Constants;
/**
* <p>Represents a RQI_I01_PROVIDER group structure (a Group object).
* A Group is an ordered collection of message segments that can repeat together or be optionally in/excluded together.
* This Group contains the following elements:
* </p>
* <ul>
* <li>1: PRD (Provider Data) <b> </b></li>
* <li>2: CTD (Contact Data) <b>optional repeating</b></li>
* </ul>
*/
public class RQI_I01_PROVIDER extends AbstractGroup {
private static final long serialVersionUID = 1L;
/**
* Creates a new RQI_I01_PROVIDER group
*/
public RQI_I01_PROVIDER(Group parent, ModelClassFactory factory) {
super(parent, factory);
init(factory);
}
private void init(ModelClassFactory factory) {
try {
this.add(PRD.class, true, false);
this.add(CTD.class, false, true);
} catch(HL7Exception e) {
Log.e(Constants.TAG, "Unexpected error creating RQI_I01_PROVIDER - this is probably a bug in the source code generator.", e);
}
}
/**
* Returns "2.6"
*/
public String getVersion() {
return "2.6";
}
/**
* Returns
* PRD (Provider Data) - creates it if necessary
*/
public PRD getPRD() {
PRD retVal = getTyped("PRD", PRD.class);
return retVal;
}
/**
* Returns
* the first repetition of
* CTD (Contact Data) - creates it if necessary
*/
public CTD getCTD() {
CTD retVal = getTyped("CTD", CTD.class);
return retVal;
}
/**
* Returns a specific repetition of
* CTD (Contact Data) - creates it if necessary
*
* @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0)
* @throws HL7Exception if the repetition requested is more than one
* greater than the number of existing repetitions.
*/
public CTD getCTD(int rep) {
CTD retVal = getTyped("CTD", rep, CTD.class);
return retVal;
}
/**
* Returns the number of existing repetitions of CTD
*/
public int getCTDReps() {
return getReps("CTD");
}
/**
* <p>
* Returns a non-modifiable List containing all current existing repetitions of CTD.
* <p>
* <p>
* Note that unlike {@link #getCTD()}, this method will not create any reps
* if none are already present, so an empty list may be returned.
* </p>
*/
public List<CTD> getCTDAll() throws HL7Exception {
return getAllAsList("CTD", CTD.class);
}
/**
* Inserts a specific repetition of CTD (Contact Data)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public void insertCTD(CTD structure, int rep) throws HL7Exception {
super.insertRepetition("CTD", structure, rep);
}
/**
* Inserts a specific repetition of CTD (Contact Data)
* @see AbstractGroup#insertRepetition(Structure, int)
*/
public CTD insertCTD(int rep) throws HL7Exception {
return (CTD)super.insertRepetition("CTD", rep);
}
/**
* Removes a specific repetition of CTD (Contact Data)
* @see AbstractGroup#removeRepetition(String, int)
*/
public CTD removeCTD(int rep) throws HL7Exception {
return (CTD)super.removeRepetition("CTD", rep);
}
}
| [
"[email protected]"
]
| |
72a1b1d49b8274508bf25ee75d1cf07d5e6dc769 | 93a91445f3de4c7d031ad5369bb01c0e18e65be3 | /src/test/java/com/xiv/gearplanner/GearplannerApplicationTests.java | 36b01ab1f0280d000924a78fff882e0e5a935652 | []
| no_license | unfaiyted/xiv-gear-planner | 568e5601ef6449cf4eb6f4477bcdfe6e8ac529a0 | be5113b7be91b4cfe7642b0b38dcc551274573a1 | refs/heads/master | 2020-03-14T17:57:04.660741 | 2018-06-11T00:39:48 | 2018-06-11T00:39:48 | 129,110,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package com.xiv.gearplanner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class GearplannerApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
]
| |
b8bc52b1ef0afae47f018dd9b57042b7ba3f7159 | e12a1f11a7e7637a57f9b83c05d1c8712c717c6a | /src/main/java/com/beautifulyears/domain/Language.java | e7a8a9aa2b01c161e5c0b74bd67a40d68c64b733 | []
| no_license | Elderly-Care-Platform/ECP-Server-Backend | 08617db6246da74f189f31c0ba19e5affcdb4905 | d30ae5afaed7ad54486bedf75eb7080b0ab61067 | refs/heads/master | 2023-07-28T07:08:59.252516 | 2020-11-11T07:28:32 | 2020-11-11T07:28:32 | 406,229,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | /**
*
*/
package com.beautifulyears.domain;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
* @author Nitin
*
*/
@Document(collection = "language")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Language {
@Id
private String id;
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"[email protected]"
]
| |
ae96681e9ddc52207f662f7aa8857bab59e23c0b | e92392cbddd969051e1dd96ea5278147b44074e9 | /src/main/java/com/epam/jmp/gamebox/Action.java | d5e12c7bb4f2769022653795298fdb539c92d82c | []
| no_license | YevgenyDrozdov/gamebox-api | b2a04eb43a39e212515096b17a9e13b541c6c77d | da24b5dceee9c74c12f215d543b0c67c71c1482c | refs/heads/master | 2020-03-29T12:07:21.060069 | 2015-05-08T13:59:43 | 2015-05-08T13:59:43 | 32,732,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 251 | java | package com.epam.jmp.gamebox;
import java.util.Map;
public interface Action {
String getActionId();
Map<String, String> getActionParametersMap();
String getActionParameter(String parameterName);
Session getSession();
}
| [
"[email protected]"
]
| |
146ba96b3156d3e057265c401c316bcbdc9b42bf | cbcfac9e1ad7cc2281accbe95d8d5b6ab2929cb5 | /src/main/java/com/shujia/web/bean/Word.java | 79021fdbdd121e7a9ecb3dbb3faa025849d08c1f | []
| no_license | Wangguangt/- | fb7189826b271e8885bad25f711f582a8eb7aa79 | debde26965a84070ca832b42856f74030df0c688 | refs/heads/master | 2020-05-17T05:57:00.353832 | 2019-04-26T03:19:09 | 2019-04-26T03:19:09 | 183,548,402 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package com.shujia.web.bean;
import java.util.Arrays;
public class Word {
private String name;
private Integer value;
public Word() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public Word(String name, Integer value) {
this.name = name;
this.value = value;
}
}
| [
"[email protected]"
]
| |
42c59d62109b4c7dae2eed2b2f9e9ad26113769d | 893ef4b72837ea693de4a6dfa7ef3aea96bd9621 | /src/main/java/webstore/config/RootApplicationContextConfig.java | 25ba5e38b5c6784e0fc520798ac29d52e1648e1f | []
| no_license | uncleVich/BookWebStore | 112e4bd775b303d99785e05232fe8a611ea68f42 | 4cb7f25286f3b8359335ffa2552eb314855223d8 | refs/heads/master | 2020-03-31T18:16:22.176725 | 2018-11-16T12:51:58 | 2018-11-16T12:51:58 | 152,452,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,137 | java | package webstore.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
import javax.sql.DataSource;
@Configuration
@ComponentScan("webstore")
public class RootApplicationContextConfig {
@Bean
public DataSource dataSource() {
EmbeddedDatabaseBuilder builder = new
EmbeddedDatabaseBuilder();
EmbeddedDatabase db = builder
.setType(EmbeddedDatabaseType.HSQL)
.addScript("db/sql/create-table.sql")
.addScript("db/sql/insert-data.sql")
.build();
return db;
}
@Bean
public NamedParameterJdbcTemplate getJdbcTemplate() {
return new NamedParameterJdbcTemplate(dataSource());
}
}
| [
"hrvDHs7813021"
]
| hrvDHs7813021 |
d49ac33c2b645178b388e6a04324901083103dfd | 898d403ce46a721dc6fbd3e6c2e14578cb869c31 | /lab-database/src/main/java/ru/optima/persist/model/Work.java | 86aa04091d125caf871a09a300898808f8880887 | []
| no_license | knife-kis/laboratory | f3f14330b591c6fd62bcdedbe0a6e60ce61534f7 | e12cc58c722ba154bce8b5142784a315e89a65df | refs/heads/master | 2023-03-29T18:51:08.674353 | 2021-04-04T10:46:46 | 2021-04-04T10:46:46 | 327,240,888 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,479 | java | package ru.optima.persist.model;
import ru.optima.persist.model.equipments.Equipment;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;
@Entity
@Table(name = "works")
public class Work implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "Registration_date", nullable = false)
private LocalDate registrationDate;
@Column(name = "client_name", nullable = false)
private String clientName;
@Column(name = "object_name")
private String objectName;
@Column(name = "number_contract", nullable = false, unique = true)
private String numberContract;
@ManyToMany(mappedBy = "works")
private List<User> users;
@Column(name = "customer")
private String customer;
public Work() {
}
public Work(Long id, LocalDate registrationDate, String clientName, String objectName, String numberContract, List<User> users, List<Equipment> equipment, String customer) {
this.id = id;
this.registrationDate = registrationDate;
this.clientName = clientName;
this.objectName = objectName;
this.numberContract = numberContract;
this.users = users;
this.customer = customer;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public LocalDate getRegistrationDate() {
return registrationDate;
}
public void setRegistrationDate(LocalDate registrationDate) {
this.registrationDate = registrationDate;
}
public String getClientName() {
return clientName;
}
public void setClientName(String clientName) {
this.clientName = clientName;
}
public String getObjectName() {
return objectName;
}
public void setObjectName(String objectName) {
this.objectName = objectName;
}
public String getNumberContract() {
return numberContract;
}
public void setNumberContract(String numberContract) {
this.numberContract = numberContract;
}
public List<User> getUsers() {
return users;
}
public void setUsers(List<User> users) {
this.users = users;
}
public String getCustomer() {
return customer;
}
public void setCustomer(String customer) {
this.customer = customer;
}
}
| [
"[email protected]"
]
| |
55888edd0bd18c67c1b3e6495c285e151d187e44 | ca31331ab044b4fdadaad7dae10169c93d009c1d | /admin/src/main/java/com/royal/admin/modular/system/mapper/LoginLogMapper.java | 529b261f0779a77ede7add80c22c57d7eec90496 | [
"Apache-2.0"
]
| permissive | sihuo-hu/adminInit | 54c0bf364f9a9e1aab07593c6568353d48abd354 | c7e8672075358c57594bd77d67d6ba7fdb80b680 | refs/heads/master | 2022-10-21T20:31:15.589633 | 2019-10-23T01:56:37 | 2019-10-23T01:56:37 | 216,944,512 | 0 | 0 | Apache-2.0 | 2022-10-12T20:32:57 | 2019-10-23T01:47:17 | JavaScript | UTF-8 | Java | false | false | 742 | java | package com.royal.admin.modular.system.mapper;
import com.royal.admin.modular.system.entity.LoginLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* 登录记录 Mapper 接口
* </p>
*
* @author stylefeng
* @since 2018-12-07
*/
public interface LoginLogMapper extends BaseMapper<LoginLog> {
/**
* 获取登录日志
*/
List<Map<String, Object>> getLoginLogs(@Param("page") Page page, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("logName") String logName);
}
| [
"[email protected]"
]
| |
f52a99c4c771e9cd086685840527fbd913c17330 | 550c0a8aada492436154b655dc7ff0a9debc172b | /src/main/java/org/leg/library/json/JSONNumber.java | 5fe8cbdcdc78e94502147519970e6af7e017c841 | []
| no_license | linlieycm/leg | 4cfd92c1da8ee8fc338d986fde072cc542dc6279 | 1a3a9608b654f5d6b2028a8d60fb644361e031b8 | refs/heads/master | 2021-01-10T08:12:54.833724 | 2015-05-29T08:17:31 | 2015-05-29T08:17:31 | 36,490,765 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,834 | java | package org.leg.library.json;
import org.leg.library.json.core.IJSON;
/**
* JSON值数字类
*/
public class JSONNumber extends Number implements IJSON {
/**
* 值
*/
protected double value = 0F;
/**
* 构造函数
*/
public JSONNumber() { }
/**
* 构造函数
*
* @param value 值
*/
public JSONNumber(int value) {
this.value = value;
}
/**
* 构造函数
*
* @param value 值
*/
public JSONNumber(long value) {
this.value = value;
}
/**
* 构造函数
*
* @param value 值
*/
public JSONNumber(float value) {
this.value = value;
}
/**
* 构造函数
*
* @param value 值
*/
public JSONNumber(double value) {
this.value = value;
}
/**
* 获取对象类型
*
* @return 对象类型
*/
@Override
public int type() {
return IJSON.JSON_TYPE_NUMBER;
}
/**
* Returns the value of the specified number as an <code>int</code>.
* This may involve rounding or truncation.
*
* @return the numeric value represented by this object after conversion
* to compareType <code>int</code>.
*/
@Override
public int intValue() {
return (int)value;
}
/**
* Returns the value of the specified number as a <code>long</code>.
* This may involve rounding or truncation.
*
* @return the numeric value represented by this object after conversion
* to compareType <code>long</code>.
*/
@Override
public long longValue() {
return (long)value;
}
/**
* Returns the value of the specified number as a <code>float</code>.
* This may involve rounding.
*
* @return the numeric value represented by this object after conversion
* to compareType <code>float</code>.
*/
@Override
public float floatValue() {
return (float)value;
}
/**
* Returns the value of the specified number as a <code>double</code>.
* This may involve rounding.
*
* @return the numeric value represented by this object after conversion
* to compareType <code>double</code>.
*/
@Override
public double doubleValue() {
return value;
}
/**
* 设置值
*
* @param number 待设置值
*/
public void setValue(Number number) {
value = number.doubleValue();
}
/**
* 设置值
*
* @param number 待设置值字符串
*/
public void setValue(String number) {
value = Double.valueOf(number);
}
/**
* 转为字符串
*
* @return 字符串
*/
@Override
public String toString() {
return String.valueOf(value);
}
}
| [
"[email protected]"
]
| |
a53167853af6210d858b49dfc673f3ae0ddfab87 | de7c442239793ca20deb3db7355a42fb52443c76 | /xulichuoi/Bai16QuestionCorrection.java | 946d0e607d4b3078c2c3758694f18de3a0167172 | []
| no_license | duong-coder/JAVA-Thuat_Toan | c174270b48499bf251e4451aef10d196c58378b3 | e6e52e75b15543aa5f007edd030d6c196736348b | refs/heads/master | 2023-03-16T14:42:53.683196 | 2021-03-14T09:59:28 | 2021-03-14T09:59:28 | 250,216,824 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,887 | java | //Một hệ thống hỏi đáp trực tuyến cần chuẩn hóa câu hỏi của người dùng
//
// Một câu hỏi đã được chuẩn hóa cần tuân thủ các luật sau:
//
// Luật chung:
// Câu hỏi chỉ chứa kí tự chữ cái (a-zA-Z), chữ số (0-9), dấu phẩy (,), dấu cách (' '), dấu hỏi (?). Các kí tự khác đều được thay thế bằng dấu cách
// Luật dấu cách:
// Không có dấu cách ở đầu hay ở cuối câu. Giữa các từ chỉ có 1 dấu cách duy nhất. Sau mỗi dấu cách là 1 chữ cái hoặc chữ số?
// Luật dấu phẩy:
// Trước dấu phẩy luôn là 1 chữ cái hoặc chữ số. Sau dấu phẩy luôn là một dấu cách
// Trường hợp đứng trước dấu phẩy là dấu cách, hãy xóa dấu phẩy này đi
// Luật chữ hoa/chữ thường:
// Chữ cái bắt đầu câu luôn được viết hoa. Các chữ cái khác đều viết thường
// Luật dấu hỏi:
// Luôn có 1 dấu ? kết thúc câu. Trước dấu ? luôn là kí tự chữ cái hoặc chữ số
// Trường hợp có các dấu ? xuất hiện khi chưa kết thúc câu, hãy thay thế nó bằng dấu cách
// Trường hợp trước dấu cách là dấu phẩy và dấu cách, hãy xóa dấu cách và dấu phẩy
// Ví dụ:
//
// Với đầu vào s="this is not a relevant question , is it???", thì kết quả questionCorrection(s) = "This is not a relevant question, is it?"
// Với đầu vào s="who are you,,???", thì kết quả questionCorrection(s) = "Who are you?"
// Đầu vào/đầu ra:
//
// [Thời gian chạy] 0.5 giây
// [Đầu vào] string s
// Xâu kí tự chứa ít nhất 1 kí tự chữ cái (a-zA-Z)
// 1 <= x.length <= 1000
// [Đầu ra] string
// Xâu kí tự được chuẩn hóa theo các luật trên
package xulichuoi;
import javax.swing.*;
public class Bai16QuestionCorrection {
static String questionCorrection(String s) {
s = (s.trim()).toLowerCase();
String resuilt = "";
String[] strArray = s.split("");
strArray = endWithQuest(strArray);
strArray = startWithUpper(strArray);
strArray = betweenString(strArray);
for (int i = 0; i<strArray.length; i++){
resuilt += strArray[i];
}
return resuilt;
}
static String[] endWithQuest(String[] strArray){
String endWithKiTu = "\\w";
int i = 0;
while(true){
if(strArray[strArray.length-i-1].matches(endWithKiTu)){
strArray[strArray.length-i-1] += "?";
break;
} else {
strArray[strArray.length-i-1] = "";
i+=1;
}
}
return strArray;
}
static String[] startWithUpper(String[] strArray){
String startWithKiTu = "\\w";
int i = 0;
if(!strArray[i].matches(startWithKiTu)){
strArray[i] = strArray[i].toUpperCase();
return strArray;
}
while(true){
if(strArray[i].matches(startWithKiTu)){
strArray[i] = strArray[i].toUpperCase();
break;
} else {
strArray[i] = "";
i+=1;
}
}
return strArray;
}
static String[] betweenString(String[] strArray){
String regexWord = "\\w";
for(int i = 1; i<strArray.length-2; i++){
if(strArray[i].equals(" ") || strArray[i].equals("")){
if(strArray[i+1].equals(" ")){
strArray[i+1] = "";
} else if(strArray[i+1].equals(",")){
strArray[i] = "";
}
} else if(strArray[i].equals(",")){
if(strArray[i+1].matches(regexWord)){
strArray[i+1] = " "+ strArray[i+1];
} else if(strArray[i+1].equals(",")){
strArray[i+1] = "";
}
} else if(strArray[i].equals("?")){
strArray[i] = "";
}
}
return strArray;
}
public static void main(String[] args) {
String a = "ddd";
String[] n = {" ", ".", ",", "a", " ", " ", "a", " ", ",", "a", ",", "g", ",", " ", "a"};
char[] b = {'a', 'b', 'a'};
// n = endWithQuest(n);
// n = startWithUpper(n);
// n = betweenString(n);
// System.out.println(n);
// for (int i = 0; i<n.length; i++){
// System.out.println(n[i]);
// }
// System.out.println(String.join("", ));
// System.out.println(endWithQuest(n));
System.out.println(questionCorrection("z,,,,,zzz"));
}
}
| [
"[email protected]"
]
| |
c106e21960419496fab0040b08f07a5c2ba9623d | 2085b094df4d3e220b24a081ca6de7c7d36ed173 | /src/main/java/com/edu/hutech/major/service/impl/CategoryServiceImpl.java | 8fb394beb5d25c5f0ab91c6ceec74a66c8c44321 | []
| no_license | tanbinh123/SpringWeb | 5c17e68e10984daf8e794a5eebee28d8d660b67b | 8f11b37b32954ba84e7a44fe148b0105e19c727b | refs/heads/master | 2023-05-12T03:08:12.199595 | 2021-06-05T04:40:25 | 2021-06-05T04:40:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.edu.hutech.major.service.impl;
import com.edu.hutech.major.model.Category;
import com.edu.hutech.major.model.Product;
import com.edu.hutech.major.repository.CategoryRepository;
import com.edu.hutech.major.repository.ProductRepository;
import com.edu.hutech.major.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Optional;
@Component
public class CategoryServiceImpl implements CategoryService {
@Autowired
CategoryRepository categoryRepository;
public List<Category> getAllCategory(){
return categoryRepository.findAll();
}//findAll
public void updateCategory(Category category){categoryRepository.save(category); }//add or update (tuy vao pri-key)
public void removeCategoryById(int id){
categoryRepository.deleteById(id);
}//delete truyen vao pri-key
public Optional<Category> getCategoryById(int id){
return categoryRepository.findById(id);
}//search theo id
}
| [
"[email protected]"
]
| |
3c36236a991a6bdb22aad549e9646196e47a12fb | ea2350bff1bc63751da66d64adeba241a1975ead | /src/br/com/ilibrary/view/panels/Panel_BuscarAcervo.java | ea62d480d9f15c9b383d97d1c31523d842359469 | []
| no_license | wctwellington/TCCILibraryDesktop | 78ccd2df9ba06064f8c656793d06ad3224ce70fa | 7d99caf88a134de9aafd64346b74797f365fe0c3 | refs/heads/master | 2021-01-20T20:36:54.842714 | 2016-08-13T14:50:31 | 2016-08-13T14:50:31 | 63,300,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,799 | java | package br.com.ilibrary.view.panels;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import br.com.ilibrary.controller.TableModel;
import br.com.ilibrary.model.Acervo;
import br.com.ilibrary.model.Exemplar;
import br.com.ilibrary.persist.JDBCDAO;
import br.com.ilibrary.view.Interface_InfoAcervo;
import net.miginfocom.swing.MigLayout;
@SuppressWarnings("serial")
public class Panel_BuscarAcervo extends JPanel {
private JLabel lblExemplares;
private JLabel lblPesquisarPor;
private JTextField txtBusca;
@SuppressWarnings("rawtypes")
private JComboBox cbPesquisarPor;
private TableModel modeloAcervo;
private TableModel modeloExemplar;
private JTable tblAcervo;
private JTable tblExemplar;
private JScrollPane spAcervo;
private JScrollPane spExemplares;
private JButton btnMaisInformacoes;
private String cod_acervo;
@SuppressWarnings("rawtypes")
private JComboBox cbApresentarExemplares;
@SuppressWarnings("rawtypes")
private JComboBox cbOrdenarPor;
private JLabel lblApresentarExemplares;
private JLabel lblOrdenarPor;
private String ordenarPor = "cod_acervo";
private void filtrarAcervo() {
String sql;
switch(cbPesquisarPor.getSelectedItem().toString()) {
case "Código Acervo":
sql = "SELECT * FROM acervo where cod_acervo like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Material":
sql = "SELECT * FROM acervo where tipo_material like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Título":
sql = "SELECT * FROM acervo where titulo like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Subtítulo":
sql = "SELECT * FROM acervo where subtitulo like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Assunto":
sql = "SELECT * FROM classificacao INNER JOIN acervo ON classificacao.cod_classificacao = acervo.cod_classificacao WHERE classificacao.assunto like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Nome Autor":
sql = "SELECT * FROM acervo where nome_autor like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
case "Editora":
sql = "SELECT * FROM acervo where editora like '" + txtBusca.getText() + "%' order by " + ordenarPor;
carregarTableAcervo(sql);
break;
}
}
private void filtrarExemplares() {
if (cod_acervo != null) {
String sql = null;
switch (cbApresentarExemplares.getSelectedItem().toString()) {
case "Todos":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo + "'";
break;
case "Para Consulta":
sql = "SELECT * FROM exemplar WHERE cod_acervo='" + cod_acervo + "' AND disponibilidade='Consulta'";
break;
case "Para Empréstimo":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo + "' AND disponibilidade='Empréstimo'";
break;
case "Emprestados":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo + "' AND emprestado=true";
break;
case "Disponíveis Para Empréstimo":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo
+ "' AND disponibilidade='Empréstimo' AND emprestado=false";
break;
case "Ativados":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo + "' AND ativo=true";
break;
case "Desativados":
sql = "SELECT * FROM exemplar WHERE cod_acervo = '" + cod_acervo + "' AND ativo=false";
break;
default:
break;
}
carregarTableExemplares(sql);
}
}
private void carregarTableAcervo(String sql) {
modeloAcervo.setNumRows(0);
ArrayList<Acervo> lista_acervo = new JDBCDAO<Acervo, String>(Acervo.class).readAll(sql);
if (lista_acervo != null) {
for (Acervo a : lista_acervo) {
modeloAcervo.addRow(new Object[] { a.getCodigo_acervo(), a.getMaterial(), a.getTitulo(),
a.getSubtitulo(), a.getClassificacao().getAssunto(), a.getAutor(), a.getEditora() });
}
}
}
private void carregarTableExemplares(String sql) {
modeloExemplar.setNumRows(0);
ArrayList<Exemplar> lista_exemplares = new JDBCDAO<Exemplar, String>(Exemplar.class).readAll(sql);
if (lista_exemplares != null) {
for (Exemplar e : lista_exemplares) {
modeloExemplar
.addRow(new Object[] { e.getCodigo_Exemplar(), e.getDisponibilidade(), e.getPreco_compra() });
}
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public Panel_BuscarAcervo() {
this.setSize(1360, 760);
setOpaque(false);
this.setLayout(new MigLayout("", "[167.00][35.00][43.00][173.00][184.00][104.00][20][214.00][:121.00:115.00]", "[28.00][][20][23.00][][:201.00:238.00][::123.00]"));
modeloAcervo = new TableModel();
modeloAcervo.addColumn("Cod. Acervo");
modeloAcervo.addColumn("Material");
modeloAcervo.addColumn("Titulo");
modeloAcervo.addColumn("Subtitulo");
modeloAcervo.addColumn("Assunto");
modeloAcervo.addColumn("Nome Autor");
modeloAcervo.addColumn("Editora");
modeloExemplar = new TableModel();
modeloExemplar.addColumn("Cod. Exemplar");
modeloExemplar.addColumn("Disponibilidade");
modeloExemplar.addColumn("Preço Compra");
tblAcervo = new JTable(modeloAcervo);
tblAcervo.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
tblAcervo.getColumnModel().getColumn(0).setPreferredWidth(120);
tblAcervo.getColumnModel().getColumn(1).setPreferredWidth(100);
tblAcervo.getColumnModel().getColumn(2).setPreferredWidth(150);
tblAcervo.getColumnModel().getColumn(3).setPreferredWidth(150);
tblAcervo.getColumnModel().getColumn(4).setPreferredWidth(150);
tblAcervo.getColumnModel().getColumn(5).setPreferredWidth(150);
tblAcervo.getColumnModel().getColumn(6).setPreferredWidth(120);
tblAcervo.setRowHeight(25);
tblExemplar = new JTable(modeloExemplar);
tblExemplar.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
tblExemplar.getColumnModel().getColumn(0).setPreferredWidth(112);
tblExemplar.getColumnModel().getColumn(1).setPreferredWidth(110);
tblExemplar.getColumnModel().getColumn(2).setPreferredWidth(110);
tblExemplar.setRowHeight(20);
lblPesquisarPor = new JLabel("Pesquisar por");
this.add(lblPesquisarPor, "cell 0 1");
lblOrdenarPor = new JLabel("Ordenar por");
add(lblOrdenarPor, "cell 3 1");
lblApresentarExemplares = new JLabel("Apresentar Exemplares");
add(lblApresentarExemplares, "cell 7 1");
cbPesquisarPor = new JComboBox();
cbPesquisarPor.addItem("Código Acervo");
cbPesquisarPor.addItem("Material");
cbPesquisarPor.addItem("Título");
cbPesquisarPor.addItem("Subtítulo");
cbPesquisarPor.addItem("Assunto");
cbPesquisarPor.addItem("Nome Autor");
cbPesquisarPor.addItem("Editora");
this.add(cbPesquisarPor, "cell 0 2,growx");
cbOrdenarPor = new JComboBox();
cbOrdenarPor.addItem("Código Acervo");
cbOrdenarPor.addItem("Material");
cbOrdenarPor.addItem("Título");
cbOrdenarPor.addItem("Subtítulo");
cbOrdenarPor.addItem("Assunto");
cbOrdenarPor.addItem("Nome Autor");
cbOrdenarPor.addItem("Editora");
add(cbOrdenarPor, "cell 3 2,growx");
cbApresentarExemplares = new JComboBox();
cbApresentarExemplares.addItem("Todos");
cbApresentarExemplares.addItem("Para Consulta");
cbApresentarExemplares.addItem("Para Empréstimo");
cbApresentarExemplares.addItem("Emprestados");
cbApresentarExemplares.addItem("Disponíveis Para Empréstimo");
cbApresentarExemplares.addItem("Ativados");
cbApresentarExemplares.addItem("Desativados");
add(cbApresentarExemplares, "cell 7 2,growx");
txtBusca = new JTextField();
this.add(txtBusca, "cell 0 3 2 1,grow");
txtBusca.setColumns(10);
btnMaisInformacoes = new JButton("<html><p align='center'>Mais<br/>Informações</p></html>");
this.add(btnMaisInformacoes, "cell 5 3 1 2,grow");
lblExemplares = new JLabel("Exemplares");
lblExemplares.setHorizontalAlignment(SwingConstants.CENTER);
this.add(lblExemplares, "cell 7 4 2 1,grow");
spAcervo = new JScrollPane(tblAcervo);
this.add(spAcervo, "cell 0 5 6 2,grow");
spAcervo.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
spAcervo.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
spExemplares = new JScrollPane(tblExemplar);
this.add(spExemplares, "cell 7 5 2 1,alignx leading,growy");
spExemplares.setViewportView(tblExemplar);
spExemplares.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
spExemplares.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
carregarTableAcervo("select * from acervo");
txtBusca.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
if (txtBusca.getText() != null) {
filtrarAcervo();
}
}
});
cbOrdenarPor.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
switch(cbOrdenarPor.getSelectedItem().toString()) {
case "Código Acervo":
ordenarPor = "cod_acervo";
break;
case "Material":
ordenarPor = "tipo_material";
break;
case "Título":
ordenarPor = "titulo";
break;
case "Subtitulo":
ordenarPor = "subtitulo";
break;
case "Assunto":
ordenarPor = "classificacao.assunto";
break;
case "Nome Autor":
ordenarPor = "nome_autor";
break;
case "Editora":
ordenarPor = "editora";
break;
}
filtrarAcervo();
}
});
tblAcervo.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent arg0) {
int viewRow = tblAcervo.getSelectedRow();
cod_acervo = tblAcervo.getValueAt(viewRow, 0).toString();
filtrarExemplares();
}
});
cbApresentarExemplares.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
filtrarExemplares();
}
});
btnMaisInformacoes.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (cod_acervo != null) {
new Interface_InfoAcervo(cod_acervo);
} else {
JOptionPane.showMessageDialog(null, "Selecione um acervo", "Aviso", JOptionPane.WARNING_MESSAGE);
}
}
});
}
} | [
"wellington@Mint"
]
| wellington@Mint |
74f48a3377ed90659234c41ddfb0c0e7a26c1884 | 0eeef197261162287eeeebc519b7139907423a4f | /MantenimientoLib/src/main/java/sv/edu/uesocc/ingenieria/mantenimientolib/Equipo.java | ad8a7a1a611d3f3fddb264e11076d7ef89a48ce8 | []
| no_license | kikeAKAdelta/MantenimientoWepApp | 1a7983eddcc2ec5d5604a892363ea81d272f677e | 6496accd90fb73d0cf9b0598c4adb7e4ae154657 | refs/heads/master | 2020-03-08T18:34:20.701651 | 2018-04-10T22:20:01 | 2018-04-10T22:20:01 | 126,776,501 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,747 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sv.edu.uesocc.ingenieria.mantenimientolib;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author degon
*/
@Entity
@Table(name = "equipo")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Equipo.findAll", query = "SELECT e FROM Equipo e")
, @NamedQuery(name = "Equipo.findByIdEquipo", query = "SELECT e FROM Equipo e WHERE e.idEquipo = :idEquipo")
, @NamedQuery(name = "Equipo.findByNumeroInventario", query = "SELECT e FROM Equipo e WHERE e.numeroInventario = :numeroInventario")
, @NamedQuery(name = "Equipo.findByDescripcion", query = "SELECT e FROM Equipo e WHERE e.descripcion = :descripcion")})
public class Equipo implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id_equipo")
private Integer idEquipo;
@Column(name = "numero_inventario")
private Integer numeroInventario;
@Size(max = 100)
@Column(name = "descripcion")
private String descripcion;
@OneToMany(mappedBy = "idEquipo")
private List<Parte> parteList;
@JoinColumn(name = "id_unidad", referencedColumnName = "id_unidad")
@ManyToOne
private Unidad idUnidad;
public Equipo() {
}
public Equipo(Integer idEquipo) {
this.idEquipo = idEquipo;
}
public Integer getIdEquipo() {
return idEquipo;
}
public void setIdEquipo(Integer idEquipo) {
this.idEquipo = idEquipo;
}
public Integer getNumeroInventario() {
return numeroInventario;
}
public void setNumeroInventario(Integer numeroInventario) {
this.numeroInventario = numeroInventario;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
@XmlTransient
public List<Parte> getParteList() {
return parteList;
}
public void setParteList(List<Parte> parteList) {
this.parteList = parteList;
}
public Unidad getIdUnidad() {
return idUnidad;
}
public void setIdUnidad(Unidad idUnidad) {
this.idUnidad = idUnidad;
}
@Override
public int hashCode() {
int hash = 0;
hash += (idEquipo != null ? idEquipo.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Equipo)) {
return false;
}
Equipo other = (Equipo) object;
if ((this.idEquipo == null && other.idEquipo != null) || (this.idEquipo != null && !this.idEquipo.equals(other.idEquipo))) {
return false;
}
return true;
}
@Override
public String toString() {
return "org.mantenimiento.tpi.mantenimientolib.Equipo[ idEquipo=" + idEquipo + " ]";
}
}
| [
"[email protected]"
]
| |
97a232574e645e996e1b47b06bc749c47ccccd85 | 5440e2329d36cf70cadde2575a3ca67d6732f1b8 | /rocketmq-demo-consumer/src/main/java/com/demo/queue/rocketmq/consumer/RocketmqDemoConsumerApplication.java | 073861eb9ca126ce95f8c4757af760314051f295 | []
| no_license | fengzhentao/queue-demo-parent | b96e966df293ed46516b646806990fa3338830f0 | 94c7ab9c942c7ee3717495f440ccaf3c4399dc56 | refs/heads/master | 2023-01-27T12:17:52.923129 | 2020-12-11T09:25:19 | 2020-12-11T09:25:19 | 320,525,528 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package com.demo.queue.rocketmq.consumer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RocketmqDemoConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(RocketmqDemoConsumerApplication.class, args);
}
}
| [
"[email protected]"
]
| |
95bc207b4eed8f0609a756e154a549a2cb10dac1 | a498267df5c672da259f2810e41830bec1d47adf | /mobile/src/main/java/com/alexstyl/specialdates/contact/ContactNotFoundException.java | 17856f83ff2262b33523722d844c1e37a16e858b | [
"MIT"
]
| permissive | danybony/Memento-Namedays | 9f0fcf6db52e223250d752c31a667fe5e758a334 | 1bf6030d1cd418a5aae6f6e0d88d617c312bf7aa | refs/heads/master | 2021-01-17T23:05:56.966226 | 2016-09-06T22:22:12 | 2016-09-06T22:22:12 | 68,078,712 | 1 | 0 | null | 2016-09-13T08:29:17 | 2016-09-13T05:55:13 | Java | UTF-8 | Java | false | false | 234 | java | package com.alexstyl.specialdates.contact;
public class ContactNotFoundException extends Exception {
public ContactNotFoundException(long contactId) {
super("Could not find contact with id [" + contactId + "]");
}
}
| [
"[email protected]"
]
| |
b543dbebabb4c75e7099dc162236d182ed117b07 | b6b6639440eb7dce463587696b01004746cdfddf | /src/test/java/net/sensale/qp/quickbooks/AmountTest.java | 8cc4702aa081bcc719a7255026e3c6f707ce0b7e | [
"Apache-2.0"
]
| permissive | bsensale/qp-iif-utility | f25e5b02ca24effe48c1d24d4e31671ea2c2d344 | 3b75edf273e304bac3919b490c59fed4017bcc11 | refs/heads/master | 2021-06-04T17:23:41.030859 | 2018-10-05T19:18:05 | 2018-10-05T19:18:05 | 23,365,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,523 | java | /**
* Copyright 2014 Brian Sensale
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sensale.qp.quickbooks;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class AmountTest {
@Test
public void testStringConstructor() {
Amount a = new Amount("444");
assertEquals(new Double(444.00), a.mValue);
}
@Test
public void testDoubleConstructor() {
Amount a = new Amount(3.54);
assertEquals("3.54", a.toString());
}
@Test(expected=NumberFormatException.class)
public void testUnparseableDouble() {
new Amount("foo");
}
@Test
public void testToStringPositiveValue() {
Amount a = new Amount("101");
assertEquals("101.00", a.toString());
}
@Test
public void testToStringNegativeValue() {
Amount a = new Amount("-344.54");
assertEquals("-344.54", a.toString());
}
}
| [
"[email protected]"
]
| |
6ca7cae434f0b40537275b003b10172f56ae294d | 04b1cb942ee98db391d611eb48d542b4d5ef11d8 | /src/main/java/com/musicapp/repository/user/IUserRepository.java | 4b690073af8c0ac46f1a1c8b15c376def8c8a46d | []
| no_license | KhanhNguyen1410/JAVA_demo_backend | 1913f197e1294086670b8e646b1b5b4787028d52 | 7bfe5e2d24ab4543b45f10f4935321627f441743 | refs/heads/master | 2023-02-14T16:01:25.300987 | 2021-01-06T01:43:14 | 2021-01-06T01:43:14 | 327,168,496 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.musicapp.repository.user;
import com.musicapp.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface IUserRepository extends JpaRepository<User , Long> {
}
| [
"[email protected]"
]
| |
0cf14d42e81ed421fc0654baac617e81accb6141 | c1b23c347fb5d0cd4c0355f4c1caa79c8689d2ff | /app/src/main/java/com/jupiter/miniximalaya/base/BaseActivity.java | bac4f46e8b5db067e11d4eafbe142c2d69d93da9 | [
"Apache-2.0"
]
| permissive | 36952362/MiniXimalaya | 922321c3fba9ab972f5c190716d9e35689c50441 | 0e513542505b008bbc7251b60ebeb0b8db248bfc | refs/heads/master | 2020-06-21T02:09:44.966994 | 2019-08-14T12:38:59 | 2019-08-14T12:38:59 | 197,319,616 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package com.jupiter.miniximalaya.base;
import androidx.fragment.app.FragmentActivity;
public class BaseActivity extends FragmentActivity {
}
| [
"[email protected]"
]
| |
fbfdfe95c7e2995e4abd88e670421d9ec37e098a | 5ab2799f082083cb35a8198e37dacd7fb8687956 | /java/com/android/mvc/util/LogTag.java | df9d02a0f994717517c72b081572943902a4fecc | []
| no_license | rebolomo/androidmvc | bfe1df7e18ad97982fd3c2d4c582422445bd1ef4 | b97ac0a5787842fdcaec05f985befe709239f526 | refs/heads/master | 2021-01-19T08:32:30.536621 | 2017-04-11T04:11:48 | 2017-04-11T04:11:48 | 87,644,861 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 289 | java | package com.android.mvc.util;
public class LogTag {
public static String View = "View";
public static String Model = "Model";
public static String Test = "Test";
public static String Control = "Control";
public static String Adapter = "Adapter";
public static String Web = "Web";
}
| [
"[email protected]"
]
| |
de36e61c5eb093995d760916a3d17799d34b6cf6 | 5f597dc90cfc29065b08515826558a7a0f262869 | /GPU.java | e7d8e31139d708f59d9521965045fbd9eee444f5 | []
| no_license | JohnBelly95/PcParts-paster | 94f682a1d7fd885edc6375801f64d46ea1371de5 | 01a8b97b21cb46e1fb5cd213eb812771ef23b7d2 | refs/heads/master | 2016-09-06T03:56:55.844880 | 2014-06-13T15:47:24 | 2014-06-13T15:47:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 918 | java | public class GPU extends Hardware{
private String Chipset;
private int Memory;
public GPU(){
super();
Chipset = " ";
Memory = 0;
}
public GPU(String Chipset, int Memory, String modelName, String Manufacturer, int modelYear, int Price ){
super(modelName, Manufacturer, modelYear, Price );
this.Chipset = Chipset;
this.Memory = Memory;
}
public String getChipset(){
return Chipset;
}
public void setChipset(String Chipset){
this.Chipset = Chipset;
}
public int getMemory(){
return Memory;
}
public void setMemory(int Memory){
this.Memory = Memory;
}
public String toString(){
return String.format("\n\t\tTYPE: GPU" +super.toString() + "\n\t\tCHIPSET: " + this.Chipset + "\n\t\tMEMORY: " + this.Memory );
}
public String getTitle()
{
return "GPU";
}
}
| [
"[email protected]"
]
| |
3a33219eefad780af05956a732ef15e4600b8c41 | 7d88160ba424f2b67245e0933f00e66392a45724 | /src/day50_Inheritance_Overriding/ShapeTask/Shape.java | 3822eb61d76bdd5bf18af142c3e16b8c6d2b4d3d | []
| no_license | proroksin/Summer_2020_B20 | b8c0b74e751d0e1d4579aec1a59e7a3f7fb39b05 | 7829a24ad43ee24aa5402b616a0d01f503203dfa | refs/heads/master | 2023-01-05T14:01:09.509477 | 2020-10-28T22:42:30 | 2020-10-28T22:42:30 | 285,146,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package day50_Inheritance_Overriding.ShapeTask;
/*
warmup Task:
1. create a class called Shape
variables: area, perimeter
methods: calculateArea(), calculatePerimeter()
*/
public class Shape {
public double area;
public double perimeter;
public double calculateArea(){
return 0;
}
public double calculatePerimeter(){
return 0;
}
}
| [
"[email protected]"
]
| |
134337e3b406d2714c916404bd8ac699c85bfdb6 | 797cd95843cf68b3c0734083b5fe12c6e1e2d484 | /app/src/main/java/org/gdg/frisbee/android/view/MyView.java | 3e84f2ce14109f07ddcfd8662a3324746c5077f2 | [
"Apache-2.0"
]
| permissive | jaydeepw/frisbee | 2f93c50b4c7d142142dd6a7c9700998f9a53bf1d | 8f98124e8628120d960e93880eda4113f55b782d | refs/heads/master | 2021-01-20T21:44:58.055157 | 2014-06-09T20:42:48 | 2014-06-09T20:42:48 | 20,872,916 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 11,095 | java | /*
* Copyright 2013 The GDG Frisbee Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gdg.frisbee.android.view;
import android.content.Context;
import android.database.DataSetObserver;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import org.gdg.frisbee.android.adapter.NewsAdapter;
import timber.log.Timber;
import java.util.ArrayList;
import java.util.Map;
/**
* GDG Aachen
* org.gdg.frisbee.android.view
* <p/>
* User: maui
* Date: 29.04.13
* Time: 16:56
*/
public class MyView extends AbsListView {
private final static String LOG_TAG = "GDG-MyView";
private ListAdapter mAdapter;
private LinearLayout mRoot;
private ArrayList<WrapAdapter> mAdapters;
private ArrayList<ListView> mColumns;
private int mColumnCount = 1;
public MyView(Context context) {
super(context);
mColumns = new ArrayList<ListView>();
mAdapters = new ArrayList<WrapAdapter>();
mColumns = new ArrayList<ListView>();
mAdapters = new ArrayList<WrapAdapter>();
}
public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
int columns = attrs.getAttributeIntValue("http://schemas.android.com/apk/res-auto","numColumns",1);
mColumns = new ArrayList<ListView>(columns);
mAdapters = new ArrayList<WrapAdapter>(columns);
mColumnCount = columns;
}
public MyView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
int columns = attrs.getAttributeIntValue("http://schemas.android.com/apk/res-auto","numColumns",1);
mColumns = new ArrayList<ListView>(columns);
mAdapters = new ArrayList<WrapAdapter>(columns);
mColumnCount = columns;
}
private void initLayout() {
mRoot = new LinearLayout(getContext());
mRoot.setOrientation(LinearLayout.HORIZONTAL);
// Defining the LinearLayout layout parameters to fill the parent.
LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
mRoot.setLayoutParams(llp);
for(int i = 0; i < mColumnCount; i++) {
ListView list = new InnerListView(getContext());
list.setDivider(null);
list.setDividerHeight(0);
list.setVerticalScrollBarEnabled(false);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
list.setScrollBarSize(0);
//list.setScrollIndicators(null, null);
}
mColumns.add(list);
LinearLayout.LayoutParams l = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
l.weight = 1;
mRoot.addView(list, i, l);
list.setAdapter(mAdapters.get(i));
}
addViewInLayout(mRoot, -1, llp, false);
mRoot.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));
mRoot.layout(0,0,getWidth(),getHeight());
Timber.d("layoutInit()");
}
@Override
public void setAdapter(ListAdapter adapter) {
mAdapter = adapter;
for(int i = 0; i < mColumnCount; i++) {
mAdapters.add(new WrapAdapter(mAdapter));
}
mAdapter.registerDataSetObserver(new DataSetObserver() {
@Override
public void onInvalidated() {
super.onInvalidated();
Timber.d("onInvalidated()");
}
@Override
public void onChanged() {
super.onChanged();
applyAdapterUpdate();
}
});
Timber.d("setAdapter()");
}
/*
@Override
public int getChildCount() {
if(mRoot == null)
return 0;
int children = 0;
return mColumns.size();
}
@Override
public View getChildAt(int index) {
View v = null;
ViewGroup vg = null;
if(mRoot == null) {
return null;
} else {
vg = (ViewGroup) mRoot.getChildAt(0);
v = vg.getChildAt(index);
if(v == null) {
vg = (ViewGroup) mRoot.getChildAt(1);
v = vg.getChildAt(index);
}
}
if(v == null) {
Timber.d("Not so good..."+index);
}
return v;
}
*/
private void applyAdapterUpdate() {
for(WrapAdapter a : mAdapters) {
a.clear();
}
for(int i = 0; i <mAdapter.getCount(); i++) {
View v = mAdapter.getView(i, null, null);
if(mAdapter instanceof NewsAdapter) {
((NewsAdapter)mAdapter).getItemInternal(i).setConsumed(false);
}
v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
getShortestAdapter().add(i, v.getMeasuredHeight());
}
}
private WrapAdapter getShortestAdapter() {
WrapAdapter a = null;
int minHeight = Integer.MAX_VALUE;
for(WrapAdapter adapter : mAdapters) {
if(adapter.getHeight() < minHeight) {
a = adapter;
minHeight = adapter.getHeight();
}
}
return a;
}
@Override
public int getFirstVisiblePosition() {
int val = 0;
for(int i = 0; i < mColumnCount; i++) {
ListView lv = (ListView) mRoot.getChildAt(i);
if(lv.getFirstVisiblePosition() > val)
val = lv.getFirstVisiblePosition();
}
Timber.d("Visible: "+ val);
return val;
}
@Override
public ListAdapter getAdapter() {
return mAdapter;
}
@Override
public void setSelection(int i) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
if (widthMode != MeasureSpec.EXACTLY) {
widthMode = MeasureSpec.EXACTLY;
}
if (heightMode != MeasureSpec.EXACTLY) {
heightMode = MeasureSpec.EXACTLY;
}
setMeasuredDimension(widthSize, heightSize);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
initLayout();
}
@Override
public void requestLayout() {
if(mRoot != null) {
//mRoot.requestLayout();
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
//return super.onInterceptTouchEvent(ev);
return true;
}
@Override
public int getCount() {
return mAdapter.getCount();
}
public class WrapAdapter extends BaseAdapter {
private ListAdapter mBaseAdapter;
private ArrayList<Integer> mItems;
private int mHeight = 0;
public WrapAdapter(ListAdapter adapter) {
mBaseAdapter = adapter;
mItems = new ArrayList<Integer>();
}
public int getHeight() {
return mHeight;
}
public void add(int baseItem, int height) {
mHeight += height;
mItems.add(baseItem);
notifyDataSetChanged();
}
public void addAll(Map<Integer,Integer> items) {
for(Map.Entry<Integer,Integer> item : items.entrySet()) {
mHeight += item.getValue();
mItems.add(item.getKey());
}
notifyDataSetChanged();
}
public void clear() {
mItems.clear();
mHeight = 0;
notifyDataSetChanged();
}
@Override
public int getCount() {
return mItems.size();
}
@Override
public Object getItem(int i) {
return mBaseAdapter.getItem(mItems.get(i));
}
@Override
public long getItemId(int i) {
return mBaseAdapter.getItemId(mItems.get(i));
}
@Override
public int getViewTypeCount() {
return mBaseAdapter.getViewTypeCount();
}
@Override
public int getItemViewType(int position) {
return mBaseAdapter.getItemViewType(mItems.get(position));
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
View v = mBaseAdapter.getView(mItems.get(i), view, viewGroup);
return v;
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
/*Rect hit = new Rect();
for(ListView v : mColumns) {
v.getDrawingRect(hit);
if(hit.contains((int) ev.getX(), (int) ev.getY()))
return v.onTouchEvent(ev);
} */
for(ListView v : mColumns) {
v.dispatchTouchEvent(ev);
}
return true;
}
public class InnerListView extends ListView {
public InnerListView(Context context) {
super(context);
}
@Override
protected boolean overScrollBy(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent)
{
//This is where the magic happens, we have replaced the incoming maxOverScrollY with our own custom variable mMaxYOverscrollDistance;
return super.overScrollBy(deltaX, deltaY, scrollX, scrollY, scrollRangeX, scrollRangeY, maxOverScrollX, maxOverScrollY, isTouchEvent);
}
}
}
| [
"[email protected]"
]
| |
378898995116027c432de0885f601b37ec5d2e78 | 40cd4da5514eb920e6a6889e82590e48720c3d38 | /desktop/applis/apps/bean/bean_games/pokemonbean/src/main/java/aiki/beans/help/GeneralHelpBeanGetMovesAtLevel.java | 1ee5c39f890df62c28983e6b1b3370eede103784 | []
| no_license | Cardman/projects | 02704237e81868f8cb614abb37468cebb4ef4b31 | 23a9477dd736795c3af10bccccb3cdfa10c8123c | refs/heads/master | 2023-08-17T11:27:41.999350 | 2023-08-15T07:09:28 | 2023-08-15T07:09:28 | 34,724,613 | 4 | 0 | null | 2020-10-13T08:08:38 | 2015-04-28T10:39:03 | Java | UTF-8 | Java | false | false | 436 | java | package aiki.beans.help;
import aiki.beans.PokemonBeanStruct;
import code.bean.nat.BeanNatCommonLgNames;
import code.bean.nat.*;
import code.bean.nat.*;
public class GeneralHelpBeanGetMovesAtLevel implements NatCaller{
@Override
public NaSt re(NaSt _instance, NaSt[] _args){
return BeanNatCommonLgNames.getStringArray(( (GeneralHelpBean) ((PokemonBeanStruct)_instance).getInstance()).getMovesAtLevelFirstPk());
}
}
| [
"[email protected]"
]
| |
e84404a8606702f84f68bc069a3e25481d35a316 | 13cbb329807224bd736ff0ac38fd731eb6739389 | /com/sun/jmx/snmp/Enumerated.java | b6fdd99c8625000d0f9b53a4f343bb83a23ff985 | []
| no_license | ZhipingLi/rt-source | 5e2537ed5f25d9ba9a0f8009ff8eeca33930564c | 1a70a036a07b2c6b8a2aac6f71964192c89aae3c | refs/heads/master | 2023-07-14T15:00:33.100256 | 2021-09-01T04:49:04 | 2021-09-01T04:49:04 | 401,933,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,085 | java | package com.sun.jmx.snmp;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;
public abstract class Enumerated implements Serializable {
protected int value;
public Enumerated() throws IllegalArgumentException {
Enumeration enumeration = getIntTable().keys();
if (enumeration.hasMoreElements()) {
this.value = ((Integer)enumeration.nextElement()).intValue();
} else {
throw new IllegalArgumentException();
}
}
public Enumerated(int paramInt) throws IllegalArgumentException {
if (getIntTable().get(new Integer(paramInt)) == null)
throw new IllegalArgumentException();
this.value = paramInt;
}
public Enumerated(Integer paramInteger) throws IllegalArgumentException {
if (getIntTable().get(paramInteger) == null)
throw new IllegalArgumentException();
this.value = paramInteger.intValue();
}
public Enumerated(String paramString) throws IllegalArgumentException {
Integer integer = (Integer)getStringTable().get(paramString);
if (integer == null)
throw new IllegalArgumentException();
this.value = integer.intValue();
}
public int intValue() { return this.value; }
public Enumeration<Integer> valueIndexes() { return getIntTable().keys(); }
public Enumeration<String> valueStrings() { return getStringTable().keys(); }
public boolean equals(Object paramObject) { return (paramObject != null && getClass() == paramObject.getClass() && this.value == ((Enumerated)paramObject).value); }
public int hashCode() {
String str = getClass().getName() + String.valueOf(this.value);
return str.hashCode();
}
public String toString() { return (String)getIntTable().get(new Integer(this.value)); }
protected abstract Hashtable<Integer, String> getIntTable();
protected abstract Hashtable<String, Integer> getStringTable();
}
/* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\com\sun\jmx\snmp\Enumerated.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.0.7
*/ | [
"[email protected]"
]
| |
b087f90fde2cc281b77d04c9dc52a2356a15ac48 | 9ade45dd374a706254898ef94d1d979acd372511 | /src/test/java/iut/tdd/RomanNumeralsTest.java | 54779cbc858f447c1de365565b393d5795658d8e | []
| no_license | LaffileHugo/RomanNumerals | 1fe3f91d2175faddedc63fea0aba7a861f1c7202 | 7ef3c0f4986f55eec564418f32fcf9b256b45998 | refs/heads/master | 2016-09-13T00:35:14.069317 | 2016-04-22T09:00:33 | 2016-04-22T09:00:33 | 56,832,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,870 | java | package iut.tdd;
import org.junit.Assert;
<<<<<<< HEAD
import org.junit.Test;
=======
>>>>>>> 03efaaeb4df0caac397796883610f21f18d174b6
public class RomanNumeralsTest {
@Test
public void should_return_I_when_1 () {
//Given
String input = "1";
String expected = "I";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
<<<<<<< HEAD
=======
>>>>>>> 03efaaeb4df0caac397796883610f21f18d174b6
@Test
public void should_return_II_when_2 () {
//Given
String input = "2";
String expected = "II";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_IV_when_4 () {
//Given
String input = "4";
String expected = "IV";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_V_when_5 () {
//Given
String input = "5";
String expected = "V";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_VI_when_6 () {
//Given
String input = "6";
String expected = "VI";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_VII_when_7 () {
//Given
String input = "7";
String expected = "VII";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_VIII_when_8 () {
//Given
String input = "8";
String expected = "VIII";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_IX_when_9 () {
//Given
String input = "9";
String expected = "IX";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_X_when_10 () {
//Given
String input = "10";
String expected = "X";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_XV_when_15 () {
//Given
String input = "15";
String expected = "XV";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_XX_when_20 () {
//Given
String input = "20";
String expected = "XX";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_XXX_when_30 () {
//Given
String input = "30";
String expected = "XXX";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void should_return_XL_when_40 () {
//Given
String input = "40";
String expected = "XL";
RomanNumerals romanNumeral = new RomanNumerals();
//When
String actual = romanNumeral.convertToRoman(input);
//Then
Assert.assertEquals(expected, actual);
}
}
| [
"[email protected]"
]
| |
8d34cd2ef5a309557e63d15bc1007a5cb96d2537 | 591e72c06407fae8563ed9740e1b5bec3a6c43b3 | /09_Scripts/src/main/java/FileCopier.java | 4caa462b5a68ae02234b2d193a02e280e48e21f2 | []
| no_license | pkrajnik/IntelliJWorkspaceMaven_WprowadzenieDoJava11 | faec3b87a389e0c0bc3856f80e42161dbb28aa77 | 36412369a56b39eca69a391626ed50a913de1091 | refs/heads/master | 2021-07-12T17:47:03.055162 | 2020-09-26T16:57:12 | 2020-09-26T16:57:12 | 237,063,157 | 0 | 0 | null | 2021-03-31T21:46:06 | 2020-01-29T19:20:12 | Java | UTF-8 | Java | false | false | 383 | java | import java.io.IOException;
public class FileCopier {
public static void main(String args[]) throws IOException {
Runtime run = Runtime.getRuntime();
System.out.println("Executing the external program . . . . . . . .");
for (int i=1;i<=2;i++){
String file = "cmd /C copy "+i+".txt .\\a\\"+i+".txt";
run.exec(file);
} }
} | [
"[email protected]"
]
| |
a4026b95897066599e4ebfb2fd2884617ff1dc5a | 779f764fdd014ef1987980891bb168b851376525 | /SistemaVotacion/src/java/edu/unincca/WebServices/Facade.java | 5521632253598b32dd3ecf1bf6a5fb74ec0bae71 | []
| no_license | ososorio-zz/unincca-contexto2 | cb4343d430fe4f21260eb23d626b2527fc9a60df | e26a836ef231424350fd6b228515af20c9968022 | refs/heads/master | 2021-05-28T03:59:45.434934 | 2012-11-17T03:12:58 | 2012-11-17T03:12:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,959 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.unincca.WebServices;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author FAMILIA YARA GUEVARA
*/
public class Facade extends HttpServlet {
/**
* Processes requests for both HTTP
* <code>GET</code> and
* <code>POST</code> methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
/* TODO output your page here. You may use following sample code. */
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet Facade</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet Facade at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP
* <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"[email protected]@b416f3bf-e919-ee76-9745-39849cef044f"
]
| [email protected]@b416f3bf-e919-ee76-9745-39849cef044f |
300dfec2852c6b6f73812c499d0df20df2419663 | e017d2e71a36e0ca926db1efadb68f2c2a85a220 | /src/main/java/sg/edu/nus/demo/controller/package-info.java | 57e4acb47da0653939455aa23689e8774c6e3529 | []
| no_license | chualeesiong/Leave-Application-System | 7aa19cfbb275ef4e6992047f96e4de0da2615271 | a394a5bc0ed30c5629838c77bfcfd6335ce4c9ad | refs/heads/master | 2020-08-06T10:49:45.694436 | 2019-10-05T06:54:40 | 2019-10-05T06:54:40 | 212,949,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 54 | java | package sg.edu.nus.demo.controller;
//xiaolin testing | [
"[email protected]"
]
| |
0b945f93fd020a1842a4104bf5c4251cde8d4995 | c3453b92741e098f6cb5d6a1d36bb07e562fe24d | /Ragnar/src/fr/isima/sma/world/patterns/Console.java | 13ebafbfe68d119d9d100406116a5fdac7c5e27c | []
| no_license | ISIMA-begarco/Ragnar-wtf | cb13ce2eb0e908052483595d73b3d0b0ea6d6f21 | 3b68656091c4f913fb82a15754d20d4e3486e0f3 | refs/heads/master | 2021-06-04T17:09:55.980949 | 2016-03-01T18:06:36 | 2016-03-01T18:06:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,837 | java | package fr.isima.sma.world.patterns;
import java.util.ArrayList;
import java.util.List;
import fr.isima.sma.resources.Properties;
public class Console extends AbstractModelObject {
static private Console instance;
static private Object objet = new Object();
protected List<String> console;
protected String name;
private Console() {
this("console");
}
static public Console getInstance() {
if(null == instance) {
synchronized (objet) {
if(null == instance) {
instance = new Console();
}
}
}
return instance;
}
private Console(String pName) {
console = new ArrayList<>();
name = pName;
}
static public void add(String elt) {
if(getInstance()!=null) {
synchronized (objet) {
List<String> oldValue = instance.console;
instance.console = new ArrayList<String>(instance.console);
instance.console.add(0, elt);
instance.firePropertyChange("console", oldValue, instance.console);
instance.firePropertyChange("consoleCount", oldValue.size(), instance.console.size());
}
}
}
static public void remove(String elt) {
if(getInstance()!=null) {
synchronized (objet) {
List<String> oldValue = instance.console;
instance.console = new ArrayList<String>(instance.console);
instance.console.remove(elt);
instance.firePropertyChange("console", oldValue, instance.console);
instance.firePropertyChange("consoleCount", oldValue.size(), instance.console.size());
}
}
}
public List<String> getConsole() {
return getInstance().console;
}
public String get(int i) {
return getInstance().console.get(i);
}
public int size() {
return getInstance().console.size();
}
static public void println(String s) {
add(s);
if(!Boolean.valueOf(Properties.getInstance().getProperty("gui"))) {
System.out.println(s);
}
}
}
| [
"[email protected]"
]
| |
d000af64e6723a5b801de067293568ea1ae58485 | 8e7b3c8dea9d83771c2dffcefd616efbbe770051 | /src/main/java/com/fosterleads/backend/service/EmailAlreadyUsedException.java | c30e2d3c1953f01cde41a70caba0c06d474a8cf9 | []
| no_license | pramod-jazz/FosterLeads | f02f4b23002b8c8ee4f906e095cadfaa07d3242d | f78b89638d2446ef5da3ef43f6281c7837a7a4c4 | refs/heads/master | 2020-09-09T11:34:45.643662 | 2019-11-13T10:46:42 | 2019-11-13T10:46:42 | 221,436,321 | 1 | 0 | null | 2020-07-18T19:22:35 | 2019-11-13T10:46:27 | Java | UTF-8 | Java | false | false | 202 | java | package com.fosterleads.backend.service;
public class EmailAlreadyUsedException extends RuntimeException {
public EmailAlreadyUsedException() {
super("Email is already in use!");
}
}
| [
"[email protected]"
]
| |
f1ffd61cb28c582cd59b1bd1e43868f0aa1f2fb3 | 287a92ac24d919d7ef0286450f8d0af3ae41ff6b | /src/main/java/com/godcheese/nimrod/common/thymeleaf/NimrodDialect.java | 7d35473bfa076a4cb49496e423ffa5765e03f274 | [
"MIT"
]
| permissive | godcheese/nimrod | d8bc4b032cc5f53b9295ba00d98bcd0491c8291f | bd7678b92c8f481cdbbfb7090a43503da99b1856 | refs/heads/master | 2021-08-15T00:55:59.054718 | 2021-08-03T10:04:20 | 2021-08-03T10:04:20 | 155,986,916 | 145 | 53 | MIT | 2021-08-03T10:04:21 | 2018-11-03T13:44:15 | Java | UTF-8 | Java | false | false | 883 | java | package com.godcheese.nimrod.common.thymeleaf;
import org.springframework.stereotype.Component;
import org.thymeleaf.dialect.AbstractProcessorDialect;
import org.thymeleaf.processor.IProcessor;
import org.thymeleaf.standard.StandardDialect;
import java.util.HashSet;
import java.util.Set;
/**
* @author godcheese [[email protected]]
* @date 2019-09-23
*/
@Component
public class NimrodDialect extends AbstractProcessorDialect {
private static final String NAME = "Nimrod Dialect";
private static final String PREFIX = "nimrod";
protected NimrodDialect() {
super(NAME, PREFIX, StandardDialect.PROCESSOR_PRECEDENCE);
}
@Override
public Set<IProcessor> getProcessors(String s) {
final Set<IProcessor> processors = new HashSet<>();
processors.add(new SecurityAuthorityElementProcessor(s));
return processors;
}
}
| [
"[email protected]"
]
| |
a888c20ca3bd30951114c85fa84215dc26aee0f6 | a8c9e098492921a0ba26cc775d3434d9dee1acbf | /think-web/src/main/java/com/thinkcms/web/controller/content/ContentController.java | b98b0d6a31ef7e5fd1a750f13546071cf07d1aca | []
| no_license | youla-tech/cms | b821e696814e29d7bff28d12ab5ab4bcd0a5db53 | c6a94eb9823792a9de095189259b0e84fb5df8d6 | refs/heads/master | 2022-11-30T14:17:57.571917 | 2020-08-06T10:17:51 | 2020-08-06T10:17:51 | 285,033,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,208 | java | package com.thinkcms.web.controller.content;
import com.thinkcms.core.annotation.Logs;
import com.thinkcms.core.enumerate.LogModule;
import com.thinkcms.core.enumerate.LogOperation;
import com.thinkcms.core.model.PageDto;
import com.thinkcms.core.utils.ApiResult;
import com.thinkcms.service.api.content.ContentService;
import com.thinkcms.service.dto.content.ContentDto;
import com.thinkcms.web.controller.BaseController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;
/**
* <p>
* 内容 前端控制器
* </p>
*
* @author LG
* @since 2019-10-30
*/
@Validated
@RestController
@RequestMapping("content")
public class ContentController extends BaseController<ContentService> {
@Logs(module = LogModule.CONTENT,operation = "查看内容详情")
@GetMapping("getByPk")
public ApiResult get(@NotBlank @RequestParam String id){
return service.getInfoByPk(id);
}
@Logs(module = LogModule.CONTENT,operation = "查询置顶标签")
@GetMapping("getTopTag")
public Set<String> getTopTag(){
Set<String> topTags= service.getTopTag();
return topTags;
}
@Logs(module = LogModule.CONTENT,operation = "置顶内容")
@PutMapping("top")
public ApiResult top(@NotNull @RequestBody ContentDto contentDto){
return service.top(contentDto);
}
@Logs(module = LogModule.CONTENT,operation = "移动内容到指定栏目的")
@PutMapping("move")
public ApiResult move(@RequestBody ContentDto contentDto){
return service.move(contentDto.getCategoryId(),contentDto.getIds());
}
@Logs(module = LogModule.CONTENT,operation = "删除内容")
@DeleteMapping("deleteByPk")
public boolean deleteByPk(@NotBlank @RequestParam String pk) {
return service.deleteContentByPk(pk);
}
@DeleteMapping(value = "deleteByIds")
public void deleteByPks(@NotEmpty @RequestBody List<String> ids){
service.deleteContentByPks(ids);
}
@PostMapping("list")
public List<ContentDto> list(@RequestBody ContentDto v){
return service.listDto(v);
}
@PostMapping("page")
public PageDto<ContentDto> listPage(@RequestBody PageDto<ContentDto> pageDto){
return service.listPage(pageDto);
}
@PostMapping("pageRecycler")
public PageDto<ContentDto> pageRecycler(@RequestBody PageDto<ContentDto> pageDto){
return service.pageRecycler(pageDto);
}
@GetMapping("getCreateForm")
public ApiResult getCreateForm(@NotBlank @RequestParam String categoryId ){
return service.getCreateForm(categoryId);
}
@Logs(module = LogModule.CONTENT,operaEnum= LogOperation.SAVE,operation = "新增内容")
@PostMapping(value="saveContent")
public void saveContent(@Validated @RequestBody ContentDto v){
service.saveContent(v);
}
@Logs(module = LogModule.CONTENT,operaEnum= LogOperation.UPDATE,operation = "修改内容")
@PutMapping("updateContent")
public void updateContent(@RequestBody ContentDto v){
service.updateContent(v);
}
@Logs(module = LogModule.CONTENT,operation = "发布/撤销内容")
@PutMapping("publish")
public void publish(@RequestBody ContentDto v){
service.publish(v,0);
}
@Logs(module = LogModule.CONTENT,operation = "定时发布/撤销内容")
@PutMapping("jobPublish")
public void jobPublish(@RequestBody ContentDto v){
service.jobPublish(v);
}
@Logs(module = LogModule.CONTENT,operation = "重新批量生成静态页")
@PostMapping(value="reStaticBatchGenCid")
public void reStaticFileByCid(@NotEmpty @RequestBody List<String> ids){
service.reStaticBatchGenCid(ids,getUserId());
}
@Logs(module = LogModule.CONTENT,operation = "彻底删除")
@DeleteMapping(value="delByPksfinalDoIt")
public void finalDoIt(@RequestBody ContentDto contentDto){
service.finalDoIt(contentDto.getIds(),contentDto.getStatus());
}
}
| [
"[email protected]"
]
| |
8771ddb5c7ae048ca62a9cf027c7181e4ff9d72c | 173d01cdf51323e7fa9b5173436171c0fd9b1d82 | /Source/kktnetd/src/gnu/io/LibManager.java | 6877f8dc0c24dadcebdaeec12a7d9c4e441dc183 | []
| no_license | shtrih-m/javapos_shtrih | 64e3ce7899ccc5c1af4cfe88f17d4bb27149cb20 | c25648f4a611413e3ffd3942c753993005a706e4 | refs/heads/master | 2023-09-04T04:24:29.279126 | 2023-08-29T08:21:40 | 2023-08-29T08:21:40 | 72,649,858 | 42 | 20 | null | 2023-07-07T13:06:52 | 2016-11-02T14:50:38 | Java | UTF-8 | Java | false | false | 3,683 | java | /*-------------------------------------------------------------------------
| RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
| RXTX is a native interface to serial ports in java.
| Copyright 1997-2007 by Trent Jarvi [email protected] and others who
| actually wrote it. See individual source files for more information.
|
| A copy of the LGPL v 2.1 may be found at
| http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
| here for your convenience.
|
| 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
| Lesser General Public License for more details.
|
| An executable that contains no derivative of any portion of RXTX, but
| is designed to work with RXTX by being dynamically linked with it,
| is considered a "work that uses the Library" subject to the terms and
| conditions of the GNU Lesser General Public License.
|
| The following has been added to the RXTX License to remove
| any confusion about linking to RXTX. We want to allow in part what
| section 5, paragraph 2 of the LGPL does not permit in the special
| case of linking over a controlled interface. The intent is to add a
| Java Specification Request or standards body defined interface in the
| future as another exception but one is not currently available.
|
| http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
|
| As a special exception, the copyright holders of RXTX give you
| permission to link RXTX with independent modules that communicate with
| RXTX solely through the Sun Microsytems CommAPI interface version 2,
| regardless of the license terms of these independent modules, and to copy
| and distribute the resulting combined work under terms of your choice,
| provided that every copy of the combined work is accompanied by a complete
| copy of the source code of RXTX (the version of RXTX used to produce the
| combined work), being distributed under the terms of the GNU Lesser General
| Public License plus this exception. An independent module is a
| module which is not derived from or based on RXTX.
|
| Note that people who make modified versions of RXTX are not obligated
| to grant this special exception for their modified versions; it is
| their choice whether to do so. The GNU Lesser General Public License
| gives permission to release a modified version without this exception; this
| exception also makes it possible to release a modified version which
| carries forward this exception.
|
| You should have received a copy of the GNU Lesser General Public
| License along with this library; if not, write to the Free
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| All trademarks belong to their respective owners.
--------------------------------------------------------------------------*/
package gnu.io;
public class LibManager {
private static LibManager instance;
private static boolean loaded = false;
private LibManager() throws Exception {
if(!loaded) {
loaded = true;
new NativeResource().load("libkktnetd");
}
}
public static LibManager getInstance() throws Exception {
if(instance == null) {
instance = new LibManager();
}
return instance;
}
}
| [
"[email protected]"
]
| |
95917bb58f0a81c86e97a964156d8d6df22fe152 | 77831058c40d792156c21d52e95b96feb268fdbf | /src/main/java/zc/devopstest/UserController.java | ad1fc6deef1fb8d323911149217a43384910d3fe | []
| no_license | zczc2390/servertest | 3f91f4257bd86aef0d468f529371c10f4902d6e2 | 4fafcfb99eb08b9fc69c08f9220ce0da9dace1d3 | refs/heads/master | 2023-02-11T00:50:52.772455 | 2021-01-07T18:50:24 | 2021-01-07T18:50:24 | 327,692,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package zc.devopstest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
//@CrossOrigin(origins = "http://localhost:4200", maxAge = 3600)
@RestController
@RequestMapping({"/api"})
public class UserController {
@Autowired
private UserService userService;
@PostMapping
public User create(@RequestBody User user){
return userService.create(user);
}
@GetMapping(path = {"/{id}"})
public User findOne(@PathVariable("id") int id){
return userService.findById(id);
}
@PutMapping
public User update(@RequestBody User user){
return userService.update(user);
}
@DeleteMapping(path ={"/{id}"})
public User delete(@PathVariable("id") int id) {
return userService.delete(id);
}
@GetMapping
public List<User> findAll(){
return userService.findAll();
}
}
| [
"[email protected]"
]
| |
89d542aa182cc4b31b65096ac854752e00c87434 | 08e49ac5fd348be9c71d3d30a3bd1b5c8f2027ae | /BookAdvisor-02/src/main/java/es/upm/dit/isst/bookAdvisor/Subir_Servlet.java | 85d8c5dd3ddf1ab5d32d2501f26a4c32b8299792 | []
| no_license | Luisgarciadefernando/ISST-Grupo02-Books | 09aa42e7eb98f7aa024cee8ee44ccdebc7d906bc | 4105d6eb7c9dc34001b475e14edb1dda2ff8b5ba | refs/heads/master | 2021-01-17T07:19:17.015846 | 2017-05-22T09:26:52 | 2017-05-22T09:26:52 | 83,702,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,597 | java | package es.upm.dit.isst.bookAdvisor;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
import com.google.appengine.api.images.ImagesService;
import com.google.appengine.api.images.ImagesServiceFactory;
import com.google.appengine.api.images.ServingUrlOptions;
import com.googlecode.objectify.ObjectifyService;
import es.upm.dit.isst.bookAdvisor.dao.AutorDAO;
import es.upm.dit.isst.bookAdvisor.dao.AutorDAOImpl;
import es.upm.dit.isst.bookAdvisor.dao.LibroDAO;
import es.upm.dit.isst.bookAdvisor.dao.LibroDAOImpl;
import es.upm.dit.isst.bookAdvisor.model.Autor;
import es.upm.dit.isst.bookAdvisor.model.Libro;
public class Subir_Servlet extends HttpServlet {
@Override
public void init() throws ServletException {
ObjectifyService.register(Libro.class);
ObjectifyService.register(Autor.class);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// TODO Auto-generated method stub
String titulo = req.getParameter("titulo");
String autor = req.getParameter("autor");
String traductor = req.getParameter("traductor");
String resumen = req.getParameter("resumen");
String isbn = req.getParameter("isbn");
String genero = req.getParameter("genero");
String imagen = "img/no-disponible.jpg";
int isbn1 = 0;
isbn1 = Integer.parseInt(isbn);
LibroDAO dao = LibroDAOImpl.getInstancia();
AutorDAO autorDao = AutorDAOImpl.getInstancia();
Map<String, List<BlobKey>> blobs = BlobstoreServiceFactory.getBlobstoreService().getUploads(req);
List<BlobKey> blobKeys = blobs.get("file");
if (blobKeys == null || blobKeys.isEmpty() || blobKeys.get(0) == null) {
resp.sendError(1200);
}
else {
ImagesService imagesService = ImagesServiceFactory.getImagesService();
ServingUrlOptions servingOptions = ServingUrlOptions.Builder.withBlobKey(blobKeys.get(0));
String servingUrl = imagesService.getServingUrl(servingOptions);
imagen = servingUrl;
}
dao.create(titulo, resumen, genero, autor, traductor, isbn1, 0, imagen);
if(autorDao.readNombre(autor).size()==0){
autorDao.create(autor);
}
resp.sendRedirect("/libros");
}
}
| [
"[email protected]"
]
| |
bbf434c1fb6ae7ac7c8467fa2d4c90877945eac6 | 1c208bcfa97cb5ba2a526ca6f48fb38a4ab2be37 | /java/net/divinerpg/client/render/entity/twilight/RenderDAR.java | a765c36da7b567dc35283ae2761b504c3007e424 | []
| no_license | Scrik/DivineRPG_Fix | 70e7126a0a01ab3287f7916c210c558dabfc2bbf | 21ce47d553b35c042519f7d4107522f0b82658ee | refs/heads/master | 2020-03-22T21:35:19.868313 | 2018-08-19T09:56:13 | 2018-08-19T09:56:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,923 | java | package net.divinerpg.client.render.entity.twilight;
import net.divinerpg.client.render.RenderLivingCreature;
import net.divinerpg.client.render.entity.twilight.model.ModelDensos;
import net.divinerpg.entities.base.DivineBossStatus;
import net.divinerpg.entities.base.EntityDivineRPGBoss;
import net.divinerpg.items.base.ItemModBow;
import net.minecraft.client.model.ModelBase;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import org.lwjgl.opengl.GL11;
public class RenderDAR extends RenderLivingCreature {
private float scale;
public int bossTextureID;
public RenderDAR(ModelBase var1, float var2, ResourceLocation texture, int id) {
this(var1, var2, 1.0F, texture, id);
}
public RenderDAR(ModelBase var1, float var2, float var3, ResourceLocation texture, int id) {
super(var1, var2 * var3, texture);
bossTextureID = id;
this.scale = var3;
}
public void preRenderScale(EntityMob var1, float var2) {
GL11.glScalef(this.scale, this.scale, this.scale);
}
@Override
protected void preRenderCallback(EntityLivingBase var1, float var2) {
this.preRenderScale((EntityDivineRPGBoss)var1, var2);
}
@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
super.doRender(par1Entity, par2, par4, par6, par8, par9);
DivineBossStatus.setBossStatus((EntityDivineRPGBoss)par1Entity, bossTextureID);
}
@Override
protected void renderEquippedItems(EntityLivingBase var1, float var2) {
super.renderEquippedItems(var1, var2);
ItemStack var3 = var1.getHeldItem();
if (var3 != null) {
GL11.glPushMatrix();
((ModelDensos)this.mainModel).rightarm.postRender(0.0625F);
GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F);
IItemRenderer var5 = MinecraftForgeClient.getItemRenderer(var3, IItemRenderer.ItemRenderType.EQUIPPED);
boolean var6 = (var5 != null) && (var5.shouldUseRenderHelper(IItemRenderer.ItemRenderType.EQUIPPED, var3, IItemRenderer.ItemRendererHelper.BLOCK_3D));
float var4 = 0.5F;
GL11.glTranslatef(-0.1F, 0.2F, -0.4F);
GL11.glScalef(var4, -var4, var4);
if(var3.getItem() instanceof ItemModBow)GL11.glRotatef(120.0F, 0F, 1.0F, -0.6F);
else {
GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.5f, -0.4f, 0f);
}
this.renderManager.itemRenderer.renderItem(var1, var3, 0);
if (var3.getItem().requiresMultipleRenderPasses()) {
for (int var7 = 1; var7 < var3.getItem().getRenderPasses(var3.getItemDamage()); var7++) {
this.renderManager.itemRenderer.renderItem(var1, var3, var7);
}
}
GL11.glPopMatrix();
}
}
} | [
"[email protected]"
]
| |
eab077d264605db3490d0d5b2eb18dbe78489836 | cb2c56f38e5713105869012501b9fce71454910b | /src/test/java/com/fortify/ssc/restclient/api/IssueAttachmentOfIssueControllerApiTest.java | b079f82787f965a4438f230872b6db457c8aa8b2 | [
"MIT"
]
| permissive | ilatypov/ssc-restapi-client | 0c0d87d23f7f88cae04c2ed23b77798fafbfd112 | 1a632fc021a07e0a609efbb6c90caa4238cbda27 | refs/heads/master | 2022-01-23T04:41:55.217639 | 2020-06-22T06:59:22 | 2020-06-22T07:32:54 | 248,676,011 | 0 | 0 | MIT | 2021-12-29T19:29:27 | 2020-03-20T05:33:51 | Java | UTF-8 | Java | false | false | 3,633 | java | /*
* Fortify Software Security Center API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1:18.20
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.fortify.ssc.restclient.api;
import com.fortify.ssc.restclient.ApiException;
import com.fortify.ssc.restclient.model.ApiResult;
import com.fortify.ssc.restclient.model.ApiResultIssueAttachment;
import com.fortify.ssc.restclient.model.ApiResultListIssueAttachment;
import com.fortify.ssc.restclient.model.ApiResultVoid;
import com.fortify.ssc.restclient.model.IssueAttachment;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for IssueAttachmentOfIssueControllerApi
*/
@Ignore
public class IssueAttachmentOfIssueControllerApiTest {
private final IssueAttachmentOfIssueControllerApi api = new IssueAttachmentOfIssueControllerApi();
/**
* create
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void createIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
IssueAttachment resource = null;
ApiResultIssueAttachment response = api.createIssueAttachmentOfIssue(parentId, resource);
// TODO: test validations
}
/**
* delete
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void deleteIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
Long id = null;
ApiResultVoid response = api.deleteIssueAttachmentOfIssue(parentId, id);
// TODO: test validations
}
/**
* list
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void listIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
Integer start = null;
Integer limit = null;
ApiResultListIssueAttachment response = api.listIssueAttachmentOfIssue(parentId, start, limit);
// TODO: test validations
}
/**
* multiDelete
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void multiDeleteIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
String ids = null;
ApiResultVoid response = api.multiDeleteIssueAttachmentOfIssue(parentId, ids);
// TODO: test validations
}
/**
* read
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void readIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
Long id = null;
String fields = null;
ApiResultIssueAttachment response = api.readIssueAttachmentOfIssue(parentId, id, fields);
// TODO: test validations
}
/**
* update
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void updateIssueAttachmentOfIssueTest() throws ApiException {
Long parentId = null;
Long id = null;
IssueAttachment data = null;
ApiResultIssueAttachment response = api.updateIssueAttachmentOfIssue(parentId, id, data);
// TODO: test validations
}
}
| [
"[email protected]"
]
| |
9fc973c7f7fc36079ac47912569dddd5735c4a23 | ef54438ce2fe6ace1dd1129cb9fb54ad0424f032 | /app/src/main/java/com/gongpingjia/gpjdetector/utility/CrashHandler.java | 264796cd593ac602c01d111d994f7c2a5322410c | []
| no_license | kevinwan/inspection_android | 544c685c223ddecc0c16d1fbce578edd5dd014b8 | 289b58ba7825fb27f747f2a4d72b959b85a5b9ad | refs/heads/master | 2020-05-29T11:46:10.185849 | 2017-02-23T06:49:30 | 2017-02-23T06:49:30 | 25,187,250 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,905 | java | package com.gongpingjia.gpjdetector.utility;
import android.os.Debug;
import android.os.Environment;
import android.util.Log;
import com.gongpingjia.gpjdetector.global.GPJApplication;
import com.umeng.analytics.MobclickAgent;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Date;
/**
*
* @author
*
*/
public class CrashHandler implements UncaughtExceptionHandler {
public static final String TAG = "CrashHandler";
private Thread.UncaughtExceptionHandler mDefaultHandler;
private static final String OOM = "java.lang.OutOfMemoryError";
private static final String HPROF_FILE_PATH = Environment
.getExternalStorageDirectory().getPath() + "/data.hprof";
private static CrashHandler sCrashHandler;
private CrashHandler() {
}
public synchronized static CrashHandler getInstance() {
if (sCrashHandler == null) {
sCrashHandler = new CrashHandler();
}
return sCrashHandler;
}
public CrashHandler init() {
mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(this);
return this;
}
public static boolean isOOM(Throwable throwable) {
Log.d(TAG, "getName:" + throwable.getClass().getName());
if (OOM.equals(throwable.getClass().getName())) {
return true;
} else {
Throwable cause = throwable.getCause();
if (cause != null) {
return isOOM(cause);
}
return false;
}
}
@Override
public void uncaughtException(Thread thread, Throwable throwable) {
if (!handleException(throwable) && mDefaultHandler != null) {
// 如果用户没有处理则让系统默认的异常处理器来处理
mDefaultHandler.uncaughtException(thread, throwable);
}else{
MobclickAgent.onKillProcess(GPJApplication.getInstance());
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
}
}
private boolean handleException(Throwable throwable) {
if (throwable == null) {
return false;
}
if (isOOM(throwable)) {
try {
Debug.dumpHprofData(HPROF_FILE_PATH);
} catch (Exception e) {
Log.e(TAG, "couldn’t dump hprof", e);
}
}
String logdir;
if (Environment.getExternalStorageDirectory() != null) {
logdir = Environment.getExternalStorageDirectory()
.getAbsolutePath()
+ File.separator
+ "gongpingjia"
+ File.separator + "error";
File file = new File(logdir);
boolean mkSuccess;
if (!file.isDirectory()) {
mkSuccess = file.mkdirs();
if (!mkSuccess) {
mkSuccess = file.mkdirs();
}
}
try {
FileWriter fw = new FileWriter(logdir + File.separator
+ "error.txt", true);
fw.write(new Date() + "\n");
StackTraceElement[] stackTrace = throwable.getStackTrace();
fw.write(throwable.getMessage() + "\n");
for (int i = 0; i < stackTrace.length; i++) {
fw.write("file:" + stackTrace[i].getFileName() + " class:"
+ stackTrace[i].getClassName() + " method:"
+ stackTrace[i].getMethodName() + " line:"
+ stackTrace[i].getLineNumber() + "\n");
}
fw.write("\n");
fw.flush();
fw.close();
} catch (IOException e) {
Log.e("crash handler", "load file failed...", e.getCause());
}
}
return true;
}
}
| [
"[email protected]"
]
| |
c585d533800b7681579914d4f23860c9c4fc5282 | da95cc958d31388a8a77e59bf7e41d0c15e511df | /src/main/java/com/ywxt/Controller/User/UserController.java | 20643b9765108c3437b918fa549d7fb67e7e2796 | []
| no_license | kerraLi/OperaApi | 33b0caced9e91249cc417507d40086e2fca183d2 | 32cafa46ec7e55ac03e2eb76044e49c662fa6083 | refs/heads/master | 2022-02-08T03:14:04.395232 | 2019-03-31T06:26:43 | 2019-03-31T06:26:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,881 | java | package com.ywxt.Controller.User;
import com.alibaba.fastjson.JSONObject;
import com.ywxt.Annotation.NotOperationAction;
import com.ywxt.Controller.CommonController;
import com.ywxt.Domain.User.User;
import com.ywxt.Service.User.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@Validated
@Controller
@RequestMapping(value = "/user", name = "用户管理")
public class UserController extends CommonController {
@Resource
private UserService userService;
@ResponseBody
@NotOperationAction
@RequestMapping(value = {"/list"}, name = "用户列表", method = RequestMethod.POST)
public JSONObject list(HttpServletRequest request) throws Exception {
int pageNumber = request.getParameter("page") == null ? 1 : Integer.parseInt(request.getParameter("page"));
int pageSize = request.getParameter("limit") == null ? 10 : Integer.parseInt(request.getParameter("limit"));
HashMap<String, Object> params = new HashMap<String, Object>();
return userService.getList(params, pageNumber, pageSize);
}
@ResponseBody
@RequestMapping(value = {"/save"}, name = "保存用户", method = RequestMethod.POST)
public User save(@RequestBody User user) throws Exception {
if (user.getUsername().equals("admin")) {
throw new Exception("非法用户名。");
}
return userService.save(user);
}
@ResponseBody
@RequestMapping(value = {"/delete/{id}"}, name = "删除用户", method = RequestMethod.POST)
public JSONObject remove(@PathVariable long id) throws Exception {
userService.remove(id);
return this.returnObject();
}
}
| [
"[email protected]"
]
| |
dc27ca40104582d0e86511675d77b2f9244b9036 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module0492_public/tests/unittests/src/java/module0492_public_tests_unittests/a/Foo0.java | f423a26f4ef9ad82a6413f10117b983275981fca | [
"BSD-3-Clause"
]
| permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,267 | java | package module0492_public_tests_unittests.a;
import java.awt.datatransfer.*;
import java.beans.beancontext.*;
import java.io.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.awt.datatransfer.DataFlavor
* @see java.beans.beancontext.BeanContext
* @see java.io.File
*/
@SuppressWarnings("all")
public abstract class Foo0<U> implements module0492_public_tests_unittests.a.IFoo0<U> {
java.rmi.Remote f0 = null;
java.nio.file.FileStore f1 = null;
java.sql.Array f2 = null;
public U element;
public static Foo0 instance;
public static Foo0 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return null;
}
public String getName() {
return element.toString();
}
public void setName(String string) {
return;
}
public U get() {
return element;
}
public void set(Object element) {
this.element = (U)element;
}
public U call() throws Exception {
return (U)getInstance().call();
}
}
| [
"[email protected]"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.