blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eeeba395efc78c73c8ef8fcef52a8af3e79245b8 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Jsoup_31_buggy/mutated/244/Tag.java | d54afb26068d69209c9758a6bdc67b722d0eaf63 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,877 | java | package org.jsoup.parser;
import org.jsoup.helper.Validate;
import java.util.HashMap;
import java.util.Map;
/**
* HTML Tag capabilities.
*
* @author Jonathan Hedley, jonathan@hedley.net
*/
public class Tag {
private static final Map<String, Tag> tags = new HashMap<String, Tag>(); // map of known tags
private String tagName;
private boolean isBlock = true; // block or inline
private boolean formatAsBlock = true; // should be formatted as a block
private boolean canContainBlock = true; // Can this tag hold block level tags?
private boolean canContainInline = true; // only pcdata if not
private boolean empty = false; // can hold nothing; e.g. img
private boolean selfClosing = false; // can self close (<foo />). used for unknown tags that self close, without forcing them as empty.
private boolean preserveWhitespace = false; // for pre, textarea, script etc
private boolean formList = false; // a control that appears in forms: input, textarea, output etc
private boolean formSubmit = false; // a control that can be submitted in a form: input etc
private Tag(String tagName) {
this.tagName = tagName.toLowerCase();
}
/**
* Get this tag's name.
*
* @return the tag's name
*/
public String getName() {
return tagName;
}
/**
* Get a Tag by name. If not previously defined (unknown), returns a new generic tag, that can do anything.
* <p/>
* Pre-defined tags (P, DIV etc) will be ==, but unknown tags are not registered and will only .equals().
*
* @param tagName Name of tag, e.g. "p". Case insensitive.
* @return The tag, either defined or new generic.
*/
public static Tag valueOf(String tagName) {
Validate.notNull(tagName);
Tag tag = tags.get(tagName);
if (tag == null) {
tagName = tagName.trim().toLowerCase();
Validate.notEmpty(tagName);
tag = tags.get(tagName);
if (tag == null) {
// not defined: create default; go anywhere, do anything! (incl be inside a <p>)
tag = new Tag(tagName);
tag.isBlock = false;
tag.canContainBlock = true;
}
}
return tag;
}
/**
* Gets if this is a block tag.
*
* @return if block tag
*/
public boolean isBlock() {
return isBlock;
}
/**
* Gets if this tag should be formatted as a block (or as inline)
*
* @return if should be formatted as block or inline
*/
public boolean formatAsBlock() {
return canContainBlock;
}
/**
* Gets if this tag can contain block tags.
*
* @return if tag can contain block tags
*/
public boolean canContainBlock() {
return canContainBlock;
}
/**
* Gets if this tag is an inline tag.
*
* @return if this tag is an inline tag.
*/
public boolean isInline() {
return !isBlock;
}
/**
* Gets if this tag is a data only tag.
*
* @return if this tag is a data only tag
*/
public boolean isData() {
return !canContainInline && !isEmpty();
}
/**
* Get if this is an empty tag
*
* @return if this is an empty tag
*/
public boolean isEmpty() {
return empty;
}
/**
* Get if this tag is self closing.
*
* @return if this tag should be output as self closing.
*/
public boolean isSelfClosing() {
return empty || selfClosing;
}
/**
* Get if this is a pre-defined tag, or was auto created on parsing.
*
* @return if a known tag
*/
public boolean isKnownTag() {
return tags.containsKey(tagName);
}
/**
* Check if this tagname is a known tag.
*
* @param tagName name of tag
* @return if known HTML tag
*/
public static boolean isKnownTag(String tagName) {
return tags.containsKey(tagName);
}
/**
* Get if this tag should preserve whitespace within child text nodes.
*
* @return if preserve whitepace
*/
public boolean preserveWhitespace() {
return preserveWhitespace;
}
/**
* Get if this tag represents a control associated with a form. E.g. input, textarea, output
* @return if associated with a form
*/
public boolean isFormListed() {
return formList;
}
/**
* Get if this tag represents an element that should be submitted with a form. E.g. input, option
* @return if submittable with a form
*/
public boolean isFormSubmittable() {
return formSubmit;
}
Tag setSelfClosing() {
selfClosing = true;
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Tag)) return false;
Tag tag = (Tag) o;
if (canContainBlock != tag.canContainBlock) return false;
if (canContainInline != tag.canContainInline) return false;
if (empty != tag.empty) return false;
if (formatAsBlock != tag.formatAsBlock) return false;
if (isBlock != tag.isBlock) return false;
if (preserveWhitespace != tag.preserveWhitespace) return false;
if (selfClosing != tag.selfClosing) return false;
if (formList != tag.formList) return false;
if (formSubmit != tag.formSubmit) return false;
if (!tagName.equals(tag.tagName)) return false;
return true;
}
@Override
public int hashCode() {
int result = tagName.hashCode();
result = 31 * result + (isBlock ? 1 : 0);
result = 31 * result + (formatAsBlock ? 1 : 0);
result = 31 * result + (canContainBlock ? 1 : 0);
result = 31 * result + (canContainInline ? 1 : 0);
result = 31 * result + (empty ? 1 : 0);
result = 31 * result + (selfClosing ? 1 : 0);
result = 31 * result + (preserveWhitespace ? 1 : 0);
result = 31 * result + (formList ? 1 : 0);
result = 31 * result + (formSubmit ? 1 : 0);
return result;
}
public String toString() {
return tagName;
}
// internal static initialisers:
// prepped from http://www.w3.org/TR/REC-html40/sgml/dtd.html and other sources
private static final String[] blockTags = {
"html", "head", "body", "frameset", "script", "noscript", "style", "meta", "link", "title", "frame",
"noframes", "section", "nav", "aside", "hgroup", "header", "footer", "p", "h1", "h2", "h3", "h4", "h5", "h6",
"ul", "ol", "pre", "div", "blockquote", "hr", "address", "figure", "figcaption", "form", "fieldset", "ins",
"del", "s", "dl", "dt", "dd", "li", "table", "caption", "thead", "tfoot", "tbody", "colgroup", "col", "tr", "th",
"td", "video", "audio", "canvas", "details", "menu", "plaintext"
};
private static final String[] inlineTags = {
"object", "base", "font", "tt", "i", "b", "u", "big", "small", "em", "strong", "dfn", "code", "samp", "kbd",
"var", "cite", "abbr", "time", "acronym", "mark", "ruby", "rt", "rp", "a", "img", "br", "wbr", "map", "q",
"sub", "sup", "bdo", "iframe", "embed", "span", "input", "select", "textarea", "label", "button", "optgroup",
"option", "legend", "datalist", "keygen", "output", "progress", "meter", "area", "param", "source", "track",
"summary", "command", "device"
};
private static final String[] emptyTags = {
"meta", "link", "base", "frame", "img", "br", "wbr", "embed", "hr", "input", "keygen", "col", "command",
"device"
};
private static final String[] formatAsInlineTags = {
"title", "a", "p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "address", "li", "th", "td", "script", "style",
"ins", "del", "s"
};
private static final String[] preserveWhitespaceTags = {
"pre", "plaintext", "title", "textarea"
};
// todo: I think we just need submit tags, and can scrub listed
private static final String[] formListedTags = {
"button", "fieldset", "input", "keygen", "object", "output", "select", "textarea"
};
private static final String[] formSubmitTags = {
"input", "keygen", "object", "select", "textarea"
};
static {
// creates
for (String tagName : blockTags) {
Tag tag = new Tag(tagName);
register(tag);
}
for (String tagName : inlineTags) {
Tag tag = new Tag(tagName);
tag.isBlock = false;
tag.canContainBlock = false;
tag.formatAsBlock = false;
register(tag);
}
// mods:
for (String tagName : emptyTags) {
Tag tag = tags.get(tagName);
Validate.notNull(tag);
tag.canContainBlock = false;
tag.canContainInline = false;
tag.empty = true;
}
for (String tagName : formatAsInlineTags) {
Tag tag = tags.get(tagName);
Validate.notNull(tag);
tag.formatAsBlock = false;
}
for (String tagName : preserveWhitespaceTags) {
Tag tag = tags.get(tagName);
Validate.notNull(tag);
tag.preserveWhitespace = true;
}
for (String tagName : formListedTags) {
Tag tag = tags.get(tagName);
Validate.notNull(tag);
tag.formList = true;
}
for (String tagName : formSubmitTags) {
Tag tag = tags.get(tagName);
Validate.notNull(tag);
tag.formSubmit = true;
}
}
private static void register(Tag tag) {
tags.put(tag.tagName, tag);
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
57a6bd71ad6b09159c1563a96f1f5d8d7e4f44a5 | 62f83097291956fc5168c04e862686b31ccace3e | /M1-Challenge-Louis-Naritchaya/CustomerComposition/src/main/java/com/company/RewardsMembers.java | e5b65270b5d098ab370d1c74ba798affba03bca4 | [] | no_license | NKLouis/Naritchaya_Louis_Java | 8a1cbdec18325b4e548719eb82544dae532e4e5a | d6d225499031391197323f9878f61e7f9c541ded | refs/heads/master | 2023-05-30T15:35:42.522950 | 2021-06-14T08:47:00 | 2021-06-14T08:47:00 | 374,289,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | package com.company;
public class RewardsMembers {
boolean isRewardsMember = true;
boolean isNotRewardMember = false;
public RewardsMembers(boolean isRewardsMember, boolean isNotRewardMember) {
this.isRewardsMember = isRewardsMember;
this.isNotRewardMember = isNotRewardMember;
}
public RewardsMembers() {
}
public boolean isRewardsMember() {
return isRewardsMember;
}
public void setRewardsMember(boolean rewardsMember) {
isRewardsMember = rewardsMember;
}
public boolean isNotRewardMember() {
return isNotRewardMember;
}
public void setNotRewardMember(boolean notRewardMember) {
isNotRewardMember = notRewardMember;
}
@Override
public String toString() {
return "RewardsMembers{" +
"isRewardsMember=" + isRewardsMember +
", isNotRewardMember=" + isNotRewardMember +
'}';
}
} | [
"naritchayalouis@gmail.com"
] | naritchayalouis@gmail.com |
2ec20abc3100cf8879c693a3826885e115629f8d | d5d05394c35981d08de9ab3d09842a8ab4fecdd9 | /newpdas/src/com/app/das/webservices/PDASInit.java | f34427202fe62b5833827e27b965401965b3bac8 | [] | no_license | inviss/sbs | 29d9e8ef86ec39292084ae679a4dcd5b073f7126 | 56699c58b810d1af6908784b2321ec486bb22334 | refs/heads/master | 2020-03-23T21:30:06.190943 | 2016-11-16T04:15:20 | 2016-11-16T04:15:20 | 74,000,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,287 | java | package com.app.das.webservices;
import org.apache.log4j.Logger;
import com.app.das.business.dao.ExternalDAO;
import com.app.das.business.exception.DASException;
/**
* pdas 초기화및 동기화 함수가 정의 되있다
*
*/
public class PDASInit {
private Logger logger = Logger.getLogger(PDASInit.class);
private static PDASInit instance;
private static ExternalDAO externalDAO = ExternalDAO.getInstance();
/**
* 초기화
*
*/
private PDASInit(){
}
/**
* 동기화
*
*/
public static synchronized PDASInit getInstance()
{
if (instance == null)
{
synchronized (PDASInit.class) {
if(instance==null){
instance = new PDASInit();
}
}
}
return instance;
}
/**
* 모든lock을 해제한다
* @throws Exception
*
*/
public void updateLockStatCd() throws Exception{
try
{
externalDAO.updateLockStatCd();
}
catch (DASException e)
{
logger.error(e);
throw e;
}
}
/**
* 초기 실행함수
*
*/
/*
public static void init(){
try {
updateLockStatCd();
} catch (DASException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
*/
}
| [
"mskang0916@7227205d-1f1f-0510-9694-d5d7590fe1ff"
] | mskang0916@7227205d-1f1f-0510-9694-d5d7590fe1ff |
68c8cb970862061332bc5c5ff9d812a929bb1279 | df0089c53c0c9c487770d86d22d773ff0ea639ea | /backend/src/test/java/com/springboot/microservice/soap/ClientLiveTest.java | 7eaa060c813b7bc2efb153f77ef988a60521c12c | [] | no_license | Adnreips/microservice-2 | 0e13e458eced6298cfe8aea9c84a690a041cadd0 | 4056980444aaf0156d54b61ea921f96895e876c7 | refs/heads/master | 2023-04-18T19:46:53.824194 | 2021-05-04T14:26:23 | 2021-05-04T14:26:23 | 358,249,072 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,685 | java | package com.springboot.microservice.soap;
import com.springboot.microservice.CurrencyConversionDto;
import com.springboot.microservice.GetCurrencyConversionDtoResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.math.BigDecimal;
import static org.junit.jupiter.api.Assertions.assertEquals;
@SpringBootTest
class ClientLiveTest {
private final CurrencyConversionDtoClient currencyConversionDtoClient;
private CurrencyConversionDto currencyConversionDto;
@Autowired
public ClientLiveTest(CurrencyConversionDtoClient currencyConversionDtoClient) {
this.currencyConversionDtoClient = currencyConversionDtoClient;
}
@BeforeEach
public void setUp() {
currencyConversionDto = new CurrencyConversionDto();
currencyConversionDto.setId(1L);
currencyConversionDto.setFrom("EUR");
currencyConversionDto.setTo("RUB");
currencyConversionDto.setConversionMultiple(new BigDecimal("1"));
currencyConversionDto.setQuantity(new BigDecimal("1"));
currencyConversionDto.setMultiply(new BigDecimal("0"));
currencyConversionDto.setPort(1);
}
@Test
void givenCurrencyConversionDto() {
GetCurrencyConversionDtoResponse actualResponse = currencyConversionDtoClient.getCurrencyConversionDto(currencyConversionDto);
BigDecimal expectedConversionMultiple = new BigDecimal("85.00");
assertEquals(expectedConversionMultiple, actualResponse.getCurrencyConversionDto().getConversionMultiple());
}
} | [
"109a@mail.ru"
] | 109a@mail.ru |
6c99e45c5b4ea7eae7e387d45889bc9f1e54a98e | c9f242a2b9fde6199220ed9c27a318a91d9440c9 | /src/main/java/com/example/algamoney/api/resource/CategoriaResource.java | 93fc0faf6f34df3988d700c78b08e3bdf76b7ca7 | [] | no_license | paullooabreu/algamoneyapi | 5315d50022d5b475c31980be6df80f9105823218 | 8dfe5db8ea10c3930c54dcee460e995587895308 | refs/heads/master | 2022-06-24T11:59:21.714212 | 2019-09-03T16:35:33 | 2019-09-03T16:35:33 | 205,002,907 | 0 | 0 | null | 2022-06-21T01:46:03 | 2019-08-28T18:58:58 | Java | UTF-8 | Java | false | false | 2,135 | java | package com.example.algamoney.api.resource;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.example.algamoney.api.event.RecursoCriadoEvent;
import com.example.algamoney.api.model.Categoria;
import com.example.algamoney.api.repository.CategoriaRepository;
@RestController
@RequestMapping("/categorias")
public class CategoriaResource {
@Autowired
private CategoriaRepository categoriaRepository;
@Autowired
private ApplicationEventPublisher publisher;
@GetMapping
public List<Categoria> listar() {
// List<Categoria> categorias = categoriaRepository.findAll();
return categoriaRepository.findAll();
// Verificando se está vazio
// !categorias.isEmpty() ? ResponseEntity.ok(categorias) :
// ResponseEntity.noContent().build();
}
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public ResponseEntity<Categoria> criar(@Valid @RequestBody Categoria categoria, HttpServletResponse response) {
Categoria categoriaSalva = categoriaRepository.save(categoria);
publisher.publishEvent(new RecursoCriadoEvent(this, response, categoriaSalva.getCodigo()));
return ResponseEntity.status(HttpStatus.CREATED).body(categoriaSalva);
}
@GetMapping("/{codigo}")
public ResponseEntity<Categoria> buscarPeloCodigo(@PathVariable Long codigo) {
Categoria categoria = categoriaRepository.findOne(codigo);
return categoria != null ? ResponseEntity.ok(categoria) : ResponseEntity.notFound().build();
}
}
| [
"paullooabreu@gmail.com"
] | paullooabreu@gmail.com |
4e92d007488ef7bd80eaf2a14e597b8112b7450b | c9837401a6901a7825ee9fc869489b5452e49c84 | /src/main/java/carrental/view/UserMenu.java | 4b6e49ea6c3c2386640944311bcc3024a4f72131 | [] | no_license | kkk1997/carRental | b2454bb5218e7e48cf013d0d2881bd592a3118b4 | 3521de8031a222fcff9ebab5de224bf51b9660d1 | refs/heads/master | 2020-03-09T07:13:31.437715 | 2018-04-07T10:18:10 | 2018-04-07T10:18:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 675 | java | package carrental.view;
import carrental.service.impl.MessageSourc;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.UI;
public class UserMenu extends MenuBar {
UserMenu() {
this.addItem(MessageSourc.getMessage("user.ActualOffer"), a -> UI.getCurrent().getNavigator().navigateTo("home"));
this.addItem(MessageSourc.getMessage("user.Cars"), a -> UI.getCurrent().getNavigator().navigateTo("carView"));
this.addItem(MessageSourc.getMessage("user.Data"), a -> UI.getCurrent().getNavigator().navigateTo("userDataView"));
this.addItem(MessageSourc.getMessage("user.Exit"), a -> UI.getCurrent().getNavigator().navigateTo("index"));
}
}
| [
"realantrox@gmail.com"
] | realantrox@gmail.com |
2fa8ccc12a6e706e5bda01fd95eee1cd5da9d994 | 0b2822b58fff8e517c2c3e18aae2817d5232ade4 | /app/src/main/java/com/renatonunes/padellog/AddAcademyActivity.java | c067f9c3567c1bbcbe61c35e98df253aeac21337 | [] | no_license | nunesrenato86/PadelLog | 0fc6027113b8679bac63d4ba5733bac17c0b22fc | 8886663d45260ebbd6c944dfa957d2f8f22c2a4b | refs/heads/master | 2020-05-21T19:18:34.881331 | 2017-10-01T02:26:31 | 2017-10-01T02:26:31 | 64,441,469 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 27,590 | java | package com.renatonunes.padellog;
import android.*;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.Switch;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.Places;
import com.google.android.gms.location.places.ui.PlacePicker;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.OnPausedListener;
import com.google.firebase.storage.OnProgressListener;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.renatonunes.padellog.domain.Academy;
import com.renatonunes.padellog.domain.util.AlertUtils;
import com.renatonunes.padellog.domain.util.ImageFactory;
import com.renatonunes.padellog.domain.util.LibraryClass;
import com.renatonunes.padellog.domain.util.PermissionUtils;
import com.renatonunes.padellog.domain.util.PhotoTaker;
import com.squareup.picasso.Picasso;
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog;
import java.io.ByteArrayOutputStream;
import java.io.File;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class AddAcademyActivity extends CommonActivity implements GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener{
//fields
@BindView(R.id.edt_add_academy_name)
EditText edtName;
@BindView(R.id.edt_add_academy_phone)
EditText edtPhone;
@BindView(R.id.edt_add_academy_place)
EditText edtPlace;
@BindView(R.id.edt_add_academy_email)
EditText edtEmail;
@BindView(R.id.switch_academy_verified)
Switch switchVerified;
static final int REQUEST_PLACE_PICKER = 103;
@BindView(R.id.fab_academy_photo_camera)
FloatingActionButton fabMenuAcademyPhoto;
@BindView(R.id.fab_academy_photo_gallery)
FloatingActionButton fabMenuAcademyPhotoGallery;
@BindView(R.id.fab_academy_photo_delete)
FloatingActionButton fabMenuAcademyPhotoDelete;
@BindView(R.id.fab_academy_photo_add)
FloatingActionButton fabMenuAcademyPhotoAdd;
private Boolean isVisible = false;
private final Activity mActivity = this;
private static Academy currentAcademy = null;
private String mCurrentAcademyImageStr = "";
private static Boolean mIsModeReadOnly = true;
private boolean hasPhoto = false;
//to handle place
private LatLng mCurrentLatLng;
//to handle images
@BindView(R.id.img_academy)
ImageView mThumbnailPreview;
private Uri mCurrentPhotoUri;
private PhotoTaker mPhotoTaker;
private Uri downloadUrl;
//google places api
private GoogleApiClient mGoogleApiClient;
private Resources resources;
// private Boolean isFabOnScreen = false;
Animation fabRotateClockwise;
Animation fabRotateAntiClockwise;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_academy);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ButterKnife.setDebug(true);
ButterKnife.bind(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
String permissions[] = new String[]{
android.Manifest.permission.READ_EXTERNAL_STORAGE,
android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
android.Manifest.permission.CAMERA,
};
Boolean ok = PermissionUtils.validate(this, 0, permissions);
if (ok) {
Log.i("RNN", "Permissions OK");
}
}
resources = getResources();
mPhotoTaker = new PhotoTaker(this);
ActionBar actionbar = getSupportActionBar();
actionbar.setDisplayHomeAsUpEnabled(true);
//google places api
mGoogleApiClient = new GoogleApiClient
.Builder(this)
.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
edtPlace.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Construct an intent for the place picker
try {
PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
Intent intent = intentBuilder.build(mActivity);
//intent.putExtra("primary_color", getResources().getColor(R.color.colorPrimary));
//intent.putExtra("primary_color_dark", getResources().getColor(R.color.colorPrimaryDark));
// Start the intent by requesting a result,
// identified by a request code.
startActivityForResult(intent, REQUEST_PLACE_PICKER);
} catch (GooglePlayServicesRepairableException e) {
// ...
} catch (GooglePlayServicesNotAvailableException e) {
// ...
}
}
});
TextWatcher textWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
callClearErrors(s);
}
};
fabRotateClockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_clockwise);
fabRotateAntiClockwise = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_anticlockwise);
updateUI();
}
@OnClick(R.id.fab_academy_photo_add)
public void toggleFabs(){
if (isVisible){
fabMenuAcademyPhotoDelete.animate().scaleY(0).scaleX(0).setDuration(200).start();
fabMenuAcademyPhotoGallery.animate().scaleY(0).scaleX(0).setDuration(200).start();
fabMenuAcademyPhoto.animate().scaleY(0).scaleX(0).setDuration(200).start();
fabMenuAcademyPhotoAdd.startAnimation(fabRotateAntiClockwise);
//fabMenuChampionshipPhotoAdd.animate().rotationY(25).setDuration(200).start();
}else{
fabMenuAcademyPhotoDelete.animate().scaleY(1).scaleX(1).setDuration(200).start();
fabMenuAcademyPhotoGallery.animate().scaleY(1).scaleX(1).setDuration(200).start();
fabMenuAcademyPhoto.animate().scaleY(1).scaleX(1).setDuration(200).start();
fabMenuAcademyPhotoAdd.startAnimation(fabRotateClockwise);
//fabMenuChampionshipPhotoAdd.animate().rotationY(0).setDuration(200).start();
}
isVisible = !isVisible;
}
@Override
protected void onDestroy() {
super.onDestroy();
currentAcademy = null;
}
private void updateUI(){
if (mIsModeReadOnly){
switchVerified.setVisibility(View.GONE);
}else{
switchVerified.setVisibility(View.VISIBLE);
}
fabMenuAcademyPhotoDelete.animate().scaleY(0).scaleX(0).setDuration(0).start();
fabMenuAcademyPhotoGallery.animate().scaleY(0).scaleX(0).setDuration(0).start();
fabMenuAcademyPhoto.animate().scaleY(0).scaleX(0).setDuration(0).start();
if (currentAcademy != null){
if (currentAcademy.getPhotoUriDownloaded() != null) {
Picasso.with(getApplicationContext()).load(currentAcademy.getPhotoUriDownloaded().toString()).into(mThumbnailPreview);
hasPhoto = true;
}else if (currentAcademy.isImgFirebase()) {
hasPhoto = true;
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference httpsReference = storage.getReferenceFromUrl(currentAcademy.getPhotoUrl());
httpsReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
Picasso.with(getApplicationContext()).load(uri.toString()).into(mThumbnailPreview);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});
}else {
deletePhoto();
}
edtName.setText(currentAcademy.getName());
edtPhone.setText(currentAcademy.getPhone());
edtPlace.setText(currentAcademy.getPlace());
edtEmail.setText(currentAcademy.getEmail());
switchVerified.setChecked(currentAcademy.getVerified());
}
}
@OnClick(R.id.fab_academy_photo_delete)
public void deletePhoto(){
toggleFabs();
hasPhoto = false;
mCurrentAcademyImageStr = "";
mThumbnailPreview.setImageBitmap(null);
mThumbnailPreview.setBackgroundResource(R.drawable.no_photo);
}
@OnClick(R.id.fab_academy_photo_camera)
public void takePhoto(View view){
if (isVisible){
File placeholderFile = ImageFactory.newFile();
mCurrentPhotoUri = Uri.fromFile(placeholderFile);
if (!mPhotoTaker.takePhoto(placeholderFile, this)) {
displayPhotoError();
}
};
toggleFabs();
}
@OnClick(R.id.fab_academy_photo_gallery)
public void pickPhoto(View view){
toggleFabs();
File placeholderFile = ImageFactory.newFile();
mCurrentPhotoUri = Uri.fromFile(placeholderFile);
if (!mPhotoTaker.pickPhoto(placeholderFile)) {
displayPhotoError();
}
}
private void previewCapturedImage() {
BitmapFactory.Options options = new BitmapFactory.Options();
// downsizing image as it throws OutOfMemory Exception for larger
// images
//options.inSampleSize = 8;
String picturePath = mCurrentPhotoUri.getPath();
if (ImageFactory.imgIsLarge(mCurrentPhotoUri)) {
//options.inSampleSize = 8;
ImageFactory.mContext = this;
picturePath = ImageFactory.compressImage(picturePath);
mCurrentPhotoUri = Uri.parse(picturePath);
}
Bitmap bitmap = BitmapFactory.decodeFile(picturePath, options);
mThumbnailPreview.setImageBitmap(bitmap);
hasPhoto = true;
}
private void previewPickedImage(Intent data){
Uri selectedImage = data.getData();
String[] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
mCurrentPhotoUri = Uri.parse(picturePath);
BitmapFactory.Options options = new BitmapFactory.Options();
if (ImageFactory.imgIsLarge(mCurrentPhotoUri)) {
//options.inSampleSize = 8;
ImageFactory.mContext = this;
picturePath = ImageFactory.compressImage(picturePath);
mCurrentPhotoUri = Uri.parse(picturePath);
}
mThumbnailPreview.setImageBitmap(BitmapFactory.decodeFile(picturePath, options));
hasPhoto = true;
}
private void displayPhotoError() {
Snackbar.make(fabMenuAcademyPhoto,
resources.getString(R.string.msg_error_img_file),
Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == PhotoTaker.REQUEST_TAKE_PHOTO) {
if (resultCode == RESULT_OK) {
previewCapturedImage();
//storeImageToFirebase();
} else if (resultCode == RESULT_CANCELED) {
// Toast.makeText(getApplicationContext(),
// "User cancelled image capture", Toast.LENGTH_SHORT)
// .show();
} else {
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_photo_erros));
}
}else if (requestCode == PhotoTaker.REQUEST_PICK_PHOTO){
if (resultCode == RESULT_OK) {
previewPickedImage(data);
} else if (resultCode == RESULT_CANCELED) {
// Toast.makeText(getApplicationContext(),
// "User cancelled image capture", Toast.LENGTH_SHORT)
// .show();
} else {
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_photo_erros));
}
}else if (requestCode == REQUEST_PLACE_PICKER
&& resultCode == Activity.RESULT_OK) {
// The user has selected a place. Extract the name and address.
final Place place = PlacePicker.getPlace(data, this);
final CharSequence name = place.getName();
final CharSequence phone = place.getPhoneNumber();
final CharSequence address = place.getAddress();
mCurrentLatLng = place.getLatLng();
//String attributions = PlacePicker.getAttributions(data);
// if (attributions == null) {
// attributions = "";
// }
// edtPlace.setText(name + " " + address + " " + Html.fromHtml(attributions));
//edtPlace.setText(address + " " + Html.fromHtml(attributions));
edtPlace.setText(address);
edtPlace.setError(null);
if (!name.equals("")){
edtName.setText(name);
edtName.setError(null);
}
if (!phone.equals("")){
edtPhone.setText(phone);
edtPhone.setError(null);
}
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
public void uploadPhotoAndSaveToDB(){
//FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
//if (user != null) {
Boolean isNewAcademy = false;
if (currentAcademy == null) { //not editing
isNewAcademy = true;
currentAcademy = new Academy();
}
currentAcademy.setName(edtName.getText().toString());
currentAcademy.setPhone(edtPhone.getText().toString());
currentAcademy.setEmail(edtEmail.getText().toString());
currentAcademy.setPlace(edtPlace.getText().toString());
currentAcademy.setVerified(switchVerified.isChecked());
if (mCurrentLatLng != null){
currentAcademy.setLat(mCurrentLatLng.latitude);
currentAcademy.setLng(mCurrentLatLng.longitude);
}
if (mCurrentPhotoUri != null) {
BitmapFactory.Options options = new BitmapFactory.Options();
//if (ImageFactory.imgIsLarge(mCurrentPhotoUri)) {
// options.inSampleSize = 8; // shrink it down otherwise we will use stupid amounts of memory
//}
Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoUri.getPath(), options);
if (bitmap != null) { //when user cancel the action and click in save
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 70, baos);
byte[] bytes = baos.toByteArray();
FirebaseStorage storage = FirebaseStorage.getInstance();
// Create a storage reference from our app
StorageReference storageRef = storage.getReferenceFromUrl("gs://padellog-b49b1.appspot.com");
String Id = "images/academies/";
if (currentAcademy.getId() == null){
DatabaseReference firebase = FirebaseDatabase.getInstance().getReference();
String academyId = firebase.child("academies").push().getKey();
currentAcademy.setId(academyId);
}
Id = Id.concat(currentAcademy.getId()).concat(".jpg");
StorageReference playersRef = storageRef.child(Id);
final ProgressDialog progressDialog = new ProgressDialog(this);
//progressDialog.setTitle(getResources().getString(R.string.photo_processing));
progressDialog.show();
UploadTask uploadTask = playersRef.putBytes(bytes);
final boolean finalIsNewAcademy = isNewAcademy;
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
progressDialog.dismiss();
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
progressDialog.dismiss();
// taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
downloadUrl = taskSnapshot.getDownloadUrl();
currentAcademy.setPhotoUrl(downloadUrl.toString());
if (finalIsNewAcademy) {
currentAcademy.saveDB();
}else{
currentAcademy.updateDB();
}
//AcademyInfoActivity.currentAcademy = currentAcademy;
//AcademyInfoActivity.currentAcademy.setPhotoUriDownloaded(downloadUrl);
AcademyListActivity.mNeedToRefreshData = true;
if (mIsModeReadOnly){
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_academy_saved_temp)
);
}else{
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_academy_saved)
);
}
}
});
uploadTask.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {
@Override
public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {
double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();
Log.e("RNN", ((int)progress + "% " + getResources().getString(R.string.photo_complete)));
progressDialog.setMessage(getResources().getString(R.string.msg_saving));
}
}).addOnPausedListener(new OnPausedListener<UploadTask.TaskSnapshot>() {
@Override
public void onPaused(UploadTask.TaskSnapshot taskSnapshot) {
progressDialog.dismiss();
}
});
}else{
//saveAcademyWithoutPhoto(isNewAcademy);
showSnackbar(fabMenuAcademyPhoto, getResources().getString(R.string.msg_academy_need_photo));
}
}else {
if (!mIsModeReadOnly){
saveAcademyWithoutPhoto(isNewAcademy);
}else
showSnackbar(fabMenuAcademyPhoto, getResources().getString(R.string.msg_academy_need_photo));
}
//}
}
private void saveAcademyWithoutPhoto(Boolean isNew){
//currentAcademy.setImageStr(mCurrentChampionshipImageStr);
if (!hasPhoto) {
currentAcademy.setPhotoUrl(null);
currentAcademy.setPhotoUriDownloaded(null);
}
if (isNew) {
currentAcademy.saveDB();
}else{
currentAcademy.updateDB();
}
//AcademyInfoActivity.currentAcademy = currentAcademy;
AcademyListActivity.mNeedToRefreshData = true;
if (mIsModeReadOnly){
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_academy_saved_temp)
);
}else{
showSnackbar(fabMenuAcademyPhoto,
getResources().getString(R.string.msg_academy_saved)
);
}
}
public void saveAcademy(){
if (LibraryClass.isNetworkActive(this)) {
uploadPhotoAndSaveToDB();
}else{
showSnackbar(fabMenuAcademyPhoto, getResources().getString(R.string.msg_no_internet) );
}
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}
@Override
public void onConnected(@Nullable Bundle bundle) {
Log.d("RNN", "connected");
}
@Override
public void onConnectionSuspended(int i) {
Log.d("RNN", "supended");
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
Log.d("RNN", "failed");
}
public static void start(Context c, Academy academy, Boolean isReadOnly) {
// mNeedToRefreshData = true;
mIsModeReadOnly = isReadOnly;
currentAcademy = academy;
c.startActivity(new Intent(c, AddAcademyActivity.class));
}
// public static void start(Context c,
// Academy academy) {
// currentAcademy = academy;
//
// c.startActivity(new Intent(c, AddAcademyActivity.class));
// }
private void callClearErrors(Editable s) {
if (!s.toString().isEmpty()) {
clearErrorFields(edtName);
}
}
private Boolean validateFields() {
String name = edtName.getText().toString().trim();
String phone = edtPhone.getText().toString().trim();
String email = edtEmail.getText().toString().trim();
String place = edtPlace.getText().toString().trim();
return (!isEmptyFields(name,
phone,
email,
place));
// && hasSizeValid(set1Score1, set1Score2));
}
private Boolean isEmptyFields(String name,
String phone,
String email,
String place) {
if (TextUtils.isEmpty(name)) {
edtName.requestFocus();
edtName.setError(resources.getString(R.string.msg_field_required));
return true;
} else if (TextUtils.isEmpty(place)) {
edtPlace.requestFocus();
edtPlace.setError(resources.getString(R.string.msg_field_required));
return true;
} else if (TextUtils.isEmpty(phone)) {
edtPhone.requestFocus();
edtPhone.setError(resources.getString(R.string.msg_field_required));
return true;
// } else if (TextUtils.isEmpty(email)) {
// edtEmail.requestFocus();
// edtEmail.setError(resources.getString(R.string.msg_field_required));
// return true;
}
return false;
}
private void clearErrorFields(EditText... editTexts) {
for (EditText editText : editTexts) {
editText.setError(null);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
for (int result : grantResults) {
if (result == getPackageManager().PERMISSION_DENIED) {
AlertUtils.alert(this,
R.string.app_name,
R.string.msg_alert_permission,
R.string.msg_alert_OK,
new Runnable() {
@Override
public void run() {
finish();
}
});
return;
}
}
//OK can use storage and camera
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_add_activity, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_save) {
if (validateFields()) {
saveAcademy();
}
return true;
}else if (id == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"nunesrenato86@gmail.com"
] | nunesrenato86@gmail.com |
219516c74f0c8a56321c7e6df3a61e5295979316 | 1e708e4a1023e8fb9e66bed3e98d0b7969ad30da | /app/src/main/vysor/android/support/v7/app/TwilightCalculator.java | a1678e4f39acf66a5b509bb982314acf175af314 | [] | no_license | wjfsanhe/Vysor-Research | c139a2120bcf94057fc1145ff88bd9f6aa443281 | f0b6172b9704885f95466a7e99f670fae760963f | refs/heads/master | 2020-03-31T16:23:18.137882 | 2018-12-11T07:35:31 | 2018-12-11T07:35:31 | 152,373,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,487 | java | //
// Decompiled by Procyon v0.5.30
//
package android.support.v7.app;
class TwilightCalculator
{
private static final float ALTIDUTE_CORRECTION_CIVIL_TWILIGHT = -0.10471976f;
private static final float C1 = 0.0334196f;
private static final float C2 = 3.49066E-4f;
private static final float C3 = 5.236E-6f;
public static final int DAY = 0;
private static final float DEGREES_TO_RADIANS = 0.017453292f;
private static final float J0 = 9.0E-4f;
public static final int NIGHT = 1;
private static final float OBLIQUITY = 0.4092797f;
private static final long UTC_2000 = 946728000000L;
private static TwilightCalculator sInstance;
public int state;
public long sunrise;
public long sunset;
static TwilightCalculator getInstance() {
if (TwilightCalculator.sInstance == null) {
TwilightCalculator.sInstance = new TwilightCalculator();
}
return TwilightCalculator.sInstance;
}
public void calculateTwilight(final long n, final double n2, final double n3) {
final float n4 = (n - 946728000000L) / 8.64E7f;
final float n5 = 6.24006f + 0.01720197f * n4;
final double n6 = 3.141592653589793 + (1.796593063 + (n5 + 0.03341960161924362 * Math.sin(n5) + 3.4906598739326E-4 * Math.sin(2.0f * n5) + 5.236000106378924E-6 * Math.sin(3.0f * n5)));
final double n7 = -n3 / 360.0;
final double n8 = n7 + (9.0E-4f + Math.round(n4 - 9.0E-4f - n7)) + 0.0053 * Math.sin(n5) + -0.0069 * Math.sin(2.0 * n6);
final double asin = Math.asin(Math.sin(n6) * Math.sin(0.4092797040939331));
final double n9 = n2 * 0.01745329238474369;
final double n10 = (Math.sin(-0.10471975803375244) - Math.sin(n9) * Math.sin(asin)) / (Math.cos(n9) * Math.cos(asin));
if (n10 >= 1.0) {
this.state = 1;
this.sunset = -1L;
this.sunrise = -1L;
}
else if (n10 <= -1.0) {
this.state = 0;
this.sunset = -1L;
this.sunrise = -1L;
}
else {
final float n11 = (float)(Math.acos(n10) / 6.283185307179586);
this.sunset = 946728000000L + Math.round(8.64E7 * (n8 + n11));
this.sunrise = 946728000000L + Math.round(8.64E7 * (n8 - n11));
if (this.sunrise < n && this.sunset > n) {
this.state = 0;
}
else {
this.state = 1;
}
}
}
}
| [
"903448239@qq.com"
] | 903448239@qq.com |
3fb774584852e3cc156c9b1915fca6a716b72b46 | fc1eeb54eb9b4e8efb1070c92b933232268b0210 | /app/src/main/java/tk/manuelml/www/mycontrol/MainActivity.java | 6b283330bef01577500580e21eac44d390b2dca8 | [] | no_license | manuelmlo/MyControl2 | e60c9071faee3b64602581b217159cbb4533a104 | 3047f04ee39952d762d337672d31becb0e8350a0 | refs/heads/master | 2021-01-10T07:53:55.300777 | 2015-11-05T18:29:57 | 2015-11-05T18:29:57 | 45,630,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,784 | java | package tk.manuelml.www.mycontrol;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"manuelmanzanolopez@gmail.com"
] | manuelmanzanolopez@gmail.com |
3da419a6cf13de08920dcb5b7053ddfa0c6c019e | 471b3e4d9d9e6128383da45f0479e9c560b4ef70 | /logistics-manager/logistics-manager-service/src/main/java/com/zz/service/IUserService.java | e42f72e99658d967c3f447ea04ccdd05fcd469de | [] | no_license | kitakuras/logistics | 0278557d577bab8e909f80a2364bcb4451d98137 | a2d67ea3a151cc84584e250e23489049a884040b | refs/heads/master | 2022-12-26T12:51:38.236492 | 2019-06-29T09:03:13 | 2019-06-29T09:03:13 | 193,028,703 | 0 | 0 | null | 2022-12-16T10:31:58 | 2019-06-21T04:09:18 | Java | UTF-8 | Java | false | false | 730 | java | package com.zz.service;
import java.util.List;
import com.github.pagehelper.PageInfo;
import com.zz.dto.UserDto;
import com.zz.pojo.Role;
import com.zz.pojo.User;
public interface IUserService {
public List<User> query(User user);
public Integer addUser(User user);
public Integer updateUser(User user);
public Integer deleteUser(Integer id);
public User queryById(Integer id);
public List<Role> queryRole();
public Integer saveUserAndRole(UserDto dto);
public List<Role> queryRoleByUserId(Integer userId);
public UserDto getUpdateInfo(Integer userId);
public void updateUserAndRole(UserDto dto);
public PageInfo<User> queryUserByPage(UserDto dto);
public List<User> queryRole(String roleYwy);
}
| [
"371820637@qq.com"
] | 371820637@qq.com |
4b50cac4115eb3dc20c37be4645606a823fd2eca | 6a123b6cf379a555cc68e92d0d640380133d0ea5 | /custom/gpcommerce/gpcommercefulfilmentprocess/testsrc/com/gp/commerce/fulfilmentprocess/test/actions/consignmentfulfilment/AbstractTestConsActionTemp.java | af49875f5ec7253faacfa72058bc0fdb752e9327 | [] | no_license | Myzenvei/Docs | c9357221bc306dc754b322350fc676dee1972e39 | 45809ee928669142073354e1126e7444dedd4730 | refs/heads/master | 2020-06-30T17:23:52.981874 | 2019-07-15T09:39:19 | 2019-07-15T09:39:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,435 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package com.gp.commerce.fulfilmentprocess.test.actions.consignmentfulfilment;
import de.hybris.platform.processengine.model.BusinessProcessModel;
import com.gp.commerce.fulfilmentprocess.constants.GpcommerceFulfilmentProcessConstants;
import com.gp.commerce.fulfilmentprocess.test.actions.TestActionTemp;
import org.apache.log4j.Logger;
/**
*
*/
public abstract class AbstractTestConsActionTemp extends TestActionTemp
{
private static final Logger LOG = Logger.getLogger(AbstractTestConsActionTemp.class);
@Override
public String execute(final BusinessProcessModel process) throws Exception //NOPMD
{
//getQueueService().actionExecuted(getParentProcess(process), this);
LOG.info(getResult());
return getResult();
}
public BusinessProcessModel getParentProcess(final BusinessProcessModel process)
{
final String parentCode = (String) getProcessParameterValue(process, GpcommerceFulfilmentProcessConstants.PARENT_PROCESS);
return getBusinessProcessService().getProcess(parentCode);
}
}
| [
"shikhgupta@deloitte.com"
] | shikhgupta@deloitte.com |
ec4d6ba8da78bf198c7fd6c23c378ee65202a30d | 039bd544d1ed35410a74741822c9e5126e1c1020 | /src/test/java/MusicShop/Instruments/DrumsTest.java | 09eed0eb4629ffb214541c3f1d7e7e253b4d3d8a | [] | no_license | helenosheaa/music_shop | 9bc41a6fc0bb0355494e689f15c5d05cbe1a7f27 | 7f0e5d728aa1378e36abd63ce4a2fcff1d840f6c | refs/heads/master | 2020-03-22T11:19:07.928854 | 2018-07-08T10:54:00 | 2018-07-08T10:54:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,149 | java | package MusicShop.Instruments;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class DrumsTest {
Drums drums;
@Before
public void before(){
drums = new Drums("Grey", "Metal", InstrumentType.PERCUSSION, 5, 55.99, 100.99);
}
@Test
public void canGetColour(){
assertEquals("Grey", drums.getColour());
}
@Test
public void canGetMaterial(){
assertEquals("Metal", drums.getMaterial());
}
@Test
public void canGetType(){
assertEquals("Percussion", drums.getInstrumentType());
}
@Test
public void canGetSizeOfSet(){
assertEquals(5, drums.getSizeOfSet());
}
@Test
public void canMakeNoise(){
assertEquals("Ra tat tat", drums.makeNoise("Ra tat tat"));
}
@Test
public void canGetCostPrice(){
assertEquals(55.99, drums.getCostPrice(), 0.01);
}
@Test
public void canGetSellPrice(){
assertEquals(100.99, drums.getSellPrice(), 0.01);
}
@Test
public void canGetMarkUp(){
assertEquals(45.00, drums.calculateMarkUp(), 0.01);
}
} | [
"helenosheaa@gmail.com"
] | helenosheaa@gmail.com |
a18a1973675643ffe14aadf89915d4f12dcccbcd | 188ca755414aed77187af58f0614e1faed9a04c4 | /projeto-financeiro-LP3A5/src/main/java/br/com/projetofinanceiro/model/Pessoa.java | 402af0da91a3be157a1a8ed82560b116c0562e7d | [] | no_license | GuilhermeSantosJS/ProjetosJava | 7f4c189a505ccfa3efedf45bd8c53d4adea78bf7 | 593c5d5f462265e3257e37c26bac3198a9a73e39 | refs/heads/master | 2023-03-23T10:50:08.578953 | 2021-03-15T00:26:28 | 2021-03-15T00:26:28 | 335,533,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,225 | java | package br.com.projetofinanceiro.model;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Email;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
public class Pessoa implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@NotNull(message = "Nome não pode ser nulo")
@NotEmpty(message = "Nome não pode ser vazio")
private String nome;
@NotNull(message = "Sobrenome não pode ser nulo")
@NotEmpty(message = "Sobrenome não pode ser vazio")
private String sobrenome;
@Min(value = 18, message = "Idade inválida")
private int idade;
@OneToMany(mappedBy = "pessoa", orphanRemoval = true, cascade = CascadeType.ALL)
private List<Telefone> telefones;
@OneToMany(mappedBy = "pessoa", orphanRemoval = true, cascade = CascadeType.ALL)
private List<Emails> emails;
@OneToMany(mappedBy = "pessoa", orphanRemoval = true, cascade = CascadeType.ALL)
private List<Despesas> despesas;
@OneToMany(mappedBy = "pessoa", orphanRemoval = true, cascade = CascadeType.ALL)
private List<Receitas> receitas;
@OneToMany(mappedBy = "pessoa", orphanRemoval = true, cascade = CascadeType.ALL)
private List<Transacoes> transacoes;
public List<Transacoes> getTransacoes() {
return transacoes;
}
public void setTransacoes(List<Transacoes> transacoes) {
this.transacoes = transacoes;
}
public List<Receitas> getReceitas() {
return receitas;
}
public void setReceitas(List<Receitas> receitas) {
this.receitas = receitas;
}
public List<Despesas> getDespesas() {
return despesas;
}
public void setDespesas(List<Despesas> despesas) {
this.despesas = despesas;
}
public List<Emails> getEmails() {
return emails;
}
public void setEmails(List<Emails> emails) {
this.emails = emails;
}
@ManyToOne
private Profissao profissao;
@Enumerated(EnumType.STRING)
private Cargo cargo;
public Cargo getCargo() {
return cargo;
}
public void setCargo(Cargo cargo) {
this.cargo = cargo;
}
private String sexopessoa;
public Profissao getProfissao() {
return profissao;
}
public void setProfissao(Profissao profissao) {
this.profissao = profissao;
}
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Temporal(TemporalType.DATE)
private Date dataNascimento;
public byte[] getCurriculo() {
return curriculo;
}
public void setCurriculo(byte[] curriculo) {
this.curriculo = curriculo;
}
@Lob
private byte[] curriculo;
private String nomeFileCurriculo;
private String tipoFileCurriculo;
public String getNomeFileCurriculo() {
return nomeFileCurriculo;
}
public void setNomeFileCurriculo(String nomeFileCurriculo) {
this.nomeFileCurriculo = nomeFileCurriculo;
}
public String getTipoFileCurriculo() {
return tipoFileCurriculo;
}
public void setTipoFileCurriculo(String tipoFileCurriculo) {
this.tipoFileCurriculo = tipoFileCurriculo;
}
public Date getDataNascimento() {
return dataNascimento;
}
public void setDataNascimento(Date dataNascimento) {
this.dataNascimento = dataNascimento;
}
private String cep;
private String rua;
private String bairro;
private String cidade;
private String uf;
private String ibge;
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
public String getRua() {
return rua;
}
public String getSexopessoa() {
return sexopessoa;
}
public void setSexopessoa(String sexopessoa) {
this.sexopessoa = sexopessoa;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getBairro() {
return bairro;
}
public void setBairro(String bairro) {
this.bairro = bairro;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getUf() {
return uf;
}
public void setUf(String uf) {
this.uf = uf;
}
public String getIbge() {
return ibge;
}
public void setIbge(String ibge) {
this.ibge = ibge;
}
public List<Telefone> getTelefones() {
return telefones;
}
public void setTelefones(List<Telefone> telefones) {
this.telefones = telefones;
}
public Long getId() {
return id;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getSobrenome() {
return sobrenome;
}
public void setSobrenome(String sobrenome) {
this.sobrenome = sobrenome;
}
}
| [
"santos.g@aluno.ifsp.edu.br"
] | santos.g@aluno.ifsp.edu.br |
1cf4eb9cf90ddc88a9aafa3b87587467f5d00259 | 53fb360cc6060171381b87299581da79ce7acdb9 | /jdbm/src/main/java/jdbm/recman/FreePhysicalRowIdPage.java | 7d9b9046f24060f4c1f354051c38f0da6f169d8b | [
"BSD-3-Clause",
"LicenseRef-scancode-jdbm-1.00"
] | permissive | kevsmith/JDBM | 16ea2fd24e677da6f5d808b4f2c84d2053134518 | 4920c75f2037b10240325f98eb5a5c566b33483d | refs/heads/master | 2021-01-18T03:24:12.605993 | 2009-05-15T07:52:21 | 2009-05-15T07:52:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,713 | java | /**
* JDBM LICENSE v1.00
*
* Redistribution and use of this software and associated documentation
* ("Software"), with or without modification, are permitted provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain copyright
* statements and notices. Redistributions must also contain a
* copy of this document.
*
* 2. Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. The name "JDBM" must not be used to endorse or promote
* products derived from this Software without prior written
* permission of Cees de Groot. For written permission,
* please contact cg@cdegroot.com.
*
* 4. Products derived from this Software may not be called "JDBM"
* nor may "JDBM" appear in their names without prior written
* permission of Cees de Groot.
*
* 5. Due credit should be given to the JDBM Project
* (http://jdbm.sourceforge.net/).
*
* THIS SOFTWARE IS PROVIDED BY THE JDBM PROJECT AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESSED 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
* CEES DE GROOT OR ANY 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.
*
* Copyright 2000 (C) Cees de Groot. All Rights Reserved.
* Contributions are Copyright (C) 2000 by their associated contributors.
*
* $Id: FreePhysicalRowIdPage.java,v 1.4 2006/06/01 13:13:15 thompsonbry Exp $
*/
package jdbm.recman;
/**
* Class describing a page that holds physical rowids that were freed.
*/
final class FreePhysicalRowIdPage extends PageHeader {
// offsets
private static final short O_COUNT = PageHeader.SIZE; // short count
static final short O_FREE = O_COUNT + Magic.SZ_SHORT;
static final short ELEMS_PER_PAGE =
(RecordFile.BLOCK_SIZE - O_FREE) / FreePhysicalRowId.SIZE;
/**
* Used to place a limit on the wasted capacity resulting in a modified
* first fit policy for re-allocated of free records. This value is the
* maximum first fit waste that is accepted when scanning the available
* slots on a given page of the free physical row page list.
*/
static public final transient int wasteMargin = 128;
/**
* Used to place a limit on the wasted capacity resulting in a modified
* first fit policy for re-allocated of free records. This value is the
* upper bound of waste that is accepted before scanning another page on the
* free physical row page list. If no page can be found whose waste for the
* re-allocation request would be less than this value then a new page will
* be allocated and the requested physical row will be allocated from that
* new page.
*/
static public final transient int wasteMargin2 = PageHeader.SIZE/4;
// slots we returned.
FreePhysicalRowId[] slots = new FreePhysicalRowId[ELEMS_PER_PAGE];
/**
* Constructs a data page view from the indicated block.
*/
FreePhysicalRowIdPage(BlockIo block) {
super(block);
}
/**
* Factory method to create or return a data page for the
* indicated block.
*/
static FreePhysicalRowIdPage getFreePhysicalRowIdPageView(BlockIo block) {
BlockView view = block.getView();
if (view != null && view instanceof FreePhysicalRowIdPage)
return (FreePhysicalRowIdPage) view;
else
return new FreePhysicalRowIdPage(block);
}
/** Returns the number of free rowids */
short getCount() {
return block.readShort(O_COUNT);
}
/** Sets the number of free rowids */
private void setCount(short i) {
block.writeShort(O_COUNT, i);
}
/** Frees a slot */
void free(int slot) {
get(slot).setSize(0);
setCount((short) (getCount() - 1));
}
/** Allocates a slot */
FreePhysicalRowId alloc(int slot) {
setCount((short) (getCount() + 1));
return get(slot);
}
/** Returns true if a slot is allocated */
boolean isAllocated(int slot) {
return get(slot).getSize() != 0;
}
/** Returns true if a slot is free */
boolean isFree(int slot) {
return !isAllocated(slot);
}
/** Returns the value of the indicated slot */
FreePhysicalRowId get(int slot) {
if (slots[slot] == null) {
slots[slot] = new FreePhysicalRowId(block, slotToOffset(slot));
}
return slots[slot];
}
/** Converts slot to offset */
short slotToOffset(int slot) {
return (short) (O_FREE +
(slot * FreePhysicalRowId.SIZE));
}
/**
* Returns first free slot, -1 if no slots are available
*/
int getFirstFree() {
for (int i = 0; i < ELEMS_PER_PAGE; i++) {
if (isFree(i))
return i;
}
return -1;
}
/**
* Returns first slot with available size >= indicated size,
* or -1 if no slots are available.
*
* @param size The requested allocation size.
**/
int getFirstLargerThan(int size) {
/*
* Tracks slot of the smallest available physical row on the page.
*/
int bestSlot = -1;
/*
* Tracks size of the smallest available physical row on the page.
*/
int bestSlotSize = 0;
/*
* Scan each slot in the page.
*/
for (int i = 0; i < ELEMS_PER_PAGE; i++) {
/*
* When large allocations are used, the space wasted by the first
* fit policy can become very large (25% of the store). The first
* fit policy has been modified to only accept a record with a
* maximum amount of wasted capacity given the requested allocation
* size.
*/
// Note: isAllocated(i) is equiv to get(i).getSize() != 0
long theSize = get(i).getSize(); // capacity of this free record.
long waste = theSize - size; // when non-negative, record has suf. capacity.
if( waste >= 0 ) {
if( waste < wasteMargin ) {
return i; // record has suf. capacity and not too much waste.
} else if( bestSlotSize >= size ) {
/*
* This slot is a better fit that any that we have seen so
* far on this page so we update the slot# and available
* size for that slot.
*/
bestSlot = i;
bestSlotSize = size;
}
}
}
if( bestSlot != -1 ) {
/*
* An available slot was identified that is large enough, but it
* exceeds the first wasted capacity limit. At this point we check
* to see whether it is under our second wasted capacity limit. If
* it is, then we return that slot.
*/
long waste = bestSlotSize - size; // when non-negative, record has suf. capacity.
if( waste >= 0 && waste < wasteMargin2 ) {
// record has suf. capacity and not too much waste.
return bestSlot;
}
/*
* Will scan next page on the free physical row page list.
*/
}
return -1;
}
}
| [
"Cees de Groot@l-lwr308207.(none)"
] | Cees de Groot@l-lwr308207.(none) |
b51b4aea79135a17732c349731db3955d8ea58e6 | 8969bf1a8f9efd6071f44d312c34c396e5c0d279 | /src/examples/org/apache/hadoop/examples/pagerank/RankReduceCacheSwitch.java | cf655387da31929105d92791e45d06b7c3df435b | [] | no_license | jarajapu/haloop | 3511c7e3f4e1551a399b76ec14fe4e0018964d9a | d4ffe32d64b74dc29293a4530d245b0d518a64b2 | refs/heads/master | 2020-05-28T07:21:44.240691 | 2013-03-18T04:20:29 | 2013-03-18T04:20:29 | 8,846,860 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package org.apache.hadoop.examples.pagerank;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.iterative.LoopReduceCacheSwitch;
import org.apache.hadoop.mapred.iterative.Step;
public class RankReduceCacheSwitch implements LoopReduceCacheSwitch {
@Override
public boolean isCacheWritten(JobConf conf, int iteration, int step) {
if (step == 0 && iteration == 0)
return true;
else
return false;
}
@Override
public boolean isCacheRead(JobConf conf, int iteration, int step) {
if (step == 0 && iteration > 0)
return true;
else
return false;
}
@Override
public Step getCacheStep(JobConf conf, int iteration, int step) {
return new Step(0, 0);
}
}
| [
"uday.jarajapu@opower.com"
] | uday.jarajapu@opower.com |
e664e6373e6c735ce804eccc1f476ecfd84f840d | 8f8e4c8f3e579e9498ba99450dcb3ddf51ecf13f | /src/main/java/com/springapp/mvc/msg/ObtainMsgInfo.java | 7e27c2cb1a3b8c9528e4ea131bfe75d9ee677978 | [] | no_license | cruiserdou/equity | f0de4a6e91e5fe41e84de931903536fa7716e3e8 | 539e9488eb6ddede22d30d5c578f86d87eec8d4a | refs/heads/master | 2020-05-30T20:16:05.184816 | 2015-09-17T00:30:00 | 2015-09-17T00:30:00 | 35,806,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,081 | java | package com.springapp.mvc.msg;
/**
* Created by xwq on 14-4-15.
*/
import com.xwq.common.model.DataShop;
import com.xwq.common.util.ConvertToList;
import com.xwq.common.util.DBInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpSession;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("/obtain_msg_info")
public class ObtainMsgInfo {
@RequestMapping(method = RequestMethod.POST)
public
@ResponseBody
DataShop getShopInJSON(
HttpSession session,
@RequestParam(value = "stat", required = false) String stat,
@RequestParam(value = "user_name", required = false) String user_name
) throws Exception{
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
DataShop dataShop = new DataShop();
List list = new ArrayList();
int user_id =Integer.parseInt(session.getAttribute("id").toString());
try{
Class.forName("org.postgresql.Driver").newInstance();
}catch (Exception e){
System.out.print(e.getMessage());
}
DBInfo connstr = new DBInfo();
String url = connstr.getUrl();
String user = connstr.getUser();
String password = connstr.getPassword();
try{
conn = DriverManager.getConnection(url, user, password);
stmt = conn.createStatement();
String sql = "select id, user_id, (select name from work.users where id =user_id ) as user_name, ruser_id," +
" TO_CHAR(deadline,'yyyy-mm-dd hh24:mi:ss') as deadline, content, stat, remark, TO_CHAR(rtdate,'yyyy-mm-dd hh24:mi:ss') as rtdate, \n" +
" case when user_id="+user_id+" then '发送' else '接收' end as type \n" +
" from work.tb_msg WHERE (ruser_id ="+user_id+" or user_id ="+user_id+") ";
if (stat != null && stat.length() != 0)
sql += " and stat like '%" + stat + "%'";
if (user_name != null && user_name.length() != 0)
sql += " and user_id in (select id from work.users where name like '%" + user_name + "%')";
sql += " order by rtdate desc ";
rs = stmt.executeQuery(sql);
list = new ConvertToList().convertList(rs);
}catch (SQLException e){
System.out.print(e.getMessage());
}finally {
try{
if (rs != null) rs.close();
if (stmt != null) stmt.close();
if (conn != null) conn.close();
}catch (SQLException e){
System.out.print(e.getMessage());
}
}
dataShop.setSuccess(true);
dataShop.setList(list);
return dataShop;
}
} | [
"jiangjiang2366@163.com"
] | jiangjiang2366@163.com |
ea5549ab2becf69d7ae70f6453bf6cf51fcb032b | f03492b8e9ffd59caa9351136c90f650b6f9ee76 | /dubbo_token/common/src/main/java/com/gavin/common/CommonApplication.java | 6fc473ab5416ab1196509ce850a17ff2a8c2db3d | [] | no_license | zhulaoqi/Backend_development | e1498a0f3be9360b75930f307f4ba1e3751b7698 | a69e436baeaa5b2730cfd72c68161de8f82643b1 | refs/heads/master | 2023-04-10T19:02:16.714090 | 2020-07-21T04:56:26 | 2020-07-21T04:56:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.gavin.common;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CommonApplication {
public static void main(String[] args) {
SpringApplication.run(CommonApplication.class, args);
}
}
| [
"907516241@qq.com"
] | 907516241@qq.com |
aa7fd599f80849343f46ebfe0b63cfd79f36e691 | c5cf2ddb26b85121e8c6853510b7d2d79940556a | /src/main/java/luby/kids/tiled/MapWrapper.java | eb6915a4a260fe1a7a38327d16f873fbc839277a | [
"MIT"
] | permissive | clubycoder/tiled-reader | d95b561732083d219cdec7ffdb7c216923caa021 | e521bd04da252d6126989506a352fa328af4b672 | refs/heads/master | 2021-06-30T19:50:56.513232 | 2019-04-23T16:27:45 | 2019-04-23T16:32:23 | 179,593,200 | 0 | 0 | MIT | 2020-10-13T12:44:05 | 2019-04-04T23:45:32 | Java | UTF-8 | Java | false | false | 953 | java | package luby.kids.tiled;
import java.io.IOException;
public class MapWrapper {
private Map map;
public Map getMap() {
return this.map;
}
public void setMap(Map map) {
this.map = map;
}
private TileLayerWrapper[] tileLayers;
public TileLayerWrapper[] getTileLayers() {
return this.tileLayers;
}
public void setTileLayers(TileLayerWrapper[] tileLayers) {
this.tileLayers = tileLayers;
}
public MapWrapper(Map map) throws IOException {
setMap(map);
setTileLayers(readTileLayers());
}
private TileLayerWrapper[] readTileLayers() throws IOException {
TileLayerWrapper[] tileLayers = new TileLayerWrapper[getMap().getLayer().size()];
for (int layerNum = 0; layerNum < tileLayers.length; layerNum++) {
tileLayers[layerNum] = new TileLayerWrapper(getMap().getLayer().get(layerNum));
}
return tileLayers;
}
}
| [
"clubycoder@gmail.com"
] | clubycoder@gmail.com |
26d4e1ba1c8c3b5bcfb2304b144362b79fac9f1a | ce8c1584c31eb26792f4946dfabc287d8b8f8c7a | /workspace/OriginAnalysis/src/com/srlab/line/GnuDiff.java | 63e3aef82b8328f74ddba01431a717abff6d7187 | [] | no_license | huihuiliu/OriginAnalysis | 5d99cf3ec0674043f3fce87db452bd68157c51ac | 56cfcf366deddc952fbea68cca3b04ed4b9e5bc7 | refs/heads/master | 2023-03-20T00:25:10.710680 | 2014-05-27T14:51:26 | 2014-05-27T14:51:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,294 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.srlab.line;
import java.io.File;
import java.util.ArrayList;
/**
*
* @author muhammad
*/
public class GnuDiff {
public static ArrayList<Integer> runDiff(ArrayList<String> original, ArrayList<String> revised){
ArrayList<Integer> delLineList = new ArrayList<Integer>();
//First save them in a file //start Index is 0
Diff diff = new Diff(original.toArray(),revised.toArray());
//diff.no_discards = true;
Diff.change script = diff.diff_2(false);
while(script!=null){
System.out.println("Line 0= "+script.line0);
System.out.println("Line 1= "+script.line1);
System.out.println("= "+script.deleted);
System.out.println("= "+script.inserted);
if(script.deleted!=0){
int startLine = script.line0;
int length = script.deleted;
for(int i = startLine; i<=length+startLine-1;i++){
delLineList.add(i);
}
}
script = script.link;
}
return delLineList;
}
public static ArrayList<Integer> runDiff(String original[], String revised[]){
ArrayList<Integer> delLineList = new ArrayList<Integer>();
//First save them in a file //start Index is 0
Diff diff = new Diff(original,revised);
Diff.change script = diff.diff_2(true);
while(script!=null){
if(script.deleted!=0){
int startLine = script.line0;
int length = script.deleted;
for(int i = startLine; i<=length+startLine-1;i++){
delLineList.add(i);
}
}
script = script.link;
}
return delLineList;
}
public static void main(String args[]){
String test1[] = {
"aaa","bbb","ccc","ddd","eee","fff","ggg","hhh","iii"
};
String test2[] = {
"aaa","jjj","kkk","lll","bbb","ccc","hhh","iii","mmm","nnn","ppp"
};
ArrayList<String> original = new ArrayList();
original.add("int bar");
original.add("(char c) {");
original.add("int b[];");
original.add("foo(c,b);");
original.add("if (size(b)>0 printf(\"D\");");
original.add(" ");
original.add("if (!b) {");
original.add("printf(\"A\");");
original.add("} else {");
original.add("printf(\"C\");");
original.add("printf(\"B\");");
original.add("}");
original.add("return 1");
original.add("}");
ArrayList<String> revised = new ArrayList();
revised.add("if(x = 1){ x++}");
revised.add("int bar(char c) {");
revised.add("int b[]={1,2};");
revised.add("b=foo(c,b);");
revised.add(" ");
revised.add("if (!b) {");
revised.add("printf(\"B\");");
revised.add("} else {");
revised.add("printf(\"C\");");
revised.add("printf(\"A\");");
revised.add("}");
revised.add("return 1");
revised.add("}");
ArrayList list = GnuDiff.runDiff(FileToLines.convert("/Users/parvez/Documents/powerOld.txt")
, FileToLines.convert("/Users/parvez/Documents/powerNew.txt"));
System.out.println(list);
}
}
| [
"ahsan.du.2010@gmail.com"
] | ahsan.du.2010@gmail.com |
88a3b65844a68b3644d9c198cf0e72b7e90034d6 | 8091dc59cc76869befe9b0a8f350fbc56c2836e5 | /sql12/app/src/main/java/net/sourceforge/squirrel_sql/client/update/gui/UpdateSummaryTableModel.java | f7f98ff666ac5beddf2cb7efed3dea0d070316d2 | [] | no_license | igorhvr/squirrel-sql | 4560c39c9221f04a49487b5f3d66b1559a32c21a | 3457d91b397392e1a9649ffb00cbfd093e453654 | refs/heads/master | 2020-04-05T08:32:51.484469 | 2011-08-10T18:59:26 | 2011-08-10T18:59:26 | 2,188,276 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 4,683 | java | /*
* Copyright (C) 2008 Rob Manning
* manningr@users.sourceforge.net
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package net.sourceforge.squirrel_sql.client.update.gui;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;
import net.sourceforge.squirrel_sql.fw.util.StringManager;
import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
/**
* Model for the UpdateSummaryTable.
*/
public class UpdateSummaryTableModel extends AbstractTableModel
{
private static final long serialVersionUID = 1L;
private List<ArtifactStatus> _artifacts = new ArrayList<ArtifactStatus>();
/** Internationalized strings for this class. */
private static final StringManager s_stringMgr =
StringManagerFactory.getStringManager(UpdateSummaryTableModel.class);
private interface i18n {
// i18n[UpdateSummaryTable.yes=yes]
String YES_VAL = s_stringMgr.getString("UpdateSummaryTable.yes");
// i18n[UpdateSummaryTable.no=no]
String NO_VAL = s_stringMgr.getString("UpdateSummaryTable.no");
}
private final static Class<?>[] s_dataTypes =
new Class[] {
String.class, // ArtifactName
String.class, // Type
String.class, // Installed?
UpdateSummaryTableActionItem.class, // Install/Update/Remove
};
private final String[] s_hdgs = new String[] {
s_stringMgr.getString("UpdateSummaryTable.artifactNameLabel"),
s_stringMgr.getString("UpdateSummaryTable.typeLabel"),
s_stringMgr.getString("UpdateSummaryTable.installedLabel"),
s_stringMgr.getString("UpdateSummaryTable.actionLabel"), };
private final int[] s_columnWidths = new int[] { 150, 100, 100, 50 };
UpdateSummaryTableModel(List<ArtifactStatus> artifacts) {
_artifacts = artifacts;
}
/**
* @see javax.swing.table.TableModel#getValueAt(int, int)
*/
public Object getValueAt(int row, int col) {
final ArtifactStatus as = _artifacts.get(row);
switch (col) {
case 0:
return as.getName();
case 1:
return as.getType();
case 2:
return as.isInstalled() ? i18n.YES_VAL : i18n.NO_VAL;
case 3:
if (as.isCoreArtifact()) {
return ArtifactAction.INSTALL;
}
return as.getArtifactAction();
default:
throw new IndexOutOfBoundsException("" + col);
}
}
/**
* @see javax.swing.table.TableModel#getRowCount()
*/
public int getRowCount() {
return _artifacts.size();
}
/**
* @see javax.swing.table.TableModel#getColumnCount()
*/
public int getColumnCount() {
return s_hdgs.length;
}
/**
* @see javax.swing.table.AbstractTableModel#getColumnName(int)
*/
public String getColumnName(int col) {
return s_hdgs[col];
}
/**
* @see javax.swing.table.AbstractTableModel#getColumnClass(int)
*/
public Class<?> getColumnClass(int col) {
return s_dataTypes[col];
}
/**
* @see javax.swing.table.AbstractTableModel#isCellEditable(int, int)
*/
public boolean isCellEditable(int row, int col) {
return col == 3;
}
/**
* @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object, int, int)
*/
public void setValueAt(Object value, int row, int col) {
final ArtifactStatus as = _artifacts.get(row);
ArtifactAction action =
ArtifactAction.valueOf(value.toString());
as.setArtifactAction(action);
}
/**
* @return the column width for the specified column
*/
public int getColumnWidth(int col)
{
return s_columnWidths[col];
}
}
| [
"manningr@0ceafaf9-a5ae-48a7-aaeb-8ec3e0f2870c"
] | manningr@0ceafaf9-a5ae-48a7-aaeb-8ec3e0f2870c |
86a9ef4308622604f266ec86ecf8982fe9672a6b | 459ecf2b467e23449a080425d2be6a1def2bebf2 | /app/src/main/java/com/hdfc/caretaker/fragments/DashboardFragment.java | 4c794a0c4a01b5c96143374add78ef8207499b0f | [] | no_license | KishorSudesi/CareTaker | 00de3f10b8bb049c5e00d5c0d8d4cd2d312c4fdc | dbe18529d9a7c2a987bd0415e7f6122a248d5db0 | refs/heads/master | 2021-06-15T20:06:42.558834 | 2016-03-26T16:23:02 | 2016-03-26T16:23:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,199 | java | package com.hdfc.caretaker.fragments;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.ListView;
import android.widget.TextView;
import com.hdfc.adapters.ActivitiesAdapter;
import com.hdfc.adapters.CarouselPagerAdapter;
import com.hdfc.caretaker.R;
import com.hdfc.config.Config;
import com.hdfc.libs.Libs;
import com.hdfc.models.ActivitiesModel;
import com.hdfc.views.RoundedImageView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class DashboardFragment extends Fragment {
public final static int PAGES = Config.intDependentsCount;
// You can choose a bigger number for LOOPS, but you know, nobody will fling
// more than 1000 times just in order to test your "infinite" ViewPager :D
public final static int LOOPS = 1;//Config.intDependentsCount;
//public final static int FIRST_PAGE = PAGES * LOOPS / 2;
public final static float BIG_SCALE = 1.0f; //1.0f
public final static float SMALL_SCALE = 0.7f; //0.7f
public final static float DIFF_SCALE = BIG_SCALE - SMALL_SCALE;
public static ViewPager pager;
public static ArrayList<ActivitiesModel> activitiesModelArrayList = new ArrayList<>();
public static RoundedImageView roundedImageView;
private static ListView listViewActivities;
private static ActivitiesAdapter activitiesAdapter;
private static TextView textView1, textView2, textView3, textView4, emptyTextView;
public CarouselPagerAdapter adapter;
private Libs libs;
public DashboardFragment() {
// Required empty public constructor
}
public static DashboardFragment newInstance() {
DashboardFragment fragment = new DashboardFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
public static void loadData(int intIndex) {
Libs.log(String.valueOf(intIndex), "");
JSONArray jsonArrayDependant, jsonArrayActivities;
JSONObject jsonObjectActivity;
try {
activitiesModelArrayList.clear();
if (Config.jsonObject != null) {
jsonArrayDependant = Config.jsonObject.getJSONArray("dependents");
String strBp;
String strHeartRate;
if (jsonArrayDependant.length() > 0 && intIndex <= jsonArrayDependant.length()) {
if (jsonArrayDependant.getJSONObject(intIndex).has("activities")) {
strBp = jsonArrayDependant.getJSONObject(intIndex).getString("health_bp");
strHeartRate = jsonArrayDependant.getJSONObject(intIndex).getString("health_heart_rate");
//String strTime = "";
} else {
strBp = "0";
strHeartRate = "0";
}
/* if (jsonArrayDependant.getJSONObject(intIndex).has("health_status")) {
jsonObjectHealth = jsonArrayDependant.getJSONObject(intIndex).getJSONArray("health_status").getJSONObject(0);
strBp = jsonObjectHealth.getString("bp");
strHeartRate = jsonObjectHealth.getString("heart_rate");
strTime = jsonObjectHealth.getString("time_taken");
} else {
strBp = "0";
strHeartRate = "0";
}
*/
if (jsonArrayDependant.getJSONObject(intIndex).has("activities")) {
jsonArrayActivities = jsonArrayDependant.getJSONObject(intIndex).getJSONArray("activities");
if (jsonArrayActivities.length() > 0) {
for (int i = 0; i < jsonArrayActivities.length(); i++) {
jsonObjectActivity = jsonArrayActivities.getJSONObject(i);
if (jsonObjectActivity.has("activity_name")) {
ActivitiesModel activitiesModel = new ActivitiesModel(jsonObjectActivity.getString("provider_image_url"),
jsonObjectActivity.getString("activity_name"),
jsonObjectActivity.getString("activity_date"),
"feedback",//jsonObjectActivity.getString("activity_name"),//feedback
jsonObjectActivity.getString("provider_name"));
activitiesModelArrayList.add(activitiesModel);
}
}
}
} else activitiesModelArrayList.clear();
} else {
strBp = "0";
strHeartRate = "0";
activitiesModelArrayList.clear();
}
activitiesAdapter.notifyDataSetChanged();
textView1.setText(strBp);
textView2.setText(strHeartRate);
textView3.setText(strBp);
textView4.setText(strHeartRate);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
libs = new Libs(getActivity());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_dashboard, container, false);
listViewActivities = (ListView) rootView.findViewById(R.id.listViewActivities);
pager = (ViewPager) rootView.findViewById(R.id.dpndntCarousel);
textView1 = (TextView) rootView.findViewById(R.id.textView1);
textView2 = (TextView) rootView.findViewById(R.id.textView2);
textView3 = (TextView) rootView.findViewById(R.id.textView3);
textView4 = (TextView) rootView.findViewById(R.id.textView4);
roundedImageView = (RoundedImageView) rootView.findViewById(R.id.roundedImageView);
if(Config.dependentNames.size()<=1)
roundedImageView.setVisibility(View.INVISIBLE);
try {
if(Config.dependentNames.size()>0) {
int intPosition = 0;
if (Config.dependentNames.size() > 1)
intPosition = 1;
roundedImageView.setImageBitmap(BitmapFactory.decodeFile(libs.getInternalFileImages(
libs.replaceSpace(Config.dependentNames.get(intPosition))).getAbsolutePath()));
}
} catch (Exception | OutOfMemoryError e) {
e.printStackTrace();
}
emptyTextView = (TextView) rootView.findViewById(android.R.id.empty);
roundedImageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int intPosition, intReversePosition;
if (pager.getCurrentItem() == Config.intDependentsCount - 1) {
intPosition = 0;
intReversePosition = intPosition + 1;
} else {
intPosition = pager.getCurrentItem() + 1;
intReversePosition = pager.getCurrentItem();
}
try {
if (intReversePosition >= Config.dependentNames.size() ||
intReversePosition < 0)
intReversePosition = 0;
roundedImageView.setImageBitmap(BitmapFactory.decodeFile(
libs.getInternalFileImages(libs.replaceSpace(
Config.dependentNames.get(intReversePosition)))
.getAbsolutePath()));
} catch (Exception | OutOfMemoryError e) {
e.printStackTrace();
}
TranslateAnimation ta = new TranslateAnimation(0, Animation.RELATIVE_TO_SELF, 0, 0);
ta.setDuration(1000);
ta.setFillAfter(true);
roundedImageView.startAnimation(ta);
pager.setCurrentItem(intPosition, true);
}
});
//
return rootView;
}
@Override
public void onResume() {
super.onResume();
activitiesAdapter = new ActivitiesAdapter(getContext(), activitiesModelArrayList);
listViewActivities.setAdapter(activitiesAdapter);
loadData(0);
listViewActivities.setEmptyView(emptyTextView);
adapter = new CarouselPagerAdapter(getActivity(), getChildFragmentManager());
new setAdapterTask().execute();
}
private class setAdapterTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void... params) {
return null;
}
@Override
protected void onPostExecute(Void result) {
pager.setAdapter(adapter);
pager.setOnPageChangeListener(adapter);
// Set current item to the middle page so we can fling to both
// directions left and right
pager.setCurrentItem(0);
// Necessary or the pager will only have one extra page to show
// make this at least however many pages you can see
pager.setOffscreenPageLimit(Config.intDependentsCount); //1
// Set margin for pages as a negative number, so a part of next and
// previous pages will be showed
//pager.setPageMargin(-200); //-200
}
}
}
| [
"balamurugan@adstingo.in"
] | balamurugan@adstingo.in |
0ed9cd7e27598fa0861290f4754c21cb7d1d225c | 6049da85ebbac2a351553246836c8fd329829f98 | /src/edu/oregonstate/cartography/flox/model/Force.java | 3387869eade06f6a8c385dd485901908cfad6d98 | [
"MIT"
] | permissive | OSUCartography/Flox | 6e07098c94cc56abf5b77e38c26b09ab73282dc3 | 521485f7a0fc6ebf92608c3603f1858d0d60cdac | refs/heads/master | 2022-02-04T07:42:56.837232 | 2021-06-30T03:56:28 | 2021-06-30T03:56:28 | 34,346,335 | 7 | 2 | MIT | 2022-02-01T00:59:56 | 2015-04-21T18:59:11 | Java | UTF-8 | Java | false | false | 924 | java | package edu.oregonstate.cartography.flox.model;
/**
*
* @author Bernhard Jenny, Cartography and Geovisualization Group, Oregon State
* University
*/
public class Force {
public double fx;
public double fy;
public Force() {
fx = fy = 0;
}
public Force(double fx, double fy) {
this.fx = fx;
this.fy = fy;
}
public double length() {
return Math.sqrt(fx * fx + fy * fy);
}
public void scale(double scale) {
fx *= scale;
fy *= scale;
}
public void normalize() {
double l = Math.sqrt(fx * fx + fy * fy);
fx /= l;
fy /= l;
}
public void add(Force f) {
fx += f.fx;
fy += f.fy;
}
public static Force add(Force f1, Force f2) {
return new Force(f1.fx + f2.fx, f1.fy + f2.fy);
}
@Override
public String toString() {
return fx + "|" + fy;
}
}
| [
"jennyb@geo.oregonstate.edu"
] | jennyb@geo.oregonstate.edu |
ac41c48a248d620e45a7bda61e5bff12a176cf8a | 2fe48c5e979b6e45800ff7a717809c877bc93460 | /Spring-Exercise9/Spring-Exercise9/src/main/java/at/nacs/cinemamessagetemplate/ui/TextMessageSender.java | dee8948358d0af4ff51e5ff518f8c5116837da7d | [] | no_license | omaralzuhairi27/BackEnd | 7a28f1076ae9c1ff8c82940fdd651a0e4436efd6 | 015dd05b4c4e19a956f2d863fb4176221b8b0889 | refs/heads/master | 2020-04-24T15:07:46.302453 | 2019-05-07T11:19:01 | 2019-05-07T11:19:01 | 172,053,210 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package at.nacs.cinemamessagetemplate.ui;
import org.springframework.stereotype.Component;
@Component
public class TextMessageSender {
public void display(String message){
System.out.println(message);
}
}
| [
"omaralzuhairi27@gmail.com"
] | omaralzuhairi27@gmail.com |
e12fb33605a2a646f59d7e4831336eced2350186 | 6dc8b8b3e518529022c133ead80fcd13f2bad7f5 | /Storage/src/main/java/com/zy/storage/chaincache/StorageChain.java | 7d0f061da4fe22fe4b577f430d90d272adaec5e1 | [] | no_license | hahajing0000/proj4_2 | d36b5e2ba2177598d44f11d842ed39d07302383a | 579a07aa92af6a6cd1d01bdaadeb5a6b17dea9f4 | refs/heads/master | 2022-04-23T23:59:25.663394 | 2020-04-27T01:58:56 | 2020-04-27T01:58:56 | 256,433,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,401 | java | package com.zy.storage.chaincache;
import com.zy.storage.callback.ResultCallback;
/**
* @author:zhangyue
* @date:2020/4/23
* 存储链的基类
*/
public abstract class StorageChain<T> {
/**
* 下一个节点
*/
protected StorageChain nextChain;
/**
* 上一个节点
*/
protected StorageChain previousChain;
/**
* 设置下游链以及将下游链的上一节点指定为当前节点
* @param _storageChain
*/
public void setNextChain(StorageChain _storageChain){
nextChain=_storageChain;
_storageChain.previousChain=this;
}
/**
* 存储数据
* @param key
* @param data
*/
public void save(String key,T data){
saveData(key,data);
if (this.nextChain!=null){
this.nextChain.save(key,data);
}
}
/**
* 获取数据
* @param key
* @param result
*/
public void get(final String key, final ResultCallback<T> result){
getData(key,new ResultCallback<T>(){
@Override
public void getData(T data) {
if (null==data&&nextChain!=null){
nextChain.get(key,result);
}else{
/**
* 同步给上一存储链节点
*/
if (previousChain!=null){
previousChain.save(key,data);
}
result.getData(data);
}
}
});
}
/**
* 按key删除数据
* @param key
*/
public void removeAtKey(String key){
removeByKey(key);
if (nextChain!=null){
nextChain.removeAtKey(key);
}
}
/**
* 清理数据
*/
public void clear(){
clearData();
if (nextChain!=null){
nextChain.clear();
}
}
/**
* 存储数据
* @param key
* @param data
*/
protected abstract void saveData(String key, T data);
/**
* 获取数据
* @param key
* @param callback
*/
protected abstract void getData(String key,ResultCallback callback);
/**
* 按key删除指定数据
* @param key
*/
protected abstract void removeByKey(String key);
/**
* 清理数据
*/
protected abstract void clearData();
}
| [
"444511958@qq.com"
] | 444511958@qq.com |
d61e45caee1f57e115e76703a09758e0258bc926 | 703fe543ed62e68d002650f962edaca6f38dd825 | /src/java/Controlador/dao/PrestarDao.java | c15d49c8b3c03006ab5b5d786ff5e24ab5f4aa7e | [] | no_license | Alejandreyes/ProyectoHibernate | c00cd7a57b73a879f8162d9967c8c90af487f905 | ad501bd35dccb07a52689e9b5b7561ce229d83ed | refs/heads/master | 2021-01-01T05:10:14.780350 | 2016-05-21T14:56:14 | 2016-05-21T14:56:14 | 59,362,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,871 | 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 Controlador.dao;
import Modelo.Objeto;
import Modelo.Prestamo;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Transaction;
/**
*
* @author stein
*/
public class PrestarDao extends AbstractDao{
public Prestamo Buscar(String nombreLibro) throws DataAccessLayerException{
Prestamo returnValue = null;
session.getTransaction().commit();
Transaction trns = null;
try {
trns = session.beginTransaction();
returnValue = (Prestamo) session.createQuery("from "+"Prestar"+" where "+"id"+"= " + nombreLibro+" and " ).uniqueResult();
} catch (RuntimeException e) {
e.printStackTrace();
} finally {
session.flush();
session.close();
}
return null;
}
public void Actualizar(Prestamo o) throws DataAccessLayerException{
super.update(o);
}
public void Eliminar(Prestamo o) throws DataAccessLayerException{
super.delete(o);
}
public void Guardar(Prestamo o) throws DataAccessLayerException{
super.save(o);
}
public List<Prestamo>obtenerTodos(){
return super.findAll(Prestamo.class);
}
public boolean disponible(Objeto obj){
Boolean disponible = false;
super.startOperation();
try {
Query d = session.createQuery("from "+"Prestamo"+" where "+"idlibro"+" = " +obj.getIdlibro()+"");
disponible = (d.list().isEmpty());
} catch (RuntimeException e) {
e.printStackTrace();
} finally {
session.flush();
session.close();
}
return disponible;
}
}
| [
"alejandreyes36@gmail.com"
] | alejandreyes36@gmail.com |
8f7e84a8d6e4be71d38a0c7cfad33044c9b56df1 | 0b04ea62f823357dc4aa04c333502fd930bffb32 | /src/main/java/io/dddbyexamples/commandandcontrol/commands/CommandsEvents.java | e9d790d0dc47a17e4ab56a8d338e1e728c650d0e | [
"MIT"
] | permissive | michal-michaluk/leadership-takeover | e60e8ca97d0e5657ab21a1c32dfee246c3e4c539 | ca1ed85753286546bf3b3af37516bbbd2bb80a69 | refs/heads/master | 2020-03-23T07:34:10.648590 | 2018-07-19T12:29:25 | 2018-07-19T12:29:25 | 141,280,051 | 1 | 1 | MIT | 2018-07-17T12:07:37 | 2018-07-17T11:30:10 | Gherkin | UTF-8 | Java | false | false | 214 | java | package io.dddbyexamples.commandandcontrol.commands;
public interface CommandsEvents {
void emit(NewCommandGiven event);
void emit(NewCommandReceived event);
void emit(CommandStatusChanged event);
}
| [
"michaluk.michal@gmail.com"
] | michaluk.michal@gmail.com |
5e12768aee3b0dd0c1029f15b0f406f20edac078 | 5804aac6e9112413997c8bd132296d66cd655034 | /src/test/java/com/lyes/springsecurityjwt/SpringSecurityJwtApplicationTests.java | 235cd638b9658fc6a78104700f6799bfb5ccd605 | [] | no_license | bouyass/spring-security-jwt | c84b8ad90932e759f27fff636f6bbe75089a8791 | dde5fe820eb30fb9c8e7b51a152c3e72bd210405 | refs/heads/master | 2023-01-29T14:53:35.664446 | 2020-12-12T15:48:03 | 2020-12-12T15:48:03 | 320,850,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | package com.lyes.springsecurityjwt;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringSecurityJwtApplicationTests {
@Test
void contextLoads() {
}
}
| [
"lyes.makhloufi@outlook.fr"
] | lyes.makhloufi@outlook.fr |
5452da84375c171410d1cfd9b9005a989081e479 | ee0475627dd5e90afeabda5149836c8697eaca0c | /src/es/upc/fib/ia/aima/basic/AgentProgram.java | 794e0836bd8c8c71cfcdbe773205ccb5e167f5e8 | [] | no_license | aleixsacrest/legendary-octo-garbanzo | 42f8ae1d4f561fd1c97de490ed7838cf41cae439 | 3bb215ccbd3f3fe5045f287de4424c4be03d0ada | refs/heads/master | 2021-06-01T03:25:09.262134 | 2016-04-11T22:05:36 | 2016-04-11T22:05:36 | 53,411,536 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package es.upc.fib.ia.aima.basic;
public abstract class AgentProgram {
public abstract String execute(Percept percept);
} | [
"alexmiromed@gmail.com"
] | alexmiromed@gmail.com |
591479eca39e79cfadf4f1d7607058a513fc9357 | 8a6453cd49949798c11f57462d3f64a1fa2fc441 | /aws-java-sdk-dax/src/main/java/com/amazonaws/services/dax/model/ListTagsRequest.java | f96f733e4981043382571d4876f51440ab553ac8 | [
"Apache-2.0"
] | permissive | tedyu/aws-sdk-java | 138837a2be45ecb73c14c0d1b5b021e7470520e1 | c97c472fd66d7fc8982cb4cf3c4ae78de590cfe8 | refs/heads/master | 2020-04-14T14:17:28.985045 | 2019-01-02T21:46:53 | 2019-01-02T21:46:53 | 163,892,339 | 0 | 0 | Apache-2.0 | 2019-01-02T21:38:39 | 2019-01-02T21:38:39 | null | UTF-8 | Java | false | false | 6,241 | java | /*
* Copyright 2013-2018 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.dax.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/ListTags" target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ListTagsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The name of the DAX resource to which the tags belong.
* </p>
*/
private String resourceName;
/**
* <p>
* An optional token returned from a prior request. Use this token for pagination of results from this action. If
* this parameter is specified, the response includes only results beyond the token.
* </p>
*/
private String nextToken;
/**
* <p>
* The name of the DAX resource to which the tags belong.
* </p>
*
* @param resourceName
* The name of the DAX resource to which the tags belong.
*/
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
/**
* <p>
* The name of the DAX resource to which the tags belong.
* </p>
*
* @return The name of the DAX resource to which the tags belong.
*/
public String getResourceName() {
return this.resourceName;
}
/**
* <p>
* The name of the DAX resource to which the tags belong.
* </p>
*
* @param resourceName
* The name of the DAX resource to which the tags belong.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListTagsRequest withResourceName(String resourceName) {
setResourceName(resourceName);
return this;
}
/**
* <p>
* An optional token returned from a prior request. Use this token for pagination of results from this action. If
* this parameter is specified, the response includes only results beyond the token.
* </p>
*
* @param nextToken
* An optional token returned from a prior request. Use this token for pagination of results from this
* action. If this parameter is specified, the response includes only results beyond the token.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* An optional token returned from a prior request. Use this token for pagination of results from this action. If
* this parameter is specified, the response includes only results beyond the token.
* </p>
*
* @return An optional token returned from a prior request. Use this token for pagination of results from this
* action. If this parameter is specified, the response includes only results beyond the token.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* An optional token returned from a prior request. Use this token for pagination of results from this action. If
* this parameter is specified, the response includes only results beyond the token.
* </p>
*
* @param nextToken
* An optional token returned from a prior request. Use this token for pagination of results from this
* action. If this parameter is specified, the response includes only results beyond the token.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ListTagsRequest withNextToken(String nextToken) {
setNextToken(nextToken);
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 (getResourceName() != null)
sb.append("ResourceName: ").append(getResourceName()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListTagsRequest == false)
return false;
ListTagsRequest other = (ListTagsRequest) obj;
if (other.getResourceName() == null ^ this.getResourceName() == null)
return false;
if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListTagsRequest clone() {
return (ListTagsRequest) super.clone();
}
}
| [
""
] | |
a483ed48396f7a8cbecc7690ec639070a5b28688 | 7601f56dc1ce7721315f468e49bdc0d1003103a6 | /Professor/src/controlador/Controladorprofessor.java | 4e1b8af787f7f491294a04ab240158f288d69035 | [] | no_license | Barbarawinsch/Professor | 5372022f14bb7a1875b6a3680a8b94fd024d7bdf | 78fbdc06395e4523f71bd269ca478881fb8b787c | refs/heads/master | 2020-06-13T17:07:42.961927 | 2019-07-09T18:42:19 | 2019-07-09T18:42:19 | 194,725,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | 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 controlador;
/**
*
* @author Administrador
*/
public class Controladorprofessor {
}
| [
"Administrador@10.10.4.20"
] | Administrador@10.10.4.20 |
610dc17e6f56d0098dc1cd6c9195536a3302e7e3 | 425e031abf5c6d76b014655186af4a7f5004e732 | /07_Java/Sol/07_01/src/main/java/curso/ej07_01/ruido/Pitar.java | b575d5ea15ff5682db7be38676c260d2319c7a5b | [] | no_license | edumarcu/CursoJavaCREA | 44534e319a77594d1c495d51776672334662a33e | 7ec31da56041506b5dbe07f0f998bfebba272ea2 | refs/heads/master | 2020-06-08T12:10:12.317428 | 2013-03-20T12:55:39 | 2013-03-20T12:55:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package curso.ej07_01.ruido;
public class Pitar implements HacerRuido{
public void hacerRuido() {
System.out.println("Piuuu!");
}
}
| [
"edumarcu@gmail.com"
] | edumarcu@gmail.com |
8a0371f4924cfe1f0fbd8fb005fdaabddbc456e8 | b5cbba586352d14c0766effe30682dae59809fb2 | /msb-dongbao-application/msb-dongbao-portal-web/src/test/java/com/msb/verifyCode/TesseractTest.java | 11afe697b782103fb4802b851e4f79022d19af5d | [] | no_license | Nyh05/dongbao-mall | 8feb7d1da57cd749bc9e793eadec19db3626fe37 | d5913d7e1fa4689460346f99e6919f8f02eed67f | refs/heads/master | 2023-07-30T16:55:43.971768 | 2021-09-26T08:03:26 | 2021-09-26T08:03:26 | 408,292,198 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package com.msb.verifyCode;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
import java.io.File;
public class TesseractTest {
public static void main(String[] args) throws TesseractException {
ITesseract iTesseract=new Tesseract();
// 语言包 加进来
iTesseract.setDatapath("D:\\tessData");
iTesseract.setLanguage("chi_sim");
// iTesseract.setLanguage("eng");
File fileDir = new File("D:\\Data");
for (File file : fileDir.listFiles()) {
String s = iTesseract.doOCR(file);
System.out.println(file.getName()+"识别后的数字是:"+s);
}
}
}
| [
"1224955890@qq.com"
] | 1224955890@qq.com |
76530194b58e844c6c44cf0bc2c2d4d3a180f5a7 | 1cc779760f023e8b7684c6a47f4a79e758a01ea0 | /src/main/java/com/acmebank/accountmanager/repository/AccountRepository.java | a0e90526d550e0068f63b547653ebcee2ee9dbc9 | [] | no_license | nitishvaidya/account-manager | 3ef56fb52484a61f1dbd77a306bdbac0ddfdbf6a | 967ae4cb53bdc0721decfe49ed3988f852ba7c53 | refs/heads/master | 2022-06-06T03:18:03.564239 | 2020-05-03T22:46:40 | 2020-05-03T22:46:40 | 260,918,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 394 | java | package com.acmebank.accountmanager.repository;
import java.util.UUID;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import com.acmebank.accountmanager.entity.AccountEntity;
@Repository
public interface AccountRepository extends CrudRepository<AccountEntity, UUID> {
AccountEntity findByAccountNumber(String accountNumber);
}
| [
"nitv89@gmail.com"
] | nitv89@gmail.com |
b6a549fac7ed6d826a466b0eb312f1bfaba34d5a | bb4608456555a78e66b023bb7bdd81212ce41379 | /8-MyResource/source/old/app-batch/src/main/java/com/asynclife/batch/domain/IlleageAccountrException.java | 82b342a33585e0c6f80b77ae12e50927591e40fb | [] | no_license | tanbinh123/technology | a7ee4602ced63af7a895aa7851075b412a6a33d9 | 9de5edd304dea32fb9d974e3912a0a1aa19404ef | refs/heads/master | 2022-01-05T07:25:30.733047 | 2019-01-13T17:56:13 | 2019-01-13T17:56:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | package com.asynclife.batch.domain;
/**
* @author Tobias Flohre
*/
public class IlleageAccountrException extends RuntimeException {
private static final long serialVersionUID = 1L;
public IlleageAccountrException() {
super();
}
public IlleageAccountrException(String message, Throwable cause) {
super(message, cause);
}
public IlleageAccountrException(String message) {
super(message);
}
public IlleageAccountrException(Throwable cause) {
super(cause);
}
}
| [
"asynclife@163.com"
] | asynclife@163.com |
6318131e79a2e7b14ff948f94cfb3ceb05bcd900 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-19-11-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest_scaffolding.java | 26fcd23abd1b74b5cfa75e5aa4649ea9fc00317d | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Apr 03 01:38:32 UTC 2020
*/
package org.xwiki.rendering.internal.parser.xhtml.wikimodel;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XWikiCommentHandler_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
f5bf44b0fd338ace530cd3d1c1a2fee93c4604c3 | 90cb963c8777a1352cdd419a2a52d20096f614db | /kinetic-tools/src/main/java/com/seagate/kinetic/tools/management/rest/message/ErrorResponse.java | 81ae1ed0eee14aebf1763a3dfb9635a9ed5858bc | [] | no_license | pcrane70/kinetic-java-tools | c81716450421cc046f27564cf7d932eb5583f4a0 | c6eea12cbfdb6c95208ddfb460680b8dba85defd | refs/heads/master | 2020-06-26T16:00:35.452992 | 2016-11-08T01:48:02 | 2016-11-08T01:48:02 | 199,679,782 | 0 | 0 | null | 2019-07-30T15:33:32 | 2019-07-30T15:33:25 | Java | UTF-8 | Java | false | false | 1,638 | java | /**
* Copyright (C) 2014 Seagate Technology.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package com.seagate.kinetic.tools.management.rest.message;
import javax.servlet.http.HttpServletResponse;
/**
* Error response message.
*
* @author chiaming
*
*/
public class ErrorResponse extends RestResponse {
private int errorCode = javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
private String errorMessage = "Unsupported request";
public ErrorResponse() {
setMessageType(MessageType.ERROR);
setOverallStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
public void setErrorCode(int code) {
this.errorCode = code;
}
public int getErrorCode() {
return this.errorCode;
}
public void setErrorMessage(String msg) {
this.errorMessage = msg;
}
public String getErrorMessage() {
return this.errorMessage;
}
}
| [
"chiaming2000@gmail.com"
] | chiaming2000@gmail.com |
e7b9b6e0578e7ed579aed6c0079085434a5d52bc | 01965ce459ad1ee09e93c9ee22179f83bd6038c7 | /src/main/java/com/nevii/servicejpa/ReportServiceJpa.java | 25110078595b859262f6652ae9cfaff415b9c812 | [] | no_license | Nevidovcic/Risk_Assesment | 873e677c02ec0e0a66289bed9be9104651445a8f | 9c7cdb185ac75766a3568ff2ebddfef02604ae85 | refs/heads/master | 2020-12-25T08:42:30.270087 | 2016-06-12T15:30:52 | 2016-06-12T15:30:52 | 60,970,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.nevii.servicejpa;
import java.util.Date;
import java.util.List;
import com.nevii.model.Report;
public interface ReportServiceJpa {
Report findByNumbReportAndYear(Long numbReport,Integer year);
List<Report> findByNumbReportAndYearReport(Long numbreport,Integer year);
List<Report> findByDateReportBetween(Date startDate,Date endDate);
}
| [
"nevidovcic.miroslav@gmail.com"
] | nevidovcic.miroslav@gmail.com |
58f8b64eb576e1137ca2416ff37f5a69476ae28e | 26719419c2dfaa533a97e060d014c9ad4a33f232 | /spring-cloud-provider-user/src/main/java/com/company/project/web/UserinfoController.java | 6e036dc44c27d78a6d328efdc3530ecc8da751c6 | [] | no_license | WLAndy/spring-cloud | 4332861a3a92a79cb554c7764a2251565f13744b | 3d9272446895d6743aea9a7d8fbfecc94fc28c02 | refs/heads/master | 2021-09-04T14:00:37.501508 | 2018-01-19T08:25:25 | 2018-01-19T08:25:25 | 112,685,225 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,064 | java | package com.company.project.web;
import com.company.project.core.Result;
import com.company.project.core.ResultGenerator;
import com.company.project.model.Userinfo;
import com.company.project.service.UserinfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by CodeGenerator on 2018/01/18.
*/
@RestController
@RequestMapping("/userinfo")
public class UserinfoController {
@Resource
private UserinfoService userinfoService;
@PostMapping("/add")
public Result add(Userinfo userinfo) {
userinfoService.save(userinfo);
return ResultGenerator.genSuccessResult();
}
@PostMapping("/delete")
public Result delete(@RequestParam Long id) {
userinfoService.deleteById(id);
return ResultGenerator.genSuccessResult();
}
@PostMapping("/update")
public Result update(Userinfo userinfo) {
userinfoService.update(userinfo);
return ResultGenerator.genSuccessResult();
}
@PostMapping("/detail")
public Result detail( Long id) {
Userinfo userinfo = userinfoService.findById(id);
return ResultGenerator.genSuccessResult(userinfo);
}
@RequestMapping("/detail1")
public Result detail1(@RequestParam Long id) {
Userinfo userinfo = userinfoService.findById(id);
return ResultGenerator.genSuccessResult(userinfo);
}
@PostMapping("/list")
public Result list(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
PageHelper.startPage(page, size);
List<Userinfo> list = userinfoService.findAll();
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
}
| [
"19960303m"
] | 19960303m |
31470f1ec985bf2c6c4998d1918d6ee3808b7c7f | 9cb9bf679e4fb51f0dee76238e79e641f8a33f9c | /src/main/java/com/reactbackend/controller/UserController.java | 0cf8e5b11aa3e60d1d71665370dd700e83768c53 | [] | no_license | RickJoseph561/amazonbackend | b5b0da1f1afc5b2527b518734b84757a8bdb09e0 | 6b8f456674e2f39b7ae5e32dc2435bb62a508e23 | refs/heads/master | 2023-05-02T03:30:01.671981 | 2021-05-19T00:41:11 | 2021-05-19T00:41:11 | 368,702,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,184 | java | package com.reactbackend.controller;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.reactbackend.bean.User;
import com.reactbackend.exception.NonUniquenameException;
import com.reactbackend.service.UserService;
@RestController
@CrossOrigin(origins="http://localhost:3000",allowCredentials="true")
@RequestMapping(path="/user")
public class UserController {
@Autowired
private UserService userserv;
@GetMapping
public ResponseEntity<User> checkLogin(HttpSession session) {
User loggedPerson = (User) session.getAttribute("user");
if (loggedPerson == null)
return ResponseEntity.badRequest().build();
return ResponseEntity.ok(loggedPerson);
}
@PutMapping
public ResponseEntity<User> logIn(HttpSession session, @RequestBody Map<String, String> loginInfo) {
User person = userserv.getUserByname(loginInfo.get("name"));
if (person != null) {
if (person.getPassword().equals(loginInfo.get("password"))) {
session.setAttribute("user", person);
return ResponseEntity.ok(person);
}
return ResponseEntity.badRequest().build();
}
return ResponseEntity.notFound().build();
}
@PostMapping
public ResponseEntity<Void> registerUser(HttpSession session, @RequestBody User person) {
try {
userserv.addUser(person);
} catch (NonUniquenameException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return ResponseEntity.ok().build();
}
@DeleteMapping
public ResponseEntity<Void> logOut(HttpSession session) {
session.invalidate();
return ResponseEntity.ok().build();
}
}
| [
"your_email_address@example.com"
] | your_email_address@example.com |
39b3326fb8b09dd9e34396265baa866008706a8d | c99dc235e704cc507a940bac4fb52e0b225a7420 | /src/main/java/Chapter06/lesson03/net/mindview/simple02/List09.java | 081c7552dee9be77f504e1634d01da85cb095d72 | [] | no_license | alsamancov/BruceEckel- | 6d468dccbafb47ab7c8c1bc1fa61e7b8bfc93ed8 | 43a34f7c012908416942f91bcef8ceda925ae552 | refs/heads/master | 2016-08-12T06:05:54.871313 | 2016-01-20T11:21:59 | 2016-01-20T11:21:59 | 45,980,024 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package Chapter06.lesson03.net.mindview.simple02;
/**
* Created by Alexey on 11/19/2015.
*/
public class List09 {
public List09(){
System.out.println("Chapter06.lesson03." +
"net.mindview.simple02.List09");
}
}
| [
"alsamancov@gmail.com"
] | alsamancov@gmail.com |
c97a4164562fe5d2b21ce2645fe1c5ee9e2bd11c | 60d5850cb50bc1afce7b952d37caa029f48636cf | /rds-sys/src/main/java/me/jinkun/rds/sys/entity/Resource.java | e9403d8b0a2c1fa528fc57ee69284184c86b0224 | [
"Apache-2.0"
] | permissive | jinkun2014/rds-boot | 784272028379b3d0cf15809005396b26843e6c6f | ff74fb3d2120e26a06092151919f82059c3512b0 | refs/heads/master | 2021-08-21T20:58:44.998711 | 2017-11-29T02:25:46 | 2017-11-29T02:25:46 | 109,127,686 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,491 | java | package me.jinkun.rds.sys.entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 资源-实体,数据库表为: sys_resource
*
* @author JinKun
* @date 2017-11-25
* @time 15:26
*/
@Getter
@Setter
@ToString
public class Resource implements Serializable {
/**
* 主键,column: id
*/
private Long id;
/**
* 资源名称,column: name
*/
private String name;
/**
* 资源路径,column: url
*/
private String url;
/**
* 打开方式 ajax,iframe,column: open_mode
*/
private String openMode;
/**
* 资源介绍,column: description
*/
private String description;
/**
* 资源图标,column: icon
*/
private String icon;
/**
* 父级资源id,column: pid
*/
private Long pid;
/**
* 排序,column: seq
*/
private Integer seq;
/**
* 状态,column: status
*/
private Integer status;
/**
* 资源类别,column: resource_type
*/
private Integer resourceType;
/**
* 是否是叶子,column: is_leaf
*/
private Boolean isLeaf;
/**
* 删除标记,column: del_flag
*/
private Boolean delFlag;
/**
* 更新时间,column: update_time
*/
private Date updateTime;
/**
* 创建时间,column: create_time
*/
private Date createTime;
} | [
"jinkun2014@163.com"
] | jinkun2014@163.com |
7bb6682c4b241f3d2ed723c212063416c1253629 | 30ce14e35efaf1dc763f34d2e3bcb44279363967 | /src/main/java/com/kh/batterflow/admin/controller/AdminAjaxController.java | d38ffafef2374f6f072b0860951f707751dc03d0 | [] | no_license | juhS/finalpjtsjh | 8c621d73a55c7d6bc40fc5c6f3b571588f05ca87 | ea6f1ab5a452dc07fe1a3ab1f0107b229ce65bb8 | refs/heads/master | 2023-05-01T13:01:50.917196 | 2021-05-21T16:11:41 | 2021-05-21T16:11:41 | 369,585,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,671 | java | package com.kh.batterflow.admin.controller;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.kh.batterflow.admin.service.AdminAjaxService;
import com.kh.batterflow.vo.DraftTitleOrder_vo;
import com.kh.batterflow.vo.DraftTitleRule_vo;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@RequestMapping("/adminajax")
public class AdminAjaxController {
@Autowired
private AdminAjaxService adminAjaxService;
//default 이름 수정
@GetMapping("/defaultNameChange")
public String changeCateName(@RequestParam Map<String, Object> newNameWithId) {
String resultCode = adminAjaxService.changeCateName(newNameWithId);
return resultCode;
}
//새로 추가된 행 이름 추가
@GetMapping("/newNameAdd")
public String newCateName(@RequestParam Map<String, Object> newNameadd) {
String resultCode = adminAjaxService.newCateNameAdd(newNameadd);
return resultCode;
}
//카테고리 삭제
@GetMapping("/delCate")
public String delCate(@RequestParam Map<String, Object> delCate) {
String resultCode = adminAjaxService.delCategory(delCate);
return resultCode;
}
//문서 카테고리 이름 변경 전 id값 조회
@GetMapping("/selectOneDocuId")
public Map<String, Object> selectOneDocuId(@RequestParam Map<String, Object> selectOneMap) {
Map<String, Object> map = adminAjaxService.selectOneDocuId(selectOneMap);
return map;
}
//문서 카테고리 이름 변경
@GetMapping("/updateCateName")
public String updateCate(@RequestParam Map<String, Object> updateCate) {
String resultCode = adminAjaxService.updateCategory(updateCate);
return resultCode;
}
//문서 카테고리 클릭 시 해당하는 문서 양식 호출(첫번째하위)
@GetMapping("/loadDraftWithCate")
public Map<String, Object> draftWithCateMap(@RequestParam Map<String, Object> map){
Map<String, Object> loadMap = adminAjaxService.draftWithCateMap(map);
log.info("loadMap : {}", loadMap);
return loadMap;
}
//기안서 복사 했을 때 insert 후 불러와서 세팅..
@GetMapping("/draftCopy")
public Map<String, Object> draftCopyAfterSelect(@RequestParam Map<String, Object> insertAndSelect){
Map<String, Object> copyMap = adminAjaxService.draftCopyAfterSelect(insertAndSelect);
log.info("map : {}", copyMap);
return copyMap;
}
//기안 문서 제목 규칙 내용 모두 불러오기
@GetMapping("/draftTitleRuleLoad")
public List<DraftTitleOrder_vo> draftTitleRuleLoad(){
List<DraftTitleOrder_vo> list = adminAjaxService.draftTitleRuleLoad();
return list;
}
//기안서 문서 제목 규칙 순서 저장
@GetMapping("/titleRuleOrderUpdate")
public String titleRuleOrderUpdate(@RequestParam String sendText) {
log.info("order : {}", sendText);
String updateResult = adminAjaxService.titleRuleOrderUpdate(sendText);
return updateResult;
}
//기안서 양식 설명 update
@GetMapping("/draftExplainUpdate")
public void draftExplainUpdate(@RequestParam Map<String, String> textAreaVal) {
adminAjaxService.draftExplainUpdate(textAreaVal);
}
//기안서 양식 저장 update
@GetMapping("/draftFileUpdate")
public String draftFileUpdate(@RequestParam Map<String, Object> map) {
String resultCode = adminAjaxService.draftFileUpdate(map);
return resultCode;
}
}
| [
"ju_hy@DESKTOP-1OR0E3A"
] | ju_hy@DESKTOP-1OR0E3A |
8f7a31416ccddc6bcf2e75b3d3ded2ad63309c23 | 46a699f988b09d0317b16efdf7431e44f2eb943c | /app/src/main/java/za/co/lbnkosi/watchdog/utils/MainMenuMap.java | e7bc9dc828f6a5a92ab05ec6983fc27cf19c669a | [] | no_license | Lebogang95/Android-Watchdog-Anti-Theft | 96a5468e8ac57c9ef2661e40f77d13ab32522c40 | ad40e883fc53a5236cfa339f9a692c88ef67d395 | refs/heads/master | 2020-03-31T05:53:39.761624 | 2019-02-25T08:47:18 | 2019-02-25T08:47:18 | 151,961,622 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 876 | java | package za.co.lbnkosi.watchdog.utils;
import com.google.firebase.firestore.IgnoreExtraProperties;
@IgnoreExtraProperties
public class MainMenuMap {
private String title;
private String description;
private String iconLink;
public MainMenuMap() {
}
public MainMenuMap(String title, String description, String iconLink) {
this.title = title;
this.description = description;
this.iconLink = iconLink;
}
public String getTitle() {
return title;
}
public void setTitle(String title) { this.title = title; }
//
public String getDescription() { return description; }
public void setDescription(String description) {
this.description= description;
}
public String getIconLink(){ return iconLink; }
public void setIconLink(String iconLink){ this.iconLink = iconLink;}
}
| [
"lebo@applord.co.za"
] | lebo@applord.co.za |
6b449e7aee889e0c17acd7c1cb19e08c125990e4 | 88925a65200770d2a83a64d869122d63f5010400 | /src/com/stackroute/datamunger/reader/CsvWhereQueryProcessor.java | 4ff47f4a628906c99e10a79884a304a07fd774d7 | [] | no_license | dmfullstack/de_s7_bp | eb8a388ced1bc3e600ba6b6061406087d0ebfde8 | 5db3ba5fdb9b3e36a359f6fb4c2ed1bff061e91e | refs/heads/master | 2020-03-20T04:42:16.427194 | 2018-06-13T10:04:19 | 2018-06-13T10:04:19 | 137,192,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,123 | java | package com.stackroute.datamunger.reader;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import com.stackroute.datamunger.query.DataSet;
import com.stackroute.datamunger.query.Filter;
import com.stackroute.datamunger.query.parser.QueryParameter;
/**
*This class will read from CSV file and process and return the resultSet based on Where clause
*Filter is user defined utility class where we defined the methods related to filter fields,
* filter records.
**/
public class CsvWhereQueryProcessor implements QueryProcessingEngine{
private DataSet dataSet;
private List<String> record;
private Map<String, Integer> header;
private Filter filter;
/**
*This method used to read the data from csv and filter the fields with the help of Filter class.
**/
public DataSet executeQuery(QueryParameter queryParameter) {
// read header
// read the remaining records
//Check wither the record is required or not based on 'where' coniditin in the query parameter
return null;
}
}
| [
"metkaridinesh@gmail.com"
] | metkaridinesh@gmail.com |
3d7b2f75a5a2c85c39ad3aca8d115028e4be5b19 | b68501c48c8543453af68da6d02c13cfbcb0437e | /Base64Study/src/test/TestBase64Coder.java | e942c8d6b761749b2fbd810fdd2c322659b81abf | [] | no_license | ziqueiros/workshop | 50fc21d7a747d5622a04bfc7ddcac19adef817ca | 584dca1088fdbcaf2d022988c1f3a0012b92cf58 | refs/heads/master | 2016-09-09T21:50:09.674351 | 2014-03-21T21:29:02 | 2014-03-21T21:29:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | // Tests for the Base64Coder class.
package test;
import biz.source_code.base64Coder.Base64Coder;
import java.util.Random;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertArrayEquals;
import org.junit.Test;
public class TestBase64Coder {
// Test Base64Coder with constant strings.
@Test
public void test1() {
check ("Aladdin:open sesame", "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="); // example from RFC 2617
check ("", "");
check ("Man", "TWFu"); //Wikipedia example
check ("1", "MQ==");
check ("22", "MjI=");
check ("333", "MzMz");
check ("4444", "NDQ0NA==");
check ("55555", "NTU1NTU=");
check ("abc:def", "YWJjOmRlZg=="); }
private static void check (String plainText, String base64Text)
{
String s1 = Base64Coder.encodeString(plainText);
String s2 = Base64Coder.decodeString(base64Text);
if (!s1.equals(base64Text) || !s2.equals(plainText))
fail ("Check failed for \""+plainText+"\" / \""+base64Text+"\".");
}
// Test Base64Coder against sun.misc.BASE64Encoder/Decoder with random data.
// Line length below 76.
@Test
public void test2() throws Exception {
final int maxLineLen = 76 - 1; // the Sun encoder adds a CR/LF when a line is longer
final int maxDataBlockLen = (maxLineLen*3) / 4;
sun.misc.BASE64Encoder sunEncoder = new sun.misc.BASE64Encoder();
sun.misc.BASE64Decoder sunDecoder = new sun.misc.BASE64Decoder();
Random rnd = new Random(0x538afb92);
for (int i=0; i<50000; i++) {
int len = rnd.nextInt(maxDataBlockLen+1);
byte[] b0 = new byte[len];
rnd.nextBytes(b0);
String e1 = new String(Base64Coder.encode(b0));
String e2 = sunEncoder.encode(b0);
assertEquals (e2, e1);
byte[] b1 = Base64Coder.decode(e1);
byte[] b2 = sunDecoder.decodeBuffer(e2);
assertArrayEquals (b0, b1);
assertArrayEquals (b0, b2); }}
// Test Base64Coder line encoding/decoding against sun.misc.BASE64Encoder/Decoder
// with random data.
@Test
public void test3() throws Exception {
final int maxDataBlockLen = 512;
sun.misc.BASE64Encoder sunEncoder = new sun.misc.BASE64Encoder();
sun.misc.BASE64Decoder sunDecoder = new sun.misc.BASE64Decoder();
Random rnd = new Random(0x39ac7d6e);
for (int i=0; i<10000; i++) {
int len = rnd.nextInt(maxDataBlockLen+1);
byte[] b0 = new byte[len];
rnd.nextBytes(b0);
String e1 = new String(Base64Coder.encodeLines(b0));
String e2 = sunEncoder.encodeBuffer(b0);
assertEquals (e2, e1);
byte[] b1 = Base64Coder.decodeLines(e1);
byte[] b2 = sunDecoder.decodeBuffer(e2);
assertArrayEquals (b0, b1);
assertArrayEquals (b0, b2); }}
} // end class TestBase64Coder
| [
"ziqueiros@live.com"
] | ziqueiros@live.com |
162a946e5d809aff263fcb1249ae26d7ac10a236 | e85f7edc923e72e44c523b8cf622c2264ec872ea | /src/main/java/cloud/weiniu/sdk/util/R.java | f6c10220a28be4307dccef94b55d397e1b2f31d9 | [
"Apache-2.0"
] | permissive | weiniuyun/weiniuyun-sdk | 1013e1594b473c97afcfb9b5ea08e0d0ef58e0ca | 80f6826d20637adf651c5543f0d8369fbd9afc79 | refs/heads/master | 2023-06-08T20:57:42.675752 | 2021-07-03T09:47:47 | 2021-07-03T09:47:47 | 382,208,514 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | package cloud.weiniu.sdk.util;
import cloud.weiniu.sdk.json.WNGsonBuilder;
/**
* 微妞分布式平台-公用工具包
*
* @author 广州加叁信息科技有限公司 (tiger@microsoul.com)
* @version V1.0.0
*/
public class R<T> {
private int code = 200;
private String message = "";
private T data;
public static R ok() {
return new R<>();
}
public static <T> R<T> ok(T data) {
return new R<>(data);
}
public static <T> R<T> fail() {
return new R<>();
}
public static <T> R<T> fail(int code) {
return new R<>(code);
}
public static <T> R<T> fail(String message, int code) {
return new R<>(message, code);
}
public R(T data) {
this.data = data;
}
public R(String message) {
this.message = message;
}
public R(String message, int code) {
this.message = message;
this.code = code;
}
public R(int code) {
this.code = code;
}
public R() {
super();
}
public int getCode() {
return code;
}
public R<T> setCode(int code) {
this.code = code;
return this;
}
public String getMessage() {
return message;
}
public R<T> setMessage(String message) {
this.message = message;
return this;
}
public T getData() {
return data;
}
public R<T> setData(T data) {
this.data = data;
return this;
}
@Override
public String toString() {
return WNGsonBuilder.create().toJson(this);
}
}
| [
"tiger@microsoul.com"
] | tiger@microsoul.com |
b159656a48a0a6c97012fb21a9f464204fd99602 | 79a50a96eb1cbc45970878895f61f4733e6ea3b7 | /CompB/src/ch/hsr/modules/compb/exercises/week02/symbolTabelle/TokenType.java | 39f20f5c0186339ca01676e6f005efd615eae28d | [] | no_license | bugybunny/hsr_modules | 58bb207bf7d57c3c94a49d35e5524935f94e6186 | 0222f5985bda32b0adc7d6f85b6175a33faed6a8 | refs/heads/master | 2021-01-22T04:33:34.186057 | 2014-10-02T08:46:57 | 2014-10-02T08:46:57 | 13,013,169 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 515 | java | package ch.hsr.modules.compb.exercises.week02.symbolTabelle;
/*
* Die Reihenfolge ist so,
* dass jedes reservierte Wort < EOF ist.
*/
public enum TokenType {
Bool,
Char,
Else,
False,
Float,
If,
Int,
Main,
True,
While,
Eof,
LeftBrace, RightBrace,
LeftBracket, RightBracket, LeftParen, RightParen,
Semicolon, Comma, Assign, Equals, Less, LessEqual,
Greater, GreaterEqual, Not, NotEqual, Plus, Minus,
Multiply, Divide, And, Or, Identifier, IntLiteral,
FloatLiteral, CharLiteral
}
| [
"msyfrig@hsr.ch"
] | msyfrig@hsr.ch |
58eb80764c7f74e8c2ff225c13b8ff2f9b0e1f42 | 1cf919cb3dfff3826fee87aefc07778ae399d314 | /src/main/java/com/platform/modules/app/utils/JwtUtils.java | 0ef45e12a0f14d7ae2dee6fe4a43796894b967d2 | [
"Apache-2.0"
] | permissive | wukailing112113/platform-plus | 06951ad0900ea26e513c749a9f9ea4633d97beb4 | 48fa65562f8650c7a60c3a058c5113bfb70ea103 | refs/heads/master | 2022-08-10T11:45:19.153231 | 2019-07-03T01:32:35 | 2019-07-03T01:32:35 | 194,874,193 | 0 | 0 | Apache-2.0 | 2022-07-06T20:37:39 | 2019-07-02T13:59:08 | Java | UTF-8 | Java | false | false | 2,293 | java | /*
* 项目名称:platform-plus
* 类名称:JwtUtils.java
* 包名称:com.platform.modules.app.utils
*
* 修改履历:
* 日期 修正者 主要内容
* 2018/11/21 16:04 李鹏军 初版完成
*
* Copyright (c) 2019-2019 微同软件
*/
package com.platform.modules.app.utils;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* jwt工具类
*
* @author 李鹏军
*/
@Slf4j
@ConfigurationProperties(prefix = "platform-plus.jwt")
@Component
public class JwtUtils {
private String secret;
private long expire;
private String header;
/**
* 生成jwt token
*/
public String generateToken(String userId) {
Date nowDate = new Date();
//过期时间
Date expireDate = new Date(nowDate.getTime() + expire * 1000);
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setSubject(userId)
.setIssuedAt(nowDate)
.setExpiration(expireDate)
.signWith(SignatureAlgorithm.HS512, secret)
.compact();
}
public Claims getClaimByToken(String token) {
try {
return Jwts.parser()
.setSigningKey(secret)
.parseClaimsJws(token)
.getBody();
} catch (Exception e) {
log.debug("validate is token error ", e);
return null;
}
}
/**
* token是否过期
*
* @return true:过期
*/
public boolean isTokenExpired(Date expiration) {
return expiration.before(new Date());
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public long getExpire() {
return expire;
}
public void setExpire(long expire) {
this.expire = expire;
}
public String getHeader() {
return header;
}
public void setHeader(String header) {
this.header = header;
}
}
| [
"wukl@massestech.com"
] | wukl@massestech.com |
c2143e26e82ed0b806f8daea5febe1e84c3666b7 | efaa8fe089e2ae47e582989e0035110df64d3732 | /week-07/day-4/foxclub/src/main/java/com/greenfox/tgabor/foxclub/models/entities/Trick.java | d867b29f1c6e6fe66600c6dc08cfb3cc9c551a40 | [] | no_license | green-fox-academy/gabortrajtler | b2416cba8c1d1c4bd05bbf71ac6c6bd8eb3ff83c | bc081a15fc7a1094928c4c428cb17faa6efc7369 | refs/heads/master | 2020-06-11T04:56:49.368008 | 2019-10-23T12:41:56 | 2019-10-23T12:41:56 | 193,855,290 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package com.greenfox.tgabor.foxclub.models.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Trick {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
public Trick() {
}
public Trick(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"trajtlerg@gmail.com"
] | trajtlerg@gmail.com |
d55d88528c4e0456bcf77c789a5adda477d12d21 | b0965d80480f6ae03743d0944dd3499d359750dd | /src/main/java/com/zking/ssm/controller/ModuleController.java | 2a215623b72cf3137335f3a81ad34a3a267c7d84 | [] | no_license | lj7867/ssm_project | da282b67e511f5e5e910fe999a11b7a4955d849e | 39dc58d76679c9f1923c19acfdeea4ff0d8eab9f | refs/heads/master | 2020-04-16T07:23:10.528572 | 2019-01-12T12:17:49 | 2019-01-12T12:17:49 | 165,384,373 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,242 | java | package com.zking.ssm.controller;
import com.zking.ssm.model.module.Module;
import com.zking.ssm.service.module.ModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/module")
public class ModuleController {
@Autowired
private ModuleService moduleService;
@RequestMapping("/initModule")
@ResponseBody
public Map<String,Object> initData(Module module){
Map<String,Object> maps = new HashMap<>();
module.setPid("-1");
// List<Module> list = moduleService.initModule(module);
// System.out.println(list);
List<Map<String,Object>> maps1 = new ArrayList<>();
List<Map<String,Object>> maps2 =null;
List<Module> lst = moduleService.initModule(module);
Map<String,Object> map =null;
Map<String,Object> map2 =null;
for (Module m : lst) {
map = new HashMap<>();
map.put("title",m.getTitle());
map.put("icon",m.getIcon());
map.put("href",m.getUrl());
map.put("spread",false);
module.setPid(m.getId());
List<Module> modules = moduleService.initModule(module);
maps2=new ArrayList<>();
for (Module m2 : modules) {
map2=new HashMap<>();
map2.put("title",m2.getTitle());
map2.put("icon",m2.getIcon());
map2.put("href",m2.getUrl());
map.put("spread",false);
maps2.add(map2);
map.put("children",maps2);
}
maps1.add(map);
}
maps.put("contentManagement",maps1);
//System.out.println(maps);
return maps;
}
/* *//**
* 所有权限模块
*
* @param right
* @return
*//*
public List<Map<String, Object>> bjyuansu(List<Map<String, Object>> a, List<Map<String, Object>> b, String ab) {
List<Map<String, Object>> lst = new ArrayList<>();
Map<String, Object> o = null;
if (0 == a.size() || null == a || 0 == b.size() || null == b) {
for (Map<String, Object> map : a) {
o = new HashMap<>();
if (ab.equals(map.get("rightParentCode"))) {
o.put("title", "" + map.get("name"));
o.put("value", "" + map.get("rightCode"));
List<Map<String, Object>> list2 = bjyuansu(a, b, map.get("rightCode").toString());
if (0 != list2.size()) {
o.put("data", list2);
}
lst.add(o);
}
}
return lst;
} else {
for (Map<String, Object> map : a) {
o = new HashMap<>();
if (b.contains(map)) {
if (ab.equals(map.get("rightParentCode"))) {
o.put("title", "" + map.get("name"));
o.put("value", "" + map.get("rightCode"));
o.put("checked", true);
List<Map<String, Object>> list2 = bjyuansu(a, b, map.get("rightCode").toString());
if (0 != list2.size()) {
o.put("data", list2);
}
lst.add(o);
}
} else {
if (ab.equals(map.get("rightParentCode"))) {
o.put("title", "" + map.get("name"));
o.put("value", "" + map.get("rightCode"));
List<Map<String, Object>> list2 = bjyuansu(a, b, map.get("rightCode").toString());
if (0 != list2.size()) {
o.put("data", list2);
}
lst.add(o);
}
}
}
return lst;
}
}*/
}
| [
"786726252@qq.com"
] | 786726252@qq.com |
b0e7353cc5c76e565f7df91f46f82eda48303136 | a1926157fbd762cf73467c8a835b748f0685c01a | /documents/类图与代码/《设计模式实训教程》代码/第5章代码/实例代码/03-Interpreter.java | 1864ad3c9c406e4210310f2ca8e2c2817171be1b | [] | no_license | guoqiangxie/DesignPattern | 534e347adb12792ca512d7e7f1816fc6bfec5203 | bad3d7ed42a499fc1991dad57197b3baf4c71e59 | refs/heads/master | 2016-08-04T19:18:06.047107 | 2014-11-20T01:55:28 | 2014-11-20T01:55:28 | 25,446,803 | 0 | 1 | null | null | null | null | GB18030 | Java | false | false | 3,731 | java | import java.util.*;
//抽象表达式
abstract class AbstractNode
{
public abstract String interpret();
}
//And解释:非终结符表达式
class AndNode extends AbstractNode
{
private AbstractNode left;
private AbstractNode right;
public AndNode(AbstractNode left,AbstractNode right)
{
this.left = left;
this.right = right;
}
public String interpret()
{
return left.interpret() + "再" + right.interpret();
}
}
//简单句子解释:非终结符表达式
class SentenceNode extends AbstractNode
{
private AbstractNode direction;
private AbstractNode action;
private AbstractNode distance;
public SentenceNode(AbstractNode direction,AbstractNode action,AbstractNode distance)
{
this.direction = direction;
this.action = action;
this.distance = distance;
}
public String interpret()
{
return direction.interpret() + action.interpret() + distance.interpret();
}
}
//方向解释:终结符表达式
class DirectionNode extends AbstractNode
{
private String direction;
public DirectionNode(String direction)
{
this.direction = direction;
}
public String interpret()
{
if(direction.equalsIgnoreCase("up"))
{
return "向上";
}
else if(direction.equalsIgnoreCase("down"))
{
return "向下";
}
else if(direction.equalsIgnoreCase("left"))
{
return "向左";
}
else if(direction.equalsIgnoreCase("right"))
{
return "向右";
}
else
{
return "无效指令";
}
}
}
//动作解释:终结符表达式
class ActionNode extends AbstractNode
{
private String action;
public ActionNode(String action)
{
this.action = action;
}
public String interpret()
{
if(action.equalsIgnoreCase("move"))
{
return "移动";
}
else if(action.equalsIgnoreCase("run"))
{
return "快速移动";
}
else
{
return "无效指令";
}
}
}
//距离解释:终结符表达式
class DistanceNode extends AbstractNode
{
private String distance;
public DistanceNode(String distance)
{
this.distance = distance;
}
public String interpret()
{
return this.distance;
}
}
//指令处理类:工具类
class InstructionHandler
{
private String instruction;
private AbstractNode node;
public void handle(String instruction)
{
AbstractNode left=null,right=null;
AbstractNode direction=null,action=null,distance=null;
Stack stack=new Stack();
String[] words=instruction.split(" "); //以空格分隔字符串
for(int i=0;i<words.length;i++)
{
if(words[i].equalsIgnoreCase("and"))
{
left=(AbstractNode)stack.pop();
String word1=words[++i];
direction=new DirectionNode(word1);
String word2=words[++i];
action=new ActionNode(word2);
String word3=words[++i];
distance=new DistanceNode(word3);
right=new SentenceNode(direction,action,distance);
stack.push(new AndNode(left,right));
}
else
{
String word1=words[i];
direction=new DirectionNode(word1);
String word2=words[++i];
action=new ActionNode(word2);
String word3=words[++i];
distance=new DistanceNode(word3);
left=new SentenceNode(direction,action,distance);
stack.push(left);
}
}
this.node=(AbstractNode)stack.pop();
}
public String output()
{
String result = node.interpret();
return result;
}
}
class Client
{
public static void main(String args[])
{
String instruction = "up move 5 and down run 10 and left move 5";
InstructionHandler handler = new InstructionHandler();
handler.handle(instruction);
String outString;
outString = handler.output();
System.out.println(outString);
}
} | [
"xieguoqiang@chinadrtv.com"
] | xieguoqiang@chinadrtv.com |
60071fdf186d7e72dc224ce15f1fdda081ee117b | 0e9efbdcbfedabce5328909976597712f673d6a7 | /Odevler/hrms/src/main/java/kodlamaio/hrms/business/abstracts/VerificationCodeService.java | 02cf98c582cf847cc7a0ee7ef341afe9556a0bfc | [] | no_license | TalibGuler/JavaCamp | cea84589e883cf37e84d089ec699a5ad7c39117a | a99b51f052bbb5608aacfd39fb712a28e08ce324 | refs/heads/main | 2023-08-23T02:59:43.359045 | 2021-09-19T17:23:21 | 2021-09-19T17:23:21 | 363,421,456 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package kodlamaio.hrms.business.abstracts;
import java.util.List;
import kodlamaio.hrms.core.utilities.results.DataResult;
import kodlamaio.hrms.entities.concretes.VerificationCode;
public interface VerificationCodeService {
DataResult<List<VerificationCode>> getAll();
}
| [
"64988496+TalibGuler@users.noreply.github.com"
] | 64988496+TalibGuler@users.noreply.github.com |
fe3c64ac341c138a7f36724276c34c88eb2857f0 | baf4884d950ef1178ec8b59bea1cf486da9b9a66 | /app/src/main/java/com/nozimy/app65_home1/domain/interactor/contacts/ContactListInteractor.java | 380d11d1ea5ba7c07aa8749cb3a2753f5e5046b6 | [] | no_license | zelflod/App65_home1 | d46ed45af2bd05e0d071002a536aac89bab017eb | 8a4200616f3ca466c88bbefa670cccc546252d4f | refs/heads/master | 2022-03-10T06:41:40.164510 | 2019-12-03T12:20:16 | 2019-12-03T12:20:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.nozimy.app65_home1.domain.interactor.contacts;
import android.support.annotation.NonNull;
import com.nozimy.app65_home1.ImportService;
import com.nozimy.app65_home1.db.entity.ContactEntity;
import com.nozimy.app65_home1.domain.interactor.BaseInteractor;
import java.util.List;
import io.reactivex.Completable;
import io.reactivex.Single;
public interface ContactListInteractor extends BaseInteractor {
@NonNull
Single<List<ContactEntity>> getContacts();
@NonNull
Single<List<ContactEntity>> getByDisplayName(String searchText);
Completable importFromProvider();
}
| [
"N9120205697y"
] | N9120205697y |
d62ae2e25d3d5f8dffb8b08fdd96a645699fe1dd | 2c4c392a910db0ac6919c7f2302ac8ca58739e31 | /src/p08interface/p01textbook/exercises/OracleDao.java | 960f7fd3d17c910777840a44284bdf00a3c9058a | [] | no_license | Hesitater/java-teacher | 84a2dfc530b8002b2a22808e4457a9a359589353 | 542bb140a6b7cc5bab8b934d67188bec90ffa2af | refs/heads/master | 2023-09-05T01:58:25.864751 | 2021-11-08T03:38:03 | 2021-11-08T03:38:03 | 425,687,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package p08interface.p01textbook.exercises;
public class OracleDao implements DataAccessObject {
@Override
public void select() {
System.out.println("Oracle DB에서 검색");
}
@Override
public void insert() {
System.out.println("Oracle DB에 삽입");
}
@Override
public void update() {
System.out.println("Oracle DB를 수정");
}
@Override
public void delete() {
System.out.println("Oracle DB에서 삭제");
}
}
| [
"89769647+Hesitater@users.noreply.github.com"
] | 89769647+Hesitater@users.noreply.github.com |
c293db77b585a29b40f93a5b3ae695e3a8e04305 | 0e82998236daecca067d58da6ebcf8ad1824bf19 | /src/main/java/net/viperfish/planner/core/Metric.java | e94eae99018606df8993c542039eb2d4374183a9 | [
"BSD-3-Clause"
] | permissive | shilongdai/9planner | 5ef192850976fdac25b451344680df3d2f5cd226 | b672527233f8535b4a2522dc23414f14c597411c | refs/heads/master | 2022-12-08T13:36:02.022482 | 2020-09-07T20:39:20 | 2020-09-07T20:39:20 | 293,627,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,095 | java | package net.viperfish.planner.core;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public class Metric {
private double scale;
private Map<String, Object> details;
public Metric() {
this(0);
}
public Metric(double scale) {
this.scale = scale;
this.details = new HashMap<>();
}
public double getScale() {
return scale;
}
public Map<String, Object> getDetails() {
return new HashMap<>(details);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Metric metric = (Metric) o;
return Double.compare(metric.scale, scale) == 0 &&
Objects.equals(details, metric.details);
}
@Override
public int hashCode() {
return Objects.hash(scale, details);
}
@Override
public String toString() {
return "Metric{" +
"scale=" + scale +
", details=" + details +
'}';
}
}
| [
"sdai@viperfish.net"
] | sdai@viperfish.net |
71fd4a9b66ce8311004b935c87c3f7b63992c7b1 | 9c200ae07692ee33602e17b43e87fde5b38bb7e2 | /app/src/main/java/com/example/layoutdesigns/EmployeeListActivity.java | b705568ca24bf9af314072c8f5710376da13059c | [] | no_license | mkndmail/AndroidTraining | 39b0ecd7bda1aa3371f3f6de32b5e9b1e2217d38 | 5c93303296b904e10cbc64e102b08c9b8a8851c9 | refs/heads/master | 2023-03-25T05:53:57.032095 | 2021-03-01T12:51:22 | 2021-03-01T12:51:22 | 343,414,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,186 | java | package com.example.layoutdesigns;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class EmployeeListActivity extends AppCompatActivity {
private RecyclerView rvEmployees;
private EmployeeAdapter employeeAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_employee_list);
rvEmployees = findViewById(R.id.rv_employees);
List<Employee> employeeList = getListOfEmployees();
employeeAdapter = new EmployeeAdapter(employeeList);
rvEmployees.setAdapter(employeeAdapter);
}
List<Employee> getListOfEmployees() {
List<Employee> employeeList = new ArrayList<>();
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
employeeList.add(new Employee("Mukund", "Technology", "Android", getAge(), getIsPresent()));
return employeeList;
}
private int getAge() {
return new Random().nextInt(60);
}
private boolean getIsPresent() {
return new Random().nextInt(10) % 2 == 0;
}
} | [
"mukund.gururani@kelltontech.com"
] | mukund.gururani@kelltontech.com |
6ad27b77086c3a0bd947516f7e5617caa96e1005 | 016397e143894ab8845ac66cb31202808761afa6 | /GaiaMA/GaiaLog/src/org/gaia/log/LogForEachRunFileAppender.java | 55f52e0fe8d4c69eaf8a8f27a3ed74ef925a95c0 | [] | no_license | srvarey/postion | 9e9b3f0d5342a29e4a162949188573fccae9eba3 | b03c079124d7cbc7a705e537f2c8ea0c1ddc8ef5 | refs/heads/master | 2021-01-10T03:43:43.122014 | 2015-10-02T05:53:24 | 2015-10-02T05:53:24 | 43,537,770 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,290 | java | /**
* Copyright (C) 2013 Gaia Transparence
* Gaia Transparence, 1 allée Paul Barillon - 94300 VINCENNES
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3.0 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 org.gaia.log;
import java.io.File;
import java.io.IOException;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Layout;
import org.apache.log4j.spi.ErrorCode;
/**
* This is a customized log4j appender, which will create a new file for every
* run of the application.
*
*
*/
public class LogForEachRunFileAppender extends FileAppender {
public LogForEachRunFileAppender() {
}
public LogForEachRunFileAppender(Layout layout, String filename,
boolean append, boolean bufferedIO, int bufferSize)
throws IOException {
super(layout, filename, append, bufferedIO, bufferSize);
}
public LogForEachRunFileAppender(Layout layout, String filename,
boolean append) throws IOException {
super(layout, filename, append);
}
public LogForEachRunFileAppender(Layout layout, String filename)
throws IOException {
super(layout, filename);
}
@Override
public void activateOptions() {
if (fileName != null) {
try {
fileName = getNewLogFileName();
setFile(fileName, fileAppend, bufferedIO, bufferSize);
} catch (Exception e) {
errorHandler.error("Error while activating log options", e,
ErrorCode.FILE_OPEN_FAILURE);
}
}
}
/**
*Return the file names
*
*/
private String getNewLogFileName() {
if (fileName != null) {
final String DOT = ".";
final String HIPHEN = "-";
final File logFile = new File(fileName);
final String logfileName = logFile.getName();
String newFileName = "";
final int dotIndex = logfileName.indexOf(DOT);
if (dotIndex != -1) {
/**
* the file name has an extension. so, insert the time stamp
* between the file name and the extension
*/
newFileName = logfileName.substring(0, dotIndex) + HIPHEN + +System.currentTimeMillis() + DOT + logfileName.substring(dotIndex + 1);
} else {
/**
* the file name has no extension. So, just append the timestamp
* at the end.
*/
newFileName = logfileName + HIPHEN + System.currentTimeMillis();
}
return logFile.getParent() + File.separator + newFileName;
}
return null;
}
} | [
"srvarey@gmail.com"
] | srvarey@gmail.com |
383cedc295a5a32e7b8133b2a1785cfe6494a468 | a6e2cd9ea01bdc5cfe58acce25627786fdfe76e9 | /src/main/java/com/alipay/api/response/AlipayEcapiprodDrawndnDrawndnlistQueryResponse.java | 3b7f4c93522e9655497aa669e44fd8a56a134965 | [
"Apache-2.0"
] | permissive | cc-shifo/alipay-sdk-java-all | 38b23cf946b73768981fdeee792e3dae568da48c | 938d6850e63160e867d35317a4a00ed7ba078257 | refs/heads/master | 2022-12-22T14:06:26.961978 | 2020-09-23T04:00:10 | 2020-09-23T04:00:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,109 | java | package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.DrawndnVo;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.ecapiprod.drawndn.drawndnlist.query response.
*
* @author auto create
* @since 1.0, 2019-03-08 15:29:11
*/
public class AlipayEcapiprodDrawndnDrawndnlistQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 8256399241148847992L;
/**
* 支用列表
*/
@ApiListField("drawndn_list")
@ApiField("drawndn_vo")
private List<DrawndnVo> drawndnList;
/**
* 唯一一次请求标示
*/
@ApiField("request_id")
private String requestId;
public void setDrawndnList(List<DrawndnVo> drawndnList) {
this.drawndnList = drawndnList;
}
public List<DrawndnVo> getDrawndnList( ) {
return this.drawndnList;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getRequestId( ) {
return this.requestId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
53a678b787d17dac32dcde6fd12edbc52d1fec54 | ba3e9cff7e9232d90610178fcfcb9df811cf5bc8 | /Java8Learning/src/main/java/com/learning/java8/methodreference/MethodReferenceDemo.java | 4d4bb5a052c82bec2dcf5323fff91eea3672cf89 | [] | no_license | vision-adwi/ownrepository | 874b26cfc64ccdf1591c912c0666288a598e5ec0 | c3dc6efb5c097f48d2f0f167bfd9a2a9c3bd2e4f | refs/heads/master | 2022-12-23T12:24:39.678443 | 2020-09-26T17:55:19 | 2020-09-26T17:55:19 | 266,111,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package com.learning.java8.methodreference;
@FunctionalInterface
interface Demonstrate {
void showUp();
}
class TheatricalShow {
void play() {
System.out.println("Lights...");
System.out.println("Raise...");
System.out.println("Go...");
}
}
public class MethodReferenceDemo {
public static void main(String[] s) {
System.out.println("******* Video Shoot ********");
Demonstrate videoShoot = MethodReferenceDemo::shoot;
//Above definition is similar to this
/*
Demonstrate videoShoot = new Demonstrate() {
@Override
public void showUp() {
MethodReferenceDemo.shoot();
}
};
*/
videoShoot.showUp();
System.out.println("\n******* Mike Check ********");
Demonstrate mikeCheck = () -> System.out.println("Check.. check.. check..");
mikeCheck.showUp();
System.out.println("\n******* Sound Recording ********");
Demonstrate recording = () -> {
System.out.println("Sound check.");
System.out.println("Record...");
};
recording.showUp();
System.out.println("\n******* Theatrical Show ********");
Demonstrate drama = new TheatricalShow()::play;
drama.showUp();
}
static void shoot() {
System.out.println("Light...");
System.out.println("Camera...");
System.out.println("Action...");
}
}
| [
"vision.adwi@gmail.com"
] | vision.adwi@gmail.com |
36290fa8e7b327f457f84ae9ff6d6a9581806bac | fe0c760d5bd9a823fede14922b6c526ba2ce74ef | /src/main/java/com/crims/common/ConstantUtil.java | 44618cb23fafbc103e6808211c996c05c1db93b5 | [] | no_license | zlw999/CRIMSSrvjc | d43c844df5d0b14682505e87c703ed71da99d836 | a69c3af59851a732534ac250e97f2bd778dcc911 | refs/heads/master | 2022-12-31T10:17:24.898873 | 2020-10-20T08:49:23 | 2020-10-20T08:49:23 | 305,646,160 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,890 | java | package com.crims.common;
import java.time.Duration;
import java.time.Instant;
import java.util.Calendar;
import java.util.Date;
public class ConstantUtil {
/*
* CCSPCommStruct.h中定义
* #define defCCSPDefaultALLNodeCode "FFFFFFFFFFFFFFFFFFFFFFFFFFF" ///< 表示所有节点
* #define DefDefaultSTSDT_MS "2000-01-01 01:01:01:000" ///< 缺省系统日期时间
* #define DefDefaultSTSDT_S "2000-01-01 01:01:01" ///<缺省系统日期时间
* #define DefCCSP_DataTime_NULL_Str "2000-01-01 01:01:01"///<日期时间默认值(字符串)
* #define DefDateTimeFormat _T("%Y-%m-%d %H:%M:%S")///<日期时间的字符串显示格式
*/
public static final int SECOND_DIFFERENCE = 1; // 以秒计算时间差
public static final int MILLIS_DIFFERENCE = 2; // 以毫秒计算时间差
public static Date getDefaultTime()
{
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, 2000);
cal.set(Calendar.MONTH, 0);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 1);
cal.set(Calendar.MINUTE, 1);
cal.set(Calendar.SECOND, 1);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
public static boolean isDefaultTime(Date time)
{
Calendar calendar = Calendar.getInstance();
calendar.setTime(time);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
if( year <= 2000
&& month == 0
&& day == 1)
{
return true;
}
return false;
}
public static long calculateTimeDifferenceByDuration(int unit, Instant lefttime, Instant righttime)
{
if( unit == SECOND_DIFFERENCE )
{
return Duration.between(lefttime, righttime).getSeconds();
}
else
{
return Duration.between(lefttime, righttime).toMillis();
}
}
}
| [
"742483505@qq.com"
] | 742483505@qq.com |
c6dbd575e7de3bb9bcccdc1d4af882fa80034acf | 338d2defd6d8c691faee9339ec50a5d5b7e78db9 | /src/pr4/Simular.java | 4937ea9d19cd80812381ce5cce3ad873c754a501 | [] | no_license | victorPG92/poker | f078b666254c256dcbe51d76ebb02dd817ef9738 | 32bcfa9e57d1ec7f8bffb27d15c441b1eee18bb3 | refs/heads/master | 2021-05-24T13:33:06.386773 | 2020-04-17T18:34:48 | 2020-04-17T18:34:48 | 253,584,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,421 | java | package pr4;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import pr1.negocio.Mano.manos.Mano;
import pr1.negocio.buscarJugadas.EncontrarMejorJugada;
import pr1.negocio.cartas.carta.Carta;
import pr4.presentacion.ventanas.VentanaJuegoConAlgoritmo;
public class Simular
{
@SuppressWarnings("unused")
private VentanaJuegoConAlgoritmo v;
private Jugador j;
//private String msj="";
private ArrayList<Carta> banca; // cartas reales que tendr� la banca
private ArrayList<Carta> comunes;
private MazoOpt mazo;
private boolean apostarInicial=true;
private boolean apostarFlop=true;
private boolean apostarTurn=true;
private boolean apostarRiver=true;
//constantes
private final static int APUESTA_INICIAL=1;
private final static int APUESTA_FLOP=2;
private final static int APUESTA_TURN=1;
private final static int APUESTA_RIVER=1;
private static final int PEOR_TRIO = 4;
private static final int MEJOR_TRIO = 5;
//ira a constantes
public final static double probFlop= 4.0/9.0;
public final static double probTurn= 2.0/9.0;
public final static double probRiver= 1.0/9.0;
public int n;//= (int)Math.pow(10, 4);
//public final static int intervalo=50;
public int DETENER;
public int DINERO;//= (APUESTA_INICIAL+APUESTA_FLOP+ APUESTA_TURN + APUESTA_RIVER )*n;
public int MARGEN;
//variables contadoras:
private int contAbandonaPreFlop=0;
private int contAbandonaFlop=0;
private int contAbandonaTurn=0;
//private int contSigue=0;
private int contGana=0;
private int contPierde=0;
private int minimoBote=4;
private int contEmpate;
public Simular(int dinero, int interaciones, int detener)
{
this.DETENER=detener;
this.n=interaciones;
this.DINERO=dinero;
this.MARGEN= DINERO/10;
j = new Jugador(DINERO);
banca = new ArrayList<Carta>();
//v = VentanaJuegoConAlgoritmo.obtenerInstancia();
}
public void inicia()
{
comunes= new ArrayList<Carta>();
mazo= new MazoOpt1(); //elegir entre mazo 1 y 2
}
public String simula()
{
String msj="Iniciamos:";
msj=msj+"\nFondo inicial: "+ DINERO;
//System.out.println("Fondo inicial: "+ DINERO);
msj=msj+"\nnumero de iteraciones: "+ n;
//System.out.println("Numero de iteraciones: "+ n);
msj=msj+"\nFondo Actual del jugador - iteracion actual ";
//System.out.println("Fondo Actual del jugador - iteracion actual ");
for(int i=0;i< n && j.getFondo()>=minimoBote;i++)
// for(int i=0;i<n/intervalo;i++)
{
// for(int k=0;k<intervalo;k++) {
inicia();
jugar();
//}
if ((i!=0) && ( i % DETENER == 0)) {
if(j.getFondo()>=DINERO)
JOptionPane.showMessageDialog(null, "Van "+i+" manos y el resultado hasta ahora es una Estrategia CORRECTA");
//else if (j.getFondo()>=(DINERO- MARGEN))
//JOptionPane.showMessageDialog(null, "Van "+i+" manos y el resultado hasta ahora es una Estrategia en el margen");
else //if(j.getFondo()< (DINERO- MARGEN))
JOptionPane.showMessageDialog(null, "Van "+i+" manos y el resultado hasta ahora es una Estrategia MALA");
}
msj=msj+"\nFondo actual del jugador: " + Integer.toString(j.getFondo())+" - "+(i+1);
//System.out.println("Fondo actual del jugador: " + Integer.toString(j.getFondo())+" - "+(i+1));
}
if(j.getFondo()>=DINERO) {
//System.out.println("Estrategia CORRECTA ");
msj=msj+"\nEstrategia CORRECTA ";
}
else if(j.getFondo()>=(DINERO- MARGEN)) {
//System.out.println("Estrategia en el margen ");
msj=msj+"\nEstrategia en el margen";
}
else if(j.getFondo()< (DINERO- MARGEN)) {
//System.out.println("Estrategia MALA ");
msj=msj+"\nEstrategia MALA";
}
JOptionPane.showMessageDialog(null, "Estadisticas:\n"
+ "victorias: " + contGana + "\n"+
"derrotas al final: " + contPierde + "\n"+
"empates al final: " + contEmpate + "\n"+
"abandona antes del flop: " + contAbandonaPreFlop + "\n"+
"abandona antes del turn: " + contAbandonaFlop +"\n"+
"abandona antes del river: " + contAbandonaTurn
) ;
return msj;
}
public void jugar()
{
Mano manoJugador=null;
Mano manoBanca=null;
//apuesta inicial
j.apostar(APUESTA_INICIAL);
banca = mazo.dameNCartas(2);
j.setCartas(mazo.dameNCartas(2));
//v.getCanvas().setCartasJugador(j.getCartas());
//v.getCanvas().setCartasBanca(banca);
apostarFlop= dameProb() > probFlop ;
if(apostarFlop)
{
j.apostar(APUESTA_FLOP);
comunes.addAll(mazo.dameNCartas(3));
apostarTurn= dameProb() > probTurn ;
if(apostarTurn)
{
j.apostar(APUESTA_TURN);
comunes.add(mazo.dameCartaAleatoria());
apostarRiver= dameProb() > probRiver ;
if(apostarRiver)
{
j.apostar(APUESTA_RIVER);
comunes.add(mazo.dameCartaAleatoria());
//saber si ganamos o no:
//coger las cartas
ArrayList<Carta> cartasJugador= j.getCartas();
banca.addAll(comunes);
cartasJugador.addAll(comunes);
//valorar las cartas y obtener la mejor mano
EncontrarMejorJugada emj = new EncontrarMejorJugada(cartasJugador);
manoJugador= emj.getManoMejor();
emj = new EncontrarMejorJugada(banca);
manoBanca= emj.getManoMejor();
int r= manoJugador.compareTo(manoBanca);
if(r==-1)
{
j.perder(); //perdemos lo apostado
contPierde++;
//return false;
}
else
{
if(r==0)
{
contEmpate++;
j.ganarBote();//recupera lo apostado
}
else if(r==1)
{
contGana++;
int valorMano=manoJugador.dameTipo().getValor();
int valorTrio=3;
if(valorMano<valorTrio)
j.ganarBote(PEOR_TRIO);
else
j.ganarBote(MEJOR_TRIO);
}
//return true;
}
}
else
{
contAbandonaTurn++;
}
}
else
{
contAbandonaFlop++;
}
}
else
{
contAbandonaPreFlop++;
}
//pierde lo que haya apostado en cualquier momento si se ha rendido
if(! apostarFlop || ! apostarInicial || !apostarRiver || !apostarTurn)
{
j.perder();
//return false;
}
//return true;
/*
System.out.println("Mano de jugador: ");
System.out.println(manoJugador);
System.out.println("Mano de banca: ");
System.out.println(manoBanca);
System.out.println("Fondo final del jugador");
System.out.println(j.getFondo());
*/
}
/**
* Devuelve la equity del jugador, respecto a la banca(aleatoria)
* @return
*/
public double dameProb()
{
int cont=0;
//int empate=0;
ArrayList<Carta> jug= j.getCartas();
int NUM_PRUEBAS = 100; //cambiar
for(int i=0;i< NUM_PRUEBAS;i++)
{
ArrayList<Carta> cartasBanca= new ArrayList<Carta>();
ArrayList<Carta> cartasJug = new ArrayList<Carta>() ;
cartasJug.addAll(jug);
//las guardo, para devolverlas al mazo
ArrayList<Carta> aleatoriasBanca = mazo.dameNCartas(2);//para simular
cartasBanca.addAll(aleatoriasBanca);
cartasJug.addAll(comunes);
cartasBanca.addAll(comunes);
int restantes=5-comunes.size();
ArrayList<Carta> aleatorias = mazo.dameNCartas(restantes);
cartasJug.addAll(aleatorias);
cartasBanca.addAll(aleatorias);
/*
System.out.println("num cartas comunes "+ comunes.size());
System.out.println("num cartas banca "+ cartasBanca.size());
System.out.println("num cartas jug "+ cartasJug.size());
*/
EncontrarMejorJugada mejorJugador= new EncontrarMejorJugada(cartasJug);
EncontrarMejorJugada mejorBanca= new EncontrarMejorJugada(cartasBanca);
if(mejorJugador.getManoMejor().compareTo(mejorBanca.getManoMejor())>=0)
cont++;
//devuelvo las cartas aleatorias, al mazo
mazo.insertaCarta(aleatorias);
mazo.insertaCarta(aleatoriasBanca);
}
return (double)cont/ NUM_PRUEBAS; // Equity
}
/**
* Al perder, el jugador pierde lo que ha apostado.
*/
public void retirarse()
{
j.perder();
}
public static void main(String[] args)
{
Simular jug= new Simular(500, 800,200);
jug.simula();
}
}
| [
"vpen01@ucm.es"
] | vpen01@ucm.es |
baa8724d7787c7e5a623ce240a26c2a0662279b3 | 3b72d12871b48a8bae6d65789a5edf8667b8706b | /zqq/dgg_zqq/src/main/java/net/dgg/zqq/dao/order/ApplicantDao.java | 304d4e8a3f2b951ebadbaa398ce09531a267c048 | [] | no_license | xeon-ye/dgg-pro | 53d344ab34c5ddf423485cc8ee5f7de6368d9571 | cc25cb60f1c1c89b4591bbdaec8db1eeba818377 | refs/heads/master | 2023-05-04T20:08:42.972557 | 2019-09-17T08:45:53 | 2019-09-17T08:45:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package net.dgg.zqq.dao.order;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
* @author 刘阳
* @ClassName <ApplicantDao>
* @despriction 查询申请人信息
* @create 2018/10/13 11:24
**/
@Repository
public interface ApplicantDao {
/**
* 查询订单申请人和联系人信息
*
* @param map
* @return
*/
List<Map> queryApplicantMap(Map map);
}
| [
"chenxin4@dgg.net"
] | chenxin4@dgg.net |
e62d5672eeebf3dc833536f0caa9981d6ac0e435 | 454162f978e16a41c22c13d6ed81754771603643 | /less06/src/main/java/com_test/service/UserService.java | b9ee55ad8c51ee5451bd006f77ad46870f38c25a | [] | no_license | dergachovda/JavaEnterprise | 90f78d523f2cfbc9c0fb7424289fed9bb0571702 | 6aed3a0bd8b39915da8a835a0657aeb5e7f3a77d | refs/heads/master | 2020-12-24T12:01:35.619732 | 2018-10-19T07:44:21 | 2018-10-19T07:44:21 | 73,097,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 143 | java | package com_test.service;
import com_test.model.User;
import java.util.List;
public interface UserService {
List<User> getAllUsers();
}
| [
"dergachovda@gmail.com"
] | dergachovda@gmail.com |
ce84ff00700d5a9cb83c9bb8a7016d021aa151c0 | 0386dd72896464326174b50eb6743a02d1a87c3f | /examples/simple20/src/main/java/org/apache/myfaces/examples/example1/UCaseForm.java | a54749b99056d21597e2ee1589c7534e825f4eb7 | [] | no_license | bschuette/tomahawk | f6922930bbb54e6914325fce11764eeeff63ef07 | 8e300e4adbadeb7221df00c3bb2e71ead86b656f | refs/heads/master | 2023-01-04T06:06:33.733606 | 2020-11-05T20:33:48 | 2020-11-05T20:33:48 | 310,410,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,763 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.myfaces.examples.example1;
import java.io.Serializable;
/**
* DOCUMENT ME!
* @author Manfred Geiler
* @version $Revision: 472610 $ $Date: 2006-11-08 14:46:34 -0500 (mié, 08 nov 2006) $
*/
public class UCaseForm
implements Serializable
{ /**
* serial id for serialisation versioning
*/
private static final long serialVersionUID = 1L;
private String text = "";
public void uppercase()
{
text = text.toUpperCase();
}
public void lowercase()
{
text = text.toLowerCase();
}
public String getText()
{
return text;
}
public void setText(String text)
{
this.text = text;
}
/**
* Test method for method binding.
*/
public String jumpHome()
{
System.out.println("JumpHome Action was called.");
return "jump_home";
}
}
| [
"bjoern@schuette.se"
] | bjoern@schuette.se |
7cf99f8e129449e28d4f6ffb0b4c74625196b052 | 3deca3822ec3de4c3fc7d1245a0f3358f40192ea | /src/main/java/com/qarantinno/api/service/impl/ShotServiceImpl.java | c7a6eb0d33166700ba05423f59c740a01e6c2660 | [] | no_license | Qarantinno/api | 53fddc56853bd99b971cbdcd60510f7bccbad12a | f5a0bcb61760be26691369915d561e4253d05cbf | refs/heads/master | 2021-05-18T19:48:44.185010 | 2020-05-26T16:42:36 | 2020-05-26T16:42:36 | 251,387,276 | 0 | 0 | null | 2020-04-27T16:21:23 | 2020-03-30T18:02:52 | Java | UTF-8 | Java | false | false | 1,294 | java | package com.qarantinno.api.service.impl;
import com.qarantinno.api.domain.Shot;
import com.qarantinno.api.domain.criteria.StatisticsCriteria;
import com.qarantinno.api.persistence.mapper.ShotMapper;
import com.qarantinno.api.service.ShotService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class ShotServiceImpl implements ShotService {
private final ShotMapper shotMapper;
public ShotServiceImpl(ShotMapper shotMapper) {
this.shotMapper = shotMapper;
}
@Override
@Transactional
public Shot create(Shot shot, Long placeId) {
if (shot.getShotAt() != null) {
Shot.WeekDay weekDay = Shot.WeekDay.getFrom(shot.getShotAt().getDayOfWeek());
shot.setWeekDay(weekDay);
}
shotMapper.create(shot, placeId);
return shot;
}
@Override
@Transactional(readOnly = true)
public List<Shot> retrieveAllByCriteria(StatisticsCriteria criteria) {
return shotMapper.findAllByCriteria(criteria);
}
@Override
@Transactional(readOnly = true)
public Integer retrieveCountByCriteria(StatisticsCriteria criteria) {
return shotMapper.findCountByCriteria(criteria);
}
}
| [
"rutkovba@gmail.com"
] | rutkovba@gmail.com |
c9c88b64ef5836ff916e66aeff0f98710e3368dc | 3faa133b7ed5340485d05908c6c4af7f8299d4b0 | /src/main/java/com/alves/cursomc/repositories/EstadoRepository.java | ac28e763ee488f04c74b533c9d8676d83512ac80 | [] | no_license | wellsu2018/spring-boot2-ionic-backend | 5eda6df0499fcd9a5d1760507df36b26ff299a7d | 200fff2851846859d01a92e477da99c9b507868d | refs/heads/master | 2020-04-05T08:57:31.870618 | 2018-11-19T13:19:36 | 2018-11-19T13:19:36 | 156,736,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.alves.cursomc.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.alves.cursomc.domain.Estado;
@Repository
public interface EstadoRepository extends JpaRepository<Estado,Integer>{
}
| [
"wellsu@gmail.com"
] | wellsu@gmail.com |
283b3b1b4b15fdf9352ff42702d72c1889d7b601 | ad11f86a1ceb9edb111e479b9ca46d50f0c976f6 | /01_Java_Advanced-16_01_2017/06_Files_and_Streams_Lab_30Jan2017/src/Ex07_ListFiles_31Jan2017.java | df550d57a98219f6a8c7ebf09a89dc768e65a5ee | [] | no_license | IMinchevQA/Java-exercises | 7d074cec6afe5e33f4108d5636005483fc576094 | 444b6a613fcdfc9b916189d4fb63cd1b5e6ac386 | refs/heads/master | 2021-09-23T20:13:19.709083 | 2018-09-27T07:41:58 | 2018-09-27T07:41:58 | 106,247,529 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | import java.io.File;
public class Ex07_ListFiles_31Jan2017 {
public static void main(String[] args){
final String stringPath = "D:\\Videos\\Softuni\\JAVA - 2017\\01_Java_Advanced-Jan-Feb2017\\06. Java-Advanced-Files-and-Directories-Lab-Resources\\Files-and-Streams\\";
File file = new File(stringPath);
if(file.isDirectory()) {
File[] files = file.listFiles();
for (File f : files) {
if (!f.isDirectory()) {
System.out.printf("%s: %s", f.getName(), f.length());
System.out.println();
}
}
}
}
}
| [
"i.minchev.qa@gmail.com"
] | i.minchev.qa@gmail.com |
4207ba844ba631629eac3e41b3d1297f185028f3 | 7375c610746568546cb25565bcba3ef979275b72 | /src/main/java/study/cafe/luna/admin/view/MainController.java | b6ed8ad06c2b545df210908cc3f4a1a4f2786574 | [] | no_license | peb7544/studyCafeLuna | 0ac0540745cd4dbfebcb82149ff7021a00254eea | 8e7f2d334888794bde3dbb599b1b22bdb572e9f5 | refs/heads/master | 2020-04-30T07:27:05.395347 | 2019-03-19T08:50:29 | 2019-03-19T08:50:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package study.cafe.luna.admin.view;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class MainController {
@RequestMapping("moveUserMode.ado")
public String moveUserMode(){
return "/public/mainpage";
}
@RequestMapping("moveAdminMode.ado")
public String moveAdminMode() {
return "/admin/admin";
}
}
| [
"saeah@DESKTOP-6JGCCS1"
] | saeah@DESKTOP-6JGCCS1 |
ef8f865e0215775780749680a12e59bbbc02ca13 | f0b00a54576553334d0d980c053acf8c20d98ab2 | /java-prepare/example/Pre01_6.java | c52a53bc8f63ab44b8ed0671b89af58924cf3e5b | [] | no_license | KANG-SEONGHYEON/bitcamp | 35de0cfda9e13412548f6c59028aa2acbbf00e2d | 606b45bb519b18f7be5333565760e67aa884750b | refs/heads/master | 2021-05-08T05:38:29.152680 | 2018-02-15T15:10:25 | 2018-02-15T15:10:25 | 104,423,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | package bitcamp.java100;
public class Pre01_6 {
public static void main(String[] args){
byte[] arr1;
arr1 = null;
arr1 = new byte[3];
arr1[0] = 10;
arr1[1] = 20;
arr1[2] = 30;
System.out.printf("%d, %d, %d\n", arr1[0], arr1[1], arr1[2]);
arr1[3] = 40;
}
} | [
"wlswlsqud@gmail.com"
] | wlswlsqud@gmail.com |
e3024a7f1974dc2648c59659b73fe22260d0a98d | 1fa5107637f9ab48fe9065827b8303c336f4a723 | /src/org/netbeans/modules/csourcefilepalette/items/resources/TryCatchPopup.java | 6a94d055c34f6aa235863fe20cba3459c30f4b10 | [] | no_license | qcccs/CppPalette | e1ad30f678ade532db4a648b480262ba4037109c | 027839c628645e07546fffdf5b5de2d30382b84d | refs/heads/master | 2020-04-08T08:41:01.613964 | 2013-05-09T12:07:48 | 2013-05-09T12:07:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,671 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.netbeans.modules.csourcefilepalette.items.resources;
import edu.mass.qcc.qcccodewizard.CodeDrop;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
import org.netbeans.api.editor.EditorRegistry;
import org.netbeans.modules.csourcefilepalette.OpenHelpUrl;
import org.netbeans.modules.csourcefilepalette.items.TryCatch;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
/**
*
* @author Ian
*/
public class TryCatchPopup extends javax.swing.JPanel {
private Dialog dialog = null;
private DialogDescriptor descriptor = null;
private boolean dialogOK = false;
TryCatch ifitem;
JTextComponent target;
/**
* Creates new Popup form
* @param item
* @param target
*/
public TryCatchPopup(TryCatch item, JTextComponent target) {
this.ifitem = item;
this.target = target;
initComponents();
}
/**
*
* @return
*/
public boolean showDialog() {
tcButton.setVisible(false);
dialogOK = false;
String displayName = "";
try {
displayName = NbBundle.getBundle("org.netbeans.modules.csourcefilepalette.items.resources.Bundle").getString("NAME_html-tryCatch");
} catch (Exception e) {
}
descriptor = new DialogDescriptor(this, NbBundle.getMessage(NewObjectPopup.class, "LBL_Customizer_InsertPrefix") + " " + displayName, true,
DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.CANCEL_OPTION,
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!descriptor.getValue().equals(DialogDescriptor.CANCEL_OPTION)) {
evaluateInput();
dialogOK = true;
tcButton.doClick();
}
dialog.dispose();
}
});
dialog = DialogDisplayer.getDefault().createDialog(descriptor);
dialog.setVisible(true);
repaint();
return dialogOK;
}
private void evaluateInput() {
String comment = jTextField1.getText();
ifitem.setComment(comment);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
varPane = new javax.swing.JPanel();
excType = new javax.swing.JComboBox();
jLabel4 = new javax.swing.JLabel();
tcButton = new javax.swing.JButton();
jLabel33 = new javax.swing.JLabel();
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.jLabel1.text")); // NOI18N
jTextField1.setText(org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.jTextField1.text")); // NOI18N
varPane.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.varPane.border.title"))); // NOI18N
varPane.setToolTipText(org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.varPane.toolTipText")); // NOI18N
excType.setEditable(true);
excType.setModel(new VariableTypeComboBoxModel());
excType.setToolTipText(org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.excType.toolTipText")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.jLabel4.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(tcButton, org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.tcButton.text")); // NOI18N
tcButton.setToolTipText(org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.tcButton.toolTipText")); // NOI18N
tcButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tcButtonActionPerformed(evt);
}
});
jLabel33.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/mass/qcc/qcccodewizard/Question.png"))); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jLabel33, org.openide.util.NbBundle.getMessage(TryCatchPopup.class, "TryCatchPopup.jLabel33.text")); // NOI18N
jLabel33.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel33MouseClicked(evt);
}
});
javax.swing.GroupLayout varPaneLayout = new javax.swing.GroupLayout(varPane);
varPane.setLayout(varPaneLayout);
varPaneLayout.setHorizontalGroup(
varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(varPaneLayout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(excType, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel33))
.addGroup(varPaneLayout.createSequentialGroup()
.addGap(429, 429, 429)
.addComponent(tcButton)
.addGap(0, 0, Short.MAX_VALUE))
);
varPaneLayout.setVerticalGroup(
varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(varPaneLayout.createSequentialGroup()
.addGroup(varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel33)
.addGroup(varPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(excType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 10, Short.MAX_VALUE)
.addComponent(tcButton)
.addGap(0, 0, 0))
);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(varPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(15, 15, 15)
.addComponent(varPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void tcButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tcButtonActionPerformed
//This adds a new variable into the current document
//Get the currently open java source
JTextComponent jtc = EditorRegistry.lastFocusedComponent();
CodeDrop codedrop = new CodeDrop();
//Find the type of exception.
String exception = excType.getSelectedItem().toString().toLowerCase();
//Construct the output string
StringBuilder sb = new StringBuilder();
sb.append("try {\n\t\t//Try Block Code Here\n\t\t}catch(").append(exception).append(" ex").append("){\n\t\t//Catch Block Here\n\t\tcout << \"An exception occurred. Exception Nr. \" << ex << endl;\n\t\t}");
String code = sb.toString();
try {
//Insert into document
System.out.println("Inserting Code");
CodeDrop.insert(code, jtc);
} catch (BadLocationException ex) {
Exceptions.printStackTrace(ex);
}
//Call combobox models visit method to update with the new variable.
}//GEN-LAST:event_tcButtonActionPerformed
private void jLabel33MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel33MouseClicked
// Help Page
OpenHelpUrl o = new OpenHelpUrl("http://www.cplusplus.com");
}//GEN-LAST:event_jLabel33MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup buttonGroup1;
private javax.swing.JComboBox excType;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel33;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField jTextField1;
private javax.swing.JButton tcButton;
private javax.swing.JPanel varPane;
// End of variables declaration//GEN-END:variables
}
| [
"ian@ian-THINK"
] | ian@ian-THINK |
847147fe5ea2a32e03a185bfcf65fd9bb7d07e3c | 53d7b150cbbfb4602ecbb5f78de9a26e590b1b47 | /src/lsg/bags/SmallBags.java | bf7ab012347e0fcbe8fd78b8cf52496868c6df6b | [] | no_license | antoinelemarie/Learning_souls_game | 801937b70943c93714517671c9fd4e053ce8f8a0 | 0739f9fc2f8ebf08c9fa59499abc7cc6f9017328 | refs/heads/master | 2021-04-26T22:16:12.755654 | 2018-04-29T21:51:11 | 2018-04-29T21:51:11 | 124,058,349 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package lsg.bags;
public class SmallBags extends Bags {
public SmallBags(int capacity) {
super(capacity);
}
public SmallBags() {
super();
this.capacity = 10;
}
}
| [
"azelnoot@gmail.com"
] | azelnoot@gmail.com |
bc52bf5d500c39487d3eda6ecb82154b8a7be530 | fbbdfb24a30e703c2e176f8572095579f6645109 | /cocmore-core/src/test/java/com/yunzo/cocmore/core/function/service/GroupsActivityServiceImplTest.java | 16143290173fffcfe4c33732f885e24f68ab4856 | [] | no_license | ailierke/git | 231216ff5a172c41cd055b18b1a9652ff7e8b2a0 | 02b4ad8d930c1c58efd272f83642dcd2bf22477a | refs/heads/master | 2021-01-01T19:30:13.731074 | 2015-05-22T09:23:53 | 2015-05-22T09:23:53 | 35,592,789 | 0 | 0 | null | 2015-05-15T07:55:40 | 2015-05-14T05:30:40 | Java | UTF-8 | Java | false | false | 4,146 | java | package com.yunzo.cocmore.core.function.service;
import java.util.Date;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
//import org.springframework.transaction.annotation.Transactional;
import com.yunzo.cocmore.core.config.AppConfig;
import com.yunzo.cocmore.core.function.model.mysql.YBasicMember;
import com.yunzo.cocmore.core.function.model.mysql.YBasicSocialgroups;
import com.yunzo.cocmore.core.function.model.mysql.YBasicSocialgroupsactivity;
import com.yunzo.cocmore.core.function.model.mysql.YBasicType;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes={AppConfig.class})//使用servlet3.0xin特性使用这个类
//使用servlet2.0使用配置文件@ContextConfiguration({"classpath:config/context/applicationContext-AppConfig.xml","classpath:config/context/applicationContext-CachingConfig.xml","classpath:config/context/applicationContext-DaoConfig.xml","classpath:config/context/applicationContext-DataSourceConfig.xml","classpath:config/context/applicationContext-MvcConfig.xml","classpath:config/context/applicationContext-MvcConfig.xml" })
//@Transactional
//@TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true)
public class GroupsActivityServiceImplTest{
Logger logger = Logger.getLogger(GroupsActivityServiceImplTest.class);
@Resource
GroupsActivityService groupsActivityService;
public YBasicSocialgroupsactivity activity;
@Before
public void befoIanre(){
}
@Test
// @Ignore
public void testAddGroupActivity() {
YBasicSocialgroups yBasicSocialgroups= new YBasicSocialgroups();yBasicSocialgroups.setFid("6f4f07da-1317-44a1-a467-366aa9068db6");
YBasicType yBasicType = new YBasicType();yBasicType.setFid("Fid");
activity = new YBasicSocialgroupsactivity();
activity.setFbillState(0);
activity.setYBasicSocialgroups(yBasicSocialgroups);
activity.setFcomment("1");
activity.setFheadline("1");
activity.setFmessage("1");
activity.setFnumber("1");
activity.setFimages("1");
activity.setFsponsor("1");
activity.setFsite("1");
activity.setFpeopleNum(new Integer(1));
activity.setFstartTime(new java.sql.Date(new Date().getTime()));
activity.setFfinishTime(new java.sql.Date(new Date().getTime()));
activity.setYBasicType(yBasicType);
groupsActivityService.addActivity(activity);
}
@Test
// @Ignore
public void testFindAllGroup(){
groupsActivityService.getAllActivityPagingList(null, null, "6f4f07da-1317-44a1-a467-366aa9068db6","");
}
@Test
// @Ignore
public void testUpdateGroup(){
YBasicSocialgroups yBasicSocialgroups= new YBasicSocialgroups();yBasicSocialgroups.setFid("6f4f07da-1317-44a1-a467-366aa9068db6");
activity = new YBasicSocialgroupsactivity();
YBasicType yBasicType = new YBasicType();yBasicType.setFid("Fid");
activity.setFbillState(1);
activity.setYBasicSocialgroups(yBasicSocialgroups);
activity.setFcomment("2");
activity.setFheadline("2");
activity.setFmessage("2");
activity.setFnumber("2");
activity.setFimages("2");
activity.setFsponsor("1");
activity.setFsite("2");
activity.setFpeopleNum(new Integer(2));
activity.setFstartTime(new java.sql.Date(new Date().getTime()));
activity.setFfinishTime(new java.sql.Date(new Date().getTime()));
activity.setYBasicType(yBasicType);
activity.setFid("bca38dc2-c24d-4740-8b07-28eb20c5f8e3");
groupsActivityService.updateActivity(activity);
}
@Test
public void testDeleteGroupActivity(){
activity = new YBasicSocialgroupsactivity();
activity.setFid("bca38dc2-c24d-4740-8b07-28eb20c5f8e3");//这个的id是表中存在数据的id
groupsActivityService.deleteActivity(activity);
}
}
| [
"724941972@qq.com"
] | 724941972@qq.com |
141ddf5d2cd4f7339dcfe0055f1140feef45fe1a | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/dbeaver/2016/12/SSHConstants.java | 4f4a6ad3eb8082c23a1b3149fb8c5a08a8bf9777 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 1,536 | java | /*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2016 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.model.impl.net;
/**
* Constants for SSH tunnel
*/
public class SSHConstants {
public static final int DEFAULT_SSH_PORT = 22;
public static final int DEFAULT_CONNECT_TIMEOUT = 10000;
public static final String PROP_HOST = "host";
public static final String PROP_PORT = "port";
public static final String PROP_AUTH_TYPE = "authType";
public static final String PROP_KEY_PATH = "keyPath";
public static final String PROP_ALIVE_INTERVAL = "aliveInterval";
public static final String PROP_ALIVE_COUNT = "aliveCount";
public static final String PROP_CONNECT_TIMEOUT = "sshConnectTimeout";
public static enum AuthType {
PASSWORD,
PUBLIC_KEY
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
099f7e48f35f23f19f06531f2c7ef1780f85edab | 2760cbcf6a5cf401c37ad47b7055cd455d170ca9 | /javademo/src/java0721_exception_stream/Java153_exception.java | c5b894b89464438ac9e34f9e27bd3eb3d9f8ceb8 | [] | no_license | davidkim9204/KH | d761f3a2721e1c3edf124c6ebf3e229b2836dfe8 | d2f39c5c8075c54d84c565783e4c0e0e6314ce64 | refs/heads/master | 2021-01-12T12:27:49.630370 | 2016-11-02T08:11:03 | 2016-11-02T08:11:03 | 72,500,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package java0721_exception_stream;
/*
* 사용자(프로그래머)가 예외클래스를 만들 수 있도록 제공이 되는데
* 이때 java.lang.Exception을 상속받아 구현한다.
*/
//전부 exception에서 상속받아왔음
class User extends Exception{
public User(String message){
super(message);
}
}//end User
public class Java153_exception {
public static void main(String[] args) {
int num=9;
try{
if(num<10 || num>99)
throw new User("2자리만 입력하세요.");
System.out.println(num);
}catch(User ex){
System.out.println(ex.toString());
}
}//end main()
}//end class
| [
"user1@user1-PC"
] | user1@user1-PC |
d116bd9a16eabb3b4d3ca4772c9d9787eb92e9a4 | b0b2aca45106959f5ea3893b83e3b725aa348506 | /app/src/main/java/com/gt/store/adapter/SubCommentAdapter.java | 8450a28d3dcefe00a1f871925f24d2cb02fb0da5 | [] | no_license | octopusy/GTStore | f23ebbcaf22d1f35a13b050dcd24c7a58f81f549 | d5a95fa8265ae08512f09f1d884312ec5ec4ba3c | refs/heads/master | 2021-04-18T18:45:55.348403 | 2020-04-12T06:08:47 | 2020-04-12T06:08:47 | 126,290,012 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,367 | java | package com.gt.store.adapter;
import android.content.Context;
import android.view.ViewGroup;
import com.gt.store.model.bean.SubCommentDataModel;
import com.gt.store.ui.viewholder.NoSubCommentViewHolder;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter;
import com.gt.store.ui.viewholder.SubCommentViewHolder;
import java.util.ArrayList;
import java.util.HashMap;
/**
* author:Richard
* Date:16/6/17 下午10:11
*/
public class SubCommentAdapter extends RecyclerArrayAdapter<SubCommentDataModel> {
private int subCommentDetail = 0;
private int noCommentData = 1;
public static HashMap<Integer, ArrayList<HashMap<Integer, Boolean>>> isNotLike = new HashMap<>();
public SubCommentAdapter(Context context) {
super(context);
}
@Override
public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == subCommentDetail) {
return new SubCommentViewHolder(parent);
} else if (viewType == noCommentData) {
return new NoSubCommentViewHolder(parent);
}
return null;
}
@Override
public int getViewType(int position) {
if (getItem(0) != null) {
return subCommentDetail;
} else {
return noCommentData;
}
}
} | [
"zhangyang5547662@126.com"
] | zhangyang5547662@126.com |
2fb9fd4dbc49e29d905700e0309cfadd90cc8eea | 9b98bb7f88b17633bb5ba21957682b160ca6cf26 | /src/main/java/com/ddabadi/service/HistoryCustomerService.java | 32166e79b95657a2673ebe2fab70db5bda0d4114 | [
"Apache-2.0"
] | permissive | fdeddys/bangunan-backend | 27706914beef95ae67ee67ddbe72899511901129 | 8f6c4aaa28b2695273622610fbc5e48b97cb3929 | refs/heads/master | 2020-04-05T23:42:19.238725 | 2016-09-16T17:14:07 | 2016-09-16T17:14:07 | 68,398,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 423 | java | package com.ddabadi.service;
import com.ddabadi.domain.HistoryCustomer;
import org.springframework.data.domain.Page;
import java.util.Date;
/**
* Created by deddy on 6/8/16.
*/
public interface HistoryCustomerService {
HistoryCustomer save(HistoryCustomer historyCustomer);
Page<HistoryCustomer> getByCustomerIdtglTransaksi(Long idCust, Date tglAwal, Date tglAkhir, int hal, int jumlah, Boolean allData);
}
| [
"fransiscus.deddy@gmail.com"
] | fransiscus.deddy@gmail.com |
fce1ca738da5b26df30d04cf87761799076a4bb2 | 3534bc9ad76465d9a237ff34ce9352e15e359cb4 | /app/src/main/java/com/dream/myliu/liangwarehouse/entity/Wares.java | 5b11c38eb5e1b61463451de926e9eb361f6eba46 | [] | no_license | dearHaoGeGe/LiangWarehouse | e1f6e51423b25b6fd3cdf007501f6cb284556d77 | 38e3137ae5add467ff05b7fcb0cf791f022657e9 | refs/heads/master | 2021-01-01T05:07:37.149441 | 2016-05-13T07:18:15 | 2016-05-13T07:18:15 | 58,711,483 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | package com.dream.myliu.liangwarehouse.entity;
import java.io.Serializable;
/**
*/
public class Wares implements Serializable {
private Long id;
private String name;
private String imgUrl;
private String description;
private Float price;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getImgUrl() {
return imgUrl;
}
public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
}
| [
"862157904@qq.com"
] | 862157904@qq.com |
0a07ff3b1c1ae0c71ae7c54dc0320c5b5cde141e | 7730e9171cad5a0bd80e29582dedcf844e03376b | /app/src/androidTest/java/com/example/tongan/unitrade/LoginInstrumentedTests.java | 8f4583b226f3dc712449222886eb936f061ba1fc | [] | no_license | omechan233/CS307-UniTrade | f7a4ccc16a39eefa0a611dc7fb4a34c639866d84 | bdaf1e091f85450910da855ca6a1ce6fdf6b8a79 | refs/heads/master | 2020-03-28T00:21:18.487248 | 2018-12-04T00:10:29 | 2018-12-04T00:10:29 | 147,402,047 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,779 | java | package com.example.tongan.unitrade;
import android.app.Instrumentation;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.espresso.Espresso;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class LoginInstrumentedTests {
private String email;
private String password;
@Rule
public ActivityTestRule<MainActivity> loginActivityRule = new ActivityTestRule<>(MainActivity.class);
@Before
public void initUsernameAndPassword(){
email = "smerritt987@gmail.com";
password = "ABC1234";
}
/**
* Test for inputting an email not in the Firebase Authentication system
*/
@Test
public void fakeEmailTest(){
//attempt to login with fake email
onView(withId(R.id.login_email_input)).perform(typeText("fake@email.com"));
onView(withId(R.id.login_password_input)).perform(typeText(password));
//close keyboard
Espresso.closeSoftKeyboard();
//make sure inputs match
onView(withId(R.id.login_email_input)).check(matches(withText("fake@email.com")));
onView(withId(R.id.login_password_input)).check(matches(withText(password)));
//attempt to login
onView(withId(R.id.login_login_btn)).perform(click());
//check if toast was displayed
onView(withText(MainActivity.bad_email_or_password)).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void invalidEmailTest(){
//attempt to login with fake email
onView(withId(R.id.login_email_input)).perform(typeText("poopoo email"));
onView(withId(R.id.login_password_input)).perform(typeText(password));
//close keyboard
Espresso.closeSoftKeyboard();
//make sure inputs match
onView(withId(R.id.login_email_input)).check(matches(withText("poopoo email")));
onView(withId(R.id.login_password_input)).check(matches(withText(password)));
//attempt to login
onView(withId(R.id.login_login_btn)).perform(click());
//check if toast was displayed
onView(withText(MainActivity.invalid_email_or_password)).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void invalidPasswordTest(){
//attempt to login with wrong password format
onView(withId(R.id.login_email_input)).perform(typeText(email));
onView(withId(R.id.login_password_input)).perform(typeText("abc"));
//close keyboard
Espresso.closeSoftKeyboard();
//make sure inputs match
onView(withId(R.id.login_email_input)).check(matches(withText(email)));
onView(withId(R.id.login_password_input)).check(matches(withText("abc")));
//attempt to login
onView(withId(R.id.login_login_btn)).perform(click());
//check if toast was displayed
onView(withText(MainActivity.invalid_email_or_password)).inRoot(new ToastMatcher()).check(matches(isDisplayed()));
}
@Test
public void validLoginTest(){
Instrumentation.ActivityMonitor monitor =
getInstrumentation().
addMonitor(MainActivity.class.getName(), null, false);
MainActivity loginAct = loginActivityRule.getActivity();
//attempt to login with wrong password format
onView(withId(R.id.login_email_input)).perform(typeText(email));
onView(withId(R.id.login_password_input)).perform(typeText(password));
//close keyboard
Espresso.closeSoftKeyboard();
//make sure inputs match
onView(withId(R.id.login_email_input)).check(matches(withText(email)));
onView(withId(R.id.login_password_input)).check(matches(withText(password)));
//attempt to login
onView(withId(R.id.login_login_btn)).perform(click());
monitor.waitForActivityWithTimeout(3000);
//go to settings and logout
onView(withId(R.id.home_settings_btn)).perform(click());
onView(withId(R.id.logout_setting_icon)).perform(click());
}
}
| [
"smerrit@purdue.edu"
] | smerrit@purdue.edu |
e4dd268d1b63f863e91ba4c29026e36babac6f00 | e5b427889dad2e65d3699141a1b38b3281a61ef6 | /src/test/java/pages/groups/GraphicsData.java | cbf721df58772efc26589ae6baa7a0bb801c4cc5 | [] | no_license | kgromov/px-automation | 1b1ada4df13775c73ef28237319599039b6a8be3 | 2362f76f7c3778badbdbbf0db1e8c1e9e6d439a8 | refs/heads/master | 2021-05-06T07:51:08.955242 | 2017-12-12T09:45:45 | 2017-12-12T09:45:45 | 113,971,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 836 | java | package pages.groups;
import configuration.helpers.DataHelper;
import org.json.JSONArray;
import java.util.HashSet;
import java.util.Set;
/**
* Created by kgr on 8/4/2017.
*/
public interface GraphicsData {
boolean hasBubbleDataToCalculate(JSONArray jsonArray);
boolean hasStackedDataToCalculate(JSONArray jsonArray);
default Set<String> getBubbleChartGraphicParams(String url) {
return new HashSet<>(DataHelper.getValuesJSONFromURL(url, "chart", "b1", "b2", "b3"));
}
default Set<String> getColumnChartGraphicParams(String url) {
return new HashSet<>(DataHelper.getValuesJSONFromURL(url, "chart", "c2")); //"c1",
}
default Set<String> setStackedAreaChartGraphicParams(String url) {
return new HashSet<>(DataHelper.getValuesJSONFromURL(url, "chart", "sa1", "sa2"));
}
}
| [
"konstantin@revimedia.com"
] | konstantin@revimedia.com |
efb3d7b30e458cffcad0cb07299bb1845e5e5578 | 8d7c7d45f535f15936d1b22b48e1f64a5bfd1779 | /TalentRoni_vlad_omer/src/a/Address.java | 9b303867bed92f61697876f33441ff1e4051c94e | [] | no_license | roncohen15/822-126 | 4b1a44416ea61a90979d26712851b4979541bc18 | 05aa777ed5bcb4754614a7e934b0ef68fe0bfc0b | refs/heads/master | 2023-04-02T23:24:08.278172 | 2021-04-05T10:26:10 | 2021-04-05T10:26:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 761 | java | package a;
public class Address implements Cloneable {
private String street;
private int number;
public Address(String street, int number) {
super();
this.street = street;
this.number = number;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
@Override
public String toString() {
return "Address [street=" + street + ", number=" + number + "]";
}
// shalow
public Address getClone() {
Address other;
try {
other = (Address) this.clone();
return other;
} catch (CloneNotSupportedException e) {
e.printStackTrace();
return null;
}
}
}
| [
"eldarba@gmail.com"
] | eldarba@gmail.com |
bdaec482f12395b0e7aec3def6c352d74c67b4d1 | 4ee8aae05a349bd9b747e791eee6f688125442c7 | /application/src/main/java/holunda/taskassignment/business/BusinessDataServiceBean.java | 136d24068ba77b7d700524ee442faa54a040c1c7 | [
"BSD-3-Clause"
] | permissive | holunda-io/example-task-assignment-with-dmn | 2f70ed83864d39187f629f34a33e4447c2d7b9aa | 01d265c1084eec58e23879bbef762736fade13c4 | refs/heads/master | 2022-07-03T18:01:34.101971 | 2022-06-03T07:46:36 | 2022-06-03T07:46:36 | 112,216,289 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,331 | java | package holunda.taskassignment.business;
import holunda.taskassignment.api.BusinessDataService;
import holunda.taskassignment.api.model.BusinessData;
import holunda.taskassignment.api.model.BusinessKey;
import holunda.taskassignment.business.jpa.PackageRepository;
import holunda.taskassignment.business.jpa.entity.PackageEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Implementation of {@link BusinessDataService}} that uses {@link PackageEntity#toMap()} to extract required keys.
*/
@Service
public class BusinessDataServiceBean implements BusinessDataService {
@Autowired
@Qualifier("readOnly")
private PackageRepository packageRepository;
@Override
public BusinessData loadBusinessData(BusinessKey businessKey, Set<String> keys) {
final PackageEntity packageEntity = packageRepository.findOne(businessKey.getValue());
final Map<String, Integer> values = new HashMap<>();
if (packageEntity != null) {
Map<String, Integer> p = packageEntity.toMap();
for (final String key : keys) {
values.put(key, p.get(key));
}
}
return new BusinessData(values);
}
}
| [
"jan.galinski@holisticon.de"
] | jan.galinski@holisticon.de |
d673929e330dc10a29e6d4f93c2cfe18015e4f90 | 64f0a73f1f35078d94b1bc229c1ce6e6de565a5f | /dataset/Top APKs Java Files/nelt.descargar-com-appodeal-ads-ac.java | 19ea0242241219dba8699f3fe3841acbc8196c9a | [
"MIT"
] | permissive | S2-group/mobilesoft-2020-iam-replication-package | 40d466184b995d7d0a9ae6e238f35ecfb249ccf0 | 600d790aaea7f1ca663d9c187df3c8760c63eacd | refs/heads/master | 2021-02-15T21:04:20.350121 | 2020-10-05T12:48:52 | 2020-10-05T12:48:52 | 244,930,541 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 41,867 | java | package com.appodeal.ads;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Pair;
import com.appodeal.ads.e.d;
import com.appodeal.ads.e.e;
import com.appodeal.ads.e.g;
import com.appodeal.ads.utils.Log.LogLevel;
import com.appodeal.ads.utils.ae;
import com.appodeal.ads.utils.aj;
import com.appodeal.ads.utils.c.a;
import com.appodeal.ads.utils.p;
import com.appodeal.ads.utils.v;
import com.appodeal.ads.utils.x;
import java.math.BigInteger;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Queue;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class ac
{
static JSONObject r;
boolean A;
String B;
double C;
private final JSONObject D;
private final Handler E;
private final int F;
private final int G;
private boolean H;
final a a;
final Context b;
final int c;
final String d;
final String e;
String f;
String g;
final d h;
long i;
final String j;
Long k;
final int l;
final double m;
final boolean n;
String o;
JSONObject p;
String q;
boolean s;
boolean t;
boolean u;
boolean v;
boolean w;
boolean x;
boolean y;
boolean z;
private ac(c paramC)
{
boolean bool2 = false;
this.F = 0;
this.G = 1;
this.a = c.a(paramC);
this.b = c.b(paramC);
this.c = c.c(paramC);
this.d = c.d(paramC);
this.e = c.e(paramC);
this.h = c.f(paramC);
this.j = c.g(paramC);
this.l = c.h(paramC);
this.m = c.i(paramC);
this.n = c.j(paramC);
this.B = c.k(paramC);
this.C = c.l(paramC);
this.D = c.m(paramC);
if (c.n(paramC) != null)
{
this.p = c.n(paramC).C;
String str;
if ((c.n(paramC).v) && (c.n(paramC).w == null)) {
str = c.n(paramC).B;
} else {
str = null;
}
this.o = str;
this.k = c.n(paramC).z;
this.i = c.n(paramC).k();
this.g = c.n(paramC).w;
this.f = c.n(paramC).n;
this.q = c.n(paramC).p();
}
this.E = new Handler(Looper.getMainLooper())
{
public void handleMessage(Message paramAnonymousMessage)
{
if (ac.this.a != null)
{
switch (paramAnonymousMessage.what)
{
default:
return;
case 1:
paramAnonymousMessage = (JSONObject)paramAnonymousMessage.obj;
if (paramAnonymousMessage != null)
{
ac.this.a.a(paramAnonymousMessage, ac.this.c, ac.this.d);
return;
}
break;
}
ac.this.a.a(ac.this.c);
}
}
};
if (this.d == null) {
return;
}
if (l.b)
{
paramC = this.a;
if (((paramC == null) || ((paramC instanceof aj))) && ((this.d.equals("init")) || (this.d.equals("stats")) || (this.d.equals("show")) || (this.d.equals("click")) || (this.d.equals("finish")) || (this.d.equals("install")))) {
return;
}
}
if ((!this.d.equals("banner")) && (!this.d.equals("debug"))) {
bool1 = false;
} else {
bool1 = true;
}
this.s = bool1;
if ((!this.d.equals("banner_320")) && (!this.d.equals("debug_banner_320"))) {
bool1 = false;
} else {
bool1 = true;
}
this.t = bool1;
if ((!this.d.equals("banner_mrec")) && (!this.d.equals("debug_mrec"))) {
bool1 = false;
} else {
bool1 = true;
}
this.u = bool1;
if ((!this.d.equals("video")) && (!this.d.equals("debug_video"))) {
bool1 = false;
} else {
bool1 = true;
}
this.v = bool1;
if ((!this.d.equals("rewarded_video")) && (!this.d.equals("debug_rewarded_video"))) {
bool1 = false;
} else {
bool1 = true;
}
this.w = bool1;
if ((!this.d.equals("native")) && (!this.d.equals("debug_native"))) {
bool1 = false;
} else {
bool1 = true;
}
this.x = bool1;
if ((!this.d.equals("debug")) && (!this.d.equals("debug_banner_320")) && (!this.d.equals("debug_video")) && (!this.d.equals("debug_rewarded_video")) && (!this.d.equals("debug_mrec")) && (!this.d.equals("debug_native"))) {
bool1 = false;
} else {
bool1 = true;
}
this.y = bool1;
if ((!this.s) && (!this.t) && (!this.u) && (!this.v) && (!this.w) && (!this.x)) {
bool1 = false;
} else {
bool1 = true;
}
this.z = bool1;
boolean bool1 = bool2;
if (!this.d.equals("init"))
{
bool1 = bool2;
if (!this.d.equals("stats"))
{
bool1 = bool2;
if (!this.d.equals("show"))
{
bool1 = bool2;
if (!this.d.equals("click"))
{
bool1 = bool2;
if (!this.d.equals("finish"))
{
bool1 = bool2;
if (!this.d.equals("install"))
{
bool1 = bool2;
if (!this.d.equals("iap")) {
bool1 = true;
}
}
}
}
}
}
}
this.A = bool1;
this.H = true;
}
/* Error */
private String a(URL paramURL, JSONObject paramJSONObject, SharedPreferences paramSharedPreferences, javax.net.ssl.SSLSocketFactory paramSSLSocketFactory)
{
// Byte code:
// 0: aconst_null
// 1: astore 9
// 3: aconst_null
// 4: astore 10
// 6: aconst_null
// 7: astore 11
// 9: aconst_null
// 10: astore 12
// 12: aload_1
// 13: invokevirtual 264 java/net/URL:openConnection ()Ljava/net/URLConnection;
// 16: astore 7
// 18: aload 4
// 20: ifnull +34 -> 54
// 23: aload 7
// 25: astore 8
// 27: aload_1
// 28: invokevirtual 267 java/net/URL:getProtocol ()Ljava/lang/String;
// 31: ldc_w 269
// 34: invokevirtual 186 java/lang/String:equals (Ljava/lang/Object;)Z
// 37: ifeq +17 -> 54
// 40: aload 7
// 42: astore 8
// 44: aload 7
// 46: checkcast 271 javax/net/ssl/HttpsURLConnection
// 49: aload 4
// 51: invokevirtual 275 javax/net/ssl/HttpsURLConnection:setSSLSocketFactory (Ljavax/net/ssl/SSLSocketFactory;)V
// 54: aload 7
// 56: astore 8
// 58: aload_0
// 59: getfield 239 com/appodeal/ads/ac:A Z
// 62: ifeq +51 -> 113
// 65: aload 7
// 67: astore 8
// 69: aload_3
// 70: aload_0
// 71: getfield 85 com/appodeal/ads/ac:d Ljava/lang/String;
// 74: invokeinterface 281 2 0
// 79: ifeq +34 -> 113
// 82: sipush 10000
// 85: istore 5
// 87: aload 7
// 89: astore 8
// 91: aload 7
// 93: sipush 10000
// 96: invokevirtual 287 java/net/URLConnection:setConnectTimeout (I)V
// 99: aload 7
// 101: astore 8
// 103: aload 7
// 105: iload 5
// 107: invokevirtual 290 java/net/URLConnection:setReadTimeout (I)V
// 110: goto +23 -> 133
// 113: sipush 20000
// 116: istore 5
// 118: aload 7
// 120: astore 8
// 122: aload 7
// 124: sipush 20000
// 127: invokevirtual 287 java/net/URLConnection:setConnectTimeout (I)V
// 130: goto -31 -> 99
// 133: aload 7
// 135: astore 8
// 137: aload 7
// 139: ldc_w 292
// 142: ldc_w 294
// 145: invokevirtual 298 java/net/URLConnection:setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V
// 148: aload 7
// 150: astore 8
// 152: aload 7
// 154: iconst_1
// 155: invokevirtual 302 java/net/URLConnection:setDoOutput (Z)V
// 158: aload 7
// 160: astore 8
// 162: new 304 java/io/ByteArrayOutputStream
// 165: dup
// 166: invokespecial 305 java/io/ByteArrayOutputStream:<init> ()V
// 169: astore_1
// 170: aload 7
// 172: astore 8
// 174: new 307 java/util/zip/GZIPOutputStream
// 177: dup
// 178: aload_1
// 179: invokespecial 310 java/util/zip/GZIPOutputStream:<init> (Ljava/io/OutputStream;)V
// 182: astore_3
// 183: aload_3
// 184: aload_2
// 185: invokevirtual 315 org/json/JSONObject:toString ()Ljava/lang/String;
// 188: ldc_w 317
// 191: invokevirtual 321 java/lang/String:getBytes (Ljava/lang/String;)[B
// 194: invokevirtual 325 java/util/zip/GZIPOutputStream:write ([B)V
// 197: aload 7
// 199: astore 8
// 201: aload_3
// 202: invokevirtual 328 java/util/zip/GZIPOutputStream:close ()V
// 205: goto +12 -> 217
// 208: astore_2
// 209: aload 7
// 211: astore 8
// 213: aload_2
// 214: invokestatic 333 com/appodeal/ads/Appodeal:a (Ljava/lang/Throwable;)V
// 217: aload 7
// 219: astore 8
// 221: aload_1
// 222: invokevirtual 337 java/io/ByteArrayOutputStream:toByteArray ()[B
// 225: iconst_0
// 226: invokestatic 343 android/util/Base64:encodeToString ([BI)Ljava/lang/String;
// 229: astore_1
// 230: aload 7
// 232: astore 8
// 234: aload 7
// 236: invokevirtual 347 java/net/URLConnection:getOutputStream ()Ljava/io/OutputStream;
// 239: aload_1
// 240: invokestatic 352 com/appodeal/ads/bg:a (Ljava/io/OutputStream;Ljava/lang/String;)V
// 243: aload 7
// 245: astore 8
// 247: aload 7
// 249: invokevirtual 356 java/net/URLConnection:getInputStream ()Ljava/io/InputStream;
// 252: invokestatic 359 com/appodeal/ads/bg:a (Ljava/io/InputStream;)Ljava/lang/String;
// 255: astore_2
// 256: aload 12
// 258: astore_1
// 259: aload_2
// 260: ifnull +43 -> 303
// 263: aload 12
// 265: astore_1
// 266: aload 7
// 268: astore 8
// 270: aload_2
// 271: invokevirtual 363 java/lang/String:isEmpty ()Z
// 274: ifne +29 -> 303
// 277: aload 7
// 279: astore 8
// 281: aload_2
// 282: ldc_w 365
// 285: invokevirtual 186 java/lang/String:equals (Ljava/lang/Object;)Z
// 288: istore 6
// 290: iload 6
// 292: ifeq +9 -> 301
// 295: aload 12
// 297: astore_1
// 298: goto +5 -> 303
// 301: aload_2
// 302: astore_1
// 303: aload_1
// 304: astore_2
// 305: aload 7
// 307: ifnull +138 -> 445
// 310: aload 7
// 312: instanceof 271
// 315: ifeq +15 -> 330
// 318: aload_1
// 319: astore_2
// 320: aload 7
// 322: checkcast 271 javax/net/ssl/HttpsURLConnection
// 325: invokevirtual 368 javax/net/ssl/HttpsURLConnection:disconnect ()V
// 328: aload_2
// 329: areturn
// 330: aload_1
// 331: astore_2
// 332: aload 7
// 334: instanceof 370
// 337: ifeq +108 -> 445
// 340: aload_1
// 341: astore_2
// 342: aload 7
// 344: checkcast 370 java/net/HttpURLConnection
// 347: invokevirtual 371 java/net/HttpURLConnection:disconnect ()V
// 350: aload_2
// 351: areturn
// 352: astore_1
// 353: aload 7
// 355: astore 8
// 357: aload_3
// 358: invokevirtual 328 java/util/zip/GZIPOutputStream:close ()V
// 361: goto +12 -> 373
// 364: astore_2
// 365: aload 7
// 367: astore 8
// 369: aload_2
// 370: invokestatic 333 com/appodeal/ads/Appodeal:a (Ljava/lang/Throwable;)V
// 373: aload 7
// 375: astore 8
// 377: aload_1
// 378: athrow
// 379: astore_2
// 380: aload 7
// 382: astore_1
// 383: goto +13 -> 396
// 386: astore_1
// 387: aconst_null
// 388: astore 8
// 390: goto +58 -> 448
// 393: astore_2
// 394: aconst_null
// 395: astore_1
// 396: aload_1
// 397: astore 8
// 399: aload_2
// 400: invokestatic 333 com/appodeal/ads/Appodeal:a (Ljava/lang/Throwable;)V
// 403: aload 11
// 405: astore_2
// 406: aload_1
// 407: ifnull +38 -> 445
// 410: aload_1
// 411: instanceof 271
// 414: ifeq +12 -> 426
// 417: aload 9
// 419: astore_2
// 420: aload_1
// 421: astore 7
// 423: goto -103 -> 320
// 426: aload 11
// 428: astore_2
// 429: aload_1
// 430: instanceof 370
// 433: ifeq +12 -> 445
// 436: aload 10
// 438: astore_2
// 439: aload_1
// 440: astore 7
// 442: goto -100 -> 342
// 445: aload_2
// 446: areturn
// 447: astore_1
// 448: aload 8
// 450: ifnull +38 -> 488
// 453: aload 8
// 455: instanceof 271
// 458: ifne +22 -> 480
// 461: aload 8
// 463: instanceof 370
// 466: ifeq +22 -> 488
// 469: aload 8
// 471: checkcast 370 java/net/HttpURLConnection
// 474: invokevirtual 371 java/net/HttpURLConnection:disconnect ()V
// 477: goto +11 -> 488
// 480: aload 8
// 482: checkcast 271 javax/net/ssl/HttpsURLConnection
// 485: invokevirtual 368 javax/net/ssl/HttpsURLConnection:disconnect ()V
// 488: aload_1
// 489: athrow
// Local variable table:
// start length slot name signature
// 0 490 0 this ac
// 0 490 1 paramURL URL
// 0 490 2 paramJSONObject JSONObject
// 0 490 3 paramSharedPreferences SharedPreferences
// 0 490 4 paramSSLSocketFactory javax.net.ssl.SSLSocketFactory
// 85 32 5 i1 int
// 288 3 6 bool boolean
// 16 425 7 localObject1 Object
// 25 456 8 localObject2 Object
// 1 417 9 localObject3 Object
// 4 433 10 localObject4 Object
// 7 420 11 localObject5 Object
// 10 286 12 localObject6 Object
// Exception table:
// from to target type
// 201 205 208 java/lang/Exception
// 183 197 352 finally
// 357 361 364 java/lang/Exception
// 27 40 379 java/io/IOException
// 44 54 379 java/io/IOException
// 58 65 379 java/io/IOException
// 69 82 379 java/io/IOException
// 91 99 379 java/io/IOException
// 103 110 379 java/io/IOException
// 122 130 379 java/io/IOException
// 137 148 379 java/io/IOException
// 152 158 379 java/io/IOException
// 162 170 379 java/io/IOException
// 174 183 379 java/io/IOException
// 201 205 379 java/io/IOException
// 213 217 379 java/io/IOException
// 221 230 379 java/io/IOException
// 234 243 379 java/io/IOException
// 247 256 379 java/io/IOException
// 270 277 379 java/io/IOException
// 281 290 379 java/io/IOException
// 357 361 379 java/io/IOException
// 369 373 379 java/io/IOException
// 377 379 379 java/io/IOException
// 12 18 386 finally
// 12 18 393 java/io/IOException
// 27 40 447 finally
// 44 54 447 finally
// 58 65 447 finally
// 69 82 447 finally
// 91 99 447 finally
// 103 110 447 finally
// 122 130 447 finally
// 137 148 447 finally
// 152 158 447 finally
// 162 170 447 finally
// 174 183 447 finally
// 201 205 447 finally
// 213 217 447 finally
// 221 230 447 finally
// 234 243 447 finally
// 247 256 447 finally
// 270 277 447 finally
// 281 290 447 finally
// 357 361 447 finally
// 369 373 447 finally
// 377 379 447 finally
// 399 403 447 finally
}
private String a(Queue<String> paramQueue, JSONObject paramJSONObject, SharedPreferences paramSharedPreferences)
{
if (paramQueue.isEmpty()) {
return null;
}
String str1 = (String)paramQueue.poll();
String str2 = a(a(str1), paramJSONObject, paramSharedPreferences, null);
if (str2 != null)
{
l.a = str1;
return str2;
}
return a(paramQueue, paramJSONObject, paramSharedPreferences);
}
private void a(JSONObject paramJSONObject)
{
JSONArray localJSONArray = paramJSONObject.optJSONArray("segments");
if (localJSONArray != null)
{
if (localJSONArray.length() == 0) {
return;
}
paramJSONObject = new com.appodeal.ads.e.h(this.b, paramJSONObject.optJSONObject("user_data"));
paramJSONObject.b(localJSONArray);
paramJSONObject = paramJSONObject.a(localJSONArray);
if (paramJSONObject == null)
{
com.appodeal.ads.e.h.c();
return;
}
if (paramJSONObject.c() != com.appodeal.ads.e.h.a().c())
{
try
{
paramJSONObject.a();
}
catch (JSONException localJSONException)
{
Appodeal.a(localJSONException);
}
com.appodeal.ads.e.h.a(paramJSONObject);
}
}
}
private String c(String paramString)
{
return String.format("%s_timestamp", new Object[] { paramString });
}
private JSONObject c(SharedPreferences paramSharedPreferences)
{
for (;;)
{
try
{
Object localObject2;
Object localObject1;
if ((r == null) || (r.length() == 0))
{
r = new JSONObject();
localObject2 = this.b.getPackageManager();
paramSharedPreferences = paramSharedPreferences.getString("appKey", null);
if (paramSharedPreferences == null) {
return null;
}
r.put("app_key", paramSharedPreferences);
r.put("android", Build.VERSION.RELEASE);
r.put("android_level", Build.VERSION.SDK_INT);
r.put("sdk", "2.4.10");
String str = this.b.getPackageName();
r.put("package", str);
try
{
paramSharedPreferences = ((PackageManager)localObject2).getPackageInfo(str, 0);
r.put("package_version", paramSharedPreferences.versionName);
r.put("package_code", paramSharedPreferences.versionCode);
r.put("install_time", paramSharedPreferences.firstInstallTime / 1000L);
paramSharedPreferences = ((PackageManager)localObject2).getApplicationInfo(str, 0);
r.put("target_sdk_version", paramSharedPreferences.targetSdkVersion);
}
catch (PackageManager.NameNotFoundException paramSharedPreferences)
{
Appodeal.a(paramSharedPreferences);
}
if (Appodeal.k != null) {
r.put("framework", Appodeal.k);
}
if (Appodeal.l != null) {
r.put("plugin_version", Appodeal.l);
}
paramSharedPreferences = bg.f(this.b);
r.put("width", paramSharedPreferences.first);
r.put("height", paramSharedPreferences.second);
r.put("pxratio", bg.i(this.b));
if (bg.m(this.b))
{
paramSharedPreferences = r;
localObject1 = "tablet";
paramSharedPreferences.put("device_type", localObject1);
}
else
{
paramSharedPreferences = r;
localObject1 = "phone";
continue;
}
if (Build.MANUFACTURER.equals("Amazon"))
{
paramSharedPreferences = "amazon";
r.put("platform", paramSharedPreferences);
try
{
localObject1 = ((PackageManager)localObject2).getInstallerPackageName(str);
paramSharedPreferences = (SharedPreferences)localObject1;
if (localObject1 == null) {
paramSharedPreferences = "unknown";
}
r.put("installer", paramSharedPreferences);
}
catch (Exception paramSharedPreferences)
{
Appodeal.a(paramSharedPreferences);
}
r.put("manufacturer", Build.MANUFACTURER);
r.put("rooted", bg.a());
r.put("webview_version", bg.s(this.b));
r.put("multidex", bg.a(new String[] { "android.support.multidex.MultiDex" }));
}
}
else
{
paramSharedPreferences = new JSONObject();
localObject1 = r.keys();
if (((Iterator)localObject1).hasNext())
{
localObject2 = (String)((Iterator)localObject1).next();
paramSharedPreferences.put((String)localObject2, r.get((String)localObject2));
continue;
}
return paramSharedPreferences;
}
}
finally {}
paramSharedPreferences = "google";
}
}
private String d(String paramString)
{
return String.format("%s_wst", new Object[] { paramString });
}
URL a(String paramString)
{
if (this.A)
{
if (this.n) {
return bg.f(this.d);
}
return new URL(String.format("%s/%s", new Object[] { paramString, "get" }));
}
return new URL(String.format("%s/%s", new Object[] { paramString, this.d }));
}
Queue<String> a(Date paramDate)
{
LinkedList localLinkedList = new LinkedList();
localLinkedList.add(com.appodeal.ads.utils.i.g());
Object localObject2 = new SimpleDateFormat("yyyy", Locale.ENGLISH).format(paramDate);
Object localObject1 = new SimpleDateFormat("yyyy-MM", Locale.ENGLISH).format(paramDate);
paramDate = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH).format(paramDate);
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append("https://a.");
localStringBuilder.append(b((String)localObject2));
localStringBuilder.append(".com");
localLinkedList.add(localStringBuilder.toString());
localObject2 = new StringBuilder();
((StringBuilder)localObject2).append("https://a.");
((StringBuilder)localObject2).append(b((String)localObject1));
((StringBuilder)localObject2).append(".com");
localLinkedList.add(((StringBuilder)localObject2).toString());
localObject1 = new StringBuilder();
((StringBuilder)localObject1).append("https://a.");
((StringBuilder)localObject1).append(b(paramDate));
((StringBuilder)localObject1).append(".com");
localLinkedList.add(((StringBuilder)localObject1).toString());
return localLinkedList;
}
JSONObject a(SharedPreferences paramSharedPreferences)
{
if (paramSharedPreferences == null) {
return null;
}
String str1 = paramSharedPreferences.getString("appKey", null);
if (str1 == null) {
return null;
}
String str2 = ba.h();
if (ba.g()) {
paramSharedPreferences = "0";
} else {
paramSharedPreferences = "1";
}
JSONObject localJSONObject = new JSONObject();
localJSONObject.put("app_key", str1);
localJSONObject.put("sdk", "2.4.10");
localJSONObject.put("package", this.b.getPackageName());
localJSONObject.put("framework", Appodeal.k);
localJSONObject.put("android_id", str2);
localJSONObject.put("advertising_tracking", paramSharedPreferences);
if (Build.MANUFACTURER.equals("Amazon")) {
paramSharedPreferences = "amazon";
} else {
paramSharedPreferences = "google";
}
localJSONObject.put("platform", paramSharedPreferences);
localJSONObject.put("consent", ba.f());
localJSONObject.put("fingerprint", ba.i());
localJSONObject.put("adidg", ba.j());
return localJSONObject;
}
public void a()
{
if (this.H) {
v.a.execute(new b(null));
}
}
void a(SharedPreferences paramSharedPreferences, int paramInt, String paramString)
{
paramSharedPreferences = paramSharedPreferences.edit();
paramSharedPreferences.putInt(d(paramString), paramInt);
paramSharedPreferences.apply();
}
void a(SharedPreferences paramSharedPreferences, String paramString1, String paramString2)
{
paramSharedPreferences = paramSharedPreferences.edit();
paramSharedPreferences.putString(paramString1, paramString2);
paramSharedPreferences.putLong(c(paramString1), System.currentTimeMillis());
paramSharedPreferences.apply();
}
boolean a(SharedPreferences paramSharedPreferences, String paramString)
{
long l1 = paramSharedPreferences.getLong(c(paramString), 0L);
if (System.currentTimeMillis() - l1 > b(paramSharedPreferences, paramString))
{
paramSharedPreferences = paramSharedPreferences.edit();
paramSharedPreferences.remove(paramString);
paramSharedPreferences.remove(c(paramString));
paramSharedPreferences.remove(d(paramString));
paramSharedPreferences.apply();
return false;
}
return true;
}
int b(SharedPreferences paramSharedPreferences, String paramString)
{
return paramSharedPreferences.getInt(d(paramString), 86400000);
}
String b(String paramString)
{
String str = new String(com.appodeal.ads.utils.i.b);
StringBuilder localStringBuilder = new StringBuilder();
localStringBuilder.append(paramString);
localStringBuilder.append(str);
return new BigInteger(1, bg.a(localStringBuilder.toString().getBytes())).toString(16);
}
JSONObject b()
{
JSONObject localJSONObject = new JSONObject();
int i1 = p.a();
int i2 = p.b();
int i3 = p.c();
try
{
localJSONObject.put("show", i1);
localJSONObject.put("click", i2);
if ((this.v) || (this.w) || ((this.j != null) && ((this.j.equals("video")) || (this.j.equals("rewarded_video"))))) {
localJSONObject.put("finish", i3);
}
if ((this.s) || ((this.j != null) && (this.j.equals("banner"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "banner", "show" }), p.a("interstitial"));
localJSONObject.put(String.format("%s_%s", new Object[] { "banner", "click" }), p.b("interstitial"));
}
if ((this.v) || ((this.j != null) && (this.j.equals("video"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "video", "show" }), p.a("video"));
localJSONObject.put(String.format("%s_%s", new Object[] { "video", "click" }), p.b("video"));
localJSONObject.put(String.format("%s_%s", new Object[] { "video", "finish" }), p.c("video"));
}
if ((this.w) || ((this.j != null) && (this.j.equals("rewarded_video"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "rewarded_video", "show" }), p.a("rewarded_video"));
localJSONObject.put(String.format("%s_%s", new Object[] { "rewarded_video", "click" }), p.b("rewarded_video"));
localJSONObject.put(String.format("%s_%s", new Object[] { "rewarded_video", "finish" }), p.c("rewarded_video"));
}
if ((this.t) || ((this.j != null) && (this.j.equals("banner_320"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "banner_320", "show" }), p.a("banner"));
localJSONObject.put(String.format("%s_%s", new Object[] { "banner_320", "click" }), p.b("banner"));
}
if ((this.u) || ((this.j != null) && (this.j.equals("banner_mrec"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "banner_mrec", "show" }), p.a("mrec"));
localJSONObject.put(String.format("%s_%s", new Object[] { "banner_mrec", "click" }), p.b("mrec"));
}
if ((this.x) || ((this.j != null) && (this.j.equals("native"))))
{
localJSONObject.put(String.format("%s_%s", new Object[] { "native", "show" }), p.a("native"));
localJSONObject.put(String.format("%s_%s", new Object[] { "native", "click" }), p.b("native"));
return localJSONObject;
}
}
catch (Exception localException)
{
Appodeal.a(localException);
}
return localJSONObject;
}
JSONObject b(SharedPreferences paramSharedPreferences)
{
JSONObject localJSONObject = c(paramSharedPreferences);
if (localJSONObject == null) {
return null;
}
Object localObject3 = ba.h();
Object localObject1;
if (ba.g()) {
localObject1 = "0";
} else {
localObject1 = "1";
}
localJSONObject.put("android_id", localObject3);
localJSONObject.put("advertising_tracking", localObject1);
localJSONObject.put("adidg", ba.j());
try
{
if (this.s) {
localJSONObject.put("type", "banner");
}
if (this.t)
{
localJSONObject.put("type", "banner_320");
if (m.h()) {
localJSONObject.put("large_banners", true);
}
}
if (this.u) {
localJSONObject.put("type", "banner_mrec");
}
if ((this.v) || (this.w)) {
localJSONObject.put("type", "video");
}
if (this.w) {
localJSONObject.put("rewarded_video", true);
}
if (this.x) {
localJSONObject.put("type", "native");
}
if (this.y) {
localJSONObject.put("debug", true);
}
if (l.b) {
localJSONObject.put("test", true);
}
localJSONObject.put("battery", bg.k(this.b));
localJSONObject.put("crr", bg.c(this.b));
localJSONObject.put("locale", Locale.getDefault().toString());
localObject1 = Calendar.getInstance(TimeZone.getTimeZone("GMT"), Locale.ENGLISH);
localJSONObject.put("timezone", new SimpleDateFormat("Z", Locale.ENGLISH).format(((Calendar)localObject1).getTime()));
localJSONObject.put("local_time", System.currentTimeMillis() / 1000L);
localJSONObject.put("user_agent", System.getProperty("http.agent"));
com.appodeal.ads.utils.f.c(this.b);
localJSONObject.put("session_id", com.appodeal.ads.utils.f.a(paramSharedPreferences));
localJSONObject.put("session_uptime", com.appodeal.ads.utils.f.b());
localJSONObject.put("app_uptime", com.appodeal.ads.utils.f.b(paramSharedPreferences));
localJSONObject.put("consent", ba.f());
localJSONObject.put("fingerprint", ba.b());
if (!i.h)
{
localObject1 = bg.b(this.b);
localJSONObject.put("connection", ((bg.a)localObject1).a);
localJSONObject.put("connection_subtype", ((bg.a)localObject1).b);
localJSONObject.put("connection_fast", ((bg.a)localObject1).c);
localObject1 = bg.d(this.b);
localJSONObject.put("lt", ((Pair)localObject1).first);
localJSONObject.put("lat", ((Pair)((Pair)localObject1).second).first);
localJSONObject.put("lon", ((Pair)((Pair)localObject1).second).second);
localJSONObject.put("model", String.format("%s %s", new Object[] { Build.MANUFACTURER, Build.MODEL }));
}
localJSONObject.put("coppa", i.h);
localJSONObject.put("session_uuid", Appodeal.d().a());
if (this.d.equals("iap"))
{
localJSONObject.put("currency", this.B);
localJSONObject.put("amount", this.C);
}
if (this.z)
{
localObject1 = new JSONArray();
if (this.s) {
localObject1 = new JSONArray(u.b().b());
}
if (this.v) {
localObject1 = new JSONArray(av.b().b());
}
if (this.w) {
localObject1 = new JSONArray(bb.b().b());
}
if (this.t) {
localObject1 = new JSONArray(m.b().b());
}
if (this.u) {
localObject1 = new JSONArray(af.b().b());
}
if (this.x) {
localObject1 = new JSONArray(Native.b().b());
}
localJSONObject.put("show_array", localObject1);
}
if (this.g != null) {
localJSONObject.put("loaded_offer", this.g);
}
if (this.o != null) {
localJSONObject.put("last_offer", this.o);
}
if ((this.k != null) && (this.k.longValue() != -1L)) {
localJSONObject.put("segment_id", this.k);
}
if (this.i != 0L) {
localJSONObject.put("show_timestamp", this.i);
}
if (this.d.equals("click")) {
localJSONObject.put("click_timestamp", System.currentTimeMillis() / 1000L);
}
if (this.d.equals("finish")) {
localJSONObject.put("finish_timestamp", System.currentTimeMillis() / 1000L);
}
if (this.l > 1) {
localJSONObject.put("capacity", this.l);
}
if (this.m > 0.0D) {
localJSONObject.put("price_floor", this.m);
}
if (this.p != null) {
localJSONObject.put("ad_properties", this.p);
}
if (this.q != null) {
localJSONObject.put("impid", this.q);
}
localJSONObject.put("id", this.e);
localJSONObject.put("main_id", this.f);
if ((this.z) || (this.j != null)) {
localJSONObject.put("ad_stats", b());
}
if ((this.z) && (l.l == null)) {
localJSONObject.put("check_sdk_version", true);
}
if (this.h != null) {
localJSONObject.put("placement_id", this.h.b());
}
if ((this.D != null) && (this.d.equals("stats"))) {
localJSONObject.put("ad_unit_stat", this.D);
}
if (ExtraData.a().length() > 0) {
localJSONObject.put("ext", ExtraData.a());
}
}
catch (JSONException localJSONException)
{
Appodeal.a(localJSONException);
}
Calendar localCalendar = Calendar.getInstance();
localCalendar.setTimeInMillis(paramSharedPreferences.getLong("lastSettingsTime", 0L));
localCalendar.add(5, 1);
if ((!UserSettings.a) && (this.z) && ((localCalendar.getTimeInMillis() < System.currentTimeMillis()) || (paramSharedPreferences.getBoolean("should_update_user_settings", true))))
{
UserSettings.a = true;
try
{
localJSONObject.put("sa", ae.a(this.b));
}
catch (Exception localException1)
{
Appodeal.a(localException1);
}
if (!i.h) {
try
{
localJSONObject.put("user_settings", bg.t(this.b).h());
}
catch (Exception localException2)
{
Appodeal.a(localException2);
}
}
localObject2 = paramSharedPreferences.edit();
((SharedPreferences.Editor)localObject2).putLong("lastSettingsTime", System.currentTimeMillis());
((SharedPreferences.Editor)localObject2).putBoolean("should_update_user_settings", false);
((SharedPreferences.Editor)localObject2).apply();
UserSettings.a = false;
}
Object localObject2 = Calendar.getInstance();
((Calendar)localObject2).setTimeInMillis(paramSharedPreferences.getLong("lastAppTime", 0L));
((Calendar)localObject2).add(5, 1);
if ((!l.i) && (l.h) && (this.z) && (((Calendar)localObject2).getTimeInMillis() < System.currentTimeMillis()))
{
l.i = true;
try
{
localObject2 = new JSONArray();
Object localObject4 = this.b.getPackageManager().getInstalledApplications(0);
localObject3 = Pattern.compile("^?(?:com\\.android|com\\.google|com\\.sec|com\\.samsung|com\\.sonyericsson|com\\.sonymobile|com\\.motorola|com\\.htc).*$");
if (localObject4 != null)
{
localObject4 = ((List)localObject4).iterator();
while (((Iterator)localObject4).hasNext())
{
String str = ((ApplicationInfo)((Iterator)localObject4).next()).packageName;
if ((!((Pattern)localObject3).matcher(str).matches()) && (!str.equals("android"))) {
((JSONArray)localObject2).put(str);
}
}
}
localJSONObject.put("apps", localObject2);
}
catch (Exception localException3)
{
Appodeal.a(localException3);
}
paramSharedPreferences = paramSharedPreferences.edit();
paramSharedPreferences.putLong("lastAppTime", System.currentTimeMillis());
paramSharedPreferences.apply();
l.i = false;
}
ba.a(localJSONObject);
return localJSONObject;
}
public static abstract interface a
{
public abstract void a(int paramInt);
public abstract void a(JSONObject paramJSONObject, int paramInt, String paramString);
}
private class b
implements Runnable
{
private b() {}
public void run()
{
try
{
Object localObject1 = ac.this.b.getSharedPreferences("appodeal", 0);
JSONObject localJSONObject;
if (ac.this.d.equals("init")) {
localJSONObject = ac.this.a((SharedPreferences)localObject1);
} else {
localJSONObject = ac.this.b((SharedPreferences)localObject1);
}
if (localJSONObject == null)
{
ac.a(ac.this).sendEmptyMessage(0);
return;
}
SharedPreferences localSharedPreferences = ac.this.b.getSharedPreferences("Appodeal", 0);
if (l.a == null) {
localObject1 = ac.this;
}
for (Object localObject2 = com.appodeal.ads.utils.i.g();; localObject2 = l.a)
{
localObject1 = ((ac)localObject1).a((String)localObject2);
break;
localObject1 = ac.this;
}
String str = ac.a(ac.this, (URL)localObject1, localJSONObject, localSharedPreferences, null);
localObject1 = str;
if (ac.this.A)
{
if (str == null)
{
localObject2 = str;
if (localSharedPreferences.contains(ac.this.d))
{
localObject2 = str;
if (ac.this.a(localSharedPreferences, ac.this.d))
{
Appodeal.a(new a("/get error, using saved waterfall"));
localObject2 = localSharedPreferences.getString(ac.this.d, "");
}
}
}
else
{
ac.this.a(localSharedPreferences, ac.this.d, str);
localObject2 = str;
}
localObject1 = localObject2;
if (localObject2 == null)
{
localObject1 = ac.this.a(new Date());
localObject2 = ac.a(ac.this, (Queue)localObject1, localJSONObject, localSharedPreferences);
localObject1 = localObject2;
if (localObject2 != null)
{
ac.this.a(localSharedPreferences, ac.this.d, (String)localObject2);
localObject1 = localObject2;
}
}
}
if (localObject1 == null)
{
ac.a(ac.this).sendEmptyMessage(0);
return;
}
try
{
localObject2 = new JSONObject((String)localObject1);
if (ac.this.A) {
Appodeal.a((String)localObject1, Log.LogLevel.verbose);
} else {
Appodeal.a((String)localObject1);
}
try
{
if (ac.this.A)
{
UserSettings.a(ac.this.b, ((JSONObject)localObject2).optJSONObject("user_data"));
i.a(ac.this.b, ((JSONObject)localObject2).optJSONObject("app_data"), ((JSONObject)localObject2).optBoolean("for_kids"), ((JSONObject)localObject2).optBoolean("corona"));
ac.this.a(localSharedPreferences, ((JSONObject)localObject2).optInt("wst", 86400000), ac.this.d);
ac.a(ac.this, (JSONObject)localObject2);
e.a(((JSONObject)localObject2).optJSONArray("placements"));
e.c();
if (Appodeal.h != null) {
Appodeal.h.a();
}
}
}
catch (Exception localException1)
{
Appodeal.a(localException1);
}
Message localMessage = ac.a(ac.this).obtainMessage(1, localObject2);
ac.a(ac.this).sendMessage(localMessage);
return;
}
catch (JSONException localJSONException)
{
if (!ac.this.d.equals("stats")) {
Appodeal.a(localJSONException);
}
ac.a(ac.this).sendEmptyMessage(0);
return;
}
return;
}
catch (Exception localException2)
{
Appodeal.a(localException2);
ac.a(ac.this).sendEmptyMessage(0);
}
}
}
public static class c
{
private final Context a;
private final int b;
private final String c;
private ac.a d;
private String e;
private d f;
private String g;
private int h = 1;
private double i = -1.0D;
private boolean j;
private String k;
private double l;
private JSONObject m;
private h n;
public c(Context paramContext, int paramInt, String paramString)
{
this.a = paramContext;
this.b = paramInt;
this.c = paramString;
}
public c a(double paramDouble)
{
this.i = paramDouble;
return this;
}
public c a(double paramDouble, String paramString)
{
this.l = paramDouble;
this.k = paramString;
return this;
}
public c a(int paramInt)
{
this.h = paramInt;
return this;
}
public c a(ac.a paramA)
{
this.d = paramA;
return this;
}
public c a(d paramD)
{
this.f = paramD;
return this;
}
public c a(h paramH)
{
this.n = paramH;
return this;
}
public c a(String paramString)
{
this.e = paramString;
return this;
}
public c a(JSONObject paramJSONObject)
{
this.m = paramJSONObject;
return this;
}
public c a(boolean paramBoolean)
{
this.j = paramBoolean;
return this;
}
public ac a()
{
return new ac(this, null);
}
public c b(String paramString)
{
this.g = paramString;
return this;
}
}
}
| [
"ibrahimkanj@outlook.com"
] | ibrahimkanj@outlook.com |
cba8d79ef3096dbc2cd5c55d6f9e11a15809ac6f | bbe605f0a8f91a3b37f957f2b81947c346e595a8 | /src/Scene.java | 5132bc90624d8e86ac4060f88ad7ac7c2730a59d | [] | no_license | cmdli/3drenderer | aad22282d28a5b0aca2bc762913f396dd30b6b9d | 022d43e4284ffa1ae4a5e1ad7e539c4452b17d13 | refs/heads/master | 2021-05-26T19:46:30.312955 | 2012-09-20T23:02:34 | 2012-09-20T23:02:34 | 5,894,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | //Christopher de la Iglesia
public class Scene {
private ArrayList<Wall> walls;
public Scene() {
}
public ArrayList<Wall> getWalls() {return walls;}
} | [
"christopher.delaiglesia@gmail.com"
] | christopher.delaiglesia@gmail.com |
39dd4f7c077b43f86dde2018941c1a5bbc346d6f | e71f2031eaddd97cb11474664c56d4df2ca063ff | /wz-jd/src/main/java/com/jd/service/impl/TeacherServiceImpl.java | 1c88ae84f54eb1ab443726ac875ad6ba6d7e6cbd | [] | no_license | langjiangit/demo-dubbo | 7fc7d7edeab0b80df0b34f15f18f6ae9fc92e6c9 | 9614e87a9367d9e468aa0d9be7b3865a05a15019 | refs/heads/master | 2022-12-20T19:23:40.596750 | 2019-07-26T11:56:41 | 2019-07-26T11:56:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package com.jd.service.impl;
import com.jd.annotation.DataSource;
import com.jd.dao.TeacherMapper;
import com.jd.domain.Teacher;
import com.jd.service.TeacherService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* Created by wangzhen23 on 2016/12/20.
*/
@Service
public class TeacherServiceImpl implements TeacherService{
@Resource
private TeacherMapper teacherMapper;
@Override
public Teacher getTeacherById(Long id) {
return teacherMapper.getTeacherById(id);
}
@Override
public Integer insertTeacher(Teacher teacher) {
return teacherMapper.insertTeacher(teacher);
}
}
| [
"wangzhen23@jd.com"
] | wangzhen23@jd.com |
0f2be5ae4952b5b880ffb3dcc4d61e94457ff4f3 | 788e1dce10fc34fa5f42cfe0bbf20ae5fc664c47 | /FinalDemo/src/com/revature/FinalMethodExtender.java | 5a65a0d2ed58348fbff9af058f5b3b53d2876b2f | [] | no_license | jhigherevature/roc_vinay_bach_jan-feb_2021 | 8571722b7e0d67f6fdce1c57c07da111a8fcab21 | 49c6523704b00bddde99ad7ce109116959376f4c | refs/heads/master | 2023-03-04T00:09:45.194705 | 2021-02-09T17:07:33 | 2021-02-09T17:07:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package com.revature;
public class FinalMethodExtender extends FinalMethod {
// @Override
// public void cannotOverrideMe() {
//
// }
}
| [
"bach.tran@revature.com"
] | bach.tran@revature.com |
1c1ae6ff3fd4d069d725e7d41ca293e46195e979 | a468a4cf6c3885ba68a273da91d7cb2dfa02399d | /Classpath/src/main/java/Main.java | 2959a8a4fc6ec75df9e4f43a0dc7d5a0d776fcbb | [] | no_license | a-prokopovich/java-examples | d7fb3da19b9cdf7ccbb5ed492b942c95a29b1bfe | 104c117a14fb88cab7b0bd23e86454b8ce219eed | refs/heads/master | 2023-07-16T22:45:31.832538 | 2021-08-25T09:35:43 | 2021-08-25T09:35:43 | 383,686,020 | 0 | 0 | null | 2021-07-21T13:47:13 | 2021-07-07T05:41:28 | Java | UTF-8 | Java | false | false | 353 | java |
import org.jfree.data.xy.XYCoordinate;
import org.jfree.data.xy.XYSeries;
public class Main {
public static void main(String [] args) {
XYSeries series = new XYSeries("Y = X + 2");
XYCoordinate coordinate = new XYCoordinate(4, 6);
System.out.println(coordinate); // call toString()
System.out.println();
}
} | [
"prokopovich@itspartner.net"
] | prokopovich@itspartner.net |
dcee37200911f9f44f18311a80a7c1d6a86c044c | e02fcbd586b8af32902683216f2f810217da1d1d | /src/main/java/com/example/order/OrderApplication.java | fdf7b60394941043ff26158421a4ceb9d6ca2f56 | [] | no_license | Trishna-Chakraborty/order | ad926086d1bba787a9a6e77360e3ccce2cf8fe2c | 3ddeee9ff05ff82f52940cb88c9d207ed6429777 | refs/heads/master | 2020-06-09T19:19:51.527478 | 2019-07-18T06:13:54 | 2019-07-18T06:13:54 | 193,492,175 | 0 | 2 | null | 2019-07-11T08:22:39 | 2019-06-24T11:26:34 | Java | UTF-8 | Java | false | false | 2,488 | java | package com.example.order;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import java.util.HashMap;
import java.util.Map;
@SpringBootApplication
public class OrderApplication {
@Bean
Queue postOrderQueue() {
Map<String, Object> args = new HashMap<String, Object>();
args.put("x-dead-letter-exchange", "dead_exchange");
args.put("x-message-ttl", 60000);
//args.put("x-dead-letter-routing-key","post.#");
return new Queue("postOrder", false, false, false, args);
}
@Bean
Queue updateOrderQueue() {
Map<String, Object> args = new HashMap<String, Object>();
args.put("x-dead-letter-exchange", "dead_exchange");
args.put("x-message-ttl", 60000);
//args.put("x-dead-letter-routing-key","post.#");
return new Queue("updateOrder", false, false, false, args);
}
@Bean
Queue postTransactionQueue() {
Map<String, Object> args = new HashMap<String, Object>();
args.put("x-dead-letter-exchange", "dead_exchange");
args.put("x-message-ttl", 60000);
//args.put("x-dead-letter-routing-key","post.#");
return new Queue("postTransaction", false, false, false, args);
}
@Bean
DirectExchange orderExchange() {
return new DirectExchange("order_exchange");
}
@Bean
DirectExchange transactionExchange() {
return new DirectExchange("transaction_exchange");
}
@Bean
Binding postTransactionBinding(Queue postTransactionQueue, DirectExchange transactionExchange) {
return BindingBuilder.bind(postTransactionQueue).to(transactionExchange).with("post.transaction");
}
@Bean
Binding updateOrderBinding(Queue updateOrderQueue, DirectExchange orderExchange) {
return BindingBuilder.bind(updateOrderQueue).to(orderExchange).with("update.order");
}
@Bean
Binding postOrderBinding(Queue postOrderQueue, DirectExchange orderExchange) {
return BindingBuilder.bind(postOrderQueue).to(orderExchange).with("post.order");
}
public static void main(String[] args) {
SpringApplication.run(OrderApplication.class, args);
}
}
| [
"trishnachakraborty13@gmail.com"
] | trishnachakraborty13@gmail.com |
96023159c61d2ca0fac53a64d3644ad556a6c3f5 | e448891db366a260135d95db9c59675f22d68793 | /UserManagement/src/main/java/com/harman/userManagement/dto/UserDTO.java | 89da848d445374f4c2bce174a7bb1b1739b4c75c | [] | no_license | ursdil/HarmanSampleProj | 976189d37050e3915d5b1aa3f287238fa00f2652 | 691b600f077500beb5ea0fb85c928c4b044a7b5c | refs/heads/main | 2023-05-04T17:04:37.089042 | 2021-05-19T11:09:32 | 2021-05-19T11:09:32 | 368,840,081 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,741 | java | package com.harman.userManagement.dto;
import java.sql.Timestamp;
import java.util.Date;
import lombok.Data;
@Data
public class UserDTO {
private Integer userId;
private Integer companyId;
private Date dob;
private Integer age;
private String firstName;
private String lastName;
private String middleName;
private String gender;
private String marriedInd;
private Date marriedDt;
private Timestamp addDt;
private Timestamp modDt;
private String priEmailId;
private Long priMobNo;
private String profilePic;
private Integer roleId;
private Integer subId;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
public Date getDob() {
return dob;
}
public void setDob(Date dob) {
this.dob = dob;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMarriedInd() {
return marriedInd;
}
public void setMarriedInd(String marriedInd) {
this.marriedInd = marriedInd;
}
public Date getMarriedDt() {
return marriedDt;
}
public void setMarriedDt(Date marriedDt) {
this.marriedDt = marriedDt;
}
public Timestamp getAddDt() {
return addDt;
}
public void setAddDt(Timestamp addDt) {
this.addDt = addDt;
}
public Timestamp getModDt() {
return modDt;
}
public void setModDt(Timestamp modDt) {
this.modDt = modDt;
}
public String getPriEmailId() {
return priEmailId;
}
public void setPriEmailId(String priEmailId) {
this.priEmailId = priEmailId;
}
public Long getPriMobNo() {
return priMobNo;
}
public void setPriMobNo(Long priMobNo) {
this.priMobNo = priMobNo;
}
public String getProfilePic() {
return profilePic;
}
public void setProfilePic(String profilePic) {
this.profilePic = profilePic;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public Integer getSubId() {
return subId;
}
public void setSubId(Integer subId) {
this.subId = subId;
}
}
| [
"57435854+candakasolutions@users.noreply.github.com"
] | 57435854+candakasolutions@users.noreply.github.com |
7924ebea78943925766be62351b3692ff51f2945 | f0e8fe7eab635f2adf766ee9ca7dd4d4977b94f7 | /main/ar.com.oxen.nibiru.validation/ar.com.oxen.nibiru.validation.generic/src/main/java/ar/com/oxen/nibiru/validation/generic/NotEmptyValidator.java | e6b19dda1f01e8da5495cfa524f2c74ca2023d96 | [] | no_license | lbrasseur/nibiru | 2d2ebdfce9175db7114890c54cb3e1ed1c607563 | 1764153c2f38f3430042132a5b8ff5e0d5572207 | refs/heads/master | 2022-07-28T00:08:56.059668 | 2015-09-08T14:25:05 | 2015-09-08T14:25:05 | 32,324,375 | 0 | 0 | null | 2022-07-08T19:06:32 | 2015-03-16T12:49:02 | Java | UTF-8 | Java | false | false | 757 | java | package ar.com.oxen.nibiru.validation.generic;
import ar.com.oxen.nibiru.validation.api.ValidationException;
import ar.com.oxen.nibiru.validation.api.Validator;
/**
* Validatro for using on required fields.
* The validated object:
* - Must not be null
* - It String representation must not be "" neither spaces.
*/
public class NotEmptyValidator implements Validator<Object> {
private String errorCode = "required";
public NotEmptyValidator() {
super();
}
public NotEmptyValidator(String errorCode) {
super();
this.errorCode = errorCode;
}
@Override
public void validate(Object object) throws ValidationException {
if (object == null || object.toString().trim().equals("")) {
throw new ValidationException(errorCode);
}
}
}
| [
"lbrasseur@gmail.com"
] | lbrasseur@gmail.com |
af70fbea9a367a54376e83a2067220af2400df02 | 0b4dc89300208f276b85fba7c140fda037394ee4 | /Goku.WebService.Provider/src/main/java/com/goku/ProviderApplication.java | e741d69100444146e5daaa7223edf89759167c73 | [] | no_license | linjianq3/Goku.WebService | c6b8b6839a985485cfb309e9924e9474f2721833 | 50737eebb5b40bc947a42f58d991fe9b90a21f46 | refs/heads/master | 2020-03-23T06:56:59.635514 | 2018-02-25T11:07:23 | 2018-02-25T11:07:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 544 | java | package com.goku;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
/**
* Created by nbfujx on 2017-11-23.
*/
@SpringBootApplication
@ServletComponentScan
@MapperScan(basePackages="com.goku.mapper.**")
public class ProviderApplication {
public static void main(String[] args) {
SpringApplication.run(ProviderApplication.class, args);
}
}
| [
"nbfujx@qq.com"
] | nbfujx@qq.com |
41b236921527f5cdaa2ff6d703a710e485387570 | e87a0d8e88e7d96cca4916104d7203090a5a6942 | /hawkular-command-gateway/hawkular-command-gateway-api/src/main/java/org/hawkular/cmdgw/api/EventDestination.java | 30d0daf620c32dbfb66882a0c73f65d12caa3029 | [
"Apache-2.0"
] | permissive | hawkular/hawkular-commons | 64fa09af16087143a2f40372b7e9c81bb4c4ff29 | e4a832862b3446d7f4d629bb05790f2df578e035 | refs/heads/master | 2023-07-02T08:22:50.599750 | 2017-12-18T14:53:15 | 2017-12-18T14:53:15 | 36,057,427 | 6 | 19 | Apache-2.0 | 2017-12-18T14:53:16 | 2015-05-22T07:03:53 | Java | UTF-8 | Java | false | false | 868 | java | /*
* Copyright 2014-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.hawkular.cmdgw.api;
import org.hawkular.bus.common.BasicMessage;
/**
* Message that gets sent as an event.
*/
public interface EventDestination extends BasicMessage {
}
| [
"jshaughn@redhat.com"
] | jshaughn@redhat.com |
f28d3ba516d072a372964a177fc23fd2ae00ad01 | f8ebb12438e6862e82830d0a83701f91ad42c035 | /src/main/java/io/pivotal/fe/fn/Aggregator.java | 40771cc5c39898259666f1b35edcff3b4883d4f7 | [] | no_license | jfullam/gemfire-dynamic-region-server | 1048b983d484ce857fb84f30ae67edb322e6815d | f731c445e7ed7f26f1512c7292db5e9084d18379 | refs/heads/master | 2021-01-19T03:11:46.070290 | 2015-06-26T21:41:24 | 2015-06-26T21:41:24 | 38,135,330 | 0 | 2 | null | 2015-07-24T21:31:46 | 2015-06-26T21:42:46 | Java | UTF-8 | Java | false | false | 296 | java | package io.pivotal.fe.fn;
import org.springframework.data.gemfire.function.annotation.GemfireFunction;
import org.springframework.stereotype.Component;
@Component
public class Aggregator {
@GemfireFunction
public Integer doSomething() {
System.out.println("on server");
return 1;
}
}
| [
"jonathanfullam@gmail.com"
] | jonathanfullam@gmail.com |
f4571cb3ca9492ddfa872f6239c5b7079b97520c | b688050d5cf5d2179f5833f3af3b85c436524fc9 | /Java Application/Java Project Source Files/SecProj/src/secproj/HistorySettingsWindow.java | 491fcdedfb18683231f4a987dea1b301e5827786 | [
"MIT"
] | permissive | msSarriman/PasswordManagementApp---GUI | 52a735a01bb31f009cd3fe7ac5ed710a63a6dd17 | 25d93637b3232ed2562d9fd9d47e45deedf8bf7c | refs/heads/master | 2020-03-28T19:07:03.565383 | 2019-02-26T17:41:45 | 2019-02-26T17:41:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,324 | 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 secproj;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
/**
*
* @author root
*/
public class HistorySettingsWindow extends javax.swing.JFrame {
Connection conn=null;
ResultSet rs=null;
Statement stmt=null;
private String typeOfChange = null;
private String dateOfChange = null;
private String email = null;
private String passPlain=null;
/**
* Creates new form HistorySettingsWindow
*/
public HistorySettingsWindow() {
initComponents();
}
public HistorySettingsWindow(String email,String pass) {
initComponents();
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
this.email = email;
this.passPlain=pass;
conn=ConnectionStatus.ConnectDb("dontShowPopUp");
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList<>();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
newEntryField = new javax.swing.JTextField();
oldEntryField = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
dateField = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
refersField = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(570, 380));
setPreferredSize(new java.awt.Dimension(570, 380));
setResizable(false);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jList1.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
jList1ValueChanged(evt);
}
});
jScrollPane1.setViewportView(jList1);
jLabel1.setText("Choose an item from the list on the left, to obtain further details for it.");
jLabel2.setText("Old Entry");
jLabel3.setText("New Entry");
jLabel4.setText("Date of Change");
jButton1.setText("Back");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel5.setText("Application Change Refers");
jButton2.setText("Refresh List");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 117, Short.MAX_VALUE))
.addComponent(jScrollPane1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(dateField, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(oldEntryField, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(newEntryField, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)
.addComponent(refersField, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
.addGap(6, 6, 6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(dateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addComponent(jLabel5)
.addGap(6, 6, 6)
.addComponent(refersField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(oldEntryField, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(1, 1, 1)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(newEntryField, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(17, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
FillList();
}//GEN-LAST:event_formWindowOpened
private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged
try{
String[] listChangedStrings=new String[2];
int i=0;
for (String val: jList1.getSelectedValue().split(",", 2)){
listChangedStrings[i++]=val;
}
AesEncryption aes = new AesEncryption(1,this.passPlain);
String myQuery = "CALL RetrieveEncryptedHistory('"+this.email+"','"+listChangedStrings[0]+"','"+listChangedStrings[1]+"','"+aes.encData+"')";
CallableStatement callStmt = conn.prepareCall(myQuery);
rs = callStmt.executeQuery(myQuery);
if(rs.next()){
AesEncryption dec1 = new AesEncryption(1, this.passPlain, rs.getString(3));
AesEncryption dec2 = new AesEncryption(1, this.passPlain, rs.getString(4));
dateField.setText(rs.getString(1));
refersField.setText(rs.getString(2));
oldEntryField.setText(dec1.decData);
newEntryField.setText(dec2.decData);
}
rs.close();
stmt.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e.toString());
}
}//GEN-LAST:event_jList1ValueChanged
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
dispose();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
FillList();
}//GEN-LAST:event_jButton2ActionPerformed
private void FillList(){
try{
String myQuery = "SELECT typeOfChange,date_format(dateOfChange,'%Y-%m-%d %H:%i:%s') FROM HistoryBulk WHERE email='"+this.email+"'";
DefaultListModel myTempList = new DefaultListModel();
stmt = conn.createStatement();
rs = stmt.executeQuery(myQuery);
while(rs.next()){
String myTempString = rs.getString(1)+","+rs.getString(2);
myTempList.addElement(myTempString);
}
jList1.setModel(myTempList);
rs.close();
stmt.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, e.toString());
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(HistorySettingsWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(HistorySettingsWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(HistorySettingsWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(HistorySettingsWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new HistorySettingsWindow().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField dateField;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JList<String> jList1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField newEntryField;
private javax.swing.JTextField oldEntryField;
private javax.swing.JTextField refersField;
// End of variables declaration//GEN-END:variables
}
| [
"sarriman@hotmail.com"
] | sarriman@hotmail.com |
883fb1f11c8c913bbc34b0c74601177a91acf256 | 152e79bcb6ad7e3e0ef808acbd5ae47191cadb76 | /rcljava/src/main/java/org/ros2/rcljava/service/Service.java | dfde9a096b0f8307225de18c0bbe02d39acba124 | [
"Apache-2.0"
] | permissive | ros2-java/ros2_java | 0a000c51e49c54261af6def128adab760905a805 | d0e4e952bad1977ce9818d00b520d3ad0aeafd8d | refs/heads/main | 2022-09-20T10:41:43.814210 | 2022-04-13T20:54:15 | 2022-08-10T15:15:18 | 52,850,323 | 121 | 55 | Apache-2.0 | 2022-10-27T15:46:22 | 2016-03-01T05:22:50 | Java | UTF-8 | Java | false | false | 1,193 | java | /* Copyright 2016-2018 Esteve Fernandez <esteve@apache.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.ros2.rcljava.service;
import org.ros2.rcljava.consumers.TriConsumer;
import org.ros2.rcljava.interfaces.Disposable;
import org.ros2.rcljava.interfaces.MessageDefinition;
import org.ros2.rcljava.interfaces.ServiceDefinition;
public interface Service<T extends ServiceDefinition> extends Disposable {
<U extends MessageDefinition> Class<U> getRequestType();
<U extends MessageDefinition> Class<U> getResponseType();
void executeCallback(RMWRequestId rmwRequestId, MessageDefinition request, MessageDefinition response);
String getServiceName();
}
| [
"esteve@apache.org"
] | esteve@apache.org |
dfa71f73bf58348c017fd16dee29b931bdba6c80 | 13d4fbb3b98127c8e31c7dbd69559bf4b687167f | /JeuGo/src/Pass.java | 316c26c93b5d8cc529befcc3f4d0a7549fcd3d48 | [] | no_license | JoLeeMtz/JeuGo | 194958c46ba7216c6bbea97cd4960aa5d3771d9e | 4444a563c957722535bc6363c93b039225940c59 | refs/heads/main | 2023-04-28T14:42:16.868575 | 2021-05-16T20:05:57 | 2021-05-16T20:05:57 | 367,975,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | public class Pass implements TypeInstruction {
private String info;
@Override
public String toString() {
return info;
}
@Override
public String getType() {
return this.info;
}
@Override
public void setType(String info) {
this.info = info;
}
}
| [
"joleemtz@gmail.com"
] | joleemtz@gmail.com |
8079910b12277ef017ae0bff3a87b571b40fb01a | 0cda5cfbd9d97b90f6c323422c63e3e10ca2c16b | /day8_21/Question854.java | 312461300a3d4bf81a3994cb62d4d2321984541c | [] | no_license | JiedaokouWangguan/leetcode | 7be9d2356d771649a83550cb5b963c10df0c916e | dd47dc0fb6ee3c331394d9a1c6f3657397763af1 | refs/heads/master | 2021-07-13T13:11:33.771139 | 2018-12-15T02:55:24 | 2018-12-15T02:55:24 | 132,697,062 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,137 | java | import java.util.Map;
import java.util.HashMap;
public class Question854{
public int kSimilarity(String A, String B) {
Map<String, Integer> map = new HashMap<>();
return backtrack(A.toCharArray(), B, map, 0);
}
private int backtrack(char[] A, String B, Map<String, Integer> map, int i) {
String sa = new String(A);
if (sa.equals(B)) {
return 0;
}
if (map.containsKey(sa)) {
return map.get(sa);
}
int min = Integer.MAX_VALUE;
while (i < A.length && A[i] == B.charAt(i)) {
i++;
}
for (int j = i + 1; j < B.length(); j++) {
if (A[j] == B.charAt(i)) {
swap(A, i, j);
int next = backtrack(A, B, map, i + 1);
if (next != Integer.MAX_VALUE) {
min = Math.min(min, next + 1);
}
swap(A, i, j);
}
}
map.put(sa, min);
return min;
}
private void swap(char[] cs, int i, int j) {
char temp = cs[i];
cs[i] = cs[j];
cs[j] = temp;
}
}
| [
"ysong243@wisc.edu"
] | ysong243@wisc.edu |
48dc405487740c34659ec5340cdab36b646799ae | 1a07fa87ddbd138ab44567d1247ac3aee2339caa | /src/main/java/com/shimizukenta/httpserver/HttpRequestMessage.java | cc1ea0ac798fcbede2cbe81577c4d0ecf9a11680 | [
"Apache-2.0"
] | permissive | kenta-shimizu/httpserver4java8 | fcbf23c443b054e685940769d56a730be6cec1de | 9415f4e3e0166bf7c27fc6552eeb40375daecb95 | refs/heads/main | 2023-03-22T17:33:18.349756 | 2021-03-14T15:59:24 | 2021-03-14T15:59:24 | 338,604,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 882 | java | package com.shimizukenta.httpserver;
public interface HttpRequestMessage extends HttpMessage {
/**
* Returns Request-Line.
*
* <p>
* <string>Not</strong> include CRLF.<br />
* </p>
*
* @return HTTP-Request-Line-String
*/
public String requestLine();
/**
* Returns URI.
*
* @return URI
*/
public String uri();
/**
* Returns Absolute-Path from URI.
*
* @return Absolute-Path
*/
public String absPath();
/**
* Returns HttpRequestQuery from URI.
*
* @return HttpRequestQuery from URI
* @throws HttpServerRequestMessageParseException
*/
public HttpRequestQuery getQueryFromUri() throws HttpServerRequestMessageParseException;
/**
* Returns Method.
*
* @return Method
*/
public HttpRequestMethod method();
/**
* Returns Method-String.
*
* @return Method-String
*/
public String methodString();
}
| [
"shimizukentagm1@gmail.com"
] | shimizukentagm1@gmail.com |
c6a7c2069500b8c7b75cdc648748ce13ba187787 | b9263ee71cfd60946d596d1f944c5b9b8fa61b97 | /webtemplate/src/main/java/com/ethercis/opt/mapper/IsmTransition.java | e8bc3da6921396dd86033f263802f82bf92b3923 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | ethercis/ehrservice | cea214ba50f1c4d06b768206e6d06614955d6d69 | e24a91d4c870c4b139852bae3d4dcc13cf5c733b | refs/heads/remote-github | 2022-10-18T11:54:50.725055 | 2019-08-20T03:04:31 | 2019-08-20T03:04:31 | 45,239,946 | 8 | 23 | NOASSERTION | 2022-10-05T19:08:46 | 2015-10-30T08:58:55 | Java | UTF-8 | Java | false | false | 3,428 | java | /*
* Copyright (c) Ripple Foundation CIC Ltd, UK, 2017
* Author: Christian Chevalley
* This file is part of Project Ethercis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ethercis.opt.mapper;
import com.ethercis.opt.TermDefinition;
import com.ethercis.opt.ValuePoint;
import org.openehr.build.RMObjectBuildingException;
import org.openehr.schemas.v1.*;
import java.util.*;
/**
* Created by christian on 1/31/2018.
*/
public class IsmTransition {
static final String type = "ISM_TRANSITION";
CCOMPLEXOBJECT ccomplexobject;
Map<String, TermDefinition> termDef;
public IsmTransition(CCOMPLEXOBJECT ccomplexobject, Map<String, TermDefinition> termDef) {
this.ccomplexobject = ccomplexobject;
this.termDef = termDef;
}
public Map<String, Object> toMap(String name) throws NoSuchFieldException, RMObjectBuildingException {
Map<String, Object> attributeMap = new HashMap<>();
attributeMap.put(Constants.TYPE, type);
attributeMap.put(Constants.ATTRIBUTE_NAME, name);
attributeMap.put(Constants.MANDATORY_ATTRIBUTES, new ValuePoint(type).attributes());
List valueList = new ArrayList<>();
Map<String, Object> constraintsMap = new HashMap<>();
attributeMap.put(Constants.CONSTRAINT, constraintsMap);
for (CATTRIBUTE attribute : ccomplexobject.getAttributesArray()) {
if (attribute.getRmAttributeName().equals(Constants.CURRENT_STATE)) {
for (COBJECT cobject : attribute.getChildrenArray()) {
if (cobject.getRmTypeName().equals("DV_CODED_TEXT")) {
constraintsMap.put(Constants.CURRENT_STATE, new CodedText((CCOMPLEXOBJECT) cobject, termDef).toMap(Constants.CURRENT_STATE));
}
}
} else if (attribute.getRmAttributeName().equals(Constants.CAREFLOW_STEP)) {
for (COBJECT cobject : attribute.getChildrenArray()) {
if (cobject.getRmTypeName().equals("DV_CODED_TEXT")) {
constraintsMap.put(Constants.CAREFLOW_STEP, new CodedText((CCOMPLEXOBJECT) cobject, termDef).toMap(Constants.CAREFLOW_STEP));
}
}
}
}
Map<String, Object> range = new HashMap<>();
constraintsMap.put(Constants.OCCURRENCE, range);
range.put(Constants.MIN_OP, ccomplexobject.getOccurrences().isSetLowerIncluded() ? ">=" : ">");
range.put(Constants.MIN, ccomplexobject.getOccurrences().isSetLower() ? ccomplexobject.getOccurrences().getLower() : -1);
range.put(Constants.MAX_OP, ccomplexobject.getOccurrences().isSetUpperIncluded() ? "<=" : "<");
range.put(Constants.MAX, ccomplexobject.getOccurrences().isSetUpper() ? ccomplexobject.getOccurrences().getUpper() : -1);
valueList.add(attributeMap);
return attributeMap;
}
}
| [
"christian@adoc.co.th"
] | christian@adoc.co.th |
fd4b00c44e95441d1531c8655e38ce0f661c997c | 9d658c64f867a0ff0b5e5960a4ffe195ac29b0e1 | /src/main/java/com/spark/spark_project/domain/AreaTop3Product.java | be2b650fa239e0049e4c25c46a62b7a2d2a00992 | [] | no_license | 996459450/spark | 031bf99e65ff3aeb7c2c226b6b78eb107e924164 | 22d513444e94fcc2d426862e2d150133c51fbf3c | refs/heads/master | 2021-09-08T09:13:16.860156 | 2018-03-09T02:34:45 | 2018-03-09T02:34:45 | 124,368,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | package com.spark.spark_project.domain;
public class AreaTop3Product {
private long taskid;
private String area;
private String areaLevel;
private long productid;
private String cityInfos;
private long clickCount;
private String productName;
private String productStatus;
public long getTaskid() {
return taskid;
}
public void setTaskid(long taskid) {
this.taskid = taskid;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getAreaLevel() {
return areaLevel;
}
public void setAreaLevel(String areaLevel) {
this.areaLevel = areaLevel;
}
public long getProductid() {
return productid;
}
public void setProductid(long productid) {
this.productid = productid;
}
public String getCityInfos() {
return cityInfos;
}
public void setCityInfos(String cityInfos) {
this.cityInfos = cityInfos;
}
public long getClickCount() {
return clickCount;
}
public void setClickCount(long clickCount) {
this.clickCount = clickCount;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductStatus() {
return productStatus;
}
public void setProductStatus(String productStatus) {
this.productStatus = productStatus;
}
}
| [
"996459450@qq.com"
] | 996459450@qq.com |
355f056c17c7238ea29cadda687aacadd0dbb1ba | f2c753978bb0f7a0f77e5494092704f19276fc39 | /baselib/src/main/java/com/example/baselib/http/HttpConstant.java | 7d6ebb35e85fe3ccddd0e2cfe8b1d1ca61d1847d | [] | no_license | aierlymon/aiersky | 8db56396a2f1557a8eb42a4165db07bc3adb5c68 | 39c5c96f143b5bdec09b304302d1a1a4b44185d9 | refs/heads/master | 2020-05-22T09:23:23.679504 | 2019-08-01T02:28:27 | 2019-08-01T02:28:56 | 55,762,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | package com.example.baselib.http;
import android.content.Context;
/**
* createBy ${huanghao}
* on 2019/6/28
* data http的一些常量值
*/
public abstract class HttpConstant {
public static int DEFAULT_TIME_OUT=8;//超时时间 单位(s)秒
public static String BASE_URL = "http://47.112.217.160/";
//http://tuershiting.com/api/
// public static String BASE_API_URL = BASE_URL+"api/";
public static String BASE_API_URL = BASE_URL+"newApi/";
public static Context context;
public static final String cacheFileName="httpcaches";
public static String MINE_BASE_URL="http://ihoufeng.com/app/html/apphtml/";
//http://tuershiting.com/api/banners?filter[where][open]=true
}
| [
"1351637684@qq.com"
] | 1351637684@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.