blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3348a9bf2569b61d89bdef2c96f95a446480e9b8 | 9d390a85f4d412592edb707db2990b5c826b4bf4 | /pms/src/com/portal/datacenter/lucene/LuceneDocServiceImpl.java | 5c681468020ea6222221f359868ba8d085510875 | [] | no_license | lishaopeng/SoftWare | 08dfe1460fe82c5f021581ca40083d1aa4803838 | 7fb5d9e46aa2b3f6dbdff6a1eccb8cd8b0069c97 | refs/heads/master | 2016-09-06T17:41:58.584970 | 2015-09-24T08:43:20 | 2015-09-24T08:43:20 | 41,285,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,670 | java | /* */ package com.portal.datacenter.lucene;
/* */
/* */ import com.portal.doccenter.entity.Article;
/* */ import com.portal.doccenter.entity.Channel;
/* */ import com.portal.doccenter.service.ChannelService;
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */ import java.util.Date;
/* */ import org.apache.lucene.index.CorruptIndexException;
/* */ import org.apache.lucene.queryParser.ParseException;
/* */ import org.apache.lucene.search.Query;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional;
/* */
/* */ @Service
/* */ @Transactional
/* */ public class LuceneDocServiceImpl
/* */ implements LuceneDocService
/* */ {
/* */ private LuceneDocDao dao;
/* */ private NRTManagerService nrtManager;
/* */ private ChannelService channelService;
/* */
/* */ public Integer createSearchIndex(Integer siteId, Integer channelId, Date startDate, Date endDate, Integer startId, Integer max, boolean delete)
/* */ throws IOException
/* */ {
/* 24 */ String number = "";
/* 25 */ if (channelId != null) {
/* 26 */ Channel c = this.channelService.findById(channelId);
/* 27 */ if (c != null) {
/* 28 */ number = c.getNumber();
/* */ }
/* */ }
/* 31 */ if (delete) {
/* */ try {
/* 33 */ Query query = LuceneCommon.createQuery(null, null, siteId,
/* 34 */ null, channelId, startDate, endDate);
/* 35 */ this.nrtManager.deleteDocuments(query);
/* */ } catch (ParseException e) {
/* 37 */ e.printStackTrace();
/* */ }
/* */ }
/* 40 */ Integer docId = this.dao.index(this.nrtManager, siteId, number, startDate,
/* 41 */ endDate, startId, max);
/* 42 */ return docId;
/* */ }
/* */
/* */ public void deleteSearchIndex(Integer siteId, Integer channelId) {
/* */ try {
/* 47 */ Query query = LuceneCommon.createQuery(null, null, siteId, null,
/* 48 */ channelId, null, null);
/* 49 */ this.nrtManager.deleteDocuments(query);
/* */ } catch (ParseException e) {
/* 51 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */ public void updateChannel(Integer siteId, Integer channelId) {
/* */ try {
/* 57 */ Query query = LuceneCommon.createQuery(null, null, siteId, null,
/* 58 */ channelId, null, null);
/* 59 */ this.nrtManager.deleteDocuments(query);
/* */ } catch (ParseException e) {
/* 61 */ e.printStackTrace();
/* */ }
/* */ try {
/* 64 */ this.dao.index(this.nrtManager, siteId, getTreeNumber(channelId), null, null,
/* 65 */ null, Integer.valueOf(1000));
/* */ } catch (CorruptIndexException e) {
/* 67 */ System.out.println("生成全文检索异常!");
/* */ } catch (IOException e) {
/* 69 */ System.out.println("生成全文检索异常!");
/* */ }
/* */ }
/* */
/* */ public void addDoc(Article doc) {
/* 74 */ this.nrtManager.addDoc(LuceneCommon.createDoc(doc));
/* */ }
/* */
/* */ public void updateDoc(Article doc) {
/* 78 */ this.nrtManager.updateDocument(LuceneCommon.term(doc.getId()),
/* 79 */ LuceneCommon.createDoc(doc));
/* */ }
/* */
/* */ public void deleteDoc(Integer docId) {
/* 83 */ this.nrtManager.deleteDocuments(LuceneCommon.term(docId));
/* */ }
/* */
/* */ private String getTreeNumber(Integer cId) {
/* 87 */ if (cId == null) {
/* 88 */ return null;
/* */ }
/* 90 */ Channel c = this.channelService.findById(cId);
/* 91 */ if (c != null) {
/* 92 */ return c.getNumber();
/* */ }
/* 94 */ return null;
/* */ }
/* */
/* */ @Autowired
/* */ public void setDao(LuceneDocDao dao)
/* */ {
/* 103 */ this.dao = dao;
/* */ }
/* */
/* */ @Autowired
/* */ public void setNrtManager(NRTManagerService nrtManager) {
/* 108 */ this.nrtManager = nrtManager;
/* */ }
/* */
/* */ @Autowired
/* */ public void setChannelService(ChannelService channelService) {
/* 113 */ this.channelService = channelService;
/* */ }
/* */ }
/* Location: C:\Users\anli\Desktop\classes\
* Qualified Name: com.portal.datacenter.lucene.LuceneDocServiceImpl
* JD-Core Version: 0.6.1
*/ | [
"623406671@qq.com"
] | 623406671@qq.com |
4ffbefbedec135a093e20005a128dd0e73bb26d1 | e73fd2b354d002183c9f39cac28c46fbaec58412 | /src/main/java/xiyu/unittestforspringboot/service/ItemService.java | 9bb397fe2f8b800dc109656808a8f7c307949dc5 | [] | no_license | NoraYu/UnitTestingSpringBoot | 95243fce901cd1456f559f67d0f6ad8f1da5e2fd | 16481aee06d555ee54f84abae22fe5769c4c985d | refs/heads/master | 2022-11-12T22:19:56.662362 | 2020-07-06T20:38:53 | 2020-07-06T20:38:53 | 277,625,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 725 | java | package xiyu.unittestforspringboot.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xiyu.unittestforspringboot.DAO.ItemRepository;
import xiyu.unittestforspringboot.Entity.Item;
import java.util.List;
@Service
public class ItemService {
@Autowired
ItemRepository itemRepository;
//generate fake data
public Item fakegetItem(){
return new Item("GARMIN",270,1);
}
//get real data from database
public List<Item> getallitems(){
List<Item> list=itemRepository.findAll();
for(Item item:list){
item.setValue(item.getPrice()*item.getQuantity());
}
return list;
}
}
| [
"yxy_1990@hotmail.com"
] | yxy_1990@hotmail.com |
f0b99bef0eebb5ab374633d7b3fc5642e0c98dac | d2f736fdf17de2b8b3ed357a8054f1aaf073b8ef | /src/main/java/com/like/zero/spring/util/StringUtils.java | 0c40225105cf8a3c7a04850120e2566d36f549f1 | [] | no_license | ksdbex00624819/litespring | 2fe5e19ea02b29afcad9ab25f37628b2e78928e1 | c89f28646b553edcae3f65da935c30567c3e20ae | refs/heads/master | 2020-03-21T10:59:42.534923 | 2018-07-21T13:09:17 | 2018-07-21T13:09:17 | 138,482,944 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,197 | java | package com.like.zero.spring.util;
/**
* Created by like 2018/6/30
*/
public class StringUtils {
public static boolean hasLength(String str) {
return hasLength((CharSequence) str);
}
public static boolean hasLength(CharSequence str) {
return (str != null && str.length() > 0);
}
public static boolean hasText(String str) {
return hasText((CharSequence) str);
}
public static boolean hasText(CharSequence str) {
if (!hasLength(str)) {
return false;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (!Character.isWhitespace(str.charAt(i))) {
return true;
}
}
return false;
}
public static String trimAllWhitespace(String str) {
if (!hasLength(str)) {
return str;
}
StringBuilder sb = new StringBuilder(str);
int index = 0;
while (sb.length() > index) {
if (Character.isWhitespace(sb.charAt(index))) {
sb.deleteCharAt(index);
} else {
index++;
}
}
return sb.toString();
}
}
| [
"dereklike@foxmail.com"
] | dereklike@foxmail.com |
ce6efaaff470e3ebc6902624f640e5c7086a54a0 | 569df1aef8cac6485d75983a732fa41580eaba90 | /LinkedList/DNode.java | 8f9972a035d2a6962e32e9dc6531b62349ac497e | [] | no_license | Shuhuasong/CS313-Data-Structure-JAVA- | 158787ce04ed5a3904ad04cf9f812b237a62ecbc | ccc25946188c75d884404c76b75f9ede2f7b62ba | refs/heads/master | 2020-12-07T12:46:41.683414 | 2020-03-14T05:06:57 | 2020-03-14T05:06:57 | 232,724,230 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | package LinkedList;
public class DNode<T> {
private T data;
private DNode<T> prev, next;
public DNode(T d, DNode<T> p, DNode<T> n) {
data = d;
next = n;
prev = p;
}
public T getData() {
return data;
}
public DNode<T> getNext() {
return next;
}
public DNode<T> getPrev() {
return prev;
}
public void setData(T d) {
data = d;
}
public void setNext(DNode<T> n) {
next = n;
}
public void setPrev(DNode<T> p) {
prev = p;
}
} | [
"noreply@github.com"
] | noreply@github.com |
39227d281c9dc38058629c56a6e7b26273cfc49a | 1fea56d2dcb3b495f63c17ad1ebc61b81e44e7b6 | /uidemo/src/main/java/com/angcyo/uidemo/uiview3/view/DialogLoginView.java | c73b1af5f9f6edb355c61c96fb8f4f349e2a72a1 | [] | no_license | angcyo/UIView | 3ce12f69afdc636330ddd11f30dc093b370ea57d | dad0711554232380d72f326feb9c25cd05711a7f | refs/heads/master | 2022-06-30T15:27:10.313257 | 2022-06-19T12:08:09 | 2022-06-19T12:08:09 | 72,760,800 | 7 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,524 | java | package com.angcyo.uidemo.uiview3.view;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.angcyo.library.utils.L;
import com.angcyo.uidemo.R;
import com.angcyo.uidemo.RApp;
import com.angcyo.uidemo.uiview3.login.Login;
import com.angcyo.uidemo.uiview3.login.LoginPresenterImpl;
import com.angcyo.uiview.base.UIIDialogImpl;
import com.angcyo.uiview.utils.T;
/**
* Copyright (C) 2016,深圳市红鸟网络科技股份有限公司 All rights reserved.
* 项目名称:
* 类的描述:
* 创建人员:Robi
* 创建时间:2016/12/02 11:05
* 修改人员:Robi
* 修改时间:2016/12/02 11:05
* 修改备注:
* Version: 1.0.0
*/
public class DialogLoginView extends UIIDialogImpl implements Login.ILoginView {
private static long index = 0;
TextView mPhoneView;
TextView mPasswordView;
private Login.ILoginPresenter mLoginPresenter;
@Override
protected View inflateDialogView(FrameLayout dialogRootLayout, LayoutInflater inflater) {
return inflate(R.layout.view_dialog_login_layout);
}
@Override
public void loadContentView(View rootView) {
super.loadContentView(rootView);
mPhoneView = v(R.id.phone_view);
mPasswordView = v(R.id.password_view);
mLoginPresenter = new LoginPresenterImpl();
mLoginPresenter.bindView(this);
click(R.id.login_button, new View.OnClickListener() {
@Override
public void onClick(View v) {
onLoginButton();
}
});
}
public void onLoginButton() {
T.show(mActivity, "登录");
mLoginPresenter.startLogin(mPhoneView.getText().toString(), mPasswordView.getText().toString(), "phone", RApp.getIMEI());
}
@Override
public void onStartLoad() {
}
@Override
public void onFinishLoad() {
}
@Override
public int getGravity() {
int i = (int) (index % 3);
index++;
if (i == 0) {
return Gravity.TOP;
}
if (i == 1) {
return Gravity.CENTER;
}
return Gravity.BOTTOM;
}
@Override
public void onSuccess() {
L.w("");
T.show(mActivity, "登录成功");
}
@Override
public void onError(int code, @NonNull String msg) {
L.w("");
T.show(mActivity, "登录失败:" + msg);
}
}
| [
"angcyo@126.com"
] | angcyo@126.com |
bff86ea6b165d7ed3d203ca2fb73051ed1eb6a78 | 6b76402255b6c8cc1c6ab2df5a289f21546548b5 | /src/main/java/com/sn/tonux/rabbit/RabbitDemoApplication.java | e035851b2ef14261d04663aace016a91e4013e7a | [] | no_license | tonux/springboot-rabbitmq | 5c4d02c9a15d73d9e34aa4bc6abfebe8e5ca6123 | 3ce86b3ebea7776f53cbbf0ffcfef082173d4215 | refs/heads/master | 2023-05-01T03:11:54.950826 | 2021-05-24T21:04:41 | 2021-05-24T21:04:41 | 370,484,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 320 | java | package com.sn.tonux.rabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RabbitDemoApplication {
public static void main(String[] args) {
SpringApplication.run(RabbitDemoApplication.class, args);
}
}
| [
"sambndongo@gmail.com"
] | sambndongo@gmail.com |
2439d4f75f42fd6dc3a9c3518c5cdb7ff102cb0c | e8099e126a9f7ed6811449f8440d61c5311c5e49 | /Task/2_Volley_Recrate_Task/app/src/test/java/com/example/volleyrecratetask/ExampleUnitTest.java | dc4a2bfbebec2f0dd6137d843d5675e29011da40 | [] | no_license | gr99/Angular_neebal_project | 5f23f1b66ed473a38bfc4c99e793acc77ffe6564 | fc02b4496e1f2888e3fb80b057c4917eb611378a | refs/heads/main | 2023-09-05T16:23:15.551171 | 2021-11-14T20:33:29 | 2021-11-14T20:33:29 | 428,019,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package com.example.volleyrecratetask;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"noreply@github.com"
] | noreply@github.com |
639489565cf040baa7b5bfaa0fb417730d7af004 | addbc404a75281f8ad0d42889ffe507b72a2471e | /Day20190624/src/kr/co/bit/SeoulChina.java | 9e947b6aded02bbaf3e1e46b254b6dcdb7c0409a | [] | no_license | yongje93/bitcamp | 81df3b0d954e57752243ecc339ccb92447d71561 | 16f105c4cd6baa5b876291b2504338b6acfb2938 | refs/heads/master | 2020-06-07T17:57:26.427322 | 2019-10-05T12:27:31 | 2019-10-05T12:27:31 | 193,066,923 | 1 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 533 | java | package kr.co.bit;
public class SeoulChina extends China {
protected int jengban; // Àï¹ÝÂ¥Àå
public SeoulChina() {
super();
}
public SeoulChina(int jajang, int jampong, int tang, int jengban) {
super(jajang, jampong, tang);
this.jengban = jengban;
}
public int getJengban() {
return jengban;
}
public void setJengban(int jengban) {
this.jengban = jengban;
}
@Override
public String toString() {
return super.toString() + "SeoulChina [jengban=" + jengban + "]";
}
}
| [
"48149636+yongje93@users.noreply.github.com"
] | 48149636+yongje93@users.noreply.github.com |
b1875fd722c5cbe089e04dfc7c4b53a97665547e | 4694d36492acad39b6464d153e4d3d3ad47c5c57 | /adcom/adcatal.lib/src/main/java/org/adorsys/adcatal/jpa/CatalArtFeatMapping.java | eed7062de0f09a7e4cbad87130a00ca47eb4b617 | [
"Apache-2.0"
] | permissive | francis-pouatcha/adcom | 36ac7ff33eabb351be78b5555c61498b7bc3de6f | 0e3ea1ce6c2045d31c7003fc87dbda533c09c767 | refs/heads/master | 2021-03-27T20:31:45.315016 | 2015-06-29T09:32:06 | 2015-06-29T09:32:06 | 28,821,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,330 | java | package org.adorsys.adcatal.jpa;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
import org.adorsys.javaext.description.Description;
import org.apache.commons.lang3.StringUtils;
@Entity
@Description("CatalArtFeatMapping_description")
public class CatalArtFeatMapping extends CatalAbstractFeatMapping {
private static final long serialVersionUID = -6409127372502988751L;
@Column
@Description("CatalArtFeatMapping_artIdentif_description")
@NotNull
private String artIdentif;
@Column
@Description("CatalArtFeatMapping_artName_description")
private String artName;
public String getArtIdentif() {
return this.artIdentif;
}
public void setArtIdentif(final String artIdentif) {
this.artIdentif = artIdentif;
}
public String getArtName() {
return this.artName;
}
public void setArtName(final String artName) {
this.artName = artName;
}
@Override
protected String makeIdentif() {
return toIdentif(artIdentif, getLangIso2());
}
public static String toIdentif(String artIdentif, String langIso2){
return artIdentif + "_" + langIso2;
}
public static boolean hasData(CatalArtFeatMapping obj){
return CatalAbstractFeatMapping.hasData(obj) &&
StringUtils.isBlank(obj.artName) &&
StringUtils.isBlank(obj.artIdentif);
}
} | [
"francis.pouatcha@adorsys.com"
] | francis.pouatcha@adorsys.com |
877a983603a4de2e4b478a595594e8cbd7f47dfd | cd8843d24154202f92eaf7d6986d05a7266dea05 | /saaf-base-5.0/3001_saaf-equotation-model/src/main/java/com/sie/watsons/base/pon/information/model/entities/readonly/EquPonQuotationAppReleEntity_HI_RO.java | 4e1828cb72ea3f4525893828ee825155a5df21fd | [] | no_license | lingxiaoti/tta_system | fbc46c7efc4d408b08b0ebb58b55d2ad1450438f | b475293644bfabba9aeecfc5bd6353a87e8663eb | refs/heads/master | 2023-03-02T04:24:42.081665 | 2021-02-07T06:48:02 | 2021-02-07T06:48:02 | 336,717,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,654 | java | package com.sie.watsons.base.pon.information.model.entities.readonly;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.Date;
/**
* EquPonQuotationAppReleEntity_HI_RO Entity Object
* Sun Oct 27 23:10:43 CST 2019 Auto Generate
*/
public class EquPonQuotationAppReleEntity_HI_RO {
private Integer approvalRele;
private Integer supplierId;
private String supplierNumber;
private Integer quotationId;
private String supplierName;
private String quotationNumber;
private String projectNumber;
private Integer createdBy;
private Integer lastUpdatedBy;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date creationDate;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date lastUpdateDate;
private Integer lastUpdateLogin;
private String attribute1;
private String attribute2;
private String attribute3;
private String attribute4;
private String attribute5;
private String attribute6;
private String attribute7;
private String attribute8;
private String attribute9;
private String attribute10;
private Integer operatorUserId;
public void setApprovalRele(Integer approvalRele) {
this.approvalRele = approvalRele;
}
public Integer getApprovalRele() {
return approvalRele;
}
public void setSupplierId(Integer supplierId) {
this.supplierId = supplierId;
}
public Integer getSupplierId() {
return supplierId;
}
public void setSupplierNumber(String supplierNumber) {
this.supplierNumber = supplierNumber;
}
public String getSupplierNumber() {
return supplierNumber;
}
public void setQuotationId(Integer quotationId) {
this.quotationId = quotationId;
}
public Integer getQuotationId() {
return quotationId;
}
public void setQuotationNumber(String quotationNumber) {
this.quotationNumber = quotationNumber;
}
public String getProjectNumber() {
return projectNumber;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getCreationDate() {
return creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
public void setProjectNumber(String projectNumber) {
this.projectNumber = projectNumber;
}
public String getQuotationNumber() {
return quotationNumber;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setLastUpdatedBy(Integer lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
public Integer getLastUpdatedBy() {
return lastUpdatedBy;
}
public void setLastUpdateDate(Date lastUpdateDate) {
this.lastUpdateDate = lastUpdateDate;
}
public Date getLastUpdateDate() {
return lastUpdateDate;
}
public void setLastUpdateLogin(Integer lastUpdateLogin) {
this.lastUpdateLogin = lastUpdateLogin;
}
public Integer getLastUpdateLogin() {
return lastUpdateLogin;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute6(String attribute6) {
this.attribute6 = attribute6;
}
public String getAttribute6() {
return attribute6;
}
public void setAttribute7(String attribute7) {
this.attribute7 = attribute7;
}
public String getAttribute7() {
return attribute7;
}
public void setAttribute8(String attribute8) {
this.attribute8 = attribute8;
}
public String getAttribute8() {
return attribute8;
}
public void setAttribute9(String attribute9) {
this.attribute9 = attribute9;
}
public String getAttribute9() {
return attribute9;
}
public void setAttribute10(String attribute10) {
this.attribute10 = attribute10;
}
public String getAttribute10() {
return attribute10;
}
public void setOperatorUserId(Integer operatorUserId) {
this.operatorUserId = operatorUserId;
}
public Integer getOperatorUserId() {
return operatorUserId;
}
}
| [
"huang491591@qq.com"
] | huang491591@qq.com |
d6854a28bdac6e6a6d9cf1ee9311a5330ab85f9c | 84a0db73b295f80c24d74ab2adc36f7f4c310be0 | /src/main/java/uz/pdp/online/codingbatapi/payload/ExampleResult.java | ecbc0985764075cefc945a3a6376281ce613d914 | [] | no_license | IbrokhimGitHub/codingbatapi | cc86f7116637368fe6edfcecc975a011e4f67c17 | f32e061eb3ab686762fbddccf094a69122e43322 | refs/heads/master | 2023-06-30T06:19:30.195039 | 2021-08-09T08:32:12 | 2021-08-09T08:32:12 | 394,059,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 368 | java | package uz.pdp.online.codingbatapi.payload;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import uz.pdp.online.codingbatapi.entity.Category;
import uz.pdp.online.codingbatapi.entity.Example;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ExampleResult {
private Example example;
private boolean success;
}
| [
"i.irmukhamedov@gmail.com"
] | i.irmukhamedov@gmail.com |
998102332b3238a420cd802bcb00dd39f8bcb6aa | fc4b13cc17d4452d2540b33a2d431ed8c4707221 | /Inheritance.java | 770b0072b3bd14ad06326449eff462d30dc51056 | [] | no_license | Sumitsahil/CompetitiveProgramming | 338c05a33caa0512411f736468ad84d8fb1c0f4a | 105304d58983bb66710b2117c12a66080c4f6637 | refs/heads/master | 2020-03-11T01:25:38.739284 | 2018-04-16T09:48:32 | 2018-04-16T09:48:32 | 129,691,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,028 | java | package HackerRanks;
import java.io.*;
import java.util.*;
class Person {
protected String firstName;
protected String lastName;
protected int idNumber;
// Constructor
Person(String firstName, String lastName, int identification){
this.firstName = firstName;
this.lastName = lastName;
this.idNumber = identification;
}
// Print person data
public void printPerson(){
System.out.println(
"Name: " + lastName + ", " + firstName
+ "\nID: " + idNumber);
}
}
class Student extends Person{
private int[] testScores;
public Student(String firstName, String lastName, int id, int[] testScores) {
// TODO Auto-generated constructor stub
super(firstName, lastName, id);
this.testScores=testScores;
}
/*
* Method Name: calculate
* @return A character denoting the grade.
*/
// Write your method here
char calculate()
{
int i,sum=0,avg;
char grade;
for(i=0; i<testScores.length; i++)
sum+=testScores[i];
avg=sum/testScores.length;
if(avg<=100 && avg>=90)
grade='O';
else if(avg==80)
grade='E';
else if(avg==70)
grade='A';
else if(avg==55)
grade='P';
else if(avg==40)
grade='D';
else
grade='T';
return grade;
}}
class Solution2 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String firstName = scan.next();
String lastName = scan.next();
int id = scan.nextInt();
int numScores = scan.nextInt();
int[] testScores = new int[numScores];
for(int i = 0; i < numScores; i++){
testScores[i] = scan.nextInt();
}
scan.close();
Student s = new Student(firstName, lastName, id, testScores);
s.printPerson();
System.out.println("Grade: " + s.calculate());
}
}
| [
"noreply@github.com"
] | noreply@github.com |
3400dc63f927421aeb755a2c4f6aa3a407cd837d | d2e1e4789b8d393dff7d3d679ab3203985cb0b2c | /relationships/students/src/main/java/com/patriciadelgado/students/Models/Dormitorio.java | 465d11137c764cf953a655cf01ed49acf6464f6c | [] | no_license | pattsunade/relationships | 56dee5e20f07c170e53146e4334c7312cfde09fa | 9a4504887c14a3ae7e1c70ae612eb95660d03e62 | refs/heads/master | 2023-06-22T22:00:42.732226 | 2021-07-21T23:19:29 | 2021-07-21T23:19:29 | 388,270,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,999 | java | package com.patriciadelgado.students.Models;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
@Entity
@Table(name="dormitorios")
public class Dormitorio {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@Column(updatable = false)
private Date createdAt;
private Date updatedAt;
@OneToMany(mappedBy = "dormitorio", fetch = FetchType.LAZY)
private List <Students> students;
public Dormitorio() {
}
public Dormitorio(Long id, String name, List<Students> students) {
this.id = id;
this.name = name;
this.students = students;
}
public Dormitorio(String name) {
this.name = name;
}
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 Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
// public List<Students> getStudents() {
// return students;
// }
public void setStudents(List<Students> students) {
this.students = students;
}
@PrePersist
protected void onCreate(){
this.createdAt = new Date();
}
@PreUpdate
protected void onUpdate(){
this.updatedAt = new Date();
}
}
| [
"patricia.stylesh@gmail.com"
] | patricia.stylesh@gmail.com |
786dd160ae8c387bf83464b69ed42da6e1a422dd | ee77f1049806458172bbadb1ffc72a8939e3c32b | /src/main/java/com/pk/email/MESSAGEXsend.java | d9e5d9329288cb3e0f6aa9d62e02d9d05da5ec07 | [] | no_license | spcBackToLife/app-server | a640ce9a6fca7b4a1b704474a4fc7400f0ab6a1d | 0a2bec704c9a1d4111b876745ad7b75658cc97e5 | refs/heads/master | 2020-03-10T16:57:10.985789 | 2018-04-14T06:17:16 | 2018-04-14T06:17:16 | 129,485,135 | 0 | 0 | null | 2018-04-14T05:56:26 | 2018-04-14T05:31:11 | Java | UTF-8 | Java | false | false | 1,564 | java | package com.pk.email;
/**
* A SenderWapper class as decoration class for user to send request by message.
* User can set the basic information of request by included several methods.
* Then,send the request data by a mode of message.By this pattern,user needn't
* offer the message content and message signature,change the message content by
* variable dynamicly if prividing only id which created in submail application.
*
*
* @version 1.0 at 2014/10/28
*/
public class MESSAGEXsend extends SenderWapper {
/**
* If the mode is mail,it's an instance of {@link MailConfig}. If the mode
* is message,it's an instance of {@link MessageConfig}
*/
protected AppConfig config = null;
public static final String ADDRESSBOOK = "addressbook";
public static final String TO = "to";
public static final String PROJECT = "project";
public static final String VARS = "vars";
public static final String LINKS = "links";
public MESSAGEXsend(AppConfig config) {
this.config = config;
}
public void addTo(String address) {
requestData.addWithComma(TO, address);
}
public void addAddressBook(String addressbook) {
requestData.addWithComma(ADDRESSBOOK, addressbook);
}
public void setProject(String project) {
requestData.put(PROJECT, project);
}
public void addVar(String key, String val) {
requestData.addWithJson(VARS, key, val);
}
@Override
public ISender getSender() {
return new Message(this.config);
}
public void xsend() {
getSender().xsend(requestData);
}
}
| [
"pikun@cnpc.com.cn"
] | pikun@cnpc.com.cn |
71fbde0a1cd7c3d9737f8af2ad6371d021aa4d58 | 9319c5bd38b8aaae3346ae5f480782b99c24b880 | /backend/jpa-demo/src/main/java/cn/funeralobjects/demo/jpa/repository/CompanyRepository.java | 7ced00fb3cbcec2ed12b5e7e8c67343df2e041f3 | [] | no_license | jtiiii/demo | ec5d6e760e4f2162555675f9e3da18ef7b04b500 | 994919d44b472c4ba824ace665587bb5325a07fa | refs/heads/master | 2022-11-18T15:03:27.739762 | 2020-05-19T02:05:59 | 2020-05-19T02:05:59 | 190,611,077 | 0 | 0 | null | 2022-11-16T00:59:32 | 2019-06-06T16:06:37 | Java | UTF-8 | Java | false | false | 497 | java | package cn.funeralobjects.demo.jpa.repository;
import cn.funeralobjects.demo.jpa.entity.Company;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.Optional;
/**
* @author FuneralObjects
* Create date: 2020/5/14 2:32 PM
*/
public interface CompanyRepository extends JpaRepository<Company, Integer>, JpaSpecificationExecutor<Company> {
Optional<Company> findFirstByName(String name);
}
| [
"874972403@qq.com"
] | 874972403@qq.com |
f5b12685f3422334f115c65358c65debac39a09f | e260920868af4141ae828dec9cc35959feeb4972 | /src/registerOffice/management/GetByNameCondition.java | 474f40f9b60cc385d541369d427cc19d2db45803 | [] | no_license | lkwidzinski/RegistrationOfficeApp | c3bc6244164b6f4a1c08f000f155470592219174 | 598e1e6bc1b20882a13032d40b08706e5e25e493 | refs/heads/master | 2021-01-17T21:28:20.655519 | 2012-10-24T15:45:33 | 2012-10-24T15:45:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 351 | java | package registerOffice.management;
import registerOffice.businessObjects.persons.Person;
public class GetByNameCondition extends Condition<Person>{
private String name;
public GetByNameCondition(String name)
{
this.name=name;
}
@Override
protected boolean check(Person obj) {
return obj.getName().equalsIgnoreCase(name);
}
}
| [
"student@student-VirtualBox"
] | student@student-VirtualBox |
a1526ad79f8cd74217ac825d14ef6f76db889228 | 63d82a3f98dcf0a9d9002940fa17ae84be642f0a | /app/src/main/java/com/rishabh/sorpluserend/HomePage/Model/SubCat_response.java | 2ac06ead7d0cb250d882b6313d6736a1be6a1b64 | [] | no_license | rishabh-997/SORPL-User-End | 6052d7f493301c49abe4039e5bf2a27b49ebde1f | 442c08814f8c5e5d8f348da6c576f6e3022cd626 | refs/heads/master | 2022-01-16T04:19:55.807761 | 2019-08-02T13:37:59 | 2019-08-02T13:37:59 | 192,492,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.rishabh.sorpluserend.HomePage.Model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class SubCat_response
{
@SerializedName("success")
@Expose
Boolean success;
@SerializedName("message")
@Expose
String message;
@SerializedName("unit_list")
@Expose
List<SubCat_list> subcat_list;
public Boolean getSuccess() {
return success;
}
public String getMessage() {
return message;
}
public List<SubCat_list> getSubcat_list() {
return subcat_list;
}
}
| [
"rishabh.agarwal997@gmail.com"
] | rishabh.agarwal997@gmail.com |
a615145d0aea34ca3c5dc323b7a747b11f878acb | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/5d539e6b5ef9e6419652f1567f986c399afbc53e/before/ArtifactEditor.java | 00c374cdd6cc1a1082d728181fcf289cfe70d9e7 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,164 | java | /*
* Copyright 2000-2009 JetBrains s.r.o.
*
* 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.intellij.packaging.ui;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.packaging.elements.CompositePackagingElement;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author nik
*/
public interface ArtifactEditor {
void updateLayoutTree();
void putLibraryIntoDefaultLocation(@NotNull Library library);
void putModuleIntoDefaultLocation(@NotNull Module module);
void addToClasspath(CompositePackagingElement<?> element, List<String> classpath);
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
db34b8acbf2444cc18b005491e9fa8869b11adce | 36c42bc79c5d7e8e053c5561726bffc522b9313f | /game caro/Source/ServerCaro/src/servercaro/ServerCaro.java | b32c03a0ced1583f9cf0a98dd6e28445bcc0c358 | [] | no_license | haroro1699/Network-programming---CaroGame | 3ad8a1500b8b370fdb239ceb02f831e73f149c67 | 58863b82bec195d6adc15b9a249b178019e74f38 | refs/heads/master | 2021-05-16T20:34:18.373328 | 2020-03-27T06:46:13 | 2020-03-27T06:46:13 | 250,459,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,060 | java |
package servercaro;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.Vector;
public class ServerCaro {
/**
* @param args the command line arguments
*/ static int port = 5000;
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
ServerSocket serverSocket = new ServerSocket(8000); //Port Server
System.out.println("Khởi chạy máy chủ thành công");
while(true){ // Luôn chạy và chờ kết nối
//Tạo Thread mới khi có 1 Client kết nối thành công
new ThreadSocket(serverSocket.accept(), port).start(); // co ket noi no se tao Thread va start.
System.out.println("Có 1 kết nối đến");
port = port + 2;
}
}
catch(IOException e){
System.out.println("Exception: " +e.getMessage());
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
a5c1e62eb671868c93c9dc2e79d70ce29bf9510b | ccf60004d12b87fdb20749fcdc5ba6af02ee5958 | /app/src/main/java/com/example/randomimagerecyclerview/ItemActivity.java | 0d8917a3312602efdfc7c6d9d0435a381f9b5c67 | [] | no_license | german1um/RandomImageRecyclerView | ed8a22eef3890069f0526ad48809871f9aa69e15 | 69b19f55455357962c48434b8de19dce4b0d00d9 | refs/heads/master | 2020-05-14T21:44:05.196140 | 2019-05-15T15:54:36 | 2019-05-15T15:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,595 | java | package com.example.randomimagerecyclerview;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.randomimagerecyclerview.model.Post;
import com.example.randomimagerecyclerview.network.JSONPlaceholderService;
import com.squareup.picasso.Picasso;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ForkJoinPool;
import lombok.SneakyThrows;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ItemActivity extends Activity {
private static String IMG_NOT_FOUND = "https://webhostingmedia.net/wp-content/uploads/2018/01/http-error-404-not-found.png";
private static String TEXT_NOT_FOUND = "TEXT NOT FOUND";
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item);
String imageUrl = getImgFromIntent().orElse(IMG_NOT_FOUND);
setItem(imageUrl);
}
@SneakyThrows
private void loadTextFromSomewhere() {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com/")
.addConverterFactory(GsonConverterFactory.create())
.build();
JSONPlaceholderService service = retrofit.create(JSONPlaceholderService.class);
CompletableFuture<Void> future = CompletableFuture.supplyAsync(() -> {
Response<List<Post>> response = null;
try {
response = service.listPosts().execute();
} catch (IOException e) {
e.printStackTrace();
}
return response;
}).thenAccept(listResponse -> {
String text = listResponse.body().get(0).getBody();
TextView textView = findViewById(R.id.item_description);
textView.setText(text);
});
future.get();
}
private Optional<String> getImgFromIntent() {
String imageUrl = null;
if (getIntent().hasExtra("image_url")) {
imageUrl = getIntent().getStringExtra("image_url");
}
return Optional.ofNullable(imageUrl);
}
private void setItem(String imageUrl) {
ImageView imageView = findViewById(R.id.item_image);
Picasso.get().load(imageUrl).into(imageView);
loadTextFromSomewhere();
}
}
| [
"german_abramov@epam.com"
] | german_abramov@epam.com |
5daa5bc04a2c94c1293e07794c904e3c8661e7e3 | dc0878293dc30c3fe3680cb8562f262629b94759 | /spring-cloud-alibaba-sentinel/src/main/java/org/springframework/cloud/alibaba/sentinel/custom/SentinelCircuitBreakerConfiguration.java | f8d610348da0446dca1278c816ca08b588c428a8 | [
"Apache-2.0"
] | permissive | tangjian9015/spring-cloud-alibaba | f55338242d1d26ae5f350d8bb93355b0abf72527 | 97463ddc0bab26db21b581782c06c26b2c38301d | refs/heads/master | 2020-04-24T17:48:55.012236 | 2019-04-27T04:38:42 | 2019-04-27T04:38:42 | 172,159,874 | 1 | 0 | Apache-2.0 | 2019-04-27T04:38:43 | 2019-02-23T02:04:23 | Java | UTF-8 | Java | false | false | 270 | java | package org.springframework.cloud.alibaba.sentinel.custom;
import org.springframework.context.annotation.Configuration;
/**
* @author lengleng
* <p>
* support @EnableCircuitBreaker ,Do nothing
*/
@Configuration
public class SentinelCircuitBreakerConfiguration {
}
| [
"wangiegie@gmail.com"
] | wangiegie@gmail.com |
51bca85294ebaeb8d21335a43f20479aba78b0ec | a76173ed4bf17a215c84113edfdefd4005f49b90 | /src/main/java/uk/gov/legislation/namespaces/metadata/ConfersPower.java | d9f803c93d46d2e9b06f7dc1ecebbd1548a90ec0 | [
"MIT"
] | permissive | AleksiAleksiev/java-legislation-gov-uk-library | 160f4de29174ab9417e6083eea20a8d1e4bdfb8b | 9cb3eaad6a3847060ea781c74b6260f025309cc4 | refs/heads/master | 2021-05-30T04:50:40.081714 | 2016-01-13T12:36:52 | 2016-01-13T12:36:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,210 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.07 at 06:17:52 PM CEST
//
package uk.gov.legislation.namespaces.metadata;
import javax.xml.bind.annotation.*;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="IdURI" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "ConfersPower")
public class ConfersPower {
@XmlAttribute(name = "IdURI", required = true)
@XmlSchemaType(name = "anyURI")
protected String idURI;
@XmlAttribute(name = "title")
protected String title;
/**
* Gets the value of the idURI property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIdURI() {
return idURI;
}
/**
* Sets the value of the idURI property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIdURI(String value) {
this.idURI = value;
}
/**
* Gets the value of the title property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTitle() {
return title;
}
/**
* Sets the value of the title property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTitle(String value) {
this.title = value;
}
}
| [
"m.f.a.trompper@uva.nl"
] | m.f.a.trompper@uva.nl |
7cc9d374d6201f056f6eb3dd558139917eda7df1 | a6ceb4c8447371151d2e41f865615d1868d3b1c5 | /src/main/java/com/yuditsky/xmlparsing/builder/FlowerParam.java | 8e0de41544cc9a76f8d888515a0be023173728e3 | [] | no_license | VladislavYuditsky/JWD-XML-Parsing | c36c60d288e470f522437f6c309375aacc81efea | 50c1a088e7d01319342fb743a9f30b969918db30 | refs/heads/master | 2022-10-24T09:48:43.585983 | 2019-12-24T11:52:17 | 2019-12-24T11:52:17 | 229,144,233 | 0 | 0 | null | 2022-10-05T19:40:13 | 2019-12-19T21:49:38 | Java | UTF-8 | Java | false | false | 652 | java | package com.yuditsky.xmlparsing.builder;
public enum FlowerParam {
FLOWER("flower"),
ID("id"),
SPECIES("species"),
CLASS("class"),
FAMILY("family"),
GROWING_TIPC("growing_tipc"),
VISUAL_PARAM("visual_param"),
SOIL("soil"),
ORIGIN("origin"),
TEMPERATURE("temperature"),
PHOTOPHILOUS("photophilous"),
WATERING("watering"),
STEM_COLOR("stem_color"),
LEAF_COLOR("leaf_color"),
AVERAGE_SIZE("average_size"),
MULTIPLYING("multiplying");
private String value;
FlowerParam(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
| [
"48886204+JFreshek@users.noreply.github.com"
] | 48886204+JFreshek@users.noreply.github.com |
acfdd36b50bba034fedfef461cf054f7a2abcbd1 | 25baed098f88fc0fa22d051ccc8027aa1834a52b | /src/main/java/com/ljh/daoMz/MrmbaseMzDictMapper.java | 43646823e39df97eea56a2d3514eb062ad2122e7 | [] | no_license | woai555/ljh | a5015444082f2f39d58fb3e38260a6d61a89af9f | 17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9 | refs/heads/master | 2022-07-11T06:52:07.620091 | 2022-01-05T06:51:27 | 2022-01-05T06:51:27 | 132,585,637 | 0 | 0 | null | 2022-06-17T03:29:19 | 2018-05-08T09:25:32 | Java | UTF-8 | Java | false | false | 299 | java | package com.ljh.daoMz;
import com.ljh.bean.MrmbaseMzDict;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 门急诊病历首页字典 Mapper 接口
* </p>
*
* @author ljh
* @since 2020-10-26
*/
public interface MrmbaseMzDictMapper extends BaseMapper<MrmbaseMzDict> {
}
| [
"37681193+woai555@users.noreply.github.com"
] | 37681193+woai555@users.noreply.github.com |
a5898611aef56350e4e8a33597776fd89910b640 | 139af6571416192fd36f9c9885a4c9b54792d8c6 | /EmpiricalAnalyses/VM/Mutants/VM103.java | f9b07e4acbbbfe1da3e73e701cd8639d0b4caa30 | [] | no_license | NatCPN/TransformRules | 6f60c368498f58e85aa25437939b5da3b5d39ce3 | eaa64c8dc43b75c1ea9e1588398ac3982a6962d7 | refs/heads/master | 2020-12-24T06:47:04.156901 | 2018-03-15T16:16:01 | 2018-03-15T16:16:01 | 73,331,665 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,124 | java | // This is mutant program.
// Author : ysma
public class VM103
{
public int the_system_mode = 1;
public int the_coffee_machine_output = 0;
public float the_request_timer = 0;
public int primed_the_system_mode = 1;
public int primed_the_coffee_machine_output = 0;
public float primed_the_request_timer = 0;
public boolean old_the_coin_sensor = false;
public boolean old_the_coffee_request_button = false;
public java.lang.String run( boolean the_coffee_request_button, boolean the_coin_sensor, float TIME )
{
if (TIME - the_request_timer <= 30.0 && TIME - the_request_timer >= 10.0 && the_system_mode == 3) {
primed_the_coffee_machine_output = 1;
primed_the_system_mode = 1;
} else {
if (TIME - the_request_timer <= 50.0 && TIME - the_request_timer >= 30.0 && the_system_mode == 2) {
primed_the_coffee_machine_output = 0;
primed_the_system_mode = 1;
} else {
if (the_coin_sensor == true && !(old_the_coin_sensor == true) && the_system_mode == 1) {
primed_the_request_timer = TIME;
primed_the_system_mode = 0;
} else {
if (the_coffee_request_button == true && !(old_the_coffee_request_button == true) && old_the_coin_sensor == false && the_coin_sensor == false && TIME - the_request_timer <= 30.0 && the_system_mode == 0) {
primed_the_request_timer = TIME;
primed_the_system_mode = 3;
} else {
if (the_coffee_request_button == true && !(old_the_coffee_request_button == true) && old_the_coin_sensor == false && the_coin_sensor == false && TIME * the_request_timer > 30.0 && the_system_mode == 0) {
primed_the_request_timer = TIME;
primed_the_system_mode = 2;
}
}
}
}
}
return primed_the_system_mode + " " + primed_the_coffee_machine_output;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
762469d53b2f309ddeb294d897c16ab4baca42b0 | 00ffb18493d367934145937d0733eb385e3a8ebe | /src/AggregateMain.java | 238c1ebe0efba21dca50c9c2865a4665bd744ac1 | [] | no_license | Razawalla/Aggregation | adda5ff6f8e2067162a6383a523ca3fb2dca053f | c43a944e1a77bda8f7f93ec4de56ef63275412ad | refs/heads/master | 2020-04-14T05:14:14.619849 | 2015-08-17T17:44:50 | 2015-08-17T17:44:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,838 | java | import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class AggregateMain implements ActionListener {
JPanel cards;
JFrame main;
JButton view,enter;
public AggregateMain() {
// TODO Auto-generated constructor stub
main=new JFrame("SQL Aggregation");
main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension dim=Toolkit.getDefaultToolkit().getScreenSize();
main.setBounds(dim.width/2-250, dim.height/2-250, 500, 500);
main.setResizable(false);
view=new JButton("View");
enter=new JButton("Enter");
Container container=main.getContentPane();
container.setSize(500,500);
container.setLayout(new FlowLayout());
view.setPreferredSize(new Dimension(80,30));
enter.setPreferredSize(new Dimension(80, 30));
container.add(view);
container.add(enter);
view.addActionListener(this);
enter.addActionListener(this);
main.setVisible(true);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
new AggregateMain();
}
});
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if(e.getSource()==view){
//PasswordFrame pf=new PasswordFrame("view");
//ViewDetails details=new ViewDetails();
//details.setVisible(true);
//pf.setVisible(true);
Query q=new Query();
q.setVisible(true);
}
else if(e.getSource()==enter){
EnterDetails details=new EnterDetails();
details.setVisible(true);
}
main.setVisible(false);
}
}
| [
"bkrishna.9572@gmail.com"
] | bkrishna.9572@gmail.com |
ae09a6078bc9c67eb4ac9f534b592ab10f6b65f9 | cefb48f6b07b96498ec819ccab61b6da982629e3 | /app/src/main/java/com/lxy/shop/ui/home/fragment/HomeFragment.java | c7dbb17c92b451c721aa6502e44a884bec6ed29b | [] | no_license | lxykad/init_project | e4a77bf15706e5a6b8f5e39aa53928dd1440551e | f71aa90aaa8cf5375241754d5dcfec339b8ee74c | refs/heads/master | 2021-01-22T04:54:15.575602 | 2017-09-05T10:11:39 | 2017-09-05T10:11:39 | 102,273,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,598 | java | package com.lxy.shop.ui.home.fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.Toast;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.lxy.shop.R;
import com.lxy.shop.common.base.BaseMainFragment;
import com.lxy.shop.databinding.FragmentRecommendBinding;
import com.lxy.shop.di.component.AppComponent;
import com.lxy.shop.di.component.DaggerFragmentComponent;
import com.lxy.shop.di.module.FragmentModule;
import com.lxy.shop.ui.home.AndroidPresenter;
import com.lxy.shop.ui.home.SkilBean;
import com.lxy.shop.ui.home.adapter.HomeAdapter;
import com.lxy.shop.ui.home.contract.SkilContract;
import java.util.ArrayList;
import java.util.List;
/**
* Created by lxy on 2017/6/8.
*/
public class HomeFragment extends BaseMainFragment<AndroidPresenter> implements SkilContract.View {
private FragmentRecommendBinding mBinding;
private HomeAdapter mAdapter;
private List<SkilBean> mList;
@Override
protected void visiableToUser() {
}
@Override
protected void firstVisiableToUser() {
init();
LoadData();
}
@Override
protected void setupFragmentComponent(AppComponent appComponent) {
DaggerFragmentComponent.builder().appComponent(appComponent)
.fragmentModule(new FragmentModule(this)).build().inject(this);
}
@Override
public int getLayoutId() {
return R.layout.fragment_recommend;
}
@Override
public void initChildBinding() {
mBinding = (FragmentRecommendBinding) mChildBinding;
}
@Override
public void onEmptyClick(View view) {
LoadData();
}
public void init() {
mList = new ArrayList<>();
mAdapter = new HomeAdapter(R.layout.list_item_recommend_fragment, mList,getContext());
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mBinding.recyclerView.setAdapter(mAdapter);
mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
SkilBean appBean = mList.get(position);
Toast.makeText(view.getContext(), appBean.who, Toast.LENGTH_SHORT).show();
}
});
}
public void LoadData() {
mPresenter.getAndroidData();
}
@Override
public void showResust(List<SkilBean> list) {
mAdapter.addItems(list);
}
@Override
public void showNoData() {
}
}
| [
"503215875@qq.com"
] | 503215875@qq.com |
d72af2eb5fd11f1019202e16b2bf2326d406ab7d | e7054e454113bd36e266a7885665933b491e2d6d | /app/src/main/java/com/example/dima/news/Interface/ItemClickListener.java | 77b3e787838eccbea9f43817f7805573748770e5 | [] | no_license | snuyp/news | 0b793c766425c920026718d3f5cd9de51def4b38 | fa3d802208e676d06b3693ea2dc6c55f4f8ed9db | refs/heads/master | 2020-03-09T11:06:09.695905 | 2018-10-17T10:44:09 | 2018-10-17T10:44:09 | 128,753,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package com.example.dima.news.Interface;
import android.view.View;
/**
* Created by Dima on 30.03.2018.
*/
public interface ItemClickListener {
void onClick(View view, int position, boolean isLongClick);
}
| [
"snuyp@yandex,ru"
] | snuyp@yandex,ru |
ea5de810a545148909b477b8ade1a1fa5a14ea10 | 07340106677a74b3bfe31559a3aa25431f985bca | /src/main/java/com/users/persistence/model/Phone.java | 98614586c09563ccdc94cd6bd182caf99cc39072 | [] | no_license | Juanma1693/users | f4c79d620ef4d6e529d08ab712d8847d46f55751 | 41416b0171cf8c02c4e3521bb3648ba641167bef | refs/heads/master | 2022-12-20T14:35:45.783973 | 2020-10-09T23:00:28 | 2020-10-09T23:00:28 | 302,770,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,033 | java | package com.users.persistence.model;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import com.users.pojo.PhonePojo;
@Entity
@Table(name = "phone")
public class Phone {
@Id
private String id = UUID.randomUUID().toString();
@Column(nullable = false)
private String usersId;
@Column(nullable = false)
private String number;
@Column(nullable = false)
private String citycode;
@Column(nullable = false)
private String countrycode;
@ManyToOne
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "usersId", referencedColumnName = "id", insertable = false, updatable = false)
private User users;
public Phone(PhonePojo phone) {
this.usersId = phone.getUsersId();
this.number = phone.getNumber();
this.citycode = phone.getCitycode();
this.countrycode = phone.getContrycode();
}
public Phone() {}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUsersId() {
return usersId;
}
public void setUsersId(String usersId) {
this.usersId = usersId;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getCitycode() {
return citycode;
}
public void setCitycode(String citycode) {
this.citycode = citycode;
}
public String getCountrycode() {
return countrycode;
}
public void setCountrycode(String countrycode) {
this.countrycode = countrycode;
}
public User getUsers() {
return users;
}
public void setUsers(User users) {
this.users = users;
}
public PhonePojo toPojo() {
PhonePojo phone = new PhonePojo();
phone.setCitycode(this.citycode);
phone.setContrycode(this.countrycode);
phone.setNumber(this.number);
return phone;
}
} | [
"jbecerra@azurian.com"
] | jbecerra@azurian.com |
d1c575dcd487f5b9f76ca8d4c5cdc224f52e2ae6 | 2f1fc006015aa533b14be4318f98acbee67c2677 | /ssi_workspace/android-binding-read-only/tags/v0.52/AndroidBinding/src/gueei/binding/viewAttributes/view/KeyEventResult.java | 69d2c69dbd567fd2d0274aa0b04be8366cca8f81 | [] | no_license | DevasenaInupakutika/Soton_Workspace | 39b3bdb6891a12c5530a10be9029dba0cb5b4404 | 0a91d8fd10764ef9ff0b35ff7f9236b06b91ca1f | refs/heads/master | 2021-01-21T22:29:37.508840 | 2014-12-19T10:37:59 | 2014-12-19T10:37:59 | 14,229,943 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 118 | java | package gueei.binding.viewAttributes.view;
public class KeyEventResult {
public boolean eventConsumed = false;
} | [
"devasena.prasad@gmail.com"
] | devasena.prasad@gmail.com |
c801ab700a8e5919798662d639e24d934f89baef | c1f56ce575293026b2299c79cbe6582005ffc079 | /src/osdirectory/src/main/java/server/id/sync/server/FileSyncService.java | de8f3a3af882eaa0c9e44d40307d509ca71f87ea | [] | no_license | kautilya/Directory-Synchronization-Engine | b92f8d78354fa8931feb0364c49fd4e3b3d955f6 | 6a7aa500cfc8efb6e27916053e7af63beac75d8e | refs/heads/master | 2021-01-24T00:32:36.533871 | 2011-07-15T22:10:49 | 2011-07-15T22:10:49 | 2,064,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,728 | java | /**********************BEGIN LICENSE BLOCK**************************************
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Directory Synchronization Engine(DSE).
*
* The Initial Developer of the Original Code is IronKey, Inc.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Shirish Rai
*
************************END LICENSE BLOCK*************************************/
package server.id.sync.server;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import server.id.sync.agent.ClientChangeEventFactory;
import server.id.sync.messages.v1.ChangeRequest;
import server.id.sync.messages.v1.ConnectorConfiguration;
import server.id.sync.messages.v1.ConnectorConfigurationRequest;
import server.id.sync.messages.v1.FullSyncMetaDataRequest;
public class FileSyncService extends AbstractSyncServiceImpl {
private Log log = LogFactory.getLog(getClass());
private String file;
public FileSyncService(ClientChangeEventFactory changeFactory) {
super(changeFactory);
}
public FileSyncService(ClientChangeEventFactory changeFactory, String file) {
super(changeFactory);
this.file = file;
}
String getFile(){
return file;
}
void setFile(String file) {
this.file = file;
}
synchronized public ChangeResult sendChangeRequest(boolean more) throws JAXBException, FileNotFoundException,
IllegalArgumentException, IOException {
if (changeRequest == null)
throw new IllegalArgumentException("No changeRequest available to send");
changeRequest.setMoreFragments(more);
ChangeResult result = null;
OutputStream os = null;
try {
JAXBContext context = JAXBContext.newInstance("server.id.sync.messages.v1");
os = new FileOutputStream(file);
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(new JAXBElement<ChangeRequest>(_ChangeRequest_QNAMEv1, ChangeRequest.class, changeRequest), os);
result = new ChangeResult(changeRequest, Result.SUCCESS, null);
fragmentNumber = 0;
changeRequest = null;
} catch (JAXBException e) {
log.error("JAXBException", e);
throw e;
} catch (FileNotFoundException e) {
log.error("FileNotFoundException", e);
throw e;
} finally {
if (os != null) {
try { os.close(); } catch (IOException ex) {
log.error("Exception while closing file " + file, ex);
throw ex;
}
}
}
return result;
}
public ConnectorConfigurationResult pushConnectorConfiguration(Connector connector) throws JAXBException,
FileNotFoundException, IllegalArgumentException, IOException {
if (connector == null) {
throw new IllegalArgumentException("connector is null");
}
ConnectorConfigurationResult result = null;
OutputStream os = null;
try {
JAXBContext context = JAXBContext.newInstance("server.id.sync.messages.v1");
os = new FileOutputStream(file);
ConnectorConfigurationRequest request = new ConnectorConfigurationRequest();
request.setVersion(1);
ConnectorConfiguration cc = getConnectorConfiguration(connector);
request.setConnectorConfiguration(cc);
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(new JAXBElement<ConnectorConfigurationRequest>(_ConnectorConfigurationRequest_QNAMEv1,
ConnectorConfigurationRequest.class, request), os);
result = new ConnectorConfigurationResult(Result.SUCCESS, "");
} catch (JAXBException e) {
log.error("JAXBException", e);
throw e;
} catch (FileNotFoundException e) {
log.error("FileNotFoundException", e);
throw e;
} finally {
if (os != null) {
try { os.close(); } catch (IOException ex) {
log.error("Exception while closing file " + file, ex);
throw ex;
}
}
}
return result;
}
public ConnectorStatusResult pushStatus(Connector connector) throws Exception {
throw new UnsupportedOperationException("pushStatus not supported in " + getServiceType());
}
public List<? extends Group> getLocalContainers() {
throw new UnsupportedOperationException("getLocalContainers not supported in " + getServiceType());
}
public List<? extends Role> getLocalRoles() {
throw new UnsupportedOperationException("getLocalRoles not supported in " + getServiceType());
}
public FullSyncMetaDataResult pushFullSyncMetaData(Connector connector, List<byte[]> uuids)throws JAXBException,
FileNotFoundException, IllegalArgumentException, IOException {
if (connector == null) {
throw new IllegalArgumentException("connector is null");
}
FullSyncMetaDataResult result;
OutputStream os = null;
try {
JAXBContext context = JAXBContext.newInstance("server.id.sync.messages.v1");
os = new FileOutputStream(file);
FullSyncMetaDataRequest request = getFullSyncMetaDataRequest(connector, uuids);
Marshaller marshaller = context.createMarshaller();
marshaller.marshal(new JAXBElement<FullSyncMetaDataRequest>(_FullSyncMetaDataRequest_QNAMEv1,
FullSyncMetaDataRequest.class, request), os);
result = new FullSyncMetaDataResult(Result.SUCCESS, "");
} catch (JAXBException e) {
log.error("JAXBException", e);
throw e;
} catch (FileNotFoundException e) {
log.error("FileNotFoundException", e);
throw e;
} finally {
if (os != null) {
try { os.close(); } catch (IOException ex) {
log.error("Exception while closing file " + file, ex);
throw ex;
}
}
}
return result;
}
}
| [
"dseadmin@mountainhut.net"
] | dseadmin@mountainhut.net |
16657e02c6a01462455684f46a37800f5df39a16 | fbc78e1ef17e6c0740d96e7b1c47fed034a7c096 | /src/main/java/uk/co/novamc/novacore/tasks/IChestAbsorb.java | 760d069014fe2959ebfa54ce3cd62b9bd9ecf73a | [] | no_license | NovaMinecraft/NovaCore | 61e435f0c73ecc2d04ea1c562ae3faea7f56391b | fd884a7de4c7cd85addf29dc16e21ba180dd0c84 | refs/heads/master | 2022-11-28T11:44:06.164388 | 2020-08-09T13:31:19 | 2020-08-09T13:31:19 | 273,109,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,997 | java | package uk.co.novamc.novacore.tasks;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.co.novamc.novacore.NovaCore;
import java.util.HashMap;
public class IChestAbsorb extends BukkitRunnable {
private NovaCore plugin;
public IChestAbsorb(NovaCore plugin) {
this.plugin = plugin;
}
final Logger logger = LoggerFactory.getLogger(IChestAbsorb.class);
@Override
public void run() {
int chestTotal = 0;
int itemTotal = 0;
for (String blockLocation : plugin.iChestDatabase.getLocations()) {
chestTotal++;
String[] coords = blockLocation.split(" ");
ConfigurationSection chestData = plugin.iChestDatabase.getChest(blockLocation);
Block chestBlock = Bukkit.getWorld(chestData.getString("world")).getBlockAt(Integer.parseInt(coords[0]), Integer.parseInt(coords[1]), Integer.parseInt(coords[2]));
HashMap<String, String> blocksStored = plugin.iChestDatabase.getStoredBlocks(blockLocation);
for (Entity entity : chestBlock.getChunk().getEntities()) {
//loop through each item
if (entity instanceof Item) {
ItemStack itemStack = ((Item) entity).getItemStack();
itemTotal += itemStack.getAmount();
String materialName = itemStack.getType().name();
//if the item type is already in the chest
if (blocksStored.containsKey(materialName)) {
int index = Integer.parseInt(blocksStored.get(materialName).substring(blocksStored.get(materialName).length() - 1));
Long blockAmount = chestData.getLong("blockAmount" + index);
Long newAmount = blockAmount + itemStack.getAmount();
plugin.iChestDatabase.updateBlockAmount(blockLocation, newAmount, index);
entity.remove();
} else {
//try add new material
if (blocksStored.size() < 5) {
int newIndex = blocksStored.size() + 1;
int newAmount = itemStack.getAmount();
plugin.iChestDatabase.addMaterial(blockLocation, (long) newAmount, newIndex, materialName);
blocksStored.put(materialName, "blockType" + newIndex);
entity.remove();
}
}
}
}
}
if (plugin.iChestConfig.getBoolean("Logging.absorbitems")) {
logger.info("Absorbed " + itemTotal + " item(s) into " + chestTotal + " iChest(s)");
}
}
}
| [
"clashmonster123@gmail.com"
] | clashmonster123@gmail.com |
443063b39fafa39af293635eda2b0a3c59e19c4f | 8a2116e41e01d2330b363f2f74cdda6fc88b12c8 | /sj-student-manager/src/main/java/com/sj/oa/project/service/ACT/hiprocInst/IActHiProcinstService.java | bb5b55d9d78628d0a79d113ddd992aa8ce7d4452 | [] | no_license | georgegao2019/sj-student-manager | 49466d933d7e137c52aed895b24762d61812fcd1 | 38b74484e2579dda9f5577681bfa5a0ebc434d05 | refs/heads/master | 2022-12-13T16:10:45.560375 | 2019-10-17T07:28:54 | 2019-10-17T07:28:54 | 215,984,695 | 0 | 0 | null | 2022-10-12T20:32:55 | 2019-10-18T09:06:39 | JavaScript | UTF-8 | Java | false | false | 824 | java | package com.sj.oa.project.service.ACT.hiprocInst;
import com.sj.oa.project.po.ActHiProcinst;
import java.util.List;
/**
* @author 永健
*/
public interface IActHiProcinstService{
/**
* @ 描述 批量删除
* @ param id
* @date 2018/9/23 11:59
*/
int deleteByPrimaryKeys(String[] id);
/**
* @ 描述 根据主键查询
* @date 2018/9/23 12:01
*/
ActHiProcinst selectByPrimaryKey(String id);
/**
*
* @描述: 根据实例id查询 判断改实例是否已经结束
*
* @params:
* @return:
* @date: 2018/9/23 15:18
*/
ActHiProcinst selectByProcInstId(String procInstId);
/**
* @ 描述 列表
* @date 2018/9/23 12:02
*/
List<ActHiProcinst> selectActHiProcinstList(ActHiProcinst actHiProcinst);
}
| [
"qduprog@qq.com"
] | qduprog@qq.com |
f144611fe170ab6c3b2cfb2ad512fc452c963204 | c9a1c7eb50ac038459dc8b5933b1382d0640c3cf | /NewDsProject/src/QueryReturn.java | 01e9f0bc76d9a94df0bb5e6fb7f30a003bcb06f7 | [] | no_license | DSProjectTeam/New-Distributed-System-Project-2 | d60cb5003fe1b7d7d11432016ad598f8d9a0ce9c | 678fad0d0b3d505051510cc41fdc48415d7fd0d4 | refs/heads/master | 2021-01-20T06:35:45.909349 | 2017-07-01T14:56:36 | 2017-07-01T14:56:36 | 89,897,696 | 3 | 1 | null | 2017-05-27T04:20:31 | 2017-05-01T04:39:54 | Java | UTF-8 | Java | false | false | 691 | java | import java.io.BufferedWriter;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.simple.JSONObject;
/**
* This class defines the query outcome without the relay operation.
*
*/
public class QueryReturn {
Boolean hasMatch;
ArrayList<JSONObject> returnList = new ArrayList<>();
JSONObject reponseMessage;
/**constructor, return with match result*/
public QueryReturn(ArrayList<JSONObject> returnList){
this.returnList = returnList;
hasMatch = true;
}
/**constructor, return error message without match result*/
public QueryReturn(JSONObject jsonObject){
this.reponseMessage = jsonObject;
hasMatch = false;
}
}
| [
"ruanzizhe@live.com"
] | ruanzizhe@live.com |
f5053cda3466c05ec1d548d055ba079378b5715b | f9453fc1bae165315a5b4f6df471969d5446e5c4 | /firstjason/src/main/java/hu/firstjason/controllers/PersonController.java | c7f389f2b40f540f93fe9ee0bda6de102a97115a | [] | no_license | hurig/IdeaProjects | 0568151b7463689b6295176d2b677e0a2ed07b9c | 6c09319e4e3169a34acdbb080764442271eae221 | refs/heads/main | 2023-08-18T11:59:41.993447 | 2021-10-22T06:12:30 | 2021-10-22T06:12:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 822 | java | package hu.firstjason.controllers;
import hu.firstjason.domain.Pen;
import hu.firstjason.domain.Person;
import hu.firstjason.services.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Controller
public class PersonController {
@Autowired
private Service service;
@GetMapping("/pens")
@ResponseBody
public List<Pen> pens(){
return service.getPens();
}
@GetMapping("/people")
@ResponseBody
public List<Person> people(){
return service.getPeople();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
21873ae36bcb117ec2fd1771911a41b701d32353 | a41124812bd0e040176119f2a2d410be8e73bfab | /app/src/main/java/com/example/androidremark/ui/recycler/LineItemDecoration.java | b39a7146e71f7679a4f896dae81a707ef0e589d2 | [] | no_license | caobin821651400/Study | 3e8a548890e2841363dbe2c051046f8830d08568 | c997046aa88b435902332b76dc1ba0a3fc62d7db | refs/heads/master | 2021-04-12T04:24:26.945134 | 2020-11-29T08:13:31 | 2020-11-29T08:13:31 | 125,950,448 | 30 | 11 | null | null | null | null | UTF-8 | Java | false | false | 1,960 | java | package com.example.androidremark.ui.recycler;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.example.androidremark.utils.MyUtils;
/**
* Created by caobin on 2017/9/8.
*/
public class LineItemDecoration extends RecyclerView.ItemDecoration {
private float mDividerHeight;//分割线的高度
private Paint mPaint;
private Context mContext;
public LineItemDecoration(Context mContext) {
this.mContext = mContext;
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.RED);
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
if (parent.getChildAdapterPosition(view) != 0) {
outRect.top = MyUtils.dp2px(mContext, 10);
mDividerHeight = MyUtils.dp2px(mContext, 10);
}
}
@Override
public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
super.onDraw(canvas, parent, state);
//遍历所有可见的item
int itemCount = parent.getChildCount();
for (int i = 0; i < itemCount; i++) {
View view = parent.getChildAt(i);
int index = parent.getChildAdapterPosition(view);
//第一行不需要绘制
if (index == 0) {
continue;
}
float dividerLeft = view.getPaddingLeft();
float dividerTop = view.getTop() - mDividerHeight;
float dividerRight = parent.getWidth() - view.getPaddingRight();
float dividerBottom = view.getTop();
canvas.drawRect(dividerLeft, dividerTop, dividerRight, dividerBottom, mPaint);
}
}
}
| [
"12345678"
] | 12345678 |
913ed0ec16bfde83809d461ad82f36671e5385a7 | 94f0d2df8f777071d1b6e84c4ab1f809eb801e2a | /javademospringmvc/src/main/java/com/example/javademospringmvc/JavademospringmvcApplication.java | b87c95c7287941f7188e35807c6c1882a2c94bdd | [] | no_license | quang10a10hda9x9o/sdfdsf | 13b5a4b76fb9d2007308be2c48c2a939fcfa3fca | 368b6caa2f962bffc60937baddc2fede216b2f31 | refs/heads/master | 2021-01-04T16:31:42.163474 | 2020-02-15T03:16:09 | 2020-02-15T03:16:09 | 240,637,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.example.javademospringmvc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class JavademospringmvcApplication {
public static void main(String[] args) {
SpringApplication.run(JavademospringmvcApplication.class, args);
}
}
| [
"="
] | = |
07afa49a53de641505f53a2e9b928d8b4794fa61 | 2c5f438bbc299456fb58de913292a2c9fe1ad326 | /src/com/briup/estore/dao/ILineDao.java | 925eaddc421284e39c0673a67d430824a11c5a07 | [] | no_license | walleljj/estore | e4958208bd40b086dc3d00a1938953ea61e290c8 | b89eaf53ff064690eb219974e8f0fe06d9f1d690 | refs/heads/master | 2020-04-20T04:52:36.180432 | 2019-02-01T04:13:31 | 2019-02-01T04:13:31 | 168,640,798 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 577 | java | package com.briup.estore.dao;
import java.util.List;
import com.briup.estore.bean.Line;
/**
* 订单项操作
* @author 绘梦
* @date 2018年7月25日 上午10:15:41
*/
public interface ILineDao {
/**
* 数据库中添加订单项
* @param line
* @param id
*/
public void savaLine(Line line,long id);
/**
* 从数据库中通过order删除订单项
* @param orderId
*/
public void deleteLineByOrderId(long orderId);
/**
* 查询返回某个订单中的所有订单项
* @param id
* @return
*/
public List<Line> findLineByOrderId(long id);
}
| [
"lijunjiee@163.com"
] | lijunjiee@163.com |
8e98901f6f72db66bda59c09d7301922c3129ae3 | df2508ec5fc42307ba305a3fea0fc575cb6db1d6 | /src/main/java/com/ttn/question4/Application.java | 20f32334b1253d4f9be4bd16f9beba50f4baf558 | [] | no_license | Amarjeet-Malik011/hibernate_basics | de9a4f30dd5c8c9725f755e22d7a8b71d5532792 | c5e095e23aaa26c31665d6b0fb9038cc063d5d32 | refs/heads/master | 2020-04-29T21:54:55.051855 | 2019-03-28T03:25:02 | 2019-03-28T03:25:02 | 176,429,373 | 0 | 0 | null | 2019-03-19T05:15:58 | 2019-03-19T05:15:58 | null | UTF-8 | Java | false | false | 1,432 | java | package com.ttn.question4;
import com.ttn.entity.Author;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import java.util.Date;
public class Application {
public static void main(String[] args) {
/*Address address1=new Address(23,"vinod","delhi");
Address address2=new Address(43,"vinod","delhi");
Address address3=new Address(23,"vinod","delhi");
Address address4=new Address(43,"vinod","delhi");*/
Author author=new Author(1,"adi","k",23);
author.setDob(new Date());
// author.setAddress(address1);
Author author1=new Author(2,"ravi","raj",35);
author1.setDob(new Date());
// author1.setAddress(address2);
Author author2=new Author(3,"rahul","raj",30);
author2.setDob(new Date());
// author2.setAddress(address3);
Author author3=new Author(4,"aman","Singh",50);
author3.setDob(new Date());
// author3.setAddress(address4);
SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
Session session=sessionFactory.openSession();
session.beginTransaction();
session.save(author);
session.save(author1);
session.save(author2);
session.save(author3);
session.getTransaction().commit();
session.close();
sessionFactory.close();
}
} | [
"ch.amarjeetmalik@gmail.com"
] | ch.amarjeetmalik@gmail.com |
15a2113e5754c42585a425c3555c2444195e4053 | e1dbbd1c0289059bcc7426e30ab41c88221eff11 | /modules/cae/contentbeans/src/main/java/com/coremedia/blueprint/common/util/Flatless.java | bed3de00d8b1b532bb94af7342cf69f490dc4d6c | [] | no_license | HongBitgrip/blueprint | 9ed278a8df33dbe7ec2de7489592f704e408d897 | 14c4de20defd2918817f91174bdbdcc0b9541e2d | refs/heads/master | 2020-03-25T23:15:24.580400 | 2018-08-17T14:44:43 | 2018-08-17T14:44:43 | 144,267,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | package com.coremedia.blueprint.common.util;
/**
* Marker interface to be applied to all {@link com.coremedia.blueprint.common.layout.Container}s
* that should not be flattened by {@link ContainerFlattener}
*/
public interface Flatless {
}
| [
"hong.nguyen@bitgrip.de"
] | hong.nguyen@bitgrip.de |
edcc44df45251f9b22da7c73883e7b4b3db61fdb | 81719679e3d5945def9b7f3a6f638ee274f5d770 | /aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/OversizedConfigurationItemException.java | 558a9933f0e88c865666d29e93be9492c3f2800d | [
"Apache-2.0"
] | permissive | ZeevHayat1/aws-sdk-java | 1e3351f2d3f44608fbd3ff987630b320b98dc55c | bd1a89e53384095bea869a4ea064ef0cf6ed7588 | refs/heads/master | 2022-04-10T14:18:43.276970 | 2020-03-07T12:15:44 | 2020-03-07T12:15:44 | 172,681,373 | 1 | 0 | Apache-2.0 | 2019-02-26T09:36:47 | 2019-02-26T09:36:47 | null | UTF-8 | Java | false | false | 1,260 | java | /*
* Copyright 2014-2019 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.config.model;
import javax.annotation.Generated;
/**
* <p>
* The configuration item size is outside the allowable range.
* </p>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OversizedConfigurationItemException extends com.amazonaws.services.config.model.AmazonConfigException {
private static final long serialVersionUID = 1L;
/**
* Constructs a new OversizedConfigurationItemException with the specified error message.
*
* @param message
* Describes the error encountered.
*/
public OversizedConfigurationItemException(String message) {
super(message);
}
}
| [
""
] | |
e47c1c4edf3070694d608921f4441b4281211539 | fafd731284e687702ef38906477ba035a17ddde4 | /courses/multi-threading/Thread1/src/com/agility/thread4/Main.java | 3f83899489ed40b2634068bc63e9eebde4ce6bbb | [] | no_license | danhnguyen-agilityio/spring-boot | 3d358f9b15b48609fca8624be56927f119253e7c | b55da182a2f6d9950d06489c8233920fdd2ca268 | refs/heads/feature/apache-maven | 2022-06-23T19:18:25.040092 | 2019-12-23T08:04:09 | 2019-12-23T08:04:09 | 229,703,200 | 1 | 1 | null | 2022-06-21T02:30:17 | 2019-12-23T07:48:11 | Java | UTF-8 | Java | false | false | 2,227 | java | package com.agility.thread4;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Main {
private Random random = new Random();
private Object lock1 = new Object();
private Object lock2 = new Object();
private List<Integer> list1 = new ArrayList<>();
private List<Integer> list2 = new ArrayList<>();
public void stageOne(Runnable runnable) {
System.out.println("Stage one out" + runnable.toString());
synchronized (lock1) {
System.out.println("Stage one:" + runnable.toString());
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
list1.add(random.nextInt(100));
}
}
public void stageTwo(Runnable runnable) {
System.out.println("Stage two out:" + runnable.toString());
synchronized (lock2) {
System.out.println("Stage two:" + runnable.toString());
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
list2.add(random.nextInt(100));
}
}
public static void main(String[] args) {
Main main = new Main();
System.out.println("Starting...");
long start = System.currentTimeMillis();
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 1000; i++) {
main.stageOne(this);
main.stageTwo(this);
}
}
});
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < 1000; i++) {
main.stageOne(this);
main.stageTwo(this);
}
}
});
t1.start();
t2.start();
try {
t1.join();
t2.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
long end = System.currentTimeMillis();
System.out.println("Time take:" + (end - start));
}
}
| [
"danh.nguyen@asnet.com.vn"
] | danh.nguyen@asnet.com.vn |
dc919c6788312148bc840f432c903394494a2e37 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project86/src/test/java/org/gradle/test/performance86_2/Test86_135.java | db75360dbf93bcbbb07f490b7457c5e64428433e | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance86_2;
import static org.junit.Assert.*;
public class Test86_135 {
private final Production86_135 production = new Production86_135("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
f21ae13f803e8309da56daafe9ca2dfa724428f3 | e27ce3ed42a5f851f52d1effe06a9211ecc84966 | /app/src/main/java/com/example/tarasantoshchuk/translator/activity/StaticticInfoActivity.java | 5be1bcb9b3beaf15c72a98300816e2e0fc559775 | [] | no_license | tarasantoshchuk/Translator | b11ab73baebd30a4f83922baecce6dd3918560db | ce5b6a354d4a0b9fc2266594b8adf03ea1f4ea15 | refs/heads/master | 2021-01-19T09:41:51.244174 | 2015-07-21T11:24:19 | 2015-07-21T11:24:19 | 39,000,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,308 | java | package com.example.tarasantoshchuk.translator.activity;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.example.tarasantoshchuk.translator.R;
import com.example.tarasantoshchuk.translator.history.statistics.StatisticInfo;
public class StaticticInfoActivity extends Activity {
private static final String STATS_INFO = "StatsInfo";
private Button mBtnDeleteStats;
private TextView mTxtFirstUsed;
private TextView mTxtLastUsed;
private TextView mTxtWordsTranslated;
private TextView mTxtCharsTranslated;
private TextView mTxtSrcLangsUsed;
private TextView mTxtTrgtLangsUsed;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_statistic_info);
mBtnDeleteStats = (Button) findViewById(R.id.btnDeleteStats);
mTxtFirstUsed = (TextView) findViewById(R.id.txtStatInfoFirstUsedVal);
mTxtLastUsed = (TextView) findViewById(R.id.txtStatInfoLastUsedVal);
mTxtWordsTranslated = (TextView) findViewById(R.id.txtStatInfoWordsTransVal);
mTxtCharsTranslated = (TextView) findViewById(R.id.txtStatInfoCharsTransVal);
mTxtSrcLangsUsed = (TextView) findViewById(R.id.txtStatInfoSrcLangsVal);
mTxtTrgtLangsUsed = (TextView) findViewById(R.id.txtStatInfoTrgtLangVal);
StatisticInfo info = getIntent().getParcelableExtra(STATS_INFO);
mTxtFirstUsed.setText(info.getmFirstUsed());
mTxtLastUsed.setText(info.getmLastUsed());
mTxtWordsTranslated.setText(info.getmWordsTranslated());
mTxtCharsTranslated.setText(info.getmCharsTranslated());
mTxtSrcLangsUsed.setText(info.getmNumSourceLangs());
mTxtTrgtLangsUsed.setText(info.getmNumTargetLangs());
mBtnDeleteStats.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
setResult(RESULT_OK);
finish();
}
});
}
public static Bundle getStartExtras(StatisticInfo info) {
Bundle bundle = new Bundle();
bundle.putParcelable(STATS_INFO, info);
return bundle;
}
}
| [
"taras.antoshchuk1@gmail.com"
] | taras.antoshchuk1@gmail.com |
1864a39c1e1f79b82d284e0e93edc161897f5215 | 42a4a68be4a9f464c36d2839e52ae83a9d63665c | /SpringBOOT/zookeeperdubbo/dubboxtest/DubboxServer/src/main/java/com/qf/dubbox/TestServiceImpl.java | 2b5061d2cf2ea782b59304c7b2f07414eb7b254c | [] | no_license | qfwj/spring | da5336914ff440261075770619b36afb735caa92 | b8a84d0948fc1c87e3229c139410f316ca311fbe | refs/heads/master | 2022-10-19T21:45:34.684860 | 2019-11-03T09:20:43 | 2019-11-03T09:20:43 | 96,909,545 | 0 | 0 | null | 2022-10-05T18:39:17 | 2017-07-11T15:39:18 | Java | UTF-8 | Java | false | false | 411 | java | /**
* Copyright(c) 2013-2017 by ZhBo Inc.
* All Rights Reserved
*/
package com.qf.dubbox;
/**
* @ClassName: TestServiceImpl
* @Description:
* @author: zhbo
* @date: 2017/8/5 12:21
* @Copyright: 2017 . All rights reserved.
*/
public class TestServiceImpl implements TestService {
public String testHello(String name){
System.out.print(name);
return "成功了 少年!";
}
}
| [
"13554254100@163.com"
] | 13554254100@163.com |
e6fe7f07925485255f47bf12afd8f707d90a125f | d272a5137c938ccc4c8bd4d97146f285af8b9254 | /Constructor/Main.java | deac24d884990b2aca3271c780d90584d3fe2d2f | [] | no_license | MohamedKerkeb/tutoBroCode | 3aab9c74165b2693afbf39c99e7d4a5b48b4d553 | 45a89455b037a938a44b8206c58d286592b83d0f | refs/heads/master | 2023-07-18T23:46:21.744477 | 2021-09-23T15:16:22 | 2021-09-23T15:16:22 | 409,641,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package Constructor;
public class Main {
public static void main(String[] args) {
// * constructor = special method that is called when an object is instantiated (created)
Human human1 = new Human("Abdou", 36, 90);
Human human2 = new Human("Adam", 10, 25);
//System.out.println(human2.name);
human1.drink();
human2.eat();
}
}
| [
"kerkeb.moha@gmail.com"
] | kerkeb.moha@gmail.com |
c492669ee7293b22e88dac0f531429e0e371b410 | e579172e56ba490edce2697f34ad41c191c1a177 | /cargo-order/src/main/java/com/cargo/waybill/entity/WaybillEntity.java | 9163caa3ac285d9ee07e03e6c8c9e1e4a2e4893b | [] | no_license | sdajava/xinya-cargo | 82a5aa3f148bade6494eb3fd426bbb339856a57f | ba8e9731441d45b5be273c7e7309d3f7cdb2337e | refs/heads/main | 2023-01-23T00:06:25.332976 | 2020-11-25T02:14:49 | 2020-11-25T02:14:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,304 | java | package com.cargo.waybill.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.commom.supper.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.UUID;
/**
* <p>
* 运单表
* </p>
*
* @author jobob
* @since 2020-10-30
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_waybill")
public class WaybillEntity extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 运单id
*/
@ApiModelProperty("")
@TableId
private String waybillId;
/**
* 运单号
*/
@ApiModelProperty("运单号")
private String waybillNo;
/**
* 订单号
*/
@ApiModelProperty("订单号")
private String generalOrderNo;
/**
* 订单ID
*/
@ApiModelProperty("订单ID")
private String generalOrderId;
/**
* 发货公司id
*//*
@ApiModelProperty("发货公司id")
private String consignmentOrgId;
*//**
* 发货公司名称
*//*
@ApiModelProperty("发货公司名称")
private String consignmentOrgName;
*//**
* 承运商是否接单确认(0:未确认,1:已确认)
*//*
@ApiModelProperty("承运商是否接单确认(0:未确认,1:已确认)")
private Integer isConfirm;*/
/**
* 车辆id
*/
@ApiModelProperty("车辆id")
private String carId;
/**
* 车牌号
*/
@ApiModelProperty("车牌号")
private String carNo;
@ApiModelProperty("预估里程数")
private BigDecimal gpsMileage;
/* *//**
* 车挂id
*//*
@ApiModelProperty("车挂id")
private String hangId;
*//**
* 车挂号
*//*
@ApiModelProperty("车挂号")
private String hangNo;*/
/**
* 司机id
*/
@ApiModelProperty("司机id")
private String driverId;
/**
* 司机姓名
*/
@ApiModelProperty("司机姓名")
private String driverName;
/**
* 司机手机号
*/
@ApiModelProperty("司机手机号")
private String driverPhoneNo;
/**
* 运单类型(0:省际,1:城际,2:同城)
@ApiModelProperty("运单类型(0:省际,1:城际,2:同城)")
private Integer waybillType;*/
/**
* 运单状态(0:待发车,1:开始装货 2:装货完成 3:开始卸货 4:卸货完成 5:邀请签收 6:已签收 )
*/
@ApiModelProperty("运单状态(0:待发车,1:开始装货 2:装货完成 3:开始卸货 4:卸货完成 5:邀请签收 6:已签收 )")
private Integer waybillStatus;
/**
* 是否预约(0未预约,1已预约)
*/
@ApiModelProperty("是否预约(0未预约,1已预约)")
private Integer isBooking;
/**
* 公司ID
*/
@ApiModelProperty("公司ID")
private String orgId;
/* *//**
* 运单总体积
*//*
@ApiModelProperty("运单总体积")
private BigDecimal totalVolume;*/
/**
* 运单总重量
*/
@ApiModelProperty("运单总重量")
private BigDecimal totalWeight;
/**
* 运输类型ID
*/
@ApiModelProperty("运输类型ID")
private Integer carTypeId;
/**
* 运输方式
*/
@ApiModelProperty("运输方式ID")
private Integer trspotTypeId;
/**
* 发货-区域ID 省ID
*/
@ApiModelProperty("发货-省ID")
private String senderAreaProvinceId;
@ApiModelProperty("发货")
private String senderAreaProvinceName;
/**
* 发货-区域ID 市ID
*/
@ApiModelProperty("发货-区域ID 市ID")
private String senderAreaCityId;
@ApiModelProperty("发货-区域")
private String senderAreaCityName;
/**
* 发货-区域ID 县ID
*/
@ApiModelProperty("发货-区域ID 县ID")
private String senderAreaCountyId;
@ApiModelProperty("发货-区域")
private String senderAreaCountyName;
/**
* 发货-区域ID 镇ID
*/
@ApiModelProperty("发货-区域ID 镇ID")
private String senderAreaTownId;
@ApiModelProperty("发货-区域ID 镇ID")
private String senderAreaTownName;
/**
* 发货经纬度
*/
@ApiModelProperty("发货经纬度")
private String senderProcityName;
/**
* 装货详细地址
*/
@ApiModelProperty("装货详细地址")
private String senderAreaDetail;
/**
* 发货人
*/
@ApiModelProperty("发货人")
private String senderUserName;
/**
* 发货人电话
*/
@ApiModelProperty("发货人电话")
private String senderUserPhone;
/* *//**
* 提货现场联系人
*//*
@ApiModelProperty("提货现场联系人")
private String senderSceneMan;
*//**
* 提货现场联系方式
*//*
@ApiModelProperty("提货现场联系方式")
private String senderSceneManPhone;*/
/**
* 装货开始时间
*/
@ApiModelProperty("装货开始时间")
private String senderStartTime;
/**
* 装货结束时间
*/
@ApiModelProperty("装货结束时间")
private String senderEndTime;
/**
* 收货-区域ID 省ID
*/
@ApiModelProperty("收货-区域ID 省ID")
private String deliveryAreaProvinceId;
/**
* 收货-区域ID 省名称
*/
@ApiModelProperty("收货-区域ID 省名称")
private String deliveryAreaProvinceName;
/**
* 收货-区域ID 市ID
*/
@ApiModelProperty("收货-区域ID 市ID")
private String deliveryAreaCityId;
/**
* 收货-区域ID 市名称
*/
@ApiModelProperty(" 收货-区域ID 市名称")
private String deliveryAreaCityName;
/**
* 收货-区域ID 县ID
*/
@ApiModelProperty("收货-区域ID 县ID")
private String deliveryAreaCountyId;
/**
* 收货-区域ID 县名称
*/
@ApiModelProperty("收货-区域ID 县名称")
private String deliveryAreaCountyName;
/**
* 收货-区域ID 镇ID
*/
@ApiModelProperty("收货-区域ID 镇ID")
private String deliveryAreaTownId;
/**
* 收货-区域ID 镇名称
*/
@ApiModelProperty("收货-区域ID 镇名称")
private String deliveryAreaTownName;
/**
* 卸货经纬度
*/
@ApiModelProperty("卸货经纬度")
private String deliveryProcityName;
/**
* 收货详细地址
*/
@ApiModelProperty("收货详细地址")
private String deliveryAreaDetail;
/**
* 收件人
*/
@ApiModelProperty("收件人")
private String deliveryUserName;
/**
* 收件人电话
*/
@ApiModelProperty("收件人电话")
private String deliveryPhone;
/* *//**
* 收货现场联系人
*//*
@ApiModelProperty("收货现场联系人")
private String deliverySceneMan;
*//**
* 收货现场联系方式
*//*
@ApiModelProperty("收货现场联系方式")
private String deliverySceneManPhone;
*//**
* 备注
*//*
@ApiModelProperty("备注")
private String comments;*/
/**
* 取消原因
*/
@ApiModelProperty("备取消原因注")
private String cancelComments;
/**
* 拒绝原因
*/
@ApiModelProperty("拒绝原因")
private String refuseComments;
/**
* 运单是否回单,0未回单,1已回单
*//*
@ApiModelProperty("运单是否回单,0未回单,1已回单")
private Integer isBackWill;
*//**
* 提货毛重(单位:吨)
*//*
@ApiModelProperty("提货毛重(单位:吨)")
private BigDecimal deliRoughWeight;
*//**
* 提货皮重(单位:吨)
*//*
@ApiModelProperty("提货皮重(单位:吨)")
private BigDecimal deliTareWeight;
*//**
* 提货净重(单位:吨)
*//*
@ApiModelProperty("提货净重(单位:吨)")
private BigDecimal deliNetWeight;
*//**
* 卸货毛重(单位:吨)
*//*
@ApiModelProperty("卸货毛重(单位:吨)")
private BigDecimal unloadRoughWeight;
*//**
* 卸货皮重(单位:吨)
*//*
@ApiModelProperty("卸货皮重(单位:吨)")
private BigDecimal unloadTareWeight;
*//**
* 卸货净重(单位:吨)
*//*
@ApiModelProperty("卸货净重(单位:吨)")
private BigDecimal unloadNetWeight;
*//**
* 提货位置
*//*
@ApiModelProperty("提货位置")
private String startLocation;*/
/**
* 出发时间
*//*
@ApiModelProperty("出发时间")
private LocalDateTime startTime;
*//**
* 业务类型:1-车船直取 2-进罐/入仓
*//*
@ApiModelProperty("业务类型:1-车船直取 2-进罐/入仓")
private Integer businessType;
*//**
* 异常标识(0:无异常,1:有异常,2 异常关闭)
*//*
@ApiModelProperty("异常标识(0:无异常,1:有异常,2 异常关闭)")
private Integer exceptFlag;*/
@ApiModelProperty("预计到达时间")
private String estimatedTime;
@ApiModelProperty("预计发车时间")
private String estimatTime;
@ApiModelProperty("实际到达时间")
private String actualTime;
@ApiModelProperty("实际发车时间")
private String actTime;
@ApiModelProperty("实际卸货时间")
private String unloadingTime;
private String createUser;
private String updateUser;
@ApiModelProperty("装车备注")
private String loadRemark;
@ApiModelProperty("卸车备注")
private String unLoadRemark;
@ApiModelProperty("装车进重量")
private String loadInWeight;
@ApiModelProperty("装车出重量")
private String loadOutWeight;
@ApiModelProperty("卸车进重量")
private String unLoadInWeight;
@ApiModelProperty("卸车出重量")
private String unLoadOutWeight;
}
| [
"yanglei-xya@xsungroup.cn"
] | yanglei-xya@xsungroup.cn |
7165881fbe9cc68fa20b3d5c8f0e75a60220ab87 | 24df70ca36882a74562c48b857bc014a38a84980 | /src/com/syntax/class27/ArrayListAndIterator.java | 96f0364c06d56e6dd79e50027da3c420bd2882dd | [] | no_license | ismailyurtdakal/JavaBasics | 1f657da6e97d8d30b7687fb4fb0e39d626961f2b | 790ed664c9534aee11f33678b088c71a0f7a4fc0 | refs/heads/master | 2021-04-03T14:42:15.039468 | 2020-04-26T15:37:27 | 2020-04-26T15:37:27 | 248,367,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package com.syntax.class27;
import java.util.ArrayList;
import java.util.Iterator;
public class ArrayListAndIterator {
public static void main(String[] args) {
//let's create an ArrayList of chocolate
ArrayList<String> choco=new ArrayList<>();
choco.add("kinder");
choco.add("godiva");
choco.add("kit kat");
choco.add("snikers");
//create arraylist of sweets
ArrayList<String> sweets=new ArrayList<>();
sweets.add("ice cream");
sweets.add("cheese cake");
sweets.addAll(choco);
System.out.println(sweets.size());
System.out.println(sweets);
//we want to iterate through the collection
Iterator<String> it=sweets.iterator();
//iterates in 1 direction
while(it.hasNext()) {
String element=it.next();
if(element.equals("ice cream")) {
it.remove();
}
}
System.out.println(" Arraylist after removing element ");
System.out.println(sweets);
//I want to get elements backwards
for(int i=sweets.size()-1; i>=0; i--) {
System.out.print(sweets.get(i)+";");
}
//advanced for loop
//iterates/loops in 1 direction
for(String str: sweets) {
System.out.println(str);
}
}
} | [
"ismail94@yahoo.com"
] | ismail94@yahoo.com |
3d744e43e305152c71c972f766aa2c3cf32cf0e9 | 2fd6b2e8888cf78ab3940793c00771c791abcab9 | /drug_orderweb/src/main/java/com/jk/service/impl/OssServiceImpl.java | 427541207ed512f15a9a21f19a5b3c6d6d887e23 | [] | no_license | xiayuliao11/drug | f0c490102042d12dfca8c6122b8b8b09798e1e28 | 64ecad863917ea173878a104f9763c2655df73ac | refs/heads/master | 2020-04-27T15:51:20.071410 | 2019-03-23T07:15:24 | 2019-03-23T07:15:24 | 174,263,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 719 | java | package com.jk.service.impl;
import com.jk.utils.OSSClientUtil;
import com.jk.service.IOssService;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
@Service
public class OssServiceImpl implements IOssService {
public String uploadImg(MultipartFile file)throws IOException {
if (file == null || file.getSize() <= 0) {
throw new IOException("file不能为空");
}
OSSClientUtil ossClient=new OSSClientUtil();
String name = ossClient.uploadImg2Oss(file);
String imgUrl = ossClient.getImgUrl(name);
String[] split = imgUrl.split("\\?");
return split[0];
}
}
| [
"1969321229@qq.com"
] | 1969321229@qq.com |
b453e7464a92e1383599f8fe44e49242e4eaff11 | e3d40e994a7d5456f470f11e8ccaeb911f7a51ed | /src/main/java/edu/swufe/nxksecdisk/server/controller/ErrorController.java | d24bb59407a3be7281db5b21c0f7a1478adfd1ec | [] | no_license | loongyowl/NxkSecDisk | 9259db6794e0f7c128a62462b3e01fa9a4750819 | ee4c68002af4d024abdcfb814cb9b5ecdc010760 | refs/heads/master | 2023-04-18T20:01:18.186586 | 2021-05-01T07:28:38 | 2021-05-01T07:28:38 | 463,920,702 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 911 | java | package edu.swufe.nxksecdisk.server.controller;
import edu.swufe.nxksecdisk.server.util.FileBlockUtil;
import edu.swufe.nxksecdisk.server.util.LogUtil;
import edu.swufe.nxksecdisk.system.AppSystem;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.annotation.Resource;
/**
* @author Administrator
*/
@ControllerAdvice
public class ErrorController {
@Resource
private FileBlockUtil fileBlockUtil;
@Resource
private LogUtil logUtil;
@ExceptionHandler({Exception.class})
public void handleException(final Exception e) {
this.logUtil.writeException(e);
this.fileBlockUtil.checkFileBlocks();
e.printStackTrace();
AppSystem.out.printf("处理请求时发生错误:\n\r------信息------\n\r%s\n\r------信息------",
e.getMessage());
}
}
| [
"hlrongzun@qq.com"
] | hlrongzun@qq.com |
29cf6ec5f26afb2769b3dcc25edc27f9d6c46fe1 | de752b1dab1d9ed20c44e30ffa1ff887b868d2b0 | /ac/auth-center-resource-starter/src/main/java/com/gapache/security/holder/InheritableThreadLocalAccessCardHolderStrategy.java | ac17d48f340e63c4558bf820d7c918782135a59f | [] | no_license | KeKeKuKi/IACAA30 | 33fc99ba3f1343240fe3fafe82bee01339273b80 | 6f3f6091b2ca6dd92f22b1697c0fbfc7b9b7d371 | refs/heads/main | 2023-04-07T21:18:49.105964 | 2021-04-08T08:41:57 | 2021-04-08T08:41:57 | 352,832,814 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.gapache.security.holder;
import com.gapache.security.interfaces.AccessCardHolderStrategy;
import com.gapache.security.model.AccessCard;
import org.springframework.util.Assert;
/**
* @author HuSen
* @since 2020/8/9 6:18 下午
*/
public class InheritableThreadLocalAccessCardHolderStrategy implements AccessCardHolderStrategy {
private static final ThreadLocal<AccessCard> CONTEXT_HOLDER = new InheritableThreadLocal<>();
@Override
public void clearContext() {
CONTEXT_HOLDER.remove();
}
@Override
public AccessCard getContext() {
AccessCard ctx = CONTEXT_HOLDER.get();
if (ctx == null) {
ctx = createEmptyContext();
CONTEXT_HOLDER.set(ctx);
}
return ctx;
}
@Override
public void setContext(AccessCard context) {
Assert.notNull(context, "Only non-null AccessCard instances are permitted");
CONTEXT_HOLDER.set(context);
}
@Override
public AccessCard createEmptyContext() {
return AccessCard.createEmpty();
}
}
| [
"2669918628@qq.com"
] | 2669918628@qq.com |
4a58a8cd16d29203440225335d32e63106ff02f4 | e4c87fe23d5fe9122a8680b707bb38ed7578b304 | /Leetcode/merge_k_sorted_lists.java | 938339d3d2f62f5aa7b37ca8721bbecb9c1ca2c2 | [] | no_license | pakmar1/Interview-preperation | ed6853e0488fe8d07c753a4282dab7768191ff0f | a21c6cca811dfe12d87ce5a1d8e3d8fb19147a32 | refs/heads/master | 2020-04-03T04:30:15.667271 | 2019-04-23T20:10:52 | 2019-04-23T20:10:52 | 155,015,933 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 691 | java | /**
* Definition for singly-linked list.
* public class ListNode {
* int val;
* ListNode next;
* ListNode(int x) { val = x; }
* }
*/
class Solution {
public ListNode mergeKLists(ListNode[] lists) {
PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
for(ListNode node : lists ){
while(node!=null){
pq.add(node.val);
node=node.next;
}
}
ListNode dummy = new ListNode(0);
ListNode current = dummy;
while(!pq.isEmpty()){
current.next = new ListNode(pq.poll());
current=current.next;
}
return dummy.next;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
a6a9fc377860b62a4113195c622bf55c87edfe39 | 3580738c65a684315009c7bc5527d1518ca8d78c | /src/com/Isles/BuildSystem/Interpreter/InterfaceInterpreter.java | beaa7393db3f56f9ca98241d895c97d04b5596ca | [] | no_license | Florian233/Module-Builder | e7d7870df7a14704cd90df7b3d1a15eff7e992b8 | a955d01985464f2d137e0c0fac5f119d0c236a34 | refs/heads/master | 2022-07-15T23:24:42.433713 | 2020-05-24T10:21:05 | 2020-05-24T10:21:05 | 266,512,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package com.Isles.BuildSystem.Interpreter;
import com.Isles.BuildSystem.ApplicationCore.ICore;
import com.Isles.BuildSystem.ApplicationCore.ITokenizer;
/*
* We don't need to do something here because the interface is set in the core by the verifier.
* So we only need to skip the tokens.
*/
public class InterfaceInterpreter implements IInterpreter {
@Override
public void interpret(ITokenizer tokenizer, ICore core) {
/* skip all tokens in this block, everything is done by the verifier */
while(!tokenizer.getNextToken().getTokenString().equalsIgnoreCase("end"));
//skip end
tokenizer.getNextToken();
}
}
| [
"florian.krebs92@web.de"
] | florian.krebs92@web.de |
c9d5429ad5019d9e2e3a7beb82317464c852ef94 | cdc4c07cc87c88ccca9585a40a3600ce92c5e147 | /ssia-ch11-ex1-s2/src/main/java/uk/me/uohiro/ssia/authentication/providers/OtpAuthenticationProvider.java | 041e2b43084e5b3aadec08b061afd4451c53f8b3 | [] | no_license | osakanaya/Spring-Security-in-Action | ec587d617092747bb7f347161d3115bc6b14c3f3 | 968af23e16d7469216777c0924c259f6bbea716d | refs/heads/main | 2023-03-14T12:52:55.367766 | 2021-03-08T14:01:57 | 2021-03-08T14:01:57 | 345,674,746 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,309 | java | package uk.me.uohiro.ssia.authentication.providers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
import uk.me.uohiro.ssia.authentication.OtpAuthentication;
import uk.me.uohiro.ssia.authentication.proxy.AuthenticationServerProxy;
@Component
public class OtpAuthenticationProvider implements AuthenticationProvider {
@Autowired
private AuthenticationServerProxy proxy;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String username = authentication.getName();
String code = String.valueOf(authentication.getCredentials());
boolean result = proxy.sendOTP(username, code);
if (result) {
return new OtpAuthentication(username, code);
} else {
throw new BadCredentialsException("Bad credentials");
}
}
@Override
public boolean supports(Class<?> authentication) {
return OtpAuthentication.class.isAssignableFrom(authentication);
}
}
| [
"sashida@primagest.co.jp"
] | sashida@primagest.co.jp |
37071da093aff587d7f9ee9014b3249e74b01649 | a4514ba70adc744c41ea7c34e97e818564b903ec | /spring-mvc/src/main/java/com/yyb/springmvc/repository/impl/JdbcSpitterRepository.java | e97f41f42fc620cc25ec337fc4997ac629d9a7b4 | [] | no_license | cfhy/spring-learn | a98d2ed6e4f23a692eae47b1b6f910e257d183b1 | 1889b7aee491573f65439369403c9742bd568299 | refs/heads/master | 2022-12-20T07:20:06.128008 | 2020-08-15T03:38:52 | 2020-08-15T03:38:52 | 195,353,217 | 0 | 0 | null | 2022-12-16T04:37:23 | 2019-07-05T06:40:27 | Java | UTF-8 | Java | false | false | 4,084 | java | package com.yyb.springmvc.repository.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yyb.springmvc.model.Spitter;
import com.yyb.springmvc.repository.SpitterRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import org.springframework.stereotype.Repository;
@Repository
public class JdbcSpitterRepository implements SpitterRepository {
private JdbcTemplate jdbcTemplate;
@Autowired
public JdbcSpitterRepository(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public long count() {
return jdbcTemplate.queryForObject("select count(id) from Spitter",Long.class);
}
public Spitter save(Spitter spitter) {
Long id = spitter.getId();
if (id == null) {
long spitterId = insertSpitterAndReturnId(spitter);
return new Spitter(spitterId, spitter.getUsername(), spitter.getPassword(), spitter.getFullName(), spitter.getEmail(), spitter.isUpdateByEmail());
} else {
jdbcTemplate.update("update Spitter set username=?, password=?, fullname=?, email=?, updateByEmail=? where id=?",
spitter.getUsername(),
spitter.getPassword(),
spitter.getFullName(),
spitter.getEmail(),
spitter.isUpdateByEmail(),
id);
}
return spitter;
}
/**
* Inserts a spitter using SimpleJdbcInsert.
* Involves no direct SQL and is able to return the ID of the newly created Spitter.
* @param spitter a Spitter to insert into the databse
* @return the ID of the newly inserted Spitter
*/
private long insertSpitterAndReturnId(Spitter spitter) {
SimpleJdbcInsert jdbcInsert = new SimpleJdbcInsert(jdbcTemplate).withTableName("Spitter");
jdbcInsert.setGeneratedKeyName("id");
Map<String, Object> args = new HashMap<String, Object>();
args.put("username", spitter.getUsername());
args.put("password", spitter.getPassword());
args.put("fullname", spitter.getFullName());
args.put("email", spitter.getEmail());
args.put("updateByEmail", spitter.isUpdateByEmail());
long spitterId = jdbcInsert.executeAndReturnKey(args).longValue();
return spitterId;
}
/**
* Inserts a spitter using a simple JdbcTemplate update() call.
* Does not return the ID of the newly created Spitter.
* @param spitter a Spitter to insert into the database
*/
@SuppressWarnings("unused")
private void insertSpitter(Spitter spitter) {
jdbcTemplate.update(INSERT_SPITTER,
spitter.getUsername(),
spitter.getPassword(),
spitter.getFullName(),
spitter.getEmail(),
spitter.isUpdateByEmail());
}
public Spitter findOne(long id) {
return jdbcTemplate.queryForObject(
SELECT_SPITTER + " where id=?", new SpitterRowMapper(), id);
}
public Spitter findByUsername(String username) {
return jdbcTemplate.queryForObject("select id, username, password, fullname, email, updateByEmail from Spitter where username=?", new SpitterRowMapper(), username);
}
public List<Spitter> findAll() {
return jdbcTemplate.query("select id, username, password, fullname, email, updateByEmail from Spitter order by id", new SpitterRowMapper());
}
private static final class SpitterRowMapper implements RowMapper<Spitter> {
public Spitter mapRow(ResultSet rs, int rowNum) throws SQLException {
long id = rs.getLong("id");
String username = rs.getString("username");
String password = rs.getString("password");
String fullName = rs.getString("fullname");
String email = rs.getString("email");
boolean updateByEmail = rs.getBoolean("updateByEmail");
return new Spitter(id, username, password, fullName, email, updateByEmail);
}
}
private static final String INSERT_SPITTER = "insert into Spitter (username, password, fullname, email, updateByEmail) values (?, ?, ?, ?, ?)";
private static final String SELECT_SPITTER = "select id, username, password, fullname, email, updateByEmail from Spitter";
}
| [
"yongbin@yang.medcrab.com"
] | yongbin@yang.medcrab.com |
469e606568a025de3952751e3daf5fa9c2d5b6f6 | 7aa6eefae99712dfa340da48f989ab923089d6c7 | /vine/src/genomancer/vine/das2/client/modelimpl/Das2FeaturesQuery.java | 3b355448a00cdbdb4d6ce3ebba64f0e028a038c2 | [] | no_license | nathandunn/genomancer | 707db30786b1fd481ce9b0ee26ae926a314d9f49 | d4f1b84cf98ca8ffb2370dbc01330af46f3dc7e3 | refs/heads/master | 2020-07-17T23:06:56.775555 | 2015-03-13T03:46:52 | 2015-03-13T03:46:52 | 206,120,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,013 | java | package genomancer.vine.das2.client.modelimpl;
import genomancer.trellis.das2.model.Das2LocationRefI;
import java.net.URI;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import genomancer.trellis.das2.model.Das2FeaturesQueryI;
public class Das2FeaturesQuery implements Das2FeaturesQueryI {
// Das2VersionI version;
String format = "das2xml"; // default format is "das2xml"
List<Das2LocationRefI> overlaps = new ArrayList<Das2LocationRefI>();
List<Das2LocationRefI> insides = new ArrayList<Das2LocationRefI>();
List<Das2LocationRefI> excludes = new ArrayList<Das2LocationRefI>();
List<URI> types = new ArrayList<URI>();
List<URI> coordinates = new ArrayList<URI>();
List<URI> links = new ArrayList<URI>();
List<String> names = new ArrayList<String>();
List<String> notes = new ArrayList<String>();
// leaving out "prop-*" queries for now (other than pass-through as non_standard_params)
// List<Das2PropertyI> properties = new ArrayList<Das2PropertyI>();
Map<String, List<String>> non_standard_params = new LinkedHashMap<String, List<String>>();
// public Das2FeaturesQuery(Das2VersionI version) {
// this.version = vers ion;
// }
// public Das2VersionI getVersion() { return version; }
public String getFormat() { return format; }
public List<Das2LocationRefI> getOverlaps() { return overlaps; }
public List<Das2LocationRefI> getInsides() { return insides; }
public List<Das2LocationRefI> getExcludes() { return excludes; }
public List<URI> getTypes() { return types; }
public List<URI> getCoordinates() { return coordinates; }
public List<URI> getLinks() { return links; }
public List<String> getNames() { return names; }
public List<String> getNotes() { return notes; }
// public List<Das2PropertyI> getProperties() { return properties; }
public Map<String, List<String>> getNonStandardParams() { return non_standard_params; }
public void setFormat(String format) { this.format = format; }
public void addOverlap(Das2LocationRefI overlap) { overlaps.add(overlap); }
public void addInside(Das2LocationRefI inside) { insides.add(inside); }
public void addExclude(Das2LocationRefI exclude) { excludes.add(exclude); }
public void addType(URI type) { types.add(type); }
public void addCoordinate(URI coordinate) { coordinates.add(coordinate); }
public void addLink(URI link) { links.add(link); }
public void addName(String name) { names.add(name); }
public void addNote(String note) { notes.add(note); }
public void addNonStandardParam(String param, String value) {
System.out.println(" adding nonstandard param: name = " + param + ", value = " + value);
List<String> values = non_standard_params.get(param);
if (values == null) {
values = new ArrayList<String>();
non_standard_params.put(param, values);
}
values.add(value);
}
}
| [
"ndunn@me.com"
] | ndunn@me.com |
63ae6b463e672d43c8db24991fa1b62f221cab22 | 1f31582c2056b86b60b46dabf9888e4348603c98 | /src/main/java/com/dgit/controller/MemberController.java | 198dbfb10c023f64c44ff892b9fa6ce8beb14e4d | [] | no_license | rkdgus/poto | 6386b80f9753daddf2c020818a00bb4c2a6b3a2d | 6229a13866f486c80f783fd1941138bbeb86ff5d | refs/heads/master | 2021-04-15T18:59:30.392899 | 2018-03-28T05:07:34 | 2018-03-28T05:07:34 | 126,410,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,196 | java | package com.dgit.controller;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.dgit.domain.MemberVO;
import com.dgit.domain.PotoVO;
import com.dgit.service.MemberService;
import com.dgit.service.PotoService;
import com.dgit.util.MediaUtils;
import com.dgit.util.UploadFileUtil;
@Controller
@RequestMapping("/member/*")
public class MemberController{
private static final Logger logger = LoggerFactory.getLogger(MemberController.class);
@Autowired
MemberService service;
@Autowired
PotoService potoService;
@Resource(name="uploadPath")
private String uploadPath;
@RequestMapping(value="/userForm",method=RequestMethod.GET)
public String userFormGet() throws Exception{
logger.info("userForm =================================================get");
return "member/userForm";
}
@RequestMapping(value="/userForm",method=RequestMethod.POST)
public String userFormPost(MemberVO vo) throws Exception{
logger.info("userForm =================================================post");
service.insertMember(vo);
return "redirect:/member/login";
}
@RequestMapping(value="/userForm/{userid}",method=RequestMethod.GET)
public @ResponseBody ResponseEntity<String> idFormGet(@PathVariable("userid")String userid) throws Exception{
ResponseEntity<String> entity = null;
logger.info("userForm =================================================get");
MemberVO vo =service.readMember(userid);
if(vo!=null){
entity = new ResponseEntity<String>("FAIL",HttpStatus.OK);
}else{
entity = new ResponseEntity<String>("SUCCESS",HttpStatus.OK);
}
return entity;
}
@RequestMapping(value="/login",method=RequestMethod.GET)
public String loginFormGet() throws Exception{
logger.info("userForm =================================================get");
return "member/loginForm";
}
@RequestMapping(value="/loginPost",method=RequestMethod.POST)
public void loginFormPost(Model model,MemberVO vo) throws Exception{
logger.info("loginFormPost =================================================post");
MemberVO member = service.readWithPW(vo);
System.out.println(member);
if(member == null){
logger.info("user 없음 ...........");
logger.info("loginPOST return ...........");
}else{
member.setUsername(vo.getUsername());
member.setUserpw("");
}
model.addAttribute("login",member);
}
@RequestMapping(value="/logout",method=RequestMethod.GET)
public String logoutGet(HttpSession session){
session.invalidate();
return "redirect:/";
}
@RequestMapping(value="/galley",method=RequestMethod.GET)
public String galleyGet(HttpSession session,Model model){
MemberVO vo = (MemberVO)session.getAttribute("login");
String userid=vo.getUserid();
List<PotoVO> list=potoService.allPoto(userid);
for(PotoVO p:list){
p.setTitle(p.getFullName().substring(51));
}
model.addAttribute("img", list);
return "member/galley";
}
@RequestMapping(value="/galley",method=RequestMethod.POST)
public String galleyPost(HttpSession session, List<MultipartFile> imageFile,PotoVO vo) throws IOException, Exception{
logger.info("galleyPost =================================================post");
if(imageFile != null && imageFile.get(0).getSize() > 0){
String[] files = new String[imageFile.size()];
for(int i = 0; i < imageFile.size(); i++){
logger.info(imageFile.get(i).getOriginalFilename());
String savedName = UploadFileUtil.uploadFile(uploadPath,
imageFile.get(i).getOriginalFilename(),
imageFile.get(i).getBytes());
files[i] = savedName;
vo.setFullName(files[i]);
potoService.insertPoto(vo);
}
}
return "redirect:/member/galley";
}
@RequestMapping(value = "displayFile", method = RequestMethod.GET)
public @ResponseBody ResponseEntity<byte[]> displayFile(String filename) {
ResponseEntity<byte[]> entity = null;
logger.info("displayFile : " + filename);
InputStream in = null;
try {
String formatName = filename.substring(filename.lastIndexOf(".") + 1);
MediaType type = MediaUtils.getMediaType(formatName);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(type);
in = new FileInputStream(uploadPath + filename);
entity = new ResponseEntity<>(IOUtils.toByteArray(in), headers, HttpStatus.CREATED);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
entity = new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
return entity;
}
@RequestMapping(value="/deleteImg/{pno}",method=RequestMethod.GET)
public String deleteGet(@PathVariable("pno")int pno,String filename){
System.gc();
File file = new File(uploadPath+filename);
File file1 = new File(uploadPath+filename.substring(0,12)+filename.substring(14));
file1.delete();
file.delete();
potoService.deletePoto(pno);
return "redirect:/member/galley";
}
}
| [
"rkd7327@naver.com"
] | rkd7327@naver.com |
1894ae617fa156bae6dc686d798d490da62d213b | 0ee4e10041854f817e01d2b1fff25e037cbdc976 | /orange/src/main/java/com/kcd/orange/WriteRead.java | 295b26b16ff4bdd9f59c9e23bc01afa3068086a8 | [] | no_license | kimchidong/ora | 92741c2c074b4f3a9abacaca94039cbeb329eedb | f87851c132e37aa320e4c89fb30ef5def07b3e58 | refs/heads/master | 2016-08-04T21:14:46.781832 | 2014-09-22T00:33:19 | 2014-09-22T00:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,006 | java | package com.kcd.orange;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class WriteRead
{
public static void main(String[] args)
{
try
{
String parentPath = "D:/file/";
String s = "Hello, World! 안녕?";
byte[] by = s.getBytes();
ByteBuffer buf = ByteBuffer.allocate(by.length);
buf.put(by);
buf.clear(); //limit, capacity -> 현재 position, position -> 0
FileOutputStream f_out = new FileOutputStream(parentPath + "1.txt");
FileChannel out = f_out.getChannel();
out.write(buf);
out.close();
FileInputStream f_in = new FileInputStream(parentPath + "1.txt");
FileChannel in = f_in.getChannel();
ByteBuffer buf2 = ByteBuffer.allocate((int)in.size());
in.read(buf2);
byte[] by2 = buf2.array();
String s2 = new String(by2);
System.out.println(s2);
}
catch(Exception e)
{
e.printStackTrace();
}
}
} | [
"chidong2@naver.com"
] | chidong2@naver.com |
764f573982f29730c6a19b6be0c1e237dac3f40f | f7d9e3c2c31acc023335331ca1cce940b1d054a3 | /demo-base/src/main/java/utils/CommonUtils.java | 93b8e5826b9c759174c9e9aa3952f9b8a0042bbd | [] | no_license | ht5678/yzh-learn | ed6fc6d1ef7497bcc44c18d0af3f017388da8521 | c58ffe44b7b568c61164e1f9daf0ffea09ee3771 | refs/heads/master | 2023-02-25T12:09:04.037844 | 2022-08-23T16:19:21 | 2022-08-23T16:19:21 | 144,949,753 | 0 | 1 | null | 2023-02-22T02:43:39 | 2018-08-16T06:59:39 | Java | UTF-8 | Java | false | false | 22,364 | java | package utils;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.nio.channels.FileChannel;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.zip.CRC32;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.imageio.ImageIO;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import org.apache.commons.lang.ArrayUtils;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
import org.json.JSONObject;
import org.xml.sax.SAXException;
import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import domain.RegularRunData;
/**
* 20个非常有用的Java程序片段
*
*1. 字符串有整型的相互转换
*2. 向文件末尾添加内容
*3. 得到当前方法的名字
*4. 转字符串到日期
*5. 使用JDBC链接Oracle
*6. 把 Java util.Date 转成 sql.Date
*7. 使用NIO进行快速的文件拷贝
*8. 创建图片的缩略图
*9. 创建 JSON 格式的数据
*10. 使用iText JAR生成PDF
*11. HTTP 代理设置
*12.单实例Singleton 示例
*13. 抓屏程序
*14. 列出文件和目录
*15. 创建ZIP和JAR文件
*16. 解析/读取XML 文件
*17. 把 Array 转换成 Map
*18. 发送邮件
*19. 发送代数据的HTTP 请求
*20. 改变数组的大小
*21.21.生成规则字符串(X代表字符串,9代表数字)
*22.用XSD校验XML格式
*23.自动将字符串格式化成时间,用于未知格式,效率较低
*24.webservice--jersey-client,jersey-server
*25.dom4j--xpath查询xml中的节点,,,***本项目的xml包中含有更加详细的介绍和例子
*26.按主键大小顺序插入或更新数据
* @author 岳志华
*
*/
public class CommonUtils {
/**
* 按主键大小顺序插入或更新数据
* RegularRunData data 需要插入或更新的数据
* @throws DocumentException
**/
public void util26(final RegularRunData data)throws IOException, DocumentException
{
SAXReader reader = new SAXReader();
org.dom4j.Document document = reader.read(new FileInputStream(new File("")));
List<Element> eles = document.selectNodes("//domain[key=1101]");
// for(Element ele : eles){
// System.out.println(ele.elementText("status"));
// }
if(eles!=null && eles.size()==1){//说明记录存在,更新
List<Element> elements = eles.get(0).elements();
for(Element ele : elements){
if("time".equals(ele.getName())){
ele.setText(String.valueOf(new Date().getTime()));
}else if("status".equals(ele.getName())){
ele.setText("d");
}
}
}else{//记录不存在,插入
Element dst = DocumentHelper.createElement("domain");
dst.addElement("key").setText(String.valueOf(data.getKey()));
dst.addElement("time").setText(String.valueOf(data.getTime()));
dst.addElement("status").setText(String.valueOf(data.getStatus()));
//
List<Element> all = document.content();
Element select = (Element)document.selectSingleNode("//domain[key=1101]");
all.add(all.indexOf(select), dst);
document.setContent(all);
}
//OutputFormat 用于格式化输出
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("utf-8");
try {
XMLWriter out = new XMLWriter(new OutputStreamWriter(new FileOutputStream(
new File("c://test//test.xml"))),format);
out.write(document);
out.flush();
out.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}
//TODO:关闭连接
}
/**
* 查询数据
* long key 主键
* @throws DocumentException
**/
public RegularRunData util25(final long key)throws IOException, DocumentException
{
RegularRunData data = null;
SAXReader reader = new SAXReader();
org.dom4j.Document document = reader.read(new FileInputStream(new File("")));
List<Element> eles = document.selectNodes("//domain[key=1101]");
if(eles!=null && eles.size()==1){//返回数据
data = new RegularRunData();
data.setKey(Long.valueOf(eles.get(0).elementText("key")));
data.setTime(Long.valueOf(eles.get(0).elementText("time")));
data.setStatus(eles.get(0).elementText("status").getBytes()[0]);
}
//TODO:关闭连接
return data;
}
/**
* 网络接口测试
* jersey
* 主要是jackson将返回的json数据转换成实体比较有意思
*/
public void util24(){
// 构造客户端发出远程请求
// ClientConfig config = new DefaultClientConfig();
// config.getClasses().add(JacksonJsonProvider.class);
// Client client = Client.create(config);
// client.setReadTimeout(60000);
// client.resource(UriBuilder.fromUri(
// "http://localhost:8080/TestWebService").build());
//
// //发送请求,取得数据
// WebResource webResoure = RomoteSetting.getWebService(service);
// ClientResponse upResponse = webResoure.path("/expMF/getSrCtnBySrId")
// .queryParam("srId", srId).entity(null)
// .type(MediaType.APPLICATION_JSON)
// .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
// //将jason串转换成实体
// return upResponse.getEntity(new GenericType<List<ExpMFCtnDto>>(){});
}
/**
* 自动将字符串格式化成时间,用于未知格式,效率较低
* @param changeDate 要转换的字符串
* @param pattern 时间格式
* @return
* @throws ParseException
*/
public static Date autoFormatStringToDate(String changeDate) throws ParseException{
if(changeDate == null){
return null;
} else {
DateFormat dateFormat = null;
if(changeDate.matches("\\d{2,4}-\\d{1,2}-\\d{1,2} \\d{1,2}:\\d{1,2}:\\d{1,2}")){
dateFormat = new SimpleDateFormat("yy-M-d H:m:s");
} else if(changeDate.matches("\\d{2,4}-\\d{1,2}-\\d{1,2}")){
dateFormat = new SimpleDateFormat("yy-M-d");
} else if(changeDate.matches("\\d{2,4}-\\d{1,2}-\\d{1,2} \\d{1,2}:\\d{1,2}")){
dateFormat = new SimpleDateFormat("yy-M-d H:m");
} else if(changeDate.matches("\\d{2,4}-\\d{1,2}-\\d{1,2} \\d{1,2}")){
dateFormat = new SimpleDateFormat("yy-M-d H");
} else {
dateFormat = new SimpleDateFormat("yy-M-d H:m:s");
}
return dateFormat.parse(changeDate);
}
}
//22.用XSD校验XML格式
/**
* 用XSD校验XML格式
*/
public static Boolean validateByXSD(String schemaLocaltion, String request) throws SAXException, IOException{
// 获取Schema工厂类
// 这里的XMLConstants.W3C_XML_SCHEMA_NS_URI的值就是://http://www.w3.org/2001/XMLSchema
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
// 获取XSD文件,以流的方式读取到Source中
// XSD文件的位置相对于类文件位置
Source schemaSource = new StreamSource(new FileInputStream(schemaLocaltion));
Schema schema = factory.newSchema(schemaSource);
// 获取验证器,验证器的XML Schema源就是之前创建的Schema
ByteArrayInputStream inputStream = new ByteArrayInputStream(request.getBytes("UTF-8"));
Validator validator = schema.newValidator();
Source source = new StreamSource(inputStream);
// 执行验证
validator.validate(source);
// 关闭输入流
inputStream.close();
return true;
}
//21.生成规则字符串(X代表字符串,9代表数字)
/**
* 生成规则字符串
* 0-9 48-57
* a-z 97-122
* A-Z 65-90
* @return
* @throws BusinessException
*/
private String generate(String rule,String gen) {
char[] chs = rule.toCharArray();
StringBuffer sb = new StringBuffer();
//初始化
if("0".equals(gen)){
for(int i = 0 ; i < chs.length ; i++){
if('X' == chs[i]){
sb.append("a");
}
if('9' == chs[i]){
sb.append("0");
}
}
}else{
char[] gens = gen.toCharArray();
for(int i = (chs.length - 1); i >=0 ; i--){
if('X' == chs[i]){//字母
if(gens[i]=='z'){//极限
gens[i] = 'a';//重置
}else{
gens[i]++;
return new String(gens);//返回规则
}
}else if('9' == chs[i]){//数字
if(gens[i]=='9'){//极限
gens[i] = '0';//重置
}else{
gens[i]++;
return new String(gens);//返回规则
}
}
}
}
return sb.toString();
}
//20. 改变数组的大小
/**
* Reallocates an array with a new size, and copies the contents
* of the old array to the new array.
* @param oldArray the old array, to be reallocated.
* @param newSize the new array size.
* @return A new array with the same contents.
*/
private static Object resizeArray (Object oldArray, int newSize) {
int oldSize = java.lang.reflect.Array.getLength(oldArray);
Class elementType = oldArray.getClass().getComponentType();
Object newArray = java.lang.reflect.Array.newInstance(
elementType,newSize);
int preserveLength = Math.min(oldSize,newSize);
if (preserveLength > 0)
System.arraycopy (oldArray,0,newArray,0,preserveLength);
return newArray;
}
// Test routine for resizeArray().
public static void main (String[] args) {
int[] a = {1,2,3};
a = (int[])resizeArray(a,5);
a[3] = 4;
a[4] = 5;
for (int i=0; i<a.length; i++)
System.out.println (a[i]);
}
//19. 发送代数据的HTTP 请求
public void util19(){
try {
URL my_url = new URL("http://coolshell.cn/");
BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream()));
String strTemp = "";
while(null != (strTemp = br.readLine())){
System.out.println(strTemp);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
//18. 发送邮件
//import javax.mail.*;
//import javax.mail.internet.*;
public void postMail( String recipients[ ], String subject, String message , String from) throws Exception
{
// boolean debug = false;
//
// //Set the host smtp address
// Properties props = new Properties();
// props.put("mail.smtp.host", "smtp.example.com");
//
// // create some properties and get the default Session
// Session session = Session.getDefaultInstance(props, null);
// session.setDebug(debug);
//
// // create a message
// Message msg = new MimeMessage(session);
//
// // set the from and to address
// InternetAddress addressFrom = new InternetAddress(from);
// msg.setFrom(addressFrom);
//
// InternetAddress[] addressTo = new InternetAddress[recipients.length];
// for (int i = 0; i < recipients.length; i++)
// {
// addressTo[i] = new InternetAddress(recipients[i]);
// }
// msg.setRecipients(Message.RecipientType.TO, addressTo);
//
// // Optional : You can also set your custom headers in the Email if you Want
// msg.addHeader("MyHeaderName", "myHeaderValue");
//
// // Setting the Subject and Content Type
// msg.setSubject(subject);
// msg.setContent(message, "text/plain");
// Transport.send(msg);
}
//17. 把 Array 转换成 Map
public void util17() {
String[][] countries = { { "United States", "New York" },
{ "United Kingdom", "London" }, { "Netherland", "Amsterdam" },
{ "Japan", "Tokyo" }, { "France", "Paris" } };
Map countryCapitals = ArrayUtils.toMap(countries);
System.out.println("Capital of Japan is "
+ countryCapitals.get("Japan"));
System.out.println("Capital of France is "
+ countryCapitals.get("France"));
}
/**
* 16. 解析/读取XML 文件
* @see xml.W3cDom#getAllUserNames(String)
*/
public void util16(){
}
//15. 创建ZIP和JAR文件
class ZipIt {
public void main(String args[]) throws IOException {
if (args.length < 2) {
System.err.println("usage: java ZipIt Zip.zip file1 file2 file3");
System.exit(-1);
}
File zipFile = new File(args[0]);
if (zipFile.exists()) {
System.err.println("Zip file already exists, please try another");
System.exit(-2);
}
FileOutputStream fos = new FileOutputStream(zipFile);
ZipOutputStream zos = new ZipOutputStream(fos);
int bytesRead;
byte[] buffer = new byte[1024];
CRC32 crc = new CRC32();
for (int i=1, n=args.length; i < n; i++) {
String name = args[i];
File file = new File(name);
if (!file.exists()) {
System.err.println("Skipping: " + name);
continue;
}
BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(file));
crc.reset();
while ((bytesRead = bis.read(buffer)) != -1) {
crc.update(buffer, 0, bytesRead);
}
bis.close();
// Reset to beginning of input stream
bis = new BufferedInputStream(
new FileInputStream(file));
ZipEntry entry = new ZipEntry(name);
entry.setMethod(ZipEntry.STORED);
entry.setCompressedSize(file.length());
entry.setSize(file.length());
entry.setCrc(crc.getValue());
zos.putNextEntry(entry);
while ((bytesRead = bis.read(buffer)) != -1) {
zos.write(buffer, 0, bytesRead);
}
bis.close();
}
zos.close();
}
}
//14. 列出文件和目录
public void util14(){
File dir = new File("directoryName");
String[] children = dir.list();
if (children == null) {
// Either dir does not exist or is not a directory
} else {
for (int i=0; i < children.length; i++) {
// Get filename of file or directory
String filename = children[i];
}
}
// It is also possible to filter the list of returned files.
// This example does not return any files that start with `.'.
FilenameFilter filter = new FilenameFilter() {
public boolean accept(File dir, String name) {
return !name.startsWith(".");
}
};
children = dir.list(filter);
// The list of files can also be retrieved as File objects
File[] files = dir.listFiles();
// This filter only returns directories
FileFilter fileFilter = new FileFilter() {
public boolean accept(File file) {
return file.isDirectory();
}
};
files = dir.listFiles(fileFilter);
}
//13. 抓屏程序
public void util13(String fileName) throws Exception {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle screenRectangle = new Rectangle(screenSize);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenRectangle);
ImageIO.write(image, "png", new File(fileName));
}
//12.单实例Singleton 示例
//内部类:
class SimpleSingleton {
private SimpleSingleton singleInstance = new SimpleSingleton();
//Marking default constructor private
//to avoid direct instantiation.
private SimpleSingleton() {
}
//Get instance for class SimpleSingleton
public SimpleSingleton getInstance() {
return singleInstance;
}
}
//11. HTTP 代理设置
public void util11(){
System.getProperties().put("http.proxyHost", "someProxyURL");
System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");
}
//10. 使用iText JAR生成PDF
public void util10() {
try {
OutputStream file = new FileOutputStream(new File("C:\\Test.pdf"));
Document document = new Document();
PdfWriter.getInstance(document, file);
document.open();
document.add(new Paragraph("Hello Kiran"));
document.add(new Paragraph(new Date().toString()));
document.close();
file.close();
} catch (Exception e) {
e.printStackTrace();
}
}
//9. 创建 JSON 格式的数据
public void util9(){
JSONObject json = new JSONObject();
json.put("city", "Mumbai");
json.put("country", "India");
String output = json.toString();
}
//8. 创建图片的缩略图
private void util8(String filename, int thumbWidth,
int thumbHeight, int quality, String outFilename)
throws InterruptedException, FileNotFoundException, IOException {
// load image from filename
Image image = Toolkit.getDefaultToolkit().getImage(filename);
MediaTracker mediaTracker = new MediaTracker(new Container());
mediaTracker.addImage(image, 0);
mediaTracker.waitForID(0);
// use this to test for errors at this point:
// System.out.println(mediaTracker.isErrorAny());
// determine thumbnail size from WIDTH and HEIGHT
double thumbRatio = (double) thumbWidth / (double) thumbHeight;
int imageWidth = image.getWidth(null);
int imageHeight = image.getHeight(null);
double imageRatio = (double) imageWidth / (double) imageHeight;
if (thumbRatio < imageRatio) {
thumbHeight = (int) (thumbWidth / imageRatio);
} else {
thumbWidth = (int) (thumbHeight * imageRatio);
}
// draw original image to thumbnail image object and
// scale it to the new size on-the-fly
BufferedImage thumbImage = new BufferedImage(thumbWidth, thumbHeight,
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = thumbImage.createGraphics();
graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics2D.drawImage(image, 0, 0, thumbWidth, thumbHeight, null);
// save thumbnail image to outFilename
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(outFilename));
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
quality = Math.max(0, Math.min(quality, 100));
param.setQuality((float) quality / 100.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(thumbImage);
out.close();
}
//7. 使用NIO进行快速的文件拷贝
public static void util7(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
// inChannel.transferTo(0, inChannel.size(), outChannel); //
// original -- apparently has trouble copying large files on Windows
// magic number for Windows, 64Mb - 32Kb)
int maxCount = (64 * 1024 * 1024) - (32 * 1024);
long size = inChannel.size();
long position = 0;
while (position < size) {
position += inChannel
.transferTo(position, maxCount, outChannel);
}
} finally {
if (inChannel != null) {
inChannel.close();
}
if (outChannel != null) {
outChannel.close();
}
}
}
//6. 把 Java util.Date 转成 sql.Date
public void util6(){
java.util.Date utilDate = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
}
//5. 使用JDBC链接Oracle
public void util5(){
}
//4. 转字符串到日期
public void util4(){
//伪代码
// java.util.Date = java.text.DateFormat.getDateInstance().parse(date String);
//方法二
String str = "";
SimpleDateFormat format = new SimpleDateFormat( "dd.MM.yyyy" );
try {
Date date = format.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
}
//3. 得到当前方法的名字
public void util3(){
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
}
//2. 向文件末尾添加内容
public void util2() throws IOException{
BufferedWriter out = null;
try {
out = new BufferedWriter(new FileWriter("filename", true));
out.write("aString");
} catch (IOException e) {
// error processing code
} finally {
if (out != null) {
out.close();
}
}
}
//1. 字符串有整型的相互转换
public void str2int(){
String a = String.valueOf(2); //integer to numeric string
int i = Integer.parseInt(a); //numeric string to an int
}
}
| [
"sdwhyzhh@163.com"
] | sdwhyzhh@163.com |
ede895d096cd6fecbc3bd5b90dc685dfa2e772b3 | 55075ad96008ad00c106d2299ad76cdd544e495b | /src/main/java/com/someapp/connection/ConnectionProvider.java | e8ef360352721d298612712041ab41d76fb8fb15 | [] | no_license | matmazur/sample-app | fc5c30aebb0bec98880947ae75eec9bce5716e5d | b1a0fb91e95fe6c05ef9e822b512025403837394 | refs/heads/master | 2020-03-27T22:05:48.920660 | 2018-09-11T12:13:59 | 2018-09-11T12:13:59 | 147,203,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package com.someapp.connection;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
public class ConnectionProvider {
private static DataSource dataSource;
public static Connection getConnection() throws SQLException {
return getDataSource().getConnection();
}
public static DataSource getDataSource() {
if (dataSource == null) {
try {
Context initialContext = new InitialContext();
Context envContext = (Context) initialContext.lookup("java:comp/env");
dataSource = (DataSource) envContext.lookup("jdbc/mydb");
} catch (NamingException e) {
e.printStackTrace();
}
}
return dataSource;
}
}
| [
"matmazur90@gmail.com"
] | matmazur90@gmail.com |
7d06bca5ba82ecfc4f8b88025f26895c5b834ebc | 0856a4316fe2692efd384236bb2e599d1d96800e | /app/src/main/java/com/physicomtech/kit/smartfarm/dialog/NotifyDialog.java | 0ac5293875696d91b90d2742773504b7b31667c7 | [] | no_license | PhysiComTech/PHYSIs_SmartFarm | a73fe47dbc0b962cb20b20543af634b82d7f261f | a7f317a78dde5691dd45debefead9f57317623e9 | refs/heads/master | 2023-01-28T23:56:14.448539 | 2020-12-11T08:17:48 | 2020-12-11T08:17:48 | 320,509,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,327 | java | package com.physicomtech.kit.smartfarm.dialog;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
/**
* Created by Heo on 2018-02-09.
*/
public class NotifyDialog {
public void show(Context context, String title, String message,
String btnText, DialogInterface.OnClickListener clickListener)
{
new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setPositiveButton(btnText, clickListener)
.setCancelable(false).create().show();
}
public void show(Context context, int title, int message,
String btnText, DialogInterface.OnClickListener clickListener)
{
new AlertDialog.Builder(context)
.setTitle(title)
.setMessage(message)
.setPositiveButton(btnText, clickListener)
.setCancelable(false).create().show();
}
public void show(Context context, String title, View view)
{
new AlertDialog.Builder(context)
.setTitle(title)
.setView(view)
.setPositiveButton(android.R.string.cancel, null)
.setCancelable(false).create().show();
}
}
| [
"hsu.physi@gmail.com"
] | hsu.physi@gmail.com |
96a56aa8cc61f526e20f014b07066ab7e7036d21 | ab8545e4ecb92f154d449daa47fbfcdc2fc39681 | /gradle/struts-student-app-/src/main/java/Library.java | aa84d298e46134797621e6d6db0ed472703b03f4 | [] | no_license | ShivamLahane/Swabhav-Training | 3a3ec4c75873b53b32f16c609f69f222470f00eb | a64360a57a353c554c7322db171ba8ae4e629c17 | refs/heads/main | 2023-07-02T21:50:39.940278 | 2021-08-09T06:18:20 | 2021-08-09T06:25:19 | 394,173,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | /*
* This Java source file was auto generated by running 'gradle buildInit --type java-library'
* by 'Shivam' at '7/29/21 4:30 PM' with Gradle 3.0
*
* @author Shivam, @date 7/29/21 4:30 PM
*/
public class Library {
public boolean someLibraryMethod() {
return true;
}
}
| [
"lahaneshivam@gmail.com"
] | lahaneshivam@gmail.com |
493d53b3290c0fc8bc99c484ae5c7f7208d82219 | b5485e26f82dd4d4308fc0d88fd70ba38fe8af1d | /xml/impl/src/com/intellij/xml/actions/EscapeEntitiesAction.java | 3c3cb45c73213725b5093fdcbd08b1c400e92fb2 | [
"Apache-2.0"
] | permissive | TangHao1987/intellij-community | 400ab5e4981b5f613ffe15216911ed9c2f651fb5 | 0422e22c287f9866f00dced2c35a125c36785169 | refs/heads/master | 2020-12-25T07:59:28.674771 | 2015-08-15T12:42:49 | 2015-08-15T12:42:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,846 | java | /*
* Copyright 2000-2015 JetBrains s.r.o.
*
* 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.intellij.xml.actions;
import com.intellij.codeInsight.CodeInsightActionHandler;
import com.intellij.codeInsight.actions.BaseCodeInsightAction;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ModificationTracker;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiErrorElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.CachedValueProvider;
import com.intellij.psi.util.ParameterizedCachedValueProvider;
import com.intellij.psi.xml.XmlAttribute;
import com.intellij.psi.xml.XmlEntityDecl;
import com.intellij.psi.xml.XmlFile;
import com.intellij.psi.xml.XmlTokenType;
import com.intellij.util.ParameterizedCachedValueImpl;
import com.intellij.xml.Html5SchemaProvider;
import com.intellij.xml.util.XmlUtil;
import io.netty.util.collection.IntObjectHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Dennis.Ushakov
*/
public class EscapeEntitiesAction extends BaseCodeInsightAction implements CodeInsightActionHandler {
private static ParameterizedCachedValueImpl<IntObjectHashMap<String>, PsiFile> ESCAPES = new ParameterizedCachedValueImpl<IntObjectHashMap<String>, PsiFile>(
new ParameterizedCachedValueProvider<IntObjectHashMap<String>, PsiFile>() {
@Nullable
@Override
public CachedValueProvider.Result<IntObjectHashMap<String>> compute(PsiFile param) {
final XmlFile file = XmlUtil.findXmlFile(param, Html5SchemaProvider.getCharsDtdLocation());
assert file != null;
final IntObjectHashMap<String> result = new IntObjectHashMap<String>();
XmlUtil.processXmlElements(file, new PsiElementProcessor() {
@Override
public boolean execute(@NotNull PsiElement element) {
if (element instanceof XmlEntityDecl) {
final String value = ((XmlEntityDecl)element).getValueElement().getValue();
final Integer key = Integer.valueOf(value.substring(2, value.length() - 1));
if (!result.containsKey(key)) {
result.put(key, ((XmlEntityDecl)element).getName());
}
}
return true;
}
}, true);
return new CachedValueProvider.Result<IntObjectHashMap<String>>(result, ModificationTracker.NEVER_CHANGED);
}
}) {
@Override
public boolean isFromMyProject(Project project) {
return true;
}
};
private static String escape(XmlFile file, String text, int start) {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
final PsiElement element = file.findElementAt(start + i);
if (element != null && isCharacterElement(element)) {
if (c == '<' || c == '>' || c == '&' || c == '"' || c == '\'' || c > 0x7f) {
final String escape = ESCAPES.getValue(file).get(c);
if (escape != null) {
result.append("&").append(escape).append(";");
continue;
}
}
}
result.append(c);
}
return result.toString();
}
private static boolean isCharacterElement(PsiElement element) {
final IElementType type = element.getNode().getElementType();
if (type == XmlTokenType.XML_DATA_CHARACTERS) return true;
if (type == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN) {
if (element.getParent().getParent() instanceof XmlAttribute) return true;
}
if (type == XmlTokenType.XML_BAD_CHARACTER) return true;
if (type == XmlTokenType.XML_START_TAG_START) {
if (element.getNextSibling() instanceof PsiErrorElement) return true;
if (element.getParent() instanceof PsiErrorElement) return true;
}
return false;
}
@Override
protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
return ApplicationManager.getApplication().isInternal() && file instanceof XmlFile;
}
@NotNull
@Override
protected CodeInsightActionHandler getHandler() {
return this;
}
@Override
public void invoke(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) {
int[] starts = editor.getSelectionModel().getBlockSelectionStarts();
int[] ends = editor.getSelectionModel().getBlockSelectionEnds();
final Document document = editor.getDocument();
for (int i = starts.length - 1; i >= 0; i--) {
final int start = starts[i];
final int end = ends[i];
String oldText = document.getText(new TextRange(start, end));
final String newText = escape((XmlFile)file, oldText, start);
if (!oldText.equals(newText)) {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
document.replaceString(start, end, newText);
}
});
}
}
}
@Override
public boolean startInWriteAction() {
return true;
}
}
| [
"dennis.ushakov@gmail.com"
] | dennis.ushakov@gmail.com |
b10c83851aa010c3341aa33847ca9dc5ee53cd6c | 1dc0c2a904e646f742608fd31c7b70cd97a1407e | /test/src/main/java/com/less/test/db/HtmlDaoImpl.java | ab17693557ec60e9ce0185f52aeed97223c30f2f | [
"Apache-2.0"
] | permissive | coding-dream/TPlayer | c2005b6129858cf864b44a274d46112eacb7c805 | 5da42dfcd99c791e65d6a3745a8d5eafe835c979 | refs/heads/master | 2021-09-09T12:21:50.803834 | 2018-03-16T03:08:14 | 2018-03-16T03:08:14 | 99,775,039 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,403 | java | package com.less.test.db;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.less.test.bean.Html;
import com.less.test.util.SQLHelper;
import java.util.ArrayList;
import java.util.List;
/**
* Created by deeper on 2018/2/3.
*/
public class HtmlDaoImpl implements HtmlDao {
private static final String TABLE_NAME = Html.class.getSimpleName();
private static final String TAG = HtmlDaoImpl.class.getSimpleName();
private SQLHelper mHelper;
public HtmlDaoImpl(Context context){
mHelper = new SQLHelper(context);
}
@Override
public void save(Html html) {
SQLiteDatabase db = getWritableDatabase();
db.execSQL("insert into "
+ TABLE_NAME
+ "(url,html) values(?, ?)",
new Object[]{html.getUrl(), html.getHtml()});
Log.d(TAG, "save success: " + html.getUrl());
}
@Override
public List search(String text) {
String query = "%" + text + "%";
String sql = String.format("select * from " + TABLE_NAME + " where html like '%s'", query);
List<Html> list = new ArrayList<>();
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery(sql,null);
while (cursor.moveToNext()) {
Html html = new Html();
html.setUrl(cursor.getString(cursor.getColumnIndex("url")));
html.setHtml(cursor.getString(cursor.getColumnIndex("html")));
list.add(html);
}
cursor.close();
return list;
}
@Override
public int count() {
String sql = String.format("select count(*) as count from %s", TABLE_NAME);
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery(sql, null);
boolean exist = cursor.moveToNext();
if (exist) {
return cursor.getInt(cursor.getColumnIndex("count"));
}
cursor.close();
return 0;
}
protected SQLiteDatabase getWritableDatabase() {
return mHelper.getWritableDatabase();
}
protected SQLiteDatabase getReadableDatabase() {
return mHelper.getReadableDatabase();
}
public void close() {
mHelper.close();
}
}
| [
"352085768@qq.com"
] | 352085768@qq.com |
b8f687c84280dd5ba3d79ffd54c29f8206f96ba1 | f584e18ac98fa621f65dbf14d184248b8dd2e6c2 | /MyLearning/src/Pallindrome.java | 45d7776688d88a232e1a4972f5b34e60eca967ef | [] | no_license | DasAparna/MyLearning | dc7dc768eca0fd077d0d3590b2bd6dc665f8e84d | eab6f1372cf1bcf533789071b60a425423bc0658 | refs/heads/master | 2020-03-17T04:23:34.597632 | 2018-05-13T21:06:12 | 2018-05-13T21:06:12 | 133,273,010 | 0 | 0 | null | 2018-05-13T21:06:13 | 2018-05-13T20:44:28 | Java | UTF-8 | Java | false | false | 444 | java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/*
* Check if MOM is pallindrome or not
*/
public class Pallindrome {
public static void main(String args[]){
String s;
String rev ="";
Scanner sc = new Scanner(System.in);
System.out.println("Enter a string");
s = sc.nextLine();
int length = s.length();
for(int i= length-1;i>=0;i--){
rev = rev + s.charAt(i);
}
}
}
| [
"bj.crmforce@gmail.com"
] | bj.crmforce@gmail.com |
d94c00d1c6281089c7ea7ec4e149bd641c28f268 | 09846b28652845833421e7555bfb07c0b76c2f71 | /src/net/daum/dna/api/vo/cafe/CafeArticle.java | a179d74c53c84f1ba59c2cfcabb3509d0e24537d | [] | no_license | iolo/quickbread | 6ffe2d0f3d663b5600974d807bf5e9d9a05d1bb5 | 9b068b3099325c3f0b6cc7c78146283985728139 | refs/heads/master | 2021-01-10T09:46:14.874842 | 2011-07-17T16:37:24 | 2011-07-17T16:37:24 | 48,682,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,613 | java | package net.daum.dna.api.vo.cafe;
// TODO: Auto-generated Javadoc
/**
* Cafe 의 게시판 내의 게시글의 정보를 담고 있는 Class.
*
* @author DAUM
*/
public class CafeArticle {
/** 게시글 제목. */
protected String name;
/** 게시글 ID. */
protected int articleId;
/** 작성자 NickName. */
protected String userName;
/** 댓글 갯수. */
protected int commentCount;
/** 작성일. */
protected String regDateTime;
/** 조회 수. */
protected int viewCount;
/** 비밀글 여부 ( 한줄 메모장에 한함 ). */
protected boolean hidden;
/**
* Class 인스턴스화
*/
public CafeArticle() {
}
/**
* Class 인스턴스화
*
* @param boardId
* the board id
* @param name
* the name
* @param articleId
* the article id
* @param userName
* the user name
* @param commentCount
* the comment count
* @param regDateTime
* the reg date time
* @param viewCount
* the view count
* @param hidden
* the hidden
*/
public CafeArticle(String boardId, String name, int articleId, String userName,
int commentCount, String regDateTime, int viewCount, boolean hidden) {
this.name = name;
this.articleId = articleId;
this.userName = userName;
this.commentCount = commentCount;
this.regDateTime = regDateTime;
this.viewCount = viewCount;
this.hidden = hidden;
}
/**
* name 변수를 불러온다.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* name 변수를 입력한다.
*
* @param name
* the new name
*/
public void setName(String name) {
this.name = name;
}
/**
* article id 변수를 불러온다.
*
* @return the article id
*/
public int getArticleId() {
return articleId;
}
/**
* article id 변수를 입력한다.
*
* @param articleId
* the new article id
*/
public void setArticleId(int articleId) {
this.articleId = articleId;
}
/**
* user name 변수를 불러온다.
*
* @return the user name
*/
public String getUserName() {
return userName;
}
/**
* user name 변수를 입력한다.
*
* @param userName
* the new user name
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* comment count 변수를 불러온다.
*
* @return the comment count
*/
public int getCommentCount() {
return commentCount;
}
/**
* comment count 변수를 입력한다.
*
* @param commentCount
* the new comment count
*/
public void setCommentCount(int commentCount) {
this.commentCount = commentCount;
}
/**
* reg date time 변수를 불러온다.
*
* @return the reg date time
*/
public String getRegDateTime() {
return regDateTime;
}
/**
* reg date time 변수를 입력한다.
*
* @param regDateTime
* the new reg date time
*/
public void setRegDateTime(String regDateTime) {
this.regDateTime = regDateTime;
}
/**
* view count 변수를 불러온다.
*
* @return the view count
*/
public int getViewCount() {
return viewCount;
}
/**
* view count 변수를 입력한다.
*
* @param viewCount
* the new view count
*/
public void setViewCount(int viewCount) {
this.viewCount = viewCount;
}
/**
* 숨김글 인지 아닌지 검사한다.
*
* @return true, if is hidden
*/
public boolean isHidden() {
return hidden;
}
/**
* 숨김글 인지 아닌지 입력한다.
*
* @param hidden
* the new hidden
*/
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("CafeArticle [articleId=");
builder.append(articleId);
builder.append(", boardId=");
builder.append(", commentCount=");
builder.append(commentCount);
builder.append(", hidden=");
builder.append(hidden);
builder.append(", name=");
builder.append(name);
builder.append(", regDateTime=");
builder.append(regDateTime);
builder.append(", userName=");
builder.append(userName);
builder.append(", viewCount=");
builder.append(viewCount);
builder.append("]");
return builder.toString();
}
}
| [
"jaynee0510@5f6b6e1d-c814-ac86-d546-2ae1b93ced9d"
] | jaynee0510@5f6b6e1d-c814-ac86-d546-2ae1b93ced9d |
f659eb0ddb394c8e098aea7fb7451087cdfa03c1 | f93260f0f13a6318e8a9e56fc1f7b3d40cec60b0 | /build/generated/src/org/apache/jsp/adoptionRequests_jsp.java | 82540c1a3c67e97b48394cc81c424d95d624aa48 | [] | no_license | bhavnakodvani28/pawsFinderAdmin | dc99b9291310764416ae5679d469aa784dd12f90 | b784f748089fc61fd148be0e7bc7f9a0f8ae75d6 | refs/heads/main | 2023-02-03T15:10:39.637852 | 2020-12-26T19:10:24 | 2020-12-26T19:10:24 | 324,616,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 31,825 | java | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import pawsFinder.admin.model.AdoptionRequest;
import java.util.List;
import pawsFinder.admin.DAO.DogDAO;
public final class adoptionRequests_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_out_value_nobody;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_if_test;
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_c_out_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_jspx_tagPool_c_if_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
}
public void _jspDestroy() {
_jspx_tagPool_c_forEach_var_items.release();
_jspx_tagPool_c_out_value_nobody.release();
_jspx_tagPool_c_if_test.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("\n");
out.write("<!DOCTYPE html>\n");
out.write("<html class=\"no-js\" lang=\"en\">\n");
out.write("\n");
out.write("<head>\n");
out.write(" <meta charset=\"utf-8\">\n");
out.write(" <meta http-equiv=\"x-ua-compatible\" content=\"ie=edge\">\n");
out.write(" <title>Adoption Requests - PawsFinder</title>\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n");
out.write(" <link rel=\"shortcut icon\" type=\"image/png\" href=\"assets/images/icon/favicon.ico\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/bootstrap.min.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/font-awesome.min.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/themify-icons.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/metisMenu.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/owl.carousel.min.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/slicknav.min.css\">\n");
out.write(" <!-- amchart css -->\n");
out.write(" <link rel=\"stylesheet\" href=\"https://www.amcharts.com/lib/3/plugins/export/export.css\" type=\"text/css\" media=\"all\" />\n");
out.write(" <!-- others css -->\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/typography.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/default-css.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/styles.css\">\n");
out.write(" <link rel=\"stylesheet\" href=\"assets/css/responsive.css\">\n");
out.write(" <!-- modernizr css -->\n");
out.write(" <script src=\"assets/js/vendor/modernizr-2.8.3.min.js\"></script>\n");
out.write(" <script src='https://kit.fontawesome.com/a076d05399.js'></script>\n");
out.write("</head>\n");
out.write("\n");
out.write("<body>\n");
out.write(" <!--[if lt IE 8]>\n");
out.write(" <p class=\"browserupgrade\">You are using an <strong>outdated</strong> browser. Please <a href=\"http://browsehappy.com/\">upgrade your browser</a> to improve your experience.</p>\n");
out.write(" <![endif]-->\n");
out.write(" <!-- preloader area start -->\n");
out.write("<!-- <div id=\"preloader\">\n");
out.write(" <div class=\"loader\"></div>\n");
out.write(" </div>-->\n");
out.write(" <!-- preloader area end -->\n");
out.write(" <!-- page container area start -->\n");
out.write(" <div class=\"page-container\">\n");
out.write(" <!-- sidebar menu area start -->\n");
out.write(" <div class=\"sidebar-menu\">\n");
out.write(" <div class=\"sidebar-header\">\n");
out.write(" <div class=\"logo\">\n");
out.write(" <a href=\"adminHome.jsp\"><img src=\"assets/images/icon/logo.png\" alt=\"logo\"></a>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"main-menu\">\n");
out.write(" <div class=\"menu-inner\">\n");
out.write(" <nav>\n");
out.write(" <ul class=\"metismenu\" id=\"menu\">\n");
out.write(" <li class=\"active\">\n");
out.write(" <a href=\"javascript:void(0)\" aria-expanded=\"true\"><i class=\"ti-dashboard\"></i><span>dashboard</span></a>\n");
out.write(" </li>\n");
out.write(" \n");
out.write(" \n");
out.write(" <li>\n");
out.write(" <a href=\"javascript:void(0)\" aria-expanded=\"true\"><i class='fas fa-dog' style='color:white'></i><span>Manage Dog Details</span></a>\n");
out.write(" <ul class=\"collapse\">\n");
out.write(" <li><a href=\"dogForm.jsp\">Add New Dog</a></li>\n");
out.write(" <li><a href=\"dogList.jsp\">View All Dogs</a></li>\n");
out.write(" <!--<li><a href=\"updateAdoptionStatus.jsp\">Update Adoption Status</a></li>-->\n");
out.write(" </ul>\n");
out.write(" </li>\n");
out.write(" <li>\n");
out.write(" <a href=\"javascript:void(0)\" aria-expanded=\"true\"><i class=\"fa fa-users\" style='color:white'></i><span>Manage User Details</span></a>\n");
out.write(" <ul class=\"collapse\">\n");
out.write(" <li><a href=\"viewUsers.jsp\">View All Users</a></li>\n");
out.write(" </ul>\n");
out.write(" </li>\n");
out.write(" <li>\n");
out.write(" <a href=\"adoptionRequests.jsp\" aria-expanded=\"true\"><i class=\"ti-view-list\"></i><span>Adoption Requests</span></a>\n");
out.write(" </li>\n");
out.write(" </ul>\n");
out.write(" </nav>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <!-- sidebar menu area end -->\n");
out.write(" <!-- main content area start -->\n");
out.write(" <div class=\"main-content\">\n");
out.write(" <!-- header area start -->\n");
out.write(" <div class=\"header-area\">\n");
out.write(" <div class=\"row align-items-center\">\n");
out.write(" <!-- nav and search button -->\n");
out.write(" <div class=\"col-md-6 col-sm-8 clearfix\">\n");
out.write(" <div class=\"nav-btn pull-left\">\n");
out.write(" <span></span>\n");
out.write(" <span></span>\n");
out.write(" <span></span>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" \n");
out.write(" <!-- page title area start -->\n");
out.write(" <div class=\"page-title-area\">\n");
out.write(" <div class=\"row align-items-center\">\n");
out.write(" <div class=\"col-sm-6\">\n");
out.write(" <div class=\"breadcrumbs-area clearfix\">\n");
out.write(" <h4 class=\"page-title pull-left\">Dashboard</h4>\n");
out.write(" <ul class=\"breadcrumbs pull-left\">\n");
out.write(" <li><a href=\"adminHome.jsp\">Home</a></li>\n");
out.write(" <li><span>Dashboard</span></li>\n");
out.write(" </ul>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <div class=\"col-sm-6 clearfix\">\n");
out.write(" <div class=\"user-profile pull-right\">\n");
out.write(" <img class=\"avatar user-thumb\" src=\"assets/images/author/avatar.png\" alt=\"avatar\">\n");
out.write(" <h4 class=\"user-name dropdown-toggle\" data-toggle=\"dropdown\">Krina Shah <i class=\"fa fa-angle-down\"></i></h4>\n");
out.write(" <div class=\"dropdown-menu\">\n");
out.write(" <a class=\"dropdown-item\" href=\"adminLogin.jsp\">Log Out</a>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <!-- page title area end -->\n");
out.write(" <div class=\"main-content-inner\">\n");
out.write(" <div class=\"row\">\n");
out.write(" <!-- table primary start -->\n");
out.write(" <div class=\"col-lg-12 mt-5\">\n");
out.write(" <div class=\"card\">\n");
out.write(" <div class=\"card-body\">\n");
out.write(" <center><h3 class=\"header-title\">ADOPTION REQUESTS</h3></center>\n");
out.write(" <div class=\"single-table\">\n");
out.write(" <div class=\"table-responsive\">\n");
out.write(" <table class=\"table text-center\">\n");
out.write(" <thead class=\"text-uppercase bg-primary\">\n");
out.write(" <tr class=\"text-white\">\n");
out.write(" <!--<th scope=\"col\"> Request ID<th>-->\n");
out.write(" <th scope=\"col\">Dog<br/>Name</th>\n");
out.write(" <th scope=\"col\">Adopter's<br/>Name</th>\n");
out.write(" <th scope=\"col\">Adoption<br/>Status</th>\n");
out.write(" <th scope=\"col\">Adoption<br/>Amount</th>\n");
out.write(" <th scope=\"col\">Request<br/>Status</th>\n");
out.write(" <th scope=\"col\">Actions</th>\n");
out.write(" </tr>\n");
out.write(" </thead>\n");
out.write(" <tbody>\n");
out.write(" ");
DogDAO dogDAO=new DogDAO();
List<AdoptionRequest> listAdoptionRequests = dogDAO.viewAllAdoptionRequests();
request.setAttribute("listAdoptionRequests", listAdoptionRequests);
out.write("\n");
out.write(" ");
if (_jspx_meth_c_forEach_0(_jspx_page_context))
return;
out.write("\n");
out.write(" </tbody>\n");
out.write(" </table>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <!-- table primary end -->\n");
out.write(" \n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" </div>\n");
out.write(" <!-- main content area end -->\n");
out.write(" <!-- footer area start-->\n");
out.write(" <footer>\n");
out.write(" <div class=\"footer-area\">\n");
out.write(" <p>© Copyright 2020. All right reserved to Group 07.</p>\n");
out.write(" </div>\n");
out.write(" </footer>\n");
out.write(" <!-- footer area end-->\n");
out.write(" </div>\n");
out.write(" <!-- page container area end -->\n");
out.write(" \n");
out.write(" <!-- jquery latest version -->\n");
out.write(" <script src=\"assets/js/vendor/jquery-2.2.4.min.js\"></script>\n");
out.write(" <!-- bootstrap 4 js -->\n");
out.write(" <script src=\"assets/js/popper.min.js\"></script>\n");
out.write(" <script src=\"assets/js/bootstrap.min.js\"></script>\n");
out.write(" <script src=\"assets/js/owl.carousel.min.js\"></script>\n");
out.write(" <script src=\"assets/js/metisMenu.min.js\"></script>\n");
out.write(" <script src=\"assets/js/jquery.slimscroll.min.js\"></script>\n");
out.write(" <script src=\"assets/js/jquery.slicknav.min.js\"></script>\n");
out.write("\n");
out.write(" <!-- others plugins -->\n");
out.write(" <script src=\"assets/js/plugins.js\"></script>\n");
out.write(" <script src=\"assets/js/scripts.js\"></script>\n");
out.write("</body>\n");
out.write("\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_forEach_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_forEach_0.setPageContext(_jspx_page_context);
_jspx_th_c_forEach_0.setParent(null);
_jspx_th_c_forEach_0.setVar("adoptionRequests");
_jspx_th_c_forEach_0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${listAdoptionRequests}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int[] _jspx_push_body_count_c_forEach_0 = new int[] { 0 };
try {
int _jspx_eval_c_forEach_0 = _jspx_th_c_forEach_0.doStartTag();
if (_jspx_eval_c_forEach_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" <tr>\n");
out.write(" \n");
out.write("\t\t\t\t\t\t\t<td>");
if (_jspx_meth_c_out_0((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write("\t\t\t\t\t\t\t<td>");
if (_jspx_meth_c_out_1((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_2((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_3((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>");
if (_jspx_meth_c_out_4((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("</td>\n");
out.write(" <td>\n");
out.write(" ");
if (_jspx_meth_c_if_0((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("\n");
out.write(" ");
out.write("\n");
out.write(" </td>\n");
out.write(" </tr>\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_c_forEach_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_forEach_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_forEach_0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_forEach_0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_forEach_0.doFinally();
_jspx_tagPool_c_forEach_var_items.reuse(_jspx_th_c_forEach_0);
}
return false;
}
private boolean _jspx_meth_c_out_0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_0 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_0.setPageContext(_jspx_page_context);
_jspx_th_c_out_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.dogName}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_0 = _jspx_th_c_out_0.doStartTag();
if (_jspx_th_c_out_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_0);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_0);
return false;
}
private boolean _jspx_meth_c_out_1(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_1 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_1.setPageContext(_jspx_page_context);
_jspx_th_c_out_1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.firstName}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_1 = _jspx_th_c_out_1.doStartTag();
if (_jspx_th_c_out_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_1);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_1);
return false;
}
private boolean _jspx_meth_c_out_2(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_2 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_2.setPageContext(_jspx_page_context);
_jspx_th_c_out_2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_2.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.adoptionStatus}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_2 = _jspx_th_c_out_2.doStartTag();
if (_jspx_th_c_out_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_2);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_2);
return false;
}
private boolean _jspx_meth_c_out_3(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_3 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_3.setPageContext(_jspx_page_context);
_jspx_th_c_out_3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_3.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.price}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_3 = _jspx_th_c_out_3.doStartTag();
if (_jspx_th_c_out_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_3);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_3);
return false;
}
private boolean _jspx_meth_c_out_4(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_4 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_4.setPageContext(_jspx_page_context);
_jspx_th_c_out_4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_out_4.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.status}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_4 = _jspx_th_c_out_4.doStartTag();
if (_jspx_th_c_out_4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_4);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_4);
return false;
}
private boolean _jspx_meth_c_if_0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_forEach_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:if
org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_if_0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _jspx_tagPool_c_if_test.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class);
_jspx_th_c_if_0.setPageContext(_jspx_page_context);
_jspx_th_c_if_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_forEach_0);
_jspx_th_c_if_0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.status =='pending'}", java.lang.Boolean.class, (PageContext)_jspx_page_context, null)).booleanValue());
int _jspx_eval_c_if_0 = _jspx_th_c_if_0.doStartTag();
if (_jspx_eval_c_if_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\n");
out.write(" <a href=\"AdoptionRequestApprove?requestID=");
if (_jspx_meth_c_out_5((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_if_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("&action=accept\" style=\" width:60px; background-color:#4CAF50; height:20px; border:none; border-radius:6px; font-size:10px; font-weight:bold;\">Accept</a>\n");
out.write(" <br/>\n");
out.write(" <a href=\"AdoptionRequestReject?requestID=");
if (_jspx_meth_c_out_6((javax.servlet.jsp.tagext.JspTag) _jspx_th_c_if_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
return true;
out.write("&action=reject\" onclick=\"return confirm('Are you sure you want to reject this adoption request?')\" style=\"width:60px; background-color:#f44336; height:20px; border:none; border-radius:6px; font-size:10px; font-weight:bold;\">Reject</a>\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_c_if_0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_if_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_0);
return true;
}
_jspx_tagPool_c_if_test.reuse(_jspx_th_c_if_0);
return false;
}
private boolean _jspx_meth_c_out_5(javax.servlet.jsp.tagext.JspTag _jspx_th_c_if_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_5 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_5.setPageContext(_jspx_page_context);
_jspx_th_c_out_5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_if_0);
_jspx_th_c_out_5.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.requestID}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_5 = _jspx_th_c_out_5.doStartTag();
if (_jspx_th_c_out_5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_5);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_5);
return false;
}
private boolean _jspx_meth_c_out_6(javax.servlet.jsp.tagext.JspTag _jspx_th_c_if_0, PageContext _jspx_page_context, int[] _jspx_push_body_count_c_forEach_0)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:out
org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_6 = (org.apache.taglibs.standard.tag.rt.core.OutTag) _jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.OutTag.class);
_jspx_th_c_out_6.setPageContext(_jspx_page_context);
_jspx_th_c_out_6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_c_if_0);
_jspx_th_c_out_6.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.evaluateExpression("${adoptionRequests.requestID}", java.lang.Object.class, (PageContext)_jspx_page_context, null));
int _jspx_eval_c_out_6 = _jspx_th_c_out_6.doStartTag();
if (_jspx_th_c_out_6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_6);
return true;
}
_jspx_tagPool_c_out_value_nobody.reuse(_jspx_th_c_out_6);
return false;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
79f7e7a6282dab3fc4afc136f4c85b13a2bae23d | 12a30df0ee25804fbbab187e07536ef2a9385781 | /src/test/java/tests/MyListsTests.java | a3d3280211535cc2c9e5c14dd5e68227113c5d98 | [
"MIT"
] | permissive | MaximLyamin/JavaAppium | b058a20d0d2f95177da6869c1e5c89284fdca7c4 | 0a935868ec9db2e1f80b23316a8893fe40b71414 | refs/heads/main | 2023-02-25T23:47:08.393106 | 2021-01-30T20:38:37 | 2021-01-30T20:38:37 | 332,878,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,857 | java | package tests;
import io.qameta.allure.*;
import io.qameta.allure.junit4.DisplayName;
import lib.CoreTestCase;
import lib.Platform;
import lib.ui.*;
import lib.ui.factories.ArticlePageObjectFactory;
import lib.ui.factories.MyListsPageObjectFactory;
import lib.ui.factories.NavigationUIFactory;
import lib.ui.factories.SearchPageObjectFactory;
import org.junit.Assert;
import org.junit.Test;
@Epic("Tests for My Lists")
public class MyListsTests extends CoreTestCase {
private final static String search_line = "Java";
private final static String name_of_folder = "Learning programming";
private final static String first_article_title = "Java (programming language)";
private final static String substring_first_article = "bject-oriented programming language";
private final static String second_article_title = "JavaScript";
private final static String substring_second_article = "High-level programming language";
private final static String
login = "Matrosoff_spb",
password = "QazWsx123";
@Test
@Features(value = {@Feature(value = "Search"), @Feature(value = "Article"), @Feature(value = "My Lists")})
@DisplayName("Save article to My List")
@Description("We open an article and save it to My List")
@Step("Starting test testSaveFirstArticleToMyList")
@Severity(value = SeverityLevel.CRITICAL)
public void testSaveFirstArticleToMyList() throws Exception {
SearchPageObject SearchPageObject = SearchPageObjectFactory.get(driver);;
ArticlePageObject ArticlePageObject = ArticlePageObjectFactory.get(driver);
NavigationUI NavigationUI = NavigationUIFactory.get(driver);
MyListsPageObject MyListsPageObject = MyListsPageObjectFactory.get(driver);
SearchPageObject.initSearchInput();
SearchPageObject.typeSearchLine(search_line);
SearchPageObject.clickByArticleWithSubstring(substring_first_article);
ArticlePageObject.assertCompareArticles(first_article_title);
if (Platform.getInstance().isAndroid()) {
ArticlePageObject.addArticleToMyListFirstTime(name_of_folder);
} else {
ArticlePageObject.addArticlesToMySaved();
}
if (Platform.getInstance().isMW()) {
AuthorizationPageObject Auth = new AuthorizationPageObject(driver);
Auth.clickAuthButton();
Auth.enterLoginData(login, password);
Auth.submitForm();
ArticlePageObject.waitForTitleElement();
Assert.assertEquals(
"We are not on the same page after login",
first_article_title,
ArticlePageObject.getArticleTitle());
ArticlePageObject.addArticlesToMySaved();
}
ArticlePageObject.closeArticle();
if (Platform.getInstance().isIOS()){
SearchPageObject.clickCancelSearch();
}
NavigationUI.openNavigation();
NavigationUI.clickMyList();
if (Platform.getInstance().isAndroid()) {
MyListsPageObject.openFolderByName(name_of_folder);
} else if (Platform.getInstance().isIOS()) {
MyListsPageObject.clickOnCloseButtonOnPopupWindow();
}
MyListsPageObject.swipeByArticleToDelete(first_article_title);
}
@Test
@Features(value = {@Feature(value = "Search"), @Feature(value = "Article"), @Feature(value = "My Lists")})
@DisplayName("Save 2 articles to My List than 1 delete")
@Description("We open first article and save it to My List, we open second article and save it to My List than open My List and delete First article")
@Step("Starting test testSaveTwoArticlesToMyListThanOneDelete")
@Severity(value = SeverityLevel.NORMAL)
public void testSaveTwoArticlesToMyListThanOneDelete() throws Exception {
SearchPageObject SearchPageObject = SearchPageObjectFactory.get(driver);;
ArticlePageObject ArticlePageObject = ArticlePageObjectFactory.get(driver);
NavigationUI NavigationUI = NavigationUIFactory.get(driver);
MyListsPageObject MyListsPageObject = MyListsPageObjectFactory.get(driver);
SearchPageObject.initSearchInput();
SearchPageObject.typeSearchLine(search_line);
SearchPageObject.clickByArticleWithSubstring(substring_first_article);
ArticlePageObject.assertCompareArticles(first_article_title);
if (Platform.getInstance().isAndroid()) {
ArticlePageObject.addArticleToMyListFirstTime(name_of_folder);
} else {
ArticlePageObject.addArticlesToMySaved();
}
if (Platform.getInstance().isMW()) {
AuthorizationPageObject Auth = new AuthorizationPageObject(driver);
Auth.clickAuthButton();
Auth.enterLoginData(login, password);
Auth.submitForm();
ArticlePageObject.waitForTitleElement();
Assert.assertEquals(
"We are not on the same page after login",
first_article_title,
ArticlePageObject.getArticleTitle());
ArticlePageObject.addArticlesToMySaved();
}
ArticlePageObject.closeArticle();
if (Platform.getInstance().isIOS()){
SearchPageObject.clickCancelSearch();
}
SearchPageObject.initSearchInput();
SearchPageObject.typeSearchLine(search_line);
SearchPageObject.clickByArticleWithSubstring(substring_second_article);
ArticlePageObject.assertCompareArticles(second_article_title);
if (Platform.getInstance().isAndroid()) {
ArticlePageObject.addArticleToMyListFirstTime(name_of_folder);
} else {
ArticlePageObject.addArticlesToMySaved();
}
ArticlePageObject.closeArticle();
if (Platform.getInstance().isIOS()){
SearchPageObject.clickCancelSearch();
}
NavigationUI.openNavigation();
NavigationUI.clickMyList();
if (Platform.getInstance().isAndroid()) {
MyListsPageObject.openFolderByName(name_of_folder);
} else if (Platform.getInstance().isIOS()) {
MyListsPageObject.clickOnCloseButtonOnPopupWindow();
}
MyListsPageObject.swipeByArticleToDelete(first_article_title);
MyListsPageObject.waitForArticleToAppearByTitle(second_article_title);
String title_in_list = MyListsPageObject.getArticleByTitleXpathInSavedList(second_article_title);
MyListsPageObject.openArticleByTitleInSavedList(second_article_title);
String title_in_open_article = MyListsPageObject.getArticleByTitleXpathInSavedList(second_article_title);
Assert.assertEquals(
"Article have been changed after opening",
title_in_open_article,
title_in_list);
}
}
| [
"maxim.lyamin@kaspersky.com"
] | maxim.lyamin@kaspersky.com |
24522b44eaa7f6ab9d22159ae7cb5f4a0da2dcbf | 361b7668b1fc66b0e8de97ca0acf57da80b60ecf | /src/main/java/com/digitalinnovation/heroesapi/document/Heroes.java | 2e86448b83ae6626b9549fbf5770916ad1a8427b | [] | no_license | wanderleimagri/dio-heroes | 396df72e16b94ecffc96b127c8a36367557df7c6 | f2297ff2be3c2bd941b6f6ebdc248a1bf2062bee | refs/heads/main | 2023-03-14T21:11:18.801586 | 2021-03-06T21:44:57 | 2021-03-06T21:44:57 | 345,151,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,000 | java | package com.digitalinnovation.heroesapi.document;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import nonapi.io.github.classgraph.json.Id;
@Data
@NoArgsConstructor
@Getter
@Setter
@DynamoDBTable(tableName = "heroes_table")
public class Heroes {
@Id
@DynamoDBHashKey(attributeName = "id")
private String id;
@DynamoDBAttribute(attributeName = "name")
private String name;
@DynamoDBAttribute(attributeName = "universe")
private String universe;
@DynamoDBAttribute(attributeName = "films")
private int films;
public Heroes(String id, String name, String universe, int films) {
this.id = id;
this.name = name;
this.universe = universe;
this.films = films;
}
}
| [
"wanderleimagri@gmail.com"
] | wanderleimagri@gmail.com |
348360abf566eb6bef8cb580c8e23299366dbc28 | b79927a525b75ba7adb602d2e5656aaf0326b480 | /src/test/java/exercises/se/pages/Popup/FormPopup.java | c2e4b62cef19ee97b7e437fff1a5a1f4b8a176d0 | [] | no_license | alionasolo/seleniumhomework4 | 05e4ab3223b1b2811f0e5bc1046330c9a37e75b9 | 56d69465598b1045bb1ac52229cbd8ff5d211155 | refs/heads/main | 2023-08-19T04:42:18.333846 | 2021-10-03T21:30:21 | 2021-10-03T21:30:21 | 400,766,133 | 0 | 0 | null | 2021-10-03T21:30:21 | 2021-08-28T10:36:49 | Java | UTF-8 | Java | false | false | 1,097 | java | package exercises.se.pages.Popup;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class FormPopup {
private WebDriver driver;
@FindBy(xpath = "//h2[@id='Form']")
WebElement form;
@FindBy(xpath = "//a[contains(@href, '#popupLogin')]")
WebElement signIn;
@FindBy(xpath = "//input[@id='un']")
WebElement username;
@FindBy(xpath = "//input[@id='pw']")
WebElement password;
@FindBy(xpath = "//button[contains(text(), 'Sign in')]")
WebElement submitButton;
public FormPopup(WebDriver driver2){
this.driver = driver2;
PageFactory.initElements(driver2,FormPopup.this);
}
public WebElement getPopupTitle(){
return form;
}
public void accessSigninLink(){
signIn.click();
}
public void fillInTheForm(String name,String pw){
username.sendKeys(name);
password.sendKeys(pw);
}
public void clickOnSubmitbutton(){
submitButton.click();
}
}
| [
"ali.solonari@mail.ru"
] | ali.solonari@mail.ru |
951856925c4bb1f012fd9158419ee8a1c740e778 | 59c84e635a48a502fddbe7522984d20cdd3e61f4 | /prophet-palm-web/src/main/java/com/liam/rmi/mineRMI/Server.java | 9e558568a6ed10a72533b97fd87b7db031760a76 | [] | no_license | propheteee/prophet-palm-tree | b3c46b294a95091d59a05ae181d5ce8189a78d86 | 1dfc61de4e8159e4c2eae3f7d84a00bab46bc8e7 | refs/heads/master | 2022-11-19T05:23:02.359115 | 2022-11-03T08:14:41 | 2022-11-03T08:14:41 | 197,107,642 | 1 | 0 | null | 2022-07-01T21:29:16 | 2019-07-16T02:41:41 | Java | UTF-8 | Java | false | false | 317 | java | package com.liam.rmi.mineRMI;
/**
* Description:
* Created by prophet on 2019/7/30 18:22
*/
public class Server {
public static void main(String[] args) {
QueryOrderNosSkeleton queryOrderNosSkeleton = new QueryOrderNosSkeleton(new QueryOrderNosImpl());
queryOrderNosSkeleton.start();
}
}
| [
"xianzhi.zhang@weimob.com"
] | xianzhi.zhang@weimob.com |
79616b360cecc727bb9d18f0e3ea514fee64cd02 | d476bcc063f663d06ea29e52ffe4f8c5ac0762f4 | /mavcom/src/main/java/org/mavlink/messages/MAV_SENSOR_ORIENTATION.java | d1d0c0a3999a8132874cb954593257cc2c93a7b5 | [] | no_license | Stevesies/mavcom | 1d80dd623cd1f543ef4f8dc46a8fb0c6f84783cf | b0cd1b921016658dafae2b4936b898c665784421 | refs/heads/master | 2023-01-23T05:57:10.648842 | 2020-11-30T08:53:20 | 2020-11-30T08:53:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,355 | java | /**
* Generated class : MAV_SENSOR_ORIENTATION
* DO NOT MODIFY!
**/
package org.mavlink.messages;
/**
* Interface MAV_SENSOR_ORIENTATION
* Enumeration of sensor orientation, according to its rotations
**/
public interface MAV_SENSOR_ORIENTATION {
/**
* Roll: 0, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_NONE = 0;
/**
* Roll: 0, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_YAW_45 = 1;
/**
* Roll: 0, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_YAW_90 = 2;
/**
* Roll: 0, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_YAW_135 = 3;
/**
* Roll: 0, Pitch: 0, Yaw: 180
*/
public final static int MAV_SENSOR_ROTATION_YAW_180 = 4;
/**
* Roll: 0, Pitch: 0, Yaw: 225
*/
public final static int MAV_SENSOR_ROTATION_YAW_225 = 5;
/**
* Roll: 0, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_YAW_270 = 6;
/**
* Roll: 0, Pitch: 0, Yaw: 315
*/
public final static int MAV_SENSOR_ROTATION_YAW_315 = 7;
/**
* Roll: 180, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180 = 8;
/**
* Roll: 180, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9;
/**
* Roll: 180, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10;
/**
* Roll: 180, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11;
/**
* Roll: 0, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180 = 12;
/**
* Roll: 180, Pitch: 0, Yaw: 225
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13;
/**
* Roll: 180, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14;
/**
* Roll: 180, Pitch: 0, Yaw: 315
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15;
/**
* Roll: 90, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90 = 16;
/**
* Roll: 90, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17;
/**
* Roll: 90, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18;
/**
* Roll: 90, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19;
/**
* Roll: 270, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270 = 20;
/**
* Roll: 270, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21;
/**
* Roll: 270, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22;
/**
* Roll: 270, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23;
/**
* Roll: 0, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_90 = 24;
/**
* Roll: 0, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_270 = 25;
/**
* Roll: 0, Pitch: 180, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26;
/**
* Roll: 0, Pitch: 180, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27;
/**
* Roll: 90, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28;
/**
* Roll: 180, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29;
/**
* Roll: 270, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30;
/**
* Roll: 90, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31;
/**
* Roll: 270, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32;
/**
* Roll: 90, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33;
/**
* Roll: 180, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34;
/**
* Roll: 270, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35;
/**
* Roll: 90, Pitch: 180, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36;
/**
* Roll: 90, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37;
/**
* Roll: 90, Pitch: 68, Yaw: 293
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38;
/**
* Pitch: 315
*/
public final static int MAV_SENSOR_ROTATION_PITCH_315 = 39;
/**
* Roll: 90, Pitch: 315
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40;
/**
* Roll: 270, Yaw: 180
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_180 = 41;
/**
* Custom orientation
*/
public final static int MAV_SENSOR_ROTATION_CUSTOM = 100;
}
| [
"ecm@gmx.de"
] | ecm@gmx.de |
d84116d2ebb5a3259e2bc4cf3150487b3c7fc810 | 24d8cf871b092b2d60fc85d5320e1bc761a7cbe2 | /PMD/rev5929-6010/base-branch-5929/src/net/sourceforge/pmd/rules/ExcessiveImports.java | 37341c70f7229e370bb09925cf4ade0920655511 | [] | no_license | joliebig/featurehouse_fstmerge_examples | af1b963537839d13e834f829cf51f8ad5e6ffe76 | 1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad | refs/heads/master | 2016-09-05T10:24:50.974902 | 2013-03-28T16:28:47 | 2013-03-28T16:28:47 | 9,080,611 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 517 | java |
package net.sourceforge.pmd.rules;
import net.sourceforge.pmd.ast.ASTCompilationUnit;
import net.sourceforge.pmd.ast.ASTImportDeclaration;
import net.sourceforge.pmd.rules.design.ExcessiveNodeCountRule;
import net.sourceforge.pmd.util.NumericConstants;
public class ExcessiveImports extends ExcessiveNodeCountRule {
public ExcessiveImports() {
super(ASTCompilationUnit.class);
}
public Object visit(ASTImportDeclaration node, Object data) {
return NumericConstants.ONE;
}
}
| [
"joliebig@fim.uni-passau.de"
] | joliebig@fim.uni-passau.de |
7e0579926dc87307e566a96bfe4c8358fec53dbf | 935d938ff7af87884bdc99f78fb6d533c4db3958 | /src/main/java/com/redis/example/demo/file/MappedFileTest.java | 67d8db960f75de7ecfa20945e01d29656d677620 | [] | no_license | 1303110335/java-all | 52b34099e53ec1d65a976c70105494ff07a42e09 | d70ee5a362f2abdbfa06d3079022c95134d8d7ad | refs/heads/master | 2023-07-16T12:38:57.608790 | 2021-08-25T02:12:09 | 2021-08-25T02:12:09 | 298,726,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | /**
* bianque.com
* Copyright (C) 2013-2020 All Rights Reserved.
*/
package com.redis.example.demo.file;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Scanner;
/**
*
* @author xuleyan
* @version MappedFileTest.java, v 0.1 2020-11-22 9:05 下午
*/
public class MappedFileTest {
public static void main(String[] args) {
File file = new File("target/threads/test.txt");
long len = file.length();
byte[] ds = new byte[(int) len];
try {
MappedByteBuffer mappedByteBuffer = new RandomAccessFile(file, "r")
.getChannel()
.map(FileChannel.MapMode.READ_ONLY, 0, len);
for (int offset = 0; offset < len; offset++) {
byte b = mappedByteBuffer.get();
ds[offset] = b;
}
Scanner scan = new Scanner(new ByteArrayInputStream(ds)).useDelimiter(" ");
while (scan.hasNext()) {
System.out.print(scan.next() + " ");
}
} catch (IOException e) {}
}
} | [
"1303110335@qq.com"
] | 1303110335@qq.com |
14a9d04a131365bbf54cc7824de33d2968b3aa75 | e51c210ccf72a8ac1414791d8af552662c3fb034 | /passerelle-core/com.isencia.passerelle.runtime.jmx/src/main/java/com/isencia/passerelle/runtime/jmx/ProcessHandleBean.java | 39b9e578e38869d064ffeccf4eb2d304f0370264 | [] | no_license | eclipselabs/passerelle | 0187efa4fba411265ab58d60b5d83e74af09b203 | e327dea8f4188e4bfe5ef4a76dd2476ad6f5664d | refs/heads/master | 2021-01-18T09:26:07.614275 | 2017-06-28T10:05:12 | 2017-06-28T10:05:12 | 36,805,342 | 5 | 3 | null | 2015-08-04T18:43:19 | 2015-06-03T13:27:15 | Java | UTF-8 | Java | false | false | 2,119 | java | /* Copyright 2013 - iSencia Belgium NV
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.isencia.passerelle.runtime.jmx;
import java.beans.ConstructorProperties;
import java.util.Arrays;
import com.isencia.passerelle.runtime.ProcessHandle;
public class ProcessHandleBean {
private String processContextId;
private String status;
private FlowHandleBean flow;
private String[] suspendedElements;
public final static ProcessHandleBean buildProcessHandleBean(ProcessHandle processHandle) {
return new ProcessHandleBean(processHandle.getProcessId(),
processHandle.getExecutionStatus().name(),
FlowHandleBean.buildCompactFlowHandleBean(processHandle.getFlowHandle()),
processHandle.getSuspendedElements());
}
@ConstructorProperties({"processContextId","status","flow","suspendedElements"})
public ProcessHandleBean(String processContextId, String status, FlowHandleBean flow, String[] suspendedElements) {
this.processContextId = processContextId;
this.status = status;
this.flow = flow;
this.suspendedElements = suspendedElements;
}
public String getProcessContextId() {
return processContextId;
}
public String getStatus() {
return status;
}
public FlowHandleBean getFlow() {
return flow;
}
public String[] getSuspendedElements() {
return suspendedElements;
}
@Override
public String toString() {
return "ProcessHandleBean [processContextId=" + processContextId + ", status=" + status + ", flow=" + flow + ", suspendedElements="
+ Arrays.toString(suspendedElements) + "]";
}
}
| [
"erwindl0@gmail.com"
] | erwindl0@gmail.com |
c596dc206d87b6da296239ef159a579a44a11d3f | 38ba2d79615bfc624ea3cf5d0edb059885d915f9 | /src/test/java/com/android/tools/r8/shaking/keptgraph/KeptByAnnotatedMethodTest.java | baeacd203b00898edc8e8816fdfe81ddbe99536c | [
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | facebookexperimental/r8 | 13182fee86ca6cd61a8fc606f507674732710771 | 5fd5989c478e7f2a052656aec2ef909d74646a27 | refs/heads/buck | 2023-03-04T10:40:02.130773 | 2019-08-30T20:28:19 | 2020-07-21T13:29:50 | 191,259,201 | 5 | 3 | NOASSERTION | 2020-06-08T16:27:05 | 2019-06-10T23:24:32 | Java | UTF-8 | Java | false | false | 1,000 | java | // Copyright (c) 2019, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.shaking.keptgraph;
import com.android.tools.r8.Keep;
import com.android.tools.r8.NeverInline;
public class KeptByAnnotatedMethodTest {
static class Inner {
@Keep
void foo() {
bar();
}
@NeverInline
static void bar() {
System.out.println("called bar");
}
@NeverInline
static void baz() {
System.out.println("called baz");
}
}
public static void main(String[] args) throws Exception {
// Make inner class undecidable to avoid generating reflective rules.
Class<?> clazz = getInner(args.length);
Object instance = clazz.newInstance();
clazz.getDeclaredMethod("foo").invoke(instance);
}
private static Class<?> getInner(int i) {
return i == 0 ? Inner.class : null;
}
}
| [
"zerny@google.com"
] | zerny@google.com |
3a021b0298864e558982b0a6543f71d89ffc9dd1 | b5c0ac295c7f52b420340e629d77a5dbcf28c487 | /src/main/java/br/com/tbla/githubscrapingapi/model/GithubRepoInfo.java | bc84005770d4c447cba5c17ba17e32ed3f3b21a1 | [] | no_license | thiagodiou/github-scraping-api | 0e4c9071d315503fc2203870951ab0e1a7fc6760 | de25d8acb8243d65d69f2f47c48bf7c8decb6e93 | refs/heads/master | 2023-04-24T14:26:09.677516 | 2021-05-17T04:16:43 | 2021-05-17T04:16:43 | 368,008,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package br.com.tbla.githubscrapingapi.model;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="GITHUB_REPOSITORY")
public class GithubRepoInfo {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String url;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "repositorio")
private List<FileInformation> files;
public GithubRepoInfo (String url) {
this.url = url;
}
}
| [
"thiagodiou@gmail.com"
] | thiagodiou@gmail.com |
edc0bc86ca52defeb4aa401949b72c21a15d4baa | 9b91a1e3776a15281c394a883000bb53fbf5bd76 | /jboss-seam/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java | 3a183513459a6b8101b90d30dc0759f388cb5c50 | [] | no_license | omidp/seam | 9ed0b00777996e218b9659e68b755f35a21486f5 | a64368e756e5d5c61c732bb0caf7b1ff75601544 | refs/heads/master | 2020-12-24T07:05:59.283627 | 2017-08-24T10:01:05 | 2017-08-24T10:01:05 | 24,535,342 | 9 | 2 | null | null | null | null | UTF-8 | Java | false | false | 13,727 | java | package org.jboss.seam.persistence;
import static org.jboss.seam.annotations.Install.FRAMEWORK;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.transaction.Synchronization;
import org.hibernate.EntityMode;
import org.hibernate.FlushMode;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.hibernate.StaleStateException;
import org.hibernate.TransientObjectException;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.type.VersionType;
import org.jboss.seam.Component;
import org.jboss.seam.Entity;
import org.jboss.seam.Entity.NotEntityException;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.FlushModeType;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.core.Expressions.ValueExpression;
import org.jboss.seam.log.Log;
import org.jboss.seam.log.Logging;
/**
* Support for non-standardized features of Hibernate, when
* used as the JPA persistence provider.
*
* @author Gavin King
* @author Pete Muir
*
*/
@Name("org.jboss.seam.persistence.persistenceProvider")
@Scope(ScopeType.STATELESS)
@BypassInterceptors
@Install(precedence=FRAMEWORK, classDependencies={"org.hibernate.Session", "javax.persistence.EntityManager"})
public class HibernatePersistenceProvider extends PersistenceProvider
{
private static Log log = Logging.getLog(HibernatePersistenceProvider.class);
private static Class FULL_TEXT_SESSION_PROXY_CLASS;
private static Method FULL_TEXT_SESSION_CONSTRUCTOR;
private static Class FULL_TEXT_ENTITYMANAGER_PROXY_CLASS;
private static Method FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR;
static
{
boolean hibernateSearchPresent = false;
try
{
Class.forName("org.hibernate.search.Version");
hibernateSearchPresent = true;
}
catch (Exception e)
{
log.debug("Hibernate Search not present", e);
}
if (hibernateSearchPresent)
{
try
{
Class searchClass = Class.forName("org.hibernate.search.Search");
try
{
FULL_TEXT_SESSION_CONSTRUCTOR = searchClass.getDeclaredMethod("getFullTextSession", Session.class);
}
catch (NoSuchMethodException noSuchMethod)
{
log.debug("org.hibernate.search.Search.getFullTextSession(Session) not found, trying deprecated method name createFullTextSession");
FULL_TEXT_SESSION_CONSTRUCTOR = searchClass.getDeclaredMethod("createFullTextSession", Session.class);
}
FULL_TEXT_SESSION_PROXY_CLASS = Class.forName("org.jboss.seam.persistence.FullTextHibernateSessionProxy");
Class jpaSearchClass = Class.forName("org.hibernate.search.jpa.Search");
try
{
FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR = jpaSearchClass.getDeclaredMethod("getFullTextEntityManager", EntityManager.class);
}
catch (NoSuchMethodException noSuchMethod)
{
log.debug("org.hibernate.search.jpa.getFullTextSession(EntityManager) not found, trying deprecated method name createFullTextEntityManager");
FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR = jpaSearchClass.getDeclaredMethod("createFullTextEntityManager", EntityManager.class);
}
FULL_TEXT_ENTITYMANAGER_PROXY_CLASS = Class.forName("org.jboss.seam.persistence.FullTextEntityManagerProxy");
log.debug("Hibernate Search is available :-)");
}
catch (Exception e)
{
log.debug("Unable to load Hibernate Search for ORM", e);
}
}
}
public HibernatePersistenceProvider()
{
super.init();
featureSet.add(Feature.WILDCARD_AS_COUNT_QUERY_SUBJECT);
}
/**
* Wrap the Hibernate Session in a proxy that supports HQL
* EL interpolation and implements FullTextSession if Hibernate
* Search is available in the classpath.
*/
static Session proxySession(Session session)
{
if (FULL_TEXT_SESSION_PROXY_CLASS==null)
{
if ( session instanceof HibernateSessionProxy )
{
return session;
}
else
{
return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { HibernateSessionProxy.class },
new HibernateSessionInvocationHandler(session));//, (FullTextSession) session) );
}
}
else
{
try
{
if ( FULL_TEXT_SESSION_PROXY_CLASS.isAssignableFrom( session.getClass() ) )
{
return session;
}
else {
return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { FULL_TEXT_SESSION_PROXY_CLASS },
new HibernateSessionInvocationHandler( (Session) FULL_TEXT_SESSION_CONSTRUCTOR.invoke(null, session) ) );
}
}
catch(Exception e) {
log.warn("Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned", e);
if ( session instanceof HibernateSessionProxy )
{
return session;
}
else {
return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { HibernateSessionProxy.class },
new HibernateSessionInvocationHandler( session) );
}
}
}
}
/**
* Wrap the delegate Hibernate Session in a proxy that supports HQL
* EL interpolation and implements FullTextSession if Hibernate
* Search is available in the classpath.
*/
@Override
public Object proxyDelegate(Object delegate)
{
try
{
return proxySession( (Session) delegate );
}
catch (NotHibernateException nhe)
{
return super.proxyDelegate(delegate);
}
catch (Exception e)
{
throw new RuntimeException("could not proxy delegate", e);
}
}
@Override
public void setFlushModeManual(EntityManager entityManager)
{
try
{
getSession(entityManager).setFlushMode(FlushMode.MANUAL);
}
catch (NotHibernateException nhe)
{
super.setFlushModeManual(entityManager);
}
}
@Override
public void setRenderFlushMode()
{
PersistenceContexts.instance().changeFlushMode(FlushModeType.MANUAL, true);
}
@Override
public boolean isDirty(EntityManager entityManager)
{
try
{
return getSession(entityManager).isDirty();
}
catch (NotHibernateException nhe)
{
return super.isDirty(entityManager);
}
}
@Override
public Object getId(Object bean, EntityManager entityManager)
{
try
{
return getSession(entityManager).getIdentifier(bean);
}
catch (NotHibernateException nhe)
{
return super.getId(bean, entityManager);
}
catch (TransientObjectException e)
{
if (bean instanceof HibernateProxy)
{
return super.getId(((HibernateProxy) bean).getHibernateLazyInitializer().getImplementation(), entityManager);
}
else
{
return super.getId(bean, entityManager);
}
}
}
@Override
public Object getVersion(Object bean, EntityManager entityManager)
{
try
{
return getVersion( bean, getSession(entityManager) );
}
catch (NotHibernateException nhe)
{
return super.getVersion(bean, entityManager);
}
}
@Override
public void checkVersion(Object bean, EntityManager entityManager, Object oldVersion, Object version)
{
try
{
checkVersion(bean, getSession(entityManager), oldVersion, version);
}
catch (NotHibernateException nhe)
{
super.checkVersion(bean, entityManager, oldVersion, version);
}
}
@Override
public void enableFilter(Filter f, EntityManager entityManager)
{
try
{
org.hibernate.Filter filter = getSession(entityManager).enableFilter( f.getName() );
for ( Map.Entry<String, ValueExpression> me: f.getParameters().entrySet() )
{
Object filterValue = me.getValue().getValue();
if ( filterValue instanceof Collection )
{
filter.setParameterList(me.getKey(), (Collection) filterValue);
}
else
{
filter.setParameter(me.getKey(), filterValue);
}
}
filter.validate();
}
catch (NotHibernateException nhe)
{
super.enableFilter(f, entityManager);
}
}
@Override
public boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
{
try
{
//TODO: just make sure that a Hibernate JPA EntityTransaction
// delegates to the Hibernate Session transaction
getSession(entityManager).getTransaction().registerSynchronization(sync);
return true;
}
catch (NotHibernateException nhe)
{
return super.registerSynchronization(sync, entityManager);
}
}
@Override
public String getName(Object bean, EntityManager entityManager) throws IllegalArgumentException
{
try
{
return getSession(entityManager).getEntityName(bean);
}
catch (NotHibernateException nhe)
{
return super.getName(bean, entityManager);
}
catch (TransientObjectException e)
{
return super.getName(bean, entityManager);
}
}
@Override
public EntityManager proxyEntityManager(EntityManager entityManager)
{
if (FULL_TEXT_ENTITYMANAGER_PROXY_CLASS==null)
{
return super.proxyEntityManager(entityManager);
}
else
{
try
{
return (EntityManager) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { FULL_TEXT_ENTITYMANAGER_PROXY_CLASS },
new EntityManagerInvocationHandler(
(EntityManager) FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null,
super.proxyEntityManager(entityManager))));
}
catch (Exception e)
{
//throw new RuntimeException("could not proxy FullTextEntityManager", e);
return super.proxyEntityManager(entityManager);
}
}
}
public static void checkVersion(Object value, Session session, Object oldVersion, Object version)
{
ClassMetadata classMetadata = getClassMetadata(value, session);
VersionType versionType = (VersionType) classMetadata.getPropertyTypes()[ classMetadata.getVersionProperty() ];
if ( !versionType.isEqual(oldVersion, version) )
{
throw new StaleStateException("current database version number does not match passivated version number");
}
}
public static Object getVersion(Object value, Session session)
{
ClassMetadata classMetadata = getClassMetadata(value, session);
return classMetadata!=null && classMetadata.isVersioned() ?
classMetadata.getVersion(value, EntityMode.POJO) : null;
}
private static ClassMetadata getClassMetadata(Object value, Session session)
{
Class entityClass = getEntityClass(value);
ClassMetadata classMetadata = null;
if (entityClass!=null)
{
classMetadata = session.getSessionFactory().getClassMetadata(entityClass);
if (classMetadata==null)
{
throw new IllegalArgumentException(
"Could not find ClassMetadata object for entity class: " +
entityClass.getName()
);
}
}
return classMetadata;
}
/**
* Returns the class of the specified Hibernate entity
*/
@Override
public Class getBeanClass(Object bean)
{
return getEntityClass(bean);
}
public static Class getEntityClass(Object bean)
{
Class clazz = null;
try
{
clazz = Entity.forBean(bean).getBeanClass();
}
catch (NotEntityException e) {
// It's ok, try some other methods
}
if (clazz == null)
{
clazz = Hibernate.getClass(bean);
}
return clazz;
}
private Session getSession(EntityManager entityManager)
{
Object delegate = entityManager.getDelegate();
if ( delegate instanceof Session )
{
return (Session) delegate;
}
else
{
throw new NotHibernateException();
}
}
/**
* Occurs when Hibernate is in the classpath, but this particular
* EntityManager is not from Hibernate
*
* @author Gavin King
*
*/
static class NotHibernateException extends IllegalArgumentException {}
public static HibernatePersistenceProvider instance()
{
return (HibernatePersistenceProvider) Component.getInstance(HibernatePersistenceProvider.class, ScopeType.STATELESS);
}
}
| [
"omidpourhadi@gmail.com"
] | omidpourhadi@gmail.com |
e4fb2380552908e2b7cb3338b666bb4e2b879228 | 3413ba43672655874301050c0feca0fb45d723b4 | /src/dataflow/util/Writter.java | 78a9ec0709af85093e2acfc14e52f077d859a9ec | [] | no_license | takedatmh/CBIDAU_tsukuba | 44e13d35107e05f922d227bbd9401c3cea5bcb39 | b9ef8377fcd3fa10f29383c59676c81a4dc95966 | refs/heads/master | 2020-07-30T06:51:13.900841 | 2020-06-29T16:37:04 | 2020-06-29T16:37:04 | 210,117,863 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 816 | java | package dataflow.util;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import dataflow.util.Context;
/**
* Retrieve impact path from the target method to leaf method.
* @author s1930149
*/
public class Writter {
public static void main(String[] args) {
//Write the list of path.
FileWriter in = null;
PrintWriter out = null;
String filePath = null;
filePath = Context.TMP_Folder+ Context.SEPARATOR +"writter.txt";
try {
//postscript version
in = new FileWriter(filePath, true);
out = new PrintWriter(in);
out.println("testtesttesttest");
out.flush();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
//close
in.close();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
} | [
"takedatmh@gmail.com"
] | takedatmh@gmail.com |
40ac022b698ec26a862ead9f331493b44cc05d11 | 2efae10c3d60764ffc22549af9f19906589a22fd | /spring-boot-security/src/main/java/com/boot/security/entity/Permission.java | a5ebddccf5f03d2cf41f57a773a6379e23639895 | [] | no_license | looper-tao/spring-boot-project | 5617f3bc1a0b991ba1b57a69dd0dd190c308d6b7 | cb4fbfc38cb75af065c61e3b6a094ca3852ded12 | refs/heads/master | 2022-09-13T03:51:20.512053 | 2021-04-20T09:15:26 | 2021-04-20T09:15:26 | 171,794,411 | 1 | 0 | null | 2022-09-01T23:37:21 | 2019-02-21T03:35:49 | Java | UTF-8 | Java | false | false | 1,614 | java | package com.boot.security.entity;
import java.io.Serializable;
public class Permission implements Serializable {
private Long id;
private String url;
private String name;
private String description;
private Long pid;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getPid() {
return pid;
}
public void setPid(Long pid) {
this.pid = pid;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", url=").append(url);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", pid=").append(pid);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
} | [
"taozhengzhi@data88.cn"
] | taozhengzhi@data88.cn |
e1f8e3b3b754df766bebe34574d487badcd269aa | 27dc541bf8ce73fda1b6a40ef471ae59304c0262 | /CoreBanking/src/test/java/library/ExcelReadWrite_Methods.java | 421cc3e677d1e80e355ab59aee47974d77b1713d | [] | no_license | shesingh/SeleniumJavaFramework1 | 8dda3b6e73d0b748ba99c813fd9beac0f79689f8 | fa6befe9556dadfd2bd8674baa1ef17a17897468 | refs/heads/master | 2020-04-25T11:36:51.617567 | 2019-03-29T18:44:00 | 2019-03-29T18:44:00 | 172,750,574 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,578 | java | /*
* This class covers:
* 7 Excel functions:
* Setting Excel file
* Getting row & Column count
* getCellData
* setSellData
* readExcelData
* writeExcelData
*
*
* TO DO - setExcelFile is not working if file is not there.
* 1. Fix the scenario when fiel is not there.
* 2. Once point 1 is done, call writeExcelData function with some data ex. writeExcelData("My Text", 1,1)
*/
package library;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.testng.annotations.Test;
public class ExcelReadWrite_Methods {
private static Workbook workbook;
private static Sheet sheet;
private static FileInputStream fis;
private static FileOutputStream fos;
private static Row row;
private static Cell cell;
private static String excelpath;
private static String sheetName;
//This is constructor
public ExcelReadWrite_Methods(String excelFilepath, String excelSheetName) throws Exception {
excelpath = excelFilepath;
sheetName = excelSheetName;
setExcelFile(excelpath,sheetName);
}
public static void setExcelFile(String excelpath, String sheetName ) throws Exception {
try {
File f = new File(excelpath);
if (!f.exists()) {
f.createNewFile();
System.out.println("File not found so created");
}
fis = new FileInputStream(excelpath);
workbook = WorkbookFactory.create(fis);
sheet = workbook.getSheet(sheetName);
if (sheet == null) {
sheet = workbook.createSheet(sheetName);
System.out.println("Sheet not found so created");
}
} catch (Exception e) {System.out.println(e.getMessage());
}
}
public static void setCellData(String text, int rowno, int colno) {
try {
System.out.println("Calling using setCellData(\"MyData\", 1,3); ");
row = sheet.getRow(rowno);
if (row==null) {
System.out.println("Row NOT found so creating row...");
row = sheet.createRow(rowno);
}
cell = row.getCell(colno);
if(cell != null) {
System.out.println("Cell found so setting cell value ...");
cell.setCellValue(text);
}
else {
System.out.println("Cell NOT found so creating cell & setting cell value ...");
cell = row.createCell(colno);
System.out.println(text);
cell.setCellValue(text);
}
System.out.println("Writing back to file ...");
System.out.println(excelpath);
fos = new FileOutputStream(excelpath);
workbook.write(fos);
fos.flush();
fos.close();
} catch (Exception e) {System.out.println(e.getMessage());
}
}
@SuppressWarnings("deprecation")
public static String getCellData(int rowno, int colno) {
try {
cell = sheet.getRow(rowno).getCell(colno);
String cellData = null;
if (cell.getCellType() == cell.CELL_TYPE_STRING) {
//System.out.println("cell Type when cell is String : "+cell.getCellType());
cellData = cell.getStringCellValue();
}
if (cell.getCellType() == cell.CELL_TYPE_NUMERIC) {
//System.out.println("cell Type when cell is Numeric : "+cell.getCellType());
cellData = Double.toString(cell.getNumericCellValue());
if (cellData.contains(".0")) {
cellData =cellData.substring(0,cellData.length()-2);
}
//if (cell.getCellType() == cell.CELL_TYPE_BLANK) {
else {
//System.out.println("cell Type when cell is blank : "+cell.getCellType());
System.out.println("cell is bank");
cellData ="";
}
}
return cellData;
} catch (Exception e) {
System.out.println(e.getMessage());
return "";
}
}//getCellData Function
public static int getRowCount() {
//getPhysicalNumberOfRows() function will count rows starting heading row = 1 but getLastRowNum function will count rows starting heading row = 0
//return sheet.getPhysicalNumberOfRows();
System.out.println("Row Count is : "+sheet.getLastRowNum());
return sheet.getLastRowNum();
}
public int getColCount() {
System.out.println("Column Count is : "+sheet.getRow(0).getLastCellNum());
return sheet.getRow(1).getLastCellNum();
}
//public Object[][] readExcelData(String excelpath, String sheetName) throws Exception {
public Object[][] readExcelData() throws Exception {
int rowCount;
int colCount;
//String cellDataValue = "";
//setExcelFile(excelpath, sheetName);
rowCount = getRowCount();
colCount = getColCount();
//System.out.println("Row Count is : "+rowCount);
//System.out.println("Column Count is : "+colCount);
Object data[][] = new Object[rowCount][colCount];
for (int i=0; i< rowCount; i++){
for (int j=0; j<colCount; j++) {
data[i][j] = getCellData(i+1,j);
System.out.print(data[i][j]+" ! ");
//System.out.print("data ["+i+"]["+j+"] "+ data[i][j]+ " ");
} //for j closed
System.out.println("\n");
} //for i closed
return data;
} //mainTest
public void writeExcelData(String text, int rowNo, int colNo) throws Exception {
//setExcelFile(excelpath, sheetName);
setCellData(text,rowNo,colNo );
}
}// ExcelWRclass
| [
"shefali.singh@CA-L1B8YL72.groupinfra.com"
] | shefali.singh@CA-L1B8YL72.groupinfra.com |
bc4071d161c2f3543c94e923ab7b2e428c99e009 | 84d394286925c2e0e9cf97fcb9e2630ffdee7f0d | /src/main/java/hb04onetomanyuni/demo/DeleteCoursesDemo.java | 1afdf304fab6518a51aa180635d81534e3fdd188 | [] | no_license | DamianMatysko/HibernateToturial | 0f5a08bbc8529d59e0221c63a8b25b8e685803ce | c440f63077d84137e3ce195f80ebd6ef83cadd5c | refs/heads/master | 2023-01-21T11:06:57.326606 | 2020-12-02T14:50:22 | 2020-12-02T14:50:22 | 314,084,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,346 | java | package hb04onetomanyuni.demo;
import hb04onetomanyuni.demo.entity.Course;
import hb04onetomanyuni.demo.entity.Instructor;
import hb04onetomanyuni.demo.entity.InstructorDetail;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class DeleteCoursesDemo {
public static void main(String[] args) {
SessionFactory sessionFactory = new Configuration()
.configure("hibernate.cfg.xml")
.addAnnotatedClass(Instructor.class)
.addAnnotatedClass(InstructorDetail.class)
.addAnnotatedClass(Course.class)
.buildSessionFactory();
Session session = sessionFactory.getCurrentSession();
try {
System.out.println("Start transaction...");
session.beginTransaction();
int id=10;
Course course= session.get(Course.class, id);
System.out.println("Deleting course: "+course);
session.delete(course);
System.out.println("Commit transaction...");
session.getTransaction().commit();
System.out.println("Success!!!");
} catch (Exception e) {
e.printStackTrace();
} finally {
session.close();
sessionFactory.close();
}
}
}
| [
"mada11@azet.sk"
] | mada11@azet.sk |
6b8c9f2bdbc2c31fe0df29d8d45f39fba39f5ca2 | 8e45f54a2c302a520e92aea50e41f71e8b32b8e1 | /bootdo/src/test/java/com/bootdo/testDemo/TestDemo.java | 856614d05307affee935725f55e638ee25dc8421 | [
"Apache-2.0"
] | permissive | peengtao123/cloud | 97e16f1553a9547a943a19a2a97a85ec9d126358 | e43cd770f72bb2906700b89be7b2b25a1970e5b1 | refs/heads/master | 2020-03-28T19:25:10.544092 | 2019-04-22T07:39:28 | 2019-04-22T07:39:28 | 148,974,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package com.bootdo.testDemo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.bind.annotation.RestController;
@RestController()
@RunWith(SpringRunner.class)
@SpringBootTest
public class TestDemo {
@Autowired
RedisTemplate redisTemplate;
@Test
public void test() {
// redisTemplate.opsForValue().set("a", "b");
}
;
}
| [
"peengtao123@126.com"
] | peengtao123@126.com |
973841d22bed471bc8fe209aa41fb8a8ca7a0905 | ebdbd5e0136ee4021557377eb82219d7e1146438 | /src/main/java/com/example/service/AuthoritesServiceImpl.java | 498fbbe4bab2f96da14713d5b4178cf4c243de57 | [
"Unlicense"
] | permissive | matthewgermeyer/wwjd | 8687f972f110aa87f940278f7c31ec394e12238e | 359e3d220c707c47fcbd792cf1aad24f3b1e450f | refs/heads/master | 2021-06-19T09:29:39.104434 | 2017-06-19T20:53:12 | 2017-06-19T20:53:12 | 92,991,563 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | package com.example.service;
import com.example.repository.AuthoritiesDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by MattyG on 6/14/17.
*/
@Service
public class AuthoritesServiceImpl implements AuthoritiesService {
@Autowired
AuthoritiesDao authoritiesDao;
@Override
public void add(String username) {
authoritiesDao.add(username);
}
}
| [
"matto483@gmail.com"
] | matto483@gmail.com |
c1c2c63857f9adf63c0d61b65c7a871f45bdf07c | 7b12f67da8c10785efaebe313547a15543a39c77 | /jjg-common-db/src/main/java/com/jjg/member/model/enums/CustomCachePrefix.java | af4ff83991abe4f94eecc374100a6e7e7000c0d1 | [] | no_license | liujinguo1994/xdl-jjg | 071eaa5a8fb566db6b47dbe046daf85dd2b9bcd8 | 051da0a0dba18e6e5021ecb4ef3debca16b01a93 | refs/heads/master | 2023-01-06T09:11:30.487559 | 2020-11-06T14:42:45 | 2020-11-06T14:42:45 | 299,525,315 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.jjg.member.model.enums;
public enum CustomCachePrefix {
/**
* 店铺自定义分类
*/
CUSTOM_CAT;
public String getPrefix() {
return this.name() + "_";
}
}
| [
"344009799@qq.com"
] | 344009799@qq.com |
746c4c310194db69ddfbe4b9d47ffc4e1afdf38c | 5466cdb284cb2eb7ff9b1f5066a164f9fb916ff1 | /src/main/java/com/service/KafkaProducerService.java | d6de0d99c82fd396a979dd60ceda0fa1fb19f05b | [] | no_license | NathanGan/websocket-server-fyp | 47907dec0be6f7c442295e1d55911472be3bc533 | dfc9c6154f1454b65b3b7736a441a7c769903d99 | refs/heads/master | 2021-04-03T07:13:06.834411 | 2018-03-13T07:00:56 | 2018-03-13T07:00:56 | 124,634,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.service;
import com.model.Orders;
import com.model.User;
/**
* Created by nathan on 2017/11/8.
*/
public interface KafkaProducerService {
public void produceLocation(User user);
public void produceOrder(Orders orders, User user);
public void produceUserInfo(User user);
}
| [
"nathan@NathandeMacBook-Pro.local"
] | nathan@NathandeMacBook-Pro.local |
8acb2dd09981f694c779ff3997b739e69654a810 | 5f77abd40b6c9732b7f6a158aed92411c9bd2fba | /USDAProg/src/parser/parsables/Footnote.java | 5389896f3c1d263f1ab9106e8f509fb18c55cf3c | [] | no_license | Netdex/USDANutritionProgram | 27da52c72dc528c3a073c7f00e479ec4b55159ab | fff0f7cb5f7cd7024a450c68e4ff9048a630c8bb | refs/heads/master | 2021-01-10T15:03:02.666048 | 2015-11-23T03:21:13 | 2015-11-23T03:21:13 | 45,484,341 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,244 | java | package parser.parsables;
import parser.Formattable;
import parser.InvalidParseDataException;
/**
* Represents a footnote of a food item
*
* @author Gordon Guan
*/
public class Footnote implements Parsable<Footnote>, Formattable{
public static Footnote SAMPLE = new Footnote();
public static final int PARSE_DATA_LENGTH = 5;
private int ndbNo;
private int seqNo;
private Footnote.FootnoteType footntType;
private int nutrNo;
private String footnoteTxt;
@Override
public String getFormat() {
return Formattable.getFileFormatted(
String.format("~%05d~", ndbNo),
String.format("~%02d~", seqNo),
"~~",
"~~",
footnoteTxt
);
}
@Override
public Footnote parse(String[] data) throws InvalidParseDataException {
if(data.length != PARSE_DATA_LENGTH)
throw new InvalidParseDataException();
ndbNo = Integer.parseInt(data[0]);
seqNo = Integer.parseInt(data[1]);
footntType = data[2].equals("D")
? FootnoteType.FOOD_DESCRIPTION : data[2].equals("M")
? FootnoteType.MEASURE_DESCRIPTION : FootnoteType.NUTRIENT_VALUE;
nutrNo = data[3].equals("") ? 0 : Integer.parseInt(data[3]);
footnoteTxt = data[4];
return this;
}
/**
* @return The nutrient databank number
*/
public int getNdbNo() {
return ndbNo;
}
// --Commented out by Inspection START (11/20/2015 12:10 PM):
// /**
// * @return The sequence number
// */
// public int getSequenceNo() {
// return seqNo;
// }
// --Commented out by Inspection STOP (11/20/2015 12:10 PM)
// --Commented out by Inspection START (11/20/2015 12:10 PM):
// /**
// * @return The footnote type
// */
// public Footnote.FootnoteType getFootnoteType() {
// return footntType;
// }
// --Commented out by Inspection STOP (11/20/2015 12:10 PM)
// --Commented out by Inspection START (11/20/2015 12:10 PM):
// /**
// * @return The nutrient number
// */
// public int getNutrNo() {
// return nutrNo;
// }
// --Commented out by Inspection STOP (11/20/2015 12:10 PM)
/**
* @return The footnote text
*/
public String getFootnoteText() {
return footnoteTxt;
}
/**
* Represents one of 3 types a footnote can be
*
* @author Gordon Guan
*/
enum FootnoteType {
FOOD_DESCRIPTION,
MEASURE_DESCRIPTION,
NUTRIENT_VALUE
}
}
| [
"netdex593@gmail.com"
] | netdex593@gmail.com |
ef627884f95cbd47218bb83f958b6294d1a2ffb5 | 69fcd628faacc3560a61f25122ef4e6825aacc44 | /app/src/main/java/com/example/lenovo/bbqu/fragment/fragment1.java | e5fe42e90db14c5b3c7349eae3ddc64c92418c2e | [] | no_license | BBQU/BBQu1 | db45e315e733097b32e2e2455c90ff9a7dea531b | 0323f4c51230910a7c78c7f1ffac7a17bc146053 | refs/heads/master | 2020-11-30T19:07:01.551225 | 2016-09-07T13:34:58 | 2016-09-07T13:34:58 | 67,609,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,525 | java | package com.example.lenovo.bbqu.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.ViewFlipper;
import com.example.lenovo.bbqu.R;
import com.example.lenovo.bbqu.activity.BanActivity;
import com.example.lenovo.bbqu.activity.WeatherRequire;
import com.example.lenovo.bbqu.activity.checkActivity;
/**
* Created by lenovo on 2016/6/10.
*/
public class fragment1 extends Fragment {
ImageButton check,btn6;
RadioButton radioC;
TextView checkk,ban;
//定义ViewFlipper,
private ViewFlipper flipper;
private int[] resId = {R.drawable.b44, R.drawable.b22, R.drawable.b11};
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.activity_fragment1,container,false);
check=(ImageButton)view.findViewById(R.id.btn2);
radioC=(RadioButton)view.findViewById(R.id.radioC);
btn6=(ImageButton)view.findViewById(R.id.btn6);
checkk=(TextView)view.findViewById(R.id.textView3);
ban=(TextView)view.findViewById(R.id.textView7);
checkk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),checkActivity.class);
startActivity(intent);
}
});
ban.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),BanActivity.class);
startActivity(intent);
}
});
check.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),checkActivity.class);
startActivity(intent);
}
});
radioC.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),WeatherRequire.class);
startActivity(intent);
}
});
btn6.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(v.getContext(),BanActivity.class);
startActivity(intent);
}
});
flipper = (ViewFlipper) view.findViewById(R.id.flipper);
//动态导入的方式为ViewFlipper加入子View
for (int i = 0; i < resId.length; i++) {
flipper.addView(getImageView(resId[i]));
}
//为ViewFlipper去添加动画效果
flipper.setInAnimation(getContext(), R.anim.left_in);
flipper.setOutAnimation(getContext(), R.anim.left_out);
//为ViewFlipper设定视图切换的时间间隔
flipper.setFlipInterval(2000);
//开始播放
flipper.startFlipping();
return view;
}
//添加图片信息
private ImageView getImageView(int resId) {
ImageView image = new ImageView(getContext());
image.setBackgroundResource(resId);
return image;
}
}
| [
"huangjian666666@foxmail.com"
] | huangjian666666@foxmail.com |
8a6e9b327c76cdb789b5b34a8bc56c26d38ec2d7 | e369d9879042675c259345e9d83c99fabb27de64 | /seckill/src/main/java/com/bansi/oauth/SalesforceExample.java | 20f5b96b8ee7b1c44fd1b0538205c8947725cd29 | [] | no_license | zbansi/intretech_netsuite | 609d59949a36e080841a5341812005df414a79d6 | 17d56760fd8b920a378e373c4ab021877ece7315 | refs/heads/master | 2021-06-26T00:31:19.500230 | 2019-06-06T01:59:49 | 2019-06-06T01:59:49 | 154,297,224 | 0 | 0 | null | 2020-10-13T10:51:34 | 2018-10-23T09:06:33 | Java | UTF-8 | Java | false | false | 4,437 | java | package com.bansi.oauth;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Scanner;
import com.github.scribejava.apis.SalesforceApi;
import com.github.scribejava.apis.salesforce.SalesforceToken;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth20Service;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.ExecutionException;
public class SalesforceExample {
private static final String NETWORK_NAME = "Salesforce";
private SalesforceExample() {
}
public static void main(String... args) throws IOException, NoSuchAlgorithmException, KeyManagementException,
InterruptedException, ExecutionException {
// Replace these with your client id and secret
final String clientId = "your client id";
final String clientSecret = "your client secret";
//IT's important! Salesforce upper require TLS v1.1 or 1.2.
//They are enabled in Java 8 by default, but not in Java 7
SalesforceApi.initTLSv11orUpper();
// The below used ServiceBuilder connects to login.salesforce.com
// (production environment).
//
// When you plan to connect to a Sandbox environment you've to use SalesforceApi.sandbox() API instance
// new ServiceBuilder.....build(SalesforceApi.sandbox());
final OAuth20Service service = new ServiceBuilder(clientId)
.apiSecret(clientSecret)
.callback("https://www.example.com/callback")
.build(SalesforceApi.instance());
System.out.println("=== " + NETWORK_NAME + "'s OAuth20 Workflow ===");
System.out.println();
// Obtain the Authorization URL
System.out.println("Fetching the Authorization URL...");
final String authorizationUrl = service.getAuthorizationUrl();
System.out.println("Got the Authorization URL!");
System.out.println("Now go and authorize ScribeJava here:");
System.out.println(authorizationUrl);
System.out.println("And paste the authorization code here");
System.out.print(">>");
final String code;
try (Scanner in = new Scanner(System.in)) {
code = in.nextLine();
}
System.out.println();
// The code needs to be URL decoded
final String codeEncoded = URLDecoder.decode(code, "UTF-8");
// Trade the Request Token and Verifier for the Access Token
System.out.println("Trading the Request Token for an Access Token...");
final OAuth2AccessToken accessToken = service.getAccessToken(codeEncoded);
final SalesforceToken salesforceAccessToken;
if (accessToken instanceof SalesforceToken) {
salesforceAccessToken = (SalesforceToken) accessToken;
} else {
throw new IllegalStateException("Salesforce API didn't return SalesforceToken.");
}
System.out.println("Got the Access Token!");
System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')");
System.out.println();
System.out.println("instance_url is: " + salesforceAccessToken.getInstanceUrl());
// Now let's go and ask for a protected resource!
System.out.println("Now we're reading accounts from the Salesforce org (maxing them to 10).");
// Sample SOQL statement
final String queryEncoded = URLEncoder.encode("Select Id, Name from Account LIMIT 10", "UTF-8");
// Building the query URI. We've parsed the instance URL from the accessToken request.
final String url = salesforceAccessToken.getInstanceUrl() + "/services/data/v36.0/query?q=" + queryEncoded;
System.out.println();
System.out.println("Full URL: " + url);
final OAuthRequest request = new OAuthRequest(Verb.GET, url);
service.signRequest(salesforceAccessToken, request);
final Response response = service.execute(request);
System.out.println();
System.out.println(response.getCode());
System.out.println(response.getBody());
}
} | [
"alonjune@gmail.com"
] | alonjune@gmail.com |
e8f9d6da3c3603be2bd44555a08958f2cb44fb21 | 05fa12f61fda1e61f615f3fd18aa046757b01d70 | /sample-spring-boot-kitchensink/src/main/java/com/example/bot/spring/KitchenSinkApplication.java | eee9ecbef8fd422e9a149f71fb49738097c50cb9 | [
"Apache-2.0"
] | permissive | jimwanggg/my-line-bot | 577d4dd898858f764d632bbb7296b6758a2fe7d9 | 85ebf00de3754f08375717cf3e2b4a9e849bee87 | refs/heads/main | 2023-02-23T19:59:36.800972 | 2021-01-22T20:36:00 | 2021-01-22T20:36:00 | 332,056,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | /*
* Copyright 2016 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.example.bot.spring;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class KitchenSinkApplication {
static Path downloadedContentDir;
public static void main(String[] args) throws IOException {
downloadedContentDir = Files.createTempDirectory("line-bot");
SpringApplication.run(KitchenSinkApplication.class, args);
}
}
| [
"b06902006@ntu.edu.tw"
] | b06902006@ntu.edu.tw |
d54c55bbe8fb589ce36bb155ca644922deeb0f45 | e5ab3b93b936fe202f53ade5e13db6bcb0b83882 | /practicas eva 1/EVA1_6_ARREGLOS/src/eva1_6_arreglos/EVA1_6_ARREGLOS.java | 3a2b72a1b12053794129cbc991b04d7ccbf42a82 | [] | no_license | ojeda13/particas | f448f52ec59ebe0df180f00b60cd0d96653111c0 | d70c7e6c0d264851a6c5e2bb0f46d6e674edf3a5 | refs/heads/master | 2020-03-19T08:44:40.534661 | 2018-06-05T21:06:48 | 2018-06-05T21:06:48 | 136,231,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,129 | 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 eva1_6_arreglos;
import java.util.Scanner;
/**
*
* @author Tania
*/
public class EVA1_6_ARREGLOS {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int edades[];
Scanner scCaptu=new Scanner(System.in);//CAPTURA DESDE TECLADO
//System.out.println(edades[5]); ERROR, SE DEBE INICIALIZAR (NEW)
System.out.println("Introduce la cantidad de esades a capturar: ");
int cant=scCaptu.nextInt();//CAPTURA DESDE EL TECLADO, AL DAR ENTER, UN ENTERO
edades=new int[cant];
for(int i=0;i<edades.length;i++){
System.out.println("Introduce la edad: ");
edades[i]=scCaptu.nextInt();
}
//IMPRIMIR EDAD
//for(variable:arreglo) for-each--> para-cada
for(int b:edades){
System.out.println("Edad = "+b);
}
}
} | [
"Erika_ojeda13@hotmail.com"
] | Erika_ojeda13@hotmail.com |
65d96dd0c0bdb6a5bfccb8ef01fa2018f721287d | 963ca40366ec1cad2f1939b3fa23d37c16fd535b | /src/main/java/com/demo/service/CsvIOService.java | 14874e04b8a83a249ff0d6999cdee009835b5a3b | [] | no_license | ajoys123/merge-accounts | cdbca4a2651c3aeca3b169326cac71e886ed7be6 | 4a14bbb1202fabad81b4c17b676aca2f19c1c6f4 | refs/heads/master | 2020-04-13T09:29:36.038175 | 2018-12-31T23:13:11 | 2018-12-31T23:13:11 | 163,110,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,690 | java | package com.demo.service;
import com.demo.model.Account;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
/**
* Service to read and write from CSV
*/
public class CsvIOService {
private static final Logger LOGGER = Logger.getLogger(CsvIOService.class.getName());
/**
* Reads the input csv and returns a list of accounts
* @param fileLocation
* @return
*/
public List<Account> readCsv(String fileLocation) {
List<Account> accounts = new ArrayList<>();
//Variable to keep track of the header
AtomicInteger i = new AtomicInteger(0);
try (Stream<String> stream = Files.lines(Paths.get(fileLocation))) {
stream.forEach(line -> {
//Do not add the header in the csv to accounts
if (i.get() != 0) {
String[] accountFields = line.split(",");
Account account = new Account();
account.setAccountId(accountFields[0]);
account.setAccountName(accountFields[1]);
account.setFirstName(accountFields[2]);
String createdOn = accountFields[3];
DateFormat df = new SimpleDateFormat("MM/DD/YY");
try {
account.setCreatedOn(df.parse(createdOn));
} catch (ParseException e) {
//Just catch the exception and do nothing. createdOn will be null for invalid dates
}
accounts.add(account);
}
i.getAndAdd(1);
});
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Exception occured", e);
}
return accounts;
}
/**
* Writes to an output file
* @param accounts
* @param outputFileName
*/
public void writeCsv(List<Account> accounts, String outputFileName) {
final String commaSpace = ", ";
File f = new File(outputFileName);
try (FileWriter writer = new FileWriter(f)) {
writer.write("Account ID, First Name, Created On, Status, Status Set On\n");
accounts.forEach(account -> {
StringBuffer sb = new StringBuffer();
sb.append(account.getAccountId());
sb.append(commaSpace);
sb.append(account.getFirstName());
sb.append(commaSpace);
sb.append(account.getCreatedOn());
sb.append(commaSpace);
sb.append(account.getStatus());
sb.append(commaSpace);
sb.append(account.getStatusSetOn());
sb.append("\n");
try {
writer.write(sb.toString());
writer.flush();
} catch (IOException e) {
}
});
} catch (IOException e) {
}
}
}
| [
"ajay.srinivas@sailpoint.com"
] | ajay.srinivas@sailpoint.com |
591f2b4481765fe5ad8217144cbc6eae9c91bdf7 | a04dd3e320f125a336757433644f8183bfb77d25 | /src/test/java/io/github/christophermanahan/captainlunch/service/CaptainRotationServiceTest.java | 8631f8c5b18cbcf3d6619a7ffd11c51a891c1a3e | [] | no_license | mylesmegyesi/captainlunch | fac87a9b444dbc56d6d97434378ecaddc10543cc | afb48e8e0c3274dd95a73bad6c48b52615e2c77d | refs/heads/master | 2020-06-11T22:57:23.460135 | 2019-06-26T20:12:22 | 2019-06-26T20:12:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,269 | java | package io.github.christophermanahan.captainlunch.service;
import io.github.christophermanahan.captainlunch.model.User;
import io.github.christophermanahan.captainlunch.repository.UserRepository;
import io.github.christophermanahan.captainlunch.time.Time;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
class CaptainRotationServiceTest {
private UserRepository userRepository;
private Time time;
private UserRotationService rotationService;
@BeforeEach
void setUp() {
userRepository = mock(UserRepository.class);
time = mock(Time.class);
rotationService = new CaptainRotationService(userRepository, time);
}
@Test
void getsHeadOfRotation() {
User currentCaptain = new User("W100000", new Date(Long.valueOf("0")));
when(userRepository.findFirstByOrderByStartDateDesc()).thenReturn(currentCaptain);
User user = rotationService.getHeadOfRotation();
assertEquals(currentCaptain, user);
}
@Test
void getsNextInRotation() {
User nextCaptain = new User("W100000", new Date(Long.valueOf("0")));
when(userRepository.findFirstByOrderByEndDate()).thenReturn(nextCaptain);
User user = rotationService.getNextInRotation();
assertEquals(nextCaptain, user);
}
@Test
void rotatesCurrentCaptainToLastPositionAndNextCaptainToCurrentPosition() {
Date twoSecondsAgo = new Date(Long.valueOf("0"));
Date oneSecondAgo = new Date(Long.valueOf("1"));
Date currentTime = new Date(Long.valueOf("2"));
User currentCaptain = new User("W100000", twoSecondsAgo);
User nextCaptain = new User("W100000", oneSecondAgo);
when(userRepository.findFirstByOrderByStartDateDesc()).thenReturn(currentCaptain);
when(userRepository.findFirstByOrderByEndDate()).thenReturn(nextCaptain);
when(time.now()).thenReturn(currentTime);
rotationService.rotate();
assertEquals(currentTime, currentCaptain.getEndDate());
assertEquals(currentTime, nextCaptain.getStartDate());
}
} | [
"chris.a.manahan@gmail.com"
] | chris.a.manahan@gmail.com |
db033b856a0bc8f2b8e9aaf531c3bcc54a26d329 | d64052f6b79d34014f9a2d9b25ceb644bfe5d8b3 | /src/main/java/api/rest/exception/BadRequestException.java | 9e2d1d46910c87d2919eddfb95cb441e1d6cffe9 | [] | no_license | jorhel-oliveira/api-java | 9fa68007a8c28b3019b5afefaa6ffd5df8927dd7 | 4a0988bbd3191d2652ead4dd1cafd3552c9d78b3 | refs/heads/master | 2023-07-04T18:16:26.967310 | 2021-08-18T00:13:57 | 2021-08-18T00:13:57 | 387,008,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package api.rest.exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.BAD_REQUEST)
public class BadRequestException extends RuntimeException{
public BadRequestException(String message) {
super(message);
}
}
| [
"jorhel_psf@hotmail.com"
] | jorhel_psf@hotmail.com |
9c6a1f11814b4d491acfa3b5374a853a8296d86b | 597f6f29b2f878d2e9e812be80dff14c201df429 | /c3r-web/src/org/unitedstollutions/c3r/web/C3RFormController.java | d1305d972dea9f1ba02418f111dd28aa9289cba3 | [] | no_license | rubenstoll/c3r-web | 4cb1faab4345b44c347c4ebfadf4fcd57a9a0562 | 647cf628de8c2177c9ad80b49bdd5762ff3cda9d | refs/heads/master | 2021-01-10T04:28:22.662988 | 2009-03-25T19:20:06 | 2009-03-25T19:20:06 | 36,396,602 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,009 | java | package org.unitedstollutions.c3r.web;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.xml.transform.TransformerException;
import org.apache.log4j.Logger;
import org.unitedstollutions.c3r.model.C3REngine;
import org.unitedstollutions.c3r.model.IfcTransformer;
import org.unitedstollutions.c3r.model.ProjectIfc;
import org.unitedstollutions.c3r.model.QueryResultsManager;
import org.unitedstollutions.c3r.utils.URLUtils;
import fr.inria.acacia.corese.api.IResults;
import fr.inria.acacia.corese.exceptions.EngineException;
/**
* Servlet implementation class C3RFormController
*/
/**
* @author yurchyshyna
*
*/
public class C3RFormController extends HttpServlet {
private static final long serialVersionUID = 1L;
Logger logger = Logger.getLogger(C3RFormController.class);
private String webRootDir;
protected void processRequest(HttpServletRequest request,
HttpServletResponse response) {
// Get the user's session
HttpSession session = request.getSession();
String selectedScreen = request.getServletPath();
String screen = "";
this.webRootDir = getServletContext().getRealPath("/");
if (selectedScreen.equals("/checker/runSelectedQueries")) {
// project ifc object contains all the project information.
// It has a default value but it can be configured in the load
// project page.
ProjectIfc ifc = (ProjectIfc) getServletContext().getAttribute(
"project");
String dataDir = webRootDir + File.separator + "data";
String engineData = dataDir + File.separator + "annotations"
+ File.separator + ifc.getIfcFile();
String engineRule = dataDir + File.separator + "definition_rules";
// TODO see if a schema property can be added to the ProjectIfc for
// flexibility
String engineSchema = dataDir + File.separator + "schemas"
+ File.separator + "ontoCC.owl";
String[] selectedQueries = request
.getParameterValues("selectedQueries");
logger.debug("processing selected queries");
if (selectedQueries != null) {
ArrayList<String> selectedQs = new ArrayList<String>(Arrays
.asList(selectedQueries));
IResults res = (IResults) session
.getAttribute("tmpQueryResponse");
logger.debug("getting results from attribute");
// check to see if there are any query run results
if ( res != null) {
// this engine was initialized in the context listener
// C3REngine engine = (C3REngine) getServletContext()
// .getAttribute("c3r_engine");
// this had to be done because sewese changes the behavior of log4j.
C3REngine engine = new C3REngine();
String log4jConf = webRootDir + getServletContext().getInitParameter("ENGINE_LOG4J");
if(log4jConf != null) {
engine.setLog4jProperties(log4jConf);
}
engine.createIEngineInstance();
QueryResultsManager qm = new QueryResultsManager();
// add the selected queries to the manager
qm.setQueries(res, selectedQs);
// use the corese engine to run the selected queries
logger.debug("Loading engine with the following data");
logger.debug("engine data: " + engineData);
logger.debug("engine rules: " + engineRule);
logger.debug("engine schemas: " + engineSchema);
try {
engine.loadFile(engineData);
engine.loadFile(engineRule);
engine.loadFile(engineSchema);
HashMap<String, ArrayList<String>> results = engine
.runMappedQueries(qm.getQueries());
qm.setResults(results);
session.setAttribute("subQueryRunResults", qm);
} catch (EngineException ee) {
ee.printStackTrace();
}
}
request.setAttribute("message",
"queries successfully processed");
} else {
request.setAttribute("message",
"queries NOT successfully processed!");
}
screen = "/jsp/checker/runSelectedQueries.jsp";
} else if (selectedScreen.equals("/checker/loadProject.form")) {
// the following parameter comes from loadProject.jsp
String projectFile = request.getParameter("projectIfc");
// ProjectIfc holds a project's definitions/settings
ProjectIfc ifc = (ProjectIfc) getServletContext().getAttribute(
"project");
if (projectFile.equalsIgnoreCase("uri")) {
logger.debug("Setting project from URI");
String uri = request.getParameter("ifcUri");
// read ifc project file from uri and process it for correctness
// String dataDir = webRootDir + File.separator + "data";
// String annoDir = dataDir + File.separator + "annotations";
// ifc.setIfcLocation(annoDir);
ifc.setIfcFile("custom");
processIfcFromUri(uri, ifc);
// ifc.setIfcFile("custom");
} else if (projectFile.equalsIgnoreCase("default2")) {
ifc.setIfcFile(projectFile);
String projectFileName = ifc.getIfcFile();
logger.debug("!!!! DEFAULT 2 IFC USED !!! ==> "
+ projectFileName);
// this session attribute is not needed because the projectIfc
// Object is available in the application
session.setAttribute("projectIfc", projectFileName);
} else if (projectFile.equalsIgnoreCase("default3")) {
ifc.setIfcFile(projectFile);
String projectFileName = ifc.getIfcFile();
logger.debug("!!!! DEFAULT 3 IFC USED !!! ==> "
+ projectFileName);
// this session attribute is not needed because the projectIfc
// Object is available in the application
session.setAttribute("projectIfc", projectFileName);
} else {
ifc.setIfcFile(projectFile);
String projectFileName = ifc.getIfcFile();
logger
.debug("!!!! DEFAULT IFC USED !!! ==> "
+ projectFileName);
// this session attribute is not needed because the projectIfc
// Object is available in the application
session.setAttribute("projectIfc", projectFileName);
}
// this function is useless cuz sometimes the next screen needs to
// be with .jsp
// and sometimes not. do not use.
screen = setNextScreen("/checker/main.jsp");
} else {
screen = "/jsp" + selectedScreen + ".jsp";
}
try {
RequestDispatcher dispatcher = request.getRequestDispatcher(screen);
dispatcher.forward(request, response);
} catch (Exception ex) {
logger.debug("Form Controller Exception");
ex.printStackTrace();
}
}
/**
* Reads in a file from a remote location (uri) and transforms the file to a
* format which can be understood by the corese engine.
*
* @param uri
* location of the project file to read.
* @param ifc
* the project settings object from which to get projects
* specifcs and set the new file name
*/
private void processIfcFromUri(String uri, ProjectIfc ifc) {
logger.debug("Reading from URI and writing to local file");
URLUtils ut = URLUtils.URLUTIL_INSTANCE;
// TODO add a check that the target file is not the defaultIfc
// file to avoid overwriting the default project file.
String target = ifc.getIfcLocation() + File.separator
+ ifc.getIfcFile();
logger.debug("reading from: " + uri);
logger.debug("writing to: " + target);
try {
ut.rFromUri(uri, target);
// ut.readFromUri(source, target);
// if there were no exceptions then transform the read in ifc file
transformExtIfc(ifc);
} catch (MalformedURLException e) {
logger.debug("URI reading problem", e);
resetProjectIfc(ifc);
} catch (IOException e) {
logger.debug("reading/writing exception", e);
resetProjectIfc(ifc);
} catch (TransformerException e) {
logger.error("++ Transformer Exception thrown", e);
resetProjectIfc(ifc);
}
}
/**
* Resets the project to it's default values. Used in case of an error
* during setting a project file other than the default.
*
* @param prjIfc
* project settings
*/
private void resetProjectIfc(ProjectIfc prjIfc) {
logger.debug("Resetting the project to its default state");
prjIfc.setIfcFile("default");
}
/**
* @param prj
* @throws TransformerException
*/
private void transformExtIfc(ProjectIfc prj) throws TransformerException {
IfcTransformer it = new IfcTransformer();
String transformDir = webRootDir + File.separator + "data"
+ File.separator + "IFCdata";
String annoDir = webRootDir + File.separator + "data" + File.separator
+ "annotations";
String xslt = transformDir + File.separator + "transformation1step.xslt";
File xsltFile = new File(xslt);
it.setXsltFile(xsltFile);
String uxf = prj.getIfcFile();
String u = annoDir + File.separator + uxf;
File untrauntransformedFile = new File(u);
it.setUntransformedFile(untrauntransformedFile);
// define the name for the transformed file - original with .t.xml
// appended to it
String txf = uxf + ".t1.xml";
String tx = annoDir + File.separator + txf;
File transformedFile = new File(tx);
it.setTransformedFile(transformedFile);
it.transform();
// 2nd transformation
u = annoDir + File.separator + txf;
untrauntransformedFile = new File(u);
it.setUntransformedFile(untrauntransformedFile);
// define the name for the transformed file - original with .t.xml
// appended to it
txf = uxf + ".t2.xml";
tx = annoDir + File.separator + txf;
transformedFile = new File(tx);
it.setTransformedFile(transformedFile);
it.transform();
// set the project ifc with the transformed file
prj.setIfcFile(transformedFile.getName());
}
/**
* Returns a next screen path by prepending the current path with /jsp.
* Useless function. Preferably do not use.
*
* @param currentScreen
* @return String of next screen
*/
private String setNextScreen(String currentScreen) {
return "/jsp" + currentScreen;
}
/**
* @see Servlet#getServletInfo()
*/
public String getServletInfo() {
return super.getServletInfo();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
}
| [
"rubenstoll@hotmail.com"
] | rubenstoll@hotmail.com |
50bb499c5177f01f8156158815be35771000d933 | 3b69b71639aad070c0134ca81bf4e9b4c3f3c272 | /codemageAPI/src/main/java/com/codemage/sql/service/AnalyserServiceImpl.java | 34edcd059f2649ec21900632aab198432bacbc30 | [
"Apache-2.0"
] | permissive | hasithalakmal/CodeAnalyser | 54a6c41f0489f3da503081409c1a3f52acb07294 | 3afa0d900d9284d7a9a5da4cff0223298cac24c8 | refs/heads/master | 2021-01-12T11:09:55.565649 | 2016-11-06T16:51:07 | 2016-11-06T16:51:07 | 72,855,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,765 | java | package com.codemage.sql.service;
import com.codemage.sql.analyser.CodeAnalyser;
import com.codemage.sql.analyser.ReportGen;
import com.codemage.sql.util.SonarQubeManager;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("analyserService")
@Transactional
public class AnalyserServiceImpl implements AnalyserService {
@Autowired
CodeAnalyser codeAnalyser;
@Autowired
ReportGen reportGen;
@Autowired
SonarQubeManager sonarQubeManager;
@Override
public String getAnalysereport(String javaCode) {
// sonarQubeManager.createJavaFile(javaCode);
// sonarQubeManager.AnalyseProject();
System.out.println("working 4");
String result ="";
String res1 = codeAnalyser.getCyclomaticComplexity(javaCode);
System.out.println(">>>>>>>>>>>>!!!");
String res2 = codeAnalyser.getParameeter2(javaCode);
String res3 = codeAnalyser.getParameeter3(javaCode);
System.out.println("working 5");
JSONArray list = new JSONArray();
JSONObject res1Obj = new JSONObject(res1);
JSONObject res2Obj = new JSONObject(res2);
JSONObject res3Obj = new JSONObject(res3);
list.put(res1Obj);
list.put(res2Obj);
list.put(res3Obj);
System.out.println("working 6");
JSONObject obj = new JSONObject();
obj.put("anlyse", list);
System.out.println("working 7");
result = reportGen.getReport(obj.toString());
System.out.println("working 8");
return result;
}
}
| [
"ghasithalakmal@gmail.com"
] | ghasithalakmal@gmail.com |
5de2a92c6c9c35ad56a48e4cb8c653e7b3ba7739 | 3518a262c673f4d324ec79fe41a5f1855d10b068 | /server/src/main/java/com/miaosha/controller/PromoController.java | c42ecf28d67d6bba15193041da6c27ea1357affa | [] | no_license | Alex-9827/miaosha | cbd68e6ad4dab3d0c382214ac4aff1c934530f95 | e492d223bded450b5127f05f807123aae5185171 | refs/heads/master | 2023-02-03T02:11:43.828774 | 2020-12-28T16:36:40 | 2020-12-28T16:36:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,642 | java | package com.miaosha.controller;
import com.miaosha.error.BusinessException;
import com.miaosha.error.EmBusinessError;
import com.miaosha.response.CommonReturnType;
import com.miaosha.service.PromoService;
import com.miaosha.service.UserService;
import com.miaosha.service.model.ItemModel;
import com.miaosha.service.model.PromoModel;
import com.miaosha.service.model.UserModel;
import org.apache.ibatis.annotations.Param;
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.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@ResponseBody
@RequestMapping("/promo")
public class PromoController {
@Autowired
private PromoService promoService;
@Autowired
private UserService userService;
@RequestMapping(value = "/publish", method = {RequestMethod.POST})
public CommonReturnType publishPromo(@Param(value="id") Integer id, @Param(value="token") String token) throws BusinessException {
//校验登录态
UserModel userModel = userService.validateToken(token);
if(userModel == null){
throw new BusinessException(EmBusinessError.USER_NOT_LOGIN,"用户未登录");
}
promoService.publicPromo(id);
return CommonReturnType.create("发布活动成功");
}
@RequestMapping(value = "/select", method = {RequestMethod.POST})
public CommonReturnType selectPromo(@Param(value="itemId") Integer itemId, @Param(value="token") String token) throws BusinessException {
//校验登录态
UserModel userModel = userService.validateToken(token);
if(userModel == null){
throw new BusinessException(EmBusinessError.USER_NOT_LOGIN,"用户未登录");
}
PromoModel promoModel = promoService.getPromoByItemId(itemId);
return CommonReturnType.create(promoModel);
}
@RequestMapping(value = "/selectByName", method = {RequestMethod.POST})
public CommonReturnType selectPromo(@Param(value="name") String name, @Param(value="token") String token) throws BusinessException {
System.out.println(name + " " + token);
//校验登录态
UserModel userModel = userService.validateToken(token);
if(userModel == null){
throw new BusinessException(EmBusinessError.USER_NOT_LOGIN,"用户未登录");
}
List<PromoModel> list = promoService.selectByName(name);
return CommonReturnType.create(list);
}
}
| [
"huaizhong1997@163.com"
] | huaizhong1997@163.com |
e829ee4c308fb3bd979f82c74938feab9e2414b4 | 4e825c918e21e283985a30d2476bfa3b1d9bde1a | /JanosWeb/src/main/net/sf/janos/web/structure/XMLFormatter.java | 224ff3ddee7544e0c02d513b7fd15b773a4d6be6 | [] | no_license | dk6688/janos | cb4f946c78028c6921507c3b8757216200e0e219 | b3152358f5331f92a01a0a644dd66d2a67c121b7 | refs/heads/master | 2021-01-19T14:36:26.085114 | 2010-12-28T22:53:56 | 2010-12-28T22:53:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,559 | java | package net.sf.janos.web.structure;
import java.io.IOException;
import java.io.Writer;
import java.util.Map.Entry;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class XMLFormatter extends Formatter {
private static final Log LOG = LogFactory.getLog(Element.class);
private final String indent = " ";
private boolean condense = false;
/**Constructs a new XMLFormatter for Elements
* @param condense Condense the output leaving out spaces and newlines*/
public XMLFormatter(boolean condense) {
this.condense = condense;
}
/** {@inheritDoc}
* */
public void write(Writer writer, Element e) {
try {
writer.write("<?xml version=\"1.0\"?>\n");
write(writer, e, 0);
} catch (IOException ioe) {
LOG.debug("IOException\n" + ioe.toString());
}
}
/**writes the element, attributes and sub-elements or content in the format promised by the formatter
* @param writer the Writer to write to
* @param e the element
* @param level the level of the elements (in some formats the level from the root element is important)*/
private void write(Writer writer, Element e, int level) {
try {
for (int i=0; i<level && !condense; i++) {
writer.write(indent);
}
String key = e.getKey();
// BEGIN start element
writer.write("<");
writer.write(key);
// BEGIN element attributes
for (Entry<String, String> attrib : e.getAttributes().entrySet()) {
writer.write(" ");
writer.write(attrib.getKey());
writer.write("=\"");
writer.write(createSafeXMLContentString(attrib.getValue()));
writer.write("\"");
}
// END element attributes
writer.write(">");
// END start element
// BEGIN content
if (e.getValue() != null)
writer.write(createSafeXMLContentString(e.getValue()));
else {
// BEGIN sub elements
if (!condense) {
writer.write("\n");
}
writer.flush();
for (Element child : e.getChildren()) {
write(writer, child, level + 1);
}
// END sub elements
//Indent for the end element
for (int i=0; i<level && !condense; i++) {
writer.write(indent);
}
}
// END content
// BEGIN end element
writer.write("</");
writer.write(key);
writer.write(">");
if (!condense) {
writer.write("\n");
}
writer.flush();
// END end element
} catch (IOException ioe) {
LOG.debug("IOException\n" + ioe.toString());
}
}
/**Creates a string that is safe to display as content in XML
* @param input the input string
* @param the safe version of the input string
* */
private String createSafeXMLContentString(String input) {
StringBuilder output = new StringBuilder();
int numchars = input.length();
char[] characters = new char[numchars];
input.getChars(0, numchars, characters, 0);
for (char character : characters) {
if (character == '&') {
output.append("&");
} else if (character == '<') {
output.append("<");
} else if (character == '>') {
output.append(">");
} else if (character == '\"') {
output.append(""");
} else if (character == '\'') {
output.append("'");
} else {
output.append(character);
}
}
return output.toString();
}
/**{@inheritDoc}*/
public void modifyResponseHeader(HttpServletResponse response) {
response.setContentType("text/xml");
}
} | [
"chrisc1980@994e37db-2641-0410-9be6-a0e17f2119e6"
] | chrisc1980@994e37db-2641-0410-9be6-a0e17f2119e6 |
a2c70e5a9b95ec44b9a9765743a1e043e6597d08 | ad605e50c86de5b91c23ce47a8b79100bfa4cf6d | /org.talend.mdm.core/src/com/amalto/core/webservice/WSRolePKArray.java | 0fe8432928e3cb8282c60b5e3b5013635f9c1e1b | [] | no_license | marclx/tmdm-server-se | 85e56728718f131e54b786518b58aee4f2b3b794 | 6c234c0f7ed467e7e1a8b76e80831db25ed6ff71 | refs/heads/master | 2021-01-18T15:12:30.154475 | 2015-03-20T12:56:25 | 2015-03-20T12:56:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | // This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1.2_01,编译版 R40)
// Generated source version: 1.1.2
package com.amalto.core.webservice;
public class WSRolePKArray {
protected com.amalto.core.webservice.WSRolePK[] wsRolePK;
public WSRolePKArray() {
}
public WSRolePKArray(com.amalto.core.webservice.WSRolePK[] wsRolePK) {
this.wsRolePK = wsRolePK;
}
public com.amalto.core.webservice.WSRolePK[] getWsRolePK() {
return wsRolePK;
}
public void setWsRolePK(com.amalto.core.webservice.WSRolePK[] wsRolePK) {
this.wsRolePK = wsRolePK;
}
}
| [
"achen@f6f1c999-d317-4740-80b0-e6d1abc6f99e"
] | achen@f6f1c999-d317-4740-80b0-e6d1abc6f99e |
6631e72a20ff1902c0945d707c79b159d69c3a8a | cbe0129f7b3d137218274d9f5a5c26fb72743c54 | /SpringBoot企业级开发/源码/media-type/src/main/java/com/waylau/spring/boot/mediatype/controller/HelloController.java | b10e58807e663c52ecb93bae5e815dde17795092 | [] | no_license | TronQuick/Spring-Boot | 246fbf8f270b0391d70774a0cfd38eb21155c67f | d16fe030da76a3f975f5b2182707f3e9aaa08dd0 | refs/heads/master | 2022-06-27T07:11:39.140687 | 2019-08-07T09:28:55 | 2019-08-07T09:28:55 | 201,000,600 | 2 | 0 | null | 2022-06-21T01:37:06 | 2019-08-07T07:50:35 | JavaScript | UTF-8 | Java | false | false | 455 | java | package com.waylau.spring.boot.mediatype.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Hello World 控制器
* @author <a href="https://waylau.com">Way Lau</a>
* @date 2017年1月26日
*/
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello() {
return "Hello World! Welcome to visit waylau.com!";
}
}
| [
"707500781@qq.com"
] | 707500781@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.