blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f82596c4dafb91e0b4b720bc0b9bf8af9c242ba7 | 5852a398ae202b0e0a9145075a0439cb766618ee | /src/main/java/org/edu_sharing/webservices/alfresco/extension/CopyNode.java | 3796ac8797ad35dacb33e820c91bfe7e3771c8ff | [] | no_license | OpenOLAT/edusharingws | 47c68bb99dd3a4bd7bf794d276d318116b41204f | 0d3c42f35162edeff57f852aeda71846d02f90ca | refs/heads/master | 2023-04-07T04:49:41.051516 | 2019-01-04T15:46:26 | 2019-01-04T15:46:26 | 164,126,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,631 | java |
package org.edu_sharing.webservices.alfresco.extension;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Classe Java pour anonymous complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="nodeId" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="toNodeId" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="copyChildren" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"nodeId",
"toNodeId",
"copyChildren"
})
@XmlRootElement(name = "copyNode")
public class CopyNode {
@XmlElement(required = true)
protected String nodeId;
@XmlElement(required = true)
protected String toNodeId;
protected boolean copyChildren;
/**
* Obtient la valeur de la propriété nodeId.
*
* @return
* possible object is
* {@link String }
*
*/
public String getNodeId() {
return nodeId;
}
/**
* Définit la valeur de la propriété nodeId.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNodeId(String value) {
this.nodeId = value;
}
/**
* Obtient la valeur de la propriété toNodeId.
*
* @return
* possible object is
* {@link String }
*
*/
public String getToNodeId() {
return toNodeId;
}
/**
* Définit la valeur de la propriété toNodeId.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setToNodeId(String value) {
this.toNodeId = value;
}
/**
* Obtient la valeur de la propriété copyChildren.
*
*/
public boolean isCopyChildren() {
return copyChildren;
}
/**
* Définit la valeur de la propriété copyChildren.
*
*/
public void setCopyChildren(boolean value) {
this.copyChildren = value;
}
}
| [
"[email protected]"
] | |
2a49d2874cb536f28cda51e002f0ec70d880f89a | 29b084f1bba7eee583df0691aa8c57b011ebd089 | /src/main/java/pers/corvey/exam/controller/ResourceCommentController.java | 30fcc0bff0cf262cdfbe3f5ae338a6e728d684ca | [] | no_license | Funds-soar/exam | ed6a45893bb8d6c98881be4a62063387facca2e2 | ec153ab5bcb9b7a48ccdd20d61e9b90399dd5b1e | refs/heads/master | 2023-04-29T21:20:05.005333 | 2021-05-09T12:47:35 | 2021-05-09T12:47:35 | 365,749,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,811 | java | package pers.corvey.exam.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import pers.corvey.exam.entity.Resource;
import pers.corvey.exam.entity.ResourceComment;
import pers.corvey.exam.entity.sys.SysUser;
import pers.corvey.exam.entity.ui.CallBackMessage;
import pers.corvey.exam.service.ResourceCommentService;
import pers.corvey.exam.service.ResourceService;
import pers.corvey.exam.util.CurrentUtils;
@Controller
@RequestMapping("/resourceComment")
public class ResourceCommentController {
private final ResourceCommentService service;
private final ResourceService resourceService;
@Autowired
public ResourceCommentController(ResourceCommentService service,
ResourceService resourceService) {
this.service = service;
this.resourceService = resourceService;
}
@RequestMapping("/good")
@ResponseBody
public int thumbsUp(@RequestParam("id") Long commentId) {
return service.thumbsUp(commentId);
}
@PostMapping("/save")
public String save(ResourceComment entity,
@RequestParam("resourceId") Long resourceId) {
SysUser user = CurrentUtils.getCurrentUser();
Resource Resource = resourceService.findByID(resourceId);
entity.setUser(user);
entity.setResource(Resource);
CallBackMessage msg = CallBackMessage.createMsgAfterFunction(
() -> service.save(entity), "回复成功!", "回复失败!请重试!");
msg.addToCurrentSession();
return "redirect:/resource/" + resourceId;
}
}
| [
"[email protected]"
] | |
db1008cf2d2fd70f165a1114bc2a43b9d8765ce6 | b9d5157b4f6052e068fa0bc66312356d3d55ac99 | /src/com/hncainiao/fubao/ui/fragment/DocFollFragment.java | abbb0bb282d605bb940774f7a40ec44b7c79ec12 | [] | no_license | liujie007/cainiao | 315e3cc094b892beabaa2fedc9f49eba0d7d535e | f5af11dcd7f958d8231e00db9cf36ff2240359ca | refs/heads/master | 2021-01-10T08:44:20.156312 | 2015-10-29T03:48:31 | 2015-10-29T03:48:31 | 44,724,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,888 | java | package com.hncainiao.fubao.ui.fragment;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.Header;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
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.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import com.hncainiao.fubao.R;
import com.hncainiao.fubao.properties.Constant;
import com.hncainiao.fubao.properties.SharedPreferencesConfig;
import com.hncainiao.fubao.ui.activity.BaseActivity;
import com.hncainiao.fubao.ui.activity.doctor.DoctorDetailActivity;
import com.hncainiao.fubao.ui.adapter.DoctorAdapter;
import com.hncainiao.fubao.ui.views.NetLoadDialog;
import com.hncainiao.fubao.utils.NetworkUtil;
import com.hncainiao.fubao.utils.ToastManager;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
/**
* @author zhaojing
* @version 2015年4月18日 上午10:13:57
*
*/
public class DocFollFragment extends Fragment {
private View view;
NetLoadDialog hDialog;
private Context mContext;
private ListView listView;
private DoctorAdapter adapter;
List<Map<String, Object>>mList=null;
ImageView emptyView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
view = inflater.inflate(R.layout.fragment_follow_doctor, null);
mContext = getActivity();
listView = (ListView) view.findViewById(R.id.lv_follow_doctors);
emptyView=(ImageView)view.findViewById(R.id.imageview);
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
Intent intent = new Intent(mContext, DoctorDetailActivity.class);
intent.putExtra("Doctor_id", mList.get(position).get("_id")+"");
if(intent!=null&&!mList.get(position).get("_id").equals("")){
SharedPreferencesConfig.saveStringConfig(mContext, "Doctor_id",mList.get(position).get("_id")+"");
startActivity(intent);
getActivity().overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
}
}
});
return view;
}
public void Showloading()
{
hDialog =new NetLoadDialog(mContext);
hDialog.SetMessage("操作中...");
hDialog.showDialog();
}
/**
* 取消动画
*/
public void Dissloading()
{
hDialog .dismissDialog();
}
private void setData() throws SocketTimeoutException {
mList = new ArrayList<Map<String, Object>>();
if(NetworkUtil.isOnline(mContext)){
try {
AsyncHttpClient client = new AsyncHttpClient();
RequestParams params = new RequestParams();
String url = Constant.CONNER_DOCTOR;
client.setTimeout(5000);
params.put("member_id", SharedPreferencesConfig.getStringConfig(mContext, "member_id"));
params.put("type", "2");
client.post(url, params, new AsyncHttpResponseHandler() {
@Override
public void onStart() {
/**
* 开始
*
* */
Showloading();
super.onStart();
}
@Override
public void onSuccess(int statusCode, Header[] headers,
byte[] responseBody) {
Dissloading();
mList.clear();
System.out.println("医生关注列表" + new String(responseBody));
if(!BaseActivity.CheckJson(responseBody).equals("")){
try {
JSONObject object = new JSONObject(new String(
responseBody));
Map<String, Object> map = null;
if (object.getInt("err") == 0) {
JSONArray array = object.getJSONArray("subscribe");
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("doctor_name");
String hospital_name = array.getJSONObject( i).getString("hospital_name");
// String department_name = array.getJSONObject(i).getString("department_name");
String title = array.getJSONObject(i).getString("doctor_title");
//是否有号
String status=array.getJSONObject(i).getString("avaiable");
// SharedPreferencesConfig.saveStringConfig(mContext, "doctor_status", status);
map = new HashMap<String, Object>();
map.put("name", name);
map.put("level", title);
map.put("locate", hospital_name);
map.put("img", array.getJSONObject(i).getString("doctor_avatar"));
map.put("_id", array.getJSONObject(i).getString("doctor_id"));
map.put("doctor_status", status);
mList.add(map);
}
}
adapter = new DoctorAdapter(mContext);
adapter.setList(paixu(mList));
listView.setAdapter(adapter);
} catch (JSONException e) {
}catch (Exception e) {
// TODO: handle exception
}
}
}
@Override
public void onFailure(int statusCode, Header[] headers,
byte[] responseBody, Throwable error) {
Dissloading();
ToastManager.getInstance(mContext).showToast("获取医生失败");
}
});
} catch (Exception e) {
}
} else {
ToastManager.getInstance(mContext).showToast("当前无网络连接");
}
}
@Override
public void onResume() {
// TODO Auto-generated method stub
try {
setData();
} catch (SocketTimeoutException e) {
// TODO Auto-generated catch block
ToastManager.getInstance(mContext).showToast("数据获取超时,请重试");
e.printStackTrace();
}
super.onResume();
}
//Listview排序
public List<Map<String, Object>> paixu(List<Map<String, Object>> mList){
if(!mList.isEmpty()){
Collections.sort(mList, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> object2,
Map<String, Object> object1) {
//根据文本排序
return ((String) object2.get("doctor_status")).
compareTo((String) object1.get("doctor_status"));
}
});
}
return mList;
}
}
| [
"[email protected]"
] | |
e589414063f4da40e3a8571b81763f9117bfb632 | 0bd0c3c44e28c72cc4fa7c3d2e4b1f3d71c7188e | /yixiekeji-provider/src/main/java/com/yixiekeji/model/seller/SellerModel.java | c6a4e4d1d97274ae7732ac9a52e595d5fa9537c2 | [] | no_license | jbzhang99/xingfuyi | 022030ddf03414ad769e71ca665693bb6d2c6855 | 797f752104b0703ad249ee6fe29b26b121338147 | refs/heads/master | 2021-01-02T03:12:57.428953 | 2019-10-30T07:53:59 | 2019-10-30T07:53:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,517 | java | package com.yixiekeji.model.seller;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import com.yixiekeji.core.StringUtil;
import com.yixiekeji.core.exception.BusinessException;
import com.yixiekeji.dao.shop.read.member.MemberCollectionSellerReadDao;
import com.yixiekeji.dao.shop.read.order.OrdersReadDao;
import com.yixiekeji.dao.shop.read.product.ProductCommentsReadDao;
import com.yixiekeji.dao.shop.read.product.ProductReadDao;
import com.yixiekeji.dao.shop.read.seller.SellerReadDao;
import com.yixiekeji.dao.shop.write.member.MemberWriteDao;
import com.yixiekeji.dao.shop.write.product.ProductWriteDao;
import com.yixiekeji.dao.shop.write.seller.SellerApplyWriteDao;
import com.yixiekeji.dao.shop.write.seller.SellerWriteDao;
import com.yixiekeji.dao.shop.write.system.RegionsWriteDao;
import com.yixiekeji.dto.CommentsDto;
import com.yixiekeji.dto.OrderDayDto;
import com.yixiekeji.entity.product.Product;
import com.yixiekeji.entity.seller.Seller;
import com.yixiekeji.entity.seller.SellerApply;
import com.yixiekeji.entity.system.Regions;
@Component(value = "sellerModel")
public class SellerModel {
private static Logger log = LoggerFactory.getLogger(SellerModel.class);
@Resource
private SellerWriteDao sellerWriteDao;
@Resource
private SellerReadDao sellerReadDao;
@Resource
private SellerApplyWriteDao sellerApplyDao;
@Resource
private DataSourceTransactionManager transactionManager;
@Resource
private MemberWriteDao memberWriteDao;
@Resource
private RegionsWriteDao regionsDao;
@Resource
private ProductReadDao productReadDao;
@Resource
private ProductWriteDao productWriteDao;
@Resource
private ProductCommentsReadDao productCommentsReadDao;
@Resource
private MemberCollectionSellerReadDao memberCollectionSellerReadDao;
@Resource
private OrdersReadDao ordersReadDao;
public Seller getSellerById(Integer sellerId) {
return sellerWriteDao.get(sellerId);
}
public Integer saveSeller(Seller seller) {
return sellerWriteDao.save(seller);
}
public Integer updateSeller(Seller seller) {
return sellerWriteDao.update(seller);
}
public Integer getSellersCount(Map<String, String> queryMap) {
return sellerReadDao.getSellersCount(queryMap);
}
public List<Seller> getSellers(Map<String, String> queryMap, Integer start, Integer size) {
List<Seller> list = sellerReadDao.getSellers(queryMap, start, size);
if(!list.isEmpty() && null !=list){
for (Seller seller : list) {
seller.setMemberName(memberWriteDao.get(seller.getMemberId()).getName());
}
}
return list;
}
public Seller getSellerByMemberId(Integer memberId) {
return sellerWriteDao.getSellerByMemberId(memberId);
}
/**
* 冻结商家,修改商家状态,修改商家下所有商品状态
* @param sellerId
* @return
*/
public Boolean freezeSeller(Integer sellerId) throws Exception {
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
TransactionStatus status = transactionManager.getTransaction(def);
try {
// 修改商家状态
Integer row = sellerWriteDao.freezeSeller(sellerId, Seller.AUDIT_STATE_3_FREEZE);
if (row == 0) {
throw new BusinessException("冻结商家时失败!");
}
// 修改商家下的商品状态
productWriteDao.freezeProductsBySellerId(sellerId, Product.SELLER_STATE_2);
transactionManager.commit(status);
return true;
} catch (BusinessException e) {
transactionManager.rollback(status);
throw e;
} catch (Exception e) {
transactionManager.rollback(status);
throw e;
}
}
/**
* 解冻商家,修改商家状态,修改商家下所有商品状态
* @param sellerId
* @return
*/
public Boolean unFreezeSeller(Integer sellerId) throws Exception {
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
TransactionStatus status = transactionManager.getTransaction(def);
try {
// 修改商家状态
Integer row = sellerWriteDao.freezeSeller(sellerId, Seller.AUDIT_STATE_2_DONE);
if (row == 0) {
throw new BusinessException("解冻商家时失败!");
}
// 修改商家下的商品状态
productWriteDao.freezeProductsBySellerId(sellerId, Product.SELLER_STATE_1);
transactionManager.commit(status);
return true;
} catch (BusinessException e) {
transactionManager.rollback(status);
throw e;
} catch (Exception e) {
transactionManager.rollback(status);
throw e;
}
}
/**
* 根据商家的用户ID,获取商家所在的地址(省市级)
* @param memberId
* @return
*/
public String getSellerLocationByMId(Integer memberId) {
//获得商家申请信息
SellerApply sellerApply = sellerApplyDao.getSellerApplyByUserId(memberId);
String location = "";
if (sellerApply != null && !StringUtil.isEmpty(sellerApply.getCompanyProvince())
&& !StringUtil.isEmpty(sellerApply.getCompanyCity())) {
Regions province = regionsDao.get(Integer.valueOf(sellerApply.getCompanyProvince()));
Regions city = regionsDao.get(Integer.valueOf(sellerApply.getCompanyCity()));
location = province.getRegionName() + city.getRegionName();
}
return location;
}
/**
* 定时任务设定商家的评分,用户评论各项求平均值设置为商家各项的综合评分
* @return
*/
public boolean jobSetSellerScore() {
Map<String, String> queryMap = new HashMap<String, String>();
queryMap.put("q_auditStatus", Seller.AUDIT_STATE_2_DONE + "");
List<Seller> sellers = sellerReadDao.getSellers(queryMap, 0, 0);
if (sellers != null && sellers.size() > 0) {
for (Seller seller : sellers) {
try {
CommentsDto commentsDto = productCommentsReadDao
.getSellerScoreSum(seller.getId());
if (commentsDto != null && commentsDto.getNumber() != null
&& commentsDto.getNumber() > 0) {
Seller sellerNew = new Seller();
sellerNew.setId(seller.getId());
BigDecimal scoreDescription = (new BigDecimal(commentsDto.getDescription()))
.divide((new BigDecimal(commentsDto.getNumber())), 1,
BigDecimal.ROUND_HALF_UP);
sellerNew.setScoreDescription(scoreDescription.toString());
BigDecimal scoreService = (new BigDecimal(commentsDto.getServiceAttitude()))
.divide((new BigDecimal(commentsDto.getNumber())), 1,
BigDecimal.ROUND_HALF_UP);
sellerNew.setScoreService(scoreService.toString());
BigDecimal scoreDeliverGoods = (new BigDecimal(
commentsDto.getProductSpeed())).divide(
(new BigDecimal(commentsDto.getNumber())), 1,
BigDecimal.ROUND_HALF_UP);
sellerNew.setScoreDeliverGoods(scoreDeliverGoods.toString());
Integer update = sellerWriteDao.update(sellerNew);
if (update == 0) {
throw new BusinessException("修改商家评分时失败:sellerId=" + seller.getId());
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
}
}
return true;
}
/**
* 定时任务设定商家各项统计数据
* @return
*/
public boolean jobSellerStatistics() {
Map<String, String> queryMap = new HashMap<String, String>();
queryMap.put("q_auditStatus", Seller.AUDIT_STATE_2_DONE + "");
List<Seller> sellers = sellerReadDao.getSellers(queryMap, 0, 0);
if (sellers != null && sellers.size() > 0) {
for (Seller seller : sellers) {
try {
Seller sellerNew = new Seller();
sellerNew.setId(seller.getId());
// 商品数量
Integer prdCount = productReadDao.getUpProductCountBySellerId(seller.getId());
sellerNew.setProductNumber(prdCount);
// 店铺收藏
Integer countBySellerId = memberCollectionSellerReadDao
.getCountBySellerId(seller.getId());
sellerNew.setCollectionNumber(countBySellerId);
// 店铺总销售金额、店铺完成订单量
OrderDayDto dto = ordersReadDao.getSumMoneyOrderBySellerId(seller.getId());
if (dto != null) {
BigDecimal moneyOrder = dto.getMoneyOrder() == null ? BigDecimal.ZERO
: dto.getMoneyOrder();
BigDecimal moneyBack = dto.getMoneyBack() == null ? BigDecimal.ZERO
: dto.getMoneyBack();
sellerNew.setSaleMoney(moneyOrder.subtract(moneyBack));
sellerNew.setOrderCountOver(dto.getCount());
}
// 店铺总订单量
Integer count = ordersReadDao.getCountBySellerId(seller.getId());
sellerNew.setOrderCount(count);
Integer update = sellerWriteDao.update(sellerNew);
if (update == 0) {
throw new BusinessException("统计商家数据时失败:sellerId=" + seller.getId());
}
} catch (Exception e) {
log.error(e.getMessage());
}
}
}
return true;
}
/**
* 根据名称取商家
* @param name
* @return
*/
public List<Seller> getSellerByName(String name) {
return sellerWriteDao.getSellerByName(name);
}
/**
* 根据店铺名称取商家
* @param name
* @return
*/
public List<Seller> getSellerBySellerName(String sellerName) {
return sellerWriteDao.getSellerBySellerName(sellerName);
}
}
| [
"[email protected]"
] | |
05abc8734a43dea87accb763145b995d4332dfd1 | e8e707baf803acd6fb251d8fb5793eba079d2e82 | /src/lista/exercicios/dip/violation/CarroDeCorrida.java | d8b81e2ac410da0b0e6eee296d93808f585e3137 | [] | no_license | vallovera/ExercicioAula005 | f3db3fbf40a3ddbc81aaa3cf21c01b2a9d002fa0 | cc935c010f72bd2300bf9166ac0b94b6610a78fe | refs/heads/master | 2021-07-06T08:21:06.730344 | 2017-10-02T03:27:30 | 2017-10-02T03:27:30 | 105,483,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package lista.exercicios.dip.violation;
public class CarroDeCorrida extends Automovel{
public CarroDeCorrida(final int combustivel) {
super(combustivel);
}
} | [
"[email protected]"
] | |
5caa07ebfb50e0bf5fb0db21cbf67f4aeead6616 | 7fffc39739869f259fe2d103efa05b87739778d1 | /Java/1017.java | 7c277c92cf439c8f836e804c7f65046e7c42d177 | [] | no_license | yunbinni/CodeUp | be39b3bd9fbeaa64be2a77a92918ebcc79b1799b | 5cb95442edb2b766de74154e0b91e8e1c236dd13 | refs/heads/main | 2023-08-15T19:02:29.819912 | 2021-10-12T00:50:16 | 2021-10-12T00:50:16 | 366,761,440 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 250 | java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println(a + " " + a + " " + a);
}
} | [
"[email protected]"
] | |
1ce48a7aed8292c9f90360148bb9fbdd540f8202 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/ui/chatting/component/bq$i$a$$ExternalSyntheticLambda0.java | f72a94be126ed5312f0748047d92ee7f08c60a4a | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 477 | java | package com.tencent.mm.ui.chatting.component;
import android.view.View;
import android.view.View.OnClickListener;
public final class bq$i$a$$ExternalSyntheticLambda0
implements View.OnClickListener
{
public final void onClick(View arg1) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar
* Qualified Name: com.tencent.mm.ui.chatting.component.bq.i.a..ExternalSyntheticLambda0
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
a4d246f12738baa1a6a9362ac050d9d000518d76 | 768ac7d2fbff7b31da820c0d6a7a423c7e2fe8b8 | /WEB-INF/java/com/youku/top/index/analyzer/WordProcessor.java | 7909b5a2c229b917835a284dc770adabb3ae4aa7 | [] | no_license | aiter/-java-soku | 9d184fb047474f1e5cb8df898fcbdb16967ee636 | 864b933d8134386bd5b97c5b0dd37627f7532d8d | refs/heads/master | 2021-01-18T17:41:28.396499 | 2015-08-24T06:09:21 | 2015-08-24T06:09:21 | 41,285,373 | 0 | 0 | null | 2015-08-24T06:08:00 | 2015-08-24T06:08:00 | null | UTF-8 | Java | false | false | 13,309 | java | /**
*
*/
package com.youku.top.index.analyzer;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.lucene.analysis.Token;
import com.youku.top.index.analyzer.WholeWord.Word;
/**
* @author william
* 分词前处理
*/
public class WordProcessor {
private int type;
private static Set<Character> numberSet = null;
private static char[] numberWords = new char[]{
'0','1','2','3','4','5','6','7','8','9','一','二','三','四','五','六','七','八','九','十'
};
static {
numberSet = new HashSet<Character>();
for (int i=0;i<numberWords.length;i++)
numberSet.add(numberWords[i]);
}
public static HashMap<String,String> numberMap = new HashMap<String,String>();
static {
numberMap.put("01","1");
numberMap.put("02","2");
numberMap.put("03","3");
numberMap.put("04","4");
numberMap.put("05","5");
numberMap.put("06","6");
numberMap.put("07","7");
numberMap.put("08","8");
numberMap.put("09","9");
numberMap.put("零","0");
numberMap.put("一","1");
numberMap.put("二","2");
numberMap.put("三","3");
numberMap.put("四","4");
numberMap.put("五","5");
numberMap.put("六","6");
numberMap.put("七","7");
numberMap.put("八","8");
numberMap.put("九","9");
numberMap.put("十","10");
numberMap.put("一十","10");
numberMap.put("十一","11");
numberMap.put("十二","12");
numberMap.put("十三","13");
numberMap.put("十四","14");
numberMap.put("十五","15");
numberMap.put("十六","16");
numberMap.put("十七","17");
numberMap.put("十八","18");
numberMap.put("十九","19");
numberMap.put("二十","20");
numberMap.put("二一","21");
numberMap.put("二二","22");
numberMap.put("二三","23");
numberMap.put("二四","24");
numberMap.put("二五","25");
numberMap.put("二六","26");
numberMap.put("二七","27");
numberMap.put("二八","28");
numberMap.put("二九","29");
numberMap.put("三十","30");
numberMap.put("三一","31");
numberMap.put("三二","32");
numberMap.put("三三","33");
numberMap.put("三四","34");
numberMap.put("三五","35");
numberMap.put("三六","36");
numberMap.put("三七","37");
numberMap.put("三八","38");
numberMap.put("三九","39");
numberMap.put("四十","40");
numberMap.put("四一","41");
numberMap.put("四二","42");
numberMap.put("四三","43");
numberMap.put("四四","44");
numberMap.put("四五","45");
numberMap.put("四六","46");
numberMap.put("四七","47");
numberMap.put("四八","48");
numberMap.put("四九","49");
numberMap.put("五十","50");
numberMap.put("五一","51");
numberMap.put("五二","52");
numberMap.put("五三","53");
numberMap.put("五四","54");
numberMap.put("五五","55");
numberMap.put("五六","56");
numberMap.put("五七","57");
numberMap.put("五八","58");
numberMap.put("五九","59");
numberMap.put("六十","60");
numberMap.put("六一","61");
numberMap.put("六二","62");
numberMap.put("六三","63");
numberMap.put("六四","64");
numberMap.put("六五","65");
numberMap.put("六六","66");
numberMap.put("六七","67");
numberMap.put("六八","68");
numberMap.put("六九","69");
numberMap.put("七十","70");
numberMap.put("七一","71");
numberMap.put("七二","72");
numberMap.put("七三","73");
numberMap.put("七四","74");
numberMap.put("七五","75");
numberMap.put("七六","76");
numberMap.put("七七","77");
numberMap.put("七八","78");
numberMap.put("七九","79");
numberMap.put("八十","80");
numberMap.put("八一","81");
numberMap.put("八二","82");
numberMap.put("八三","83");
numberMap.put("八四","84");
numberMap.put("八五","85");
numberMap.put("八六","86");
numberMap.put("八七","87");
numberMap.put("八八","88");
numberMap.put("八九","89");
numberMap.put("九十","90");
numberMap.put("九一","91");
numberMap.put("九二","92");
numberMap.put("九三","93");
numberMap.put("九四","94");
numberMap.put("九五","95");
numberMap.put("九六","96");
numberMap.put("九七","97");
numberMap.put("九八","98");
numberMap.put("九九","99");
numberMap.put("二十一","21");
numberMap.put("二十二","22");
numberMap.put("二十三","23");
numberMap.put("二十四","24");
numberMap.put("二十五","25");
numberMap.put("二十六","26");
numberMap.put("二十七","27");
numberMap.put("二十八","28");
numberMap.put("二十九","29");
numberMap.put("三十一","31");
numberMap.put("三十二","32");
numberMap.put("三十三","33");
numberMap.put("三十四","34");
numberMap.put("三十五","35");
numberMap.put("三十六","36");
numberMap.put("三十七","37");
numberMap.put("三十八","38");
numberMap.put("三十九","39");
numberMap.put("四十一","41");
numberMap.put("四十二","42");
numberMap.put("四十三","43");
numberMap.put("四十四","44");
numberMap.put("四十五","45");
numberMap.put("四十六","46");
numberMap.put("四十七","47");
numberMap.put("四十八","48");
numberMap.put("四十九","49");
numberMap.put("五十一","51");
numberMap.put("五十二","52");
numberMap.put("五十三","53");
numberMap.put("五十四","54");
numberMap.put("五十五","55");
numberMap.put("五十六","56");
numberMap.put("五十七","57");
numberMap.put("五十八","58");
numberMap.put("五十九","59");
numberMap.put("六十一","61");
numberMap.put("六十二","62");
numberMap.put("六十三","63");
numberMap.put("六十四","64");
numberMap.put("六十五","65");
numberMap.put("六十六","66");
numberMap.put("六十七","67");
numberMap.put("六十八","68");
numberMap.put("六十九","69");
numberMap.put("七十一","71");
numberMap.put("七十二","72");
numberMap.put("七十三","73");
numberMap.put("七十四","74");
numberMap.put("七十五","75");
numberMap.put("七十六","76");
numberMap.put("七十七","77");
numberMap.put("七十八","78");
numberMap.put("七十九","79");
numberMap.put("八十一","81");
numberMap.put("八十二","82");
numberMap.put("八十三","83");
numberMap.put("八十四","84");
numberMap.put("八十五","85");
numberMap.put("八十六","86");
numberMap.put("八十七","87");
numberMap.put("八十八","88");
numberMap.put("八十九","89");
numberMap.put("九十一","91");
numberMap.put("九十二","92");
numberMap.put("九十三","93");
numberMap.put("九十四","94");
numberMap.put("九十五","95");
numberMap.put("九十六","96");
numberMap.put("九十七","97");
numberMap.put("九十八","98");
numberMap.put("九十九","99");
numberMap.put("一百","100");
numberMap.put("一千","1000");
numberMap.put("一千零一","1001");
numberMap.put("一万","10000");
}
public static String[] analyzerPrepare(String s)
{
if (s == null)
return null;
char[] array = s.toCharArray();
int len = array.length;
StringBuffer sb = null;
StringBuffer sb_not_analyze = null;
int last = 0;
try
{
for (int i =0;i<len;i++)
{
if (i > 0 && array[i] == '集')
{
if (numberSet.contains(array[i-1]))
{
for (int j = i-1;j>=last;j--)
{
if (!numberSet.contains(array[j]))
{
if (array[j] == ' ' || array[j] == '第')
{
if (sb == null) sb = new StringBuffer();
String n = new String(array,j+1,i-j-1);
String k = numberMap.get(n);
if (k == null) k = n;
sb.append(array,last,j-last).append(" ").append(k).append(" ");
}
else
{
if (sb == null) sb = new StringBuffer();
String n = new String(array,j+1,i-j-1);
String k = numberMap.get(n);
if (k == null) k = n;
sb.append(array,last,j-last+1).append(" ").append(k).append(" ");
}
last = i+1;
break;
}
else
continue;
}
}
else
continue;
}
else if (i > 0 && (array[i] == '季' || array[i] == '部'))
{
if (i == len - 1 || (i < len-1 && array[i+1] != '度' && array[i+1] != '节'))
{
if (numberSet.contains(array[i-1]))
{
for (int j = i-1;j>=0;j--)
{
if (!numberSet.contains(array[j]))
{
if (array[j] == '第')
{
if (j>last)
{
if (sb == null) sb = new StringBuffer();
sb.append(array,last,j-last);
}
last = i+1;
if (sb_not_analyze == null)
sb_not_analyze = new StringBuffer();
else
sb_not_analyze.append(" ");
String n = new String(array,j+1,i-j-1);
String k = numberMap.get(n);
if (k == null) k = n;
sb_not_analyze.append("第").append(k).append(array[i]);
}
break;
}
}
}
else
continue;
}
}
else
{
}
}
if (last < s.length())
{
if (sb == null) sb = new StringBuffer();
sb.append(array,last,len-last);
}
}catch(Throwable e)
{
e.printStackTrace();
}
return new String[]{sb!=null?sb.toString():sb_not_analyze!=null?null:s
,sb_not_analyze!=null?sb_not_analyze.toString():null};
}
public static WholeWord getWholeWord(String s)
{
WholeWord tokens = new WholeWord();
if (s == null)
return tokens;
char[] array = s.toCharArray();
int len = array.length;
int last = 0;
try
{
for (int i =0;i<len;i++)
{
if (i > 0 && array[i] == '集')
{
if (numberSet.contains(array[i-1]))
{
for (int j = i-1;j>=last;j--)
{
if (!numberSet.contains(array[j]))
{
String k ;
int start;
if (array[j] == ' ' || array[j] == '第')
{
start = j;
String n = new String(array,j+1,i-j-1);
k = numberMap.get(n);
if (k == null) k = n;
if (j>last)
tokens.add(s.substring(last,j));
}
else
{
start = j+1;
String n = new String(array,j+1,i-j-1);
k = numberMap.get(n);
if (k == null) k = n;
if (j>last)
tokens.add(s.substring(last,j+1));
}
Token token = new Token();
token.setStartOffset(start);
token.setEndOffset(i+1);
token.setTermText(k);
tokens.add(token);
last = i+1;
break;
}
else
continue;
}
}
else
continue;
}
else if (i > 0 && (array[i] == '季' || array[i] == '部'))
{
if (i == len - 1 || (i < len-1 && array[i+1] != '度' && array[i+1] != '节'))
{
if (numberSet.contains(array[i-1]))
{
for (int j = i-1;j>=0;j--)
{
if (!numberSet.contains(array[j]))
{
if (array[j] == '第')
{
String n = new String(array,j+1,i-j-1);
String k = numberMap.get(n);
if (k == null) k = n;
if (j>last)
tokens.add(s.substring(last,j));
Token token = new Token();
token.setStartOffset(j);
token.setEndOffset(i+1);
token.setTermText("第"+k+array[i]);
tokens.add(token);
last = i+1;
}
break;
}
}
}
else
continue;
}
}
}
}catch(Throwable e)
{
e.printStackTrace();
}
if (!tokens.isEmpty())
{
if (last < s.length())
tokens.add(s.substring(last));
}
return tokens;
}
/**
* 格式化字符串数字
* @param number
* @return 不在map内,原值返回
*/
public static String formatNumber(String number)
{
if (numberMap.containsKey(number))
return numberMap.get(number);
return number;
}
public static String formatTeleplayName(String title)
{
return title.replaceAll("((中字|中文字幕|英文原声|中英文|中英双语|中英双字幕|双语字幕|国英|双语|国语|日语|韩语|汉语|无字幕|字幕|DVD|中文高清|高清|清晰)+版*)|抢先看|美剧|日剧|韩剧|偶像剧","");
}
public static String formatVideoQueryString(String keyword)
{
if (keyword != null && keyword.endsWith("全集") && keyword.length() >2)
{
return keyword.substring(0,keyword.length()-2);
}
return keyword;
}
public static void main(String[] args)
{
WholeWord word = getWholeWord("[PPX字幕组][空之境界][Karanokyoukai][剧场版][第06部]");
if(!word.isEmpty())
{
List<Word> list = word.getTokens();
for (int i=0;i<list.size();i++){
Word w = list.get(i);
if (w.isToken)
System.out.println(w.token.termText() + "\tstart="+w.token.startOffset() + "\tend="+w.token.endOffset());
else
System.out.println(w.text);
}
}
}
}
| [
"[email protected]"
] | |
941af70fac37f3a2fb8bae8a5dc853eed62f08b0 | e41a9d645bb0fb37123c9d4a01bee1914c4b3729 | /project3/KruskalTest.java | e5f9d65384def86581f6e111e1651dbb6995edba | [] | no_license | BelieverW/Data-Structures-in-Java | fd44a9851c07f5dc0cf2c6fd0900037502f56fc0 | 41b319eae3b2c07e875e2843f9143ac62d1e878e | refs/heads/master | 2016-09-01T07:31:44.654129 | 2015-12-21T06:31:45 | 2015-12-21T06:31:45 | 45,292,670 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,581 | java | /* KruskalTest.java */
/**
* The KruskalTest class tests the Kruskal class.
*/
import graph.*;
import graphalg.*;
import java.util.*;
public class KruskalTest {
private static final int VERTICES = 10;
private static final int MAXINT = 100;
private static boolean tree = true;
private static boolean minTree = true;
public static void addRandomEdges(WUGraph g, Object[] vertArray) {
int i, j;
System.out.println("Adding random edges to graph.");
Random random = new Random(3); // Create a "Random" object with seed 0
for (i = 0; i < vertArray.length; i++) {
for (j = i; j < vertArray.length; j++) {
int r = random.nextInt() % MAXINT; // Between -99 and 99
if (r >= 0) {
g.addEdge(vertArray[i], vertArray[j], r);
}
}
}
}
public static void DFS(WUGraph t, DFSVertex current, DFSVertex prev,
int[] maxOnPath, int maxEdge) {
Neighbors neigh;
int i;
current.visited = true;
maxOnPath[current.number] = maxEdge;
neigh = t.getNeighbors(current);
if (neigh != null) {
for (i = 0; i < neigh.neighborList.length; i++) {
DFSVertex next = (DFSVertex) neigh.neighborList[i];
if (next.visited) {
if ((next != current) && (next != prev)) {
tree = false;
return;
}
} else if (neigh.weightList[i] > maxEdge) {
DFS(t, next, current, maxOnPath, neigh.weightList[i]);
} else {
DFS(t, next, current, maxOnPath, maxEdge);
}
if (!tree) {
return;
}
}
}
}
public static void DFSTest(WUGraph g, WUGraph t, DFSVertex[] vertArray) {
int[][] maxOnPath;
Neighbors neigh;
int i, j;
System.out.println("Testing the tree.");
maxOnPath = new int[VERTICES][VERTICES];
for (i = 0; i < VERTICES; i++) {
for (j = 0; j < VERTICES; j++) {
vertArray[j].visited = false;
}
DFS(t, vertArray[i], null, maxOnPath[i], -MAXINT);
for (j = 0; j < VERTICES; j++) {
if (!vertArray[j].visited) {
tree = false;
}
}
if (!tree) {
return;
}
}
for (i = 0; i < vertArray.length; i++) {
for (j = 0; j < vertArray.length; j++) {
System.out.print(" " + maxOnPath[i][j]);
}
System.out.println();
}
for (i = 0; i < VERTICES; i++) {
neigh = g.getNeighbors(vertArray[i]);
if (neigh != null) {
for (j = 0; j < neigh.neighborList.length; j++) {
int v = ((DFSVertex) neigh.neighborList[j]).number;
if (neigh.weightList[j] < maxOnPath[i][v]) {
minTree = false;
}
}
}
}
}
public static void main(String[] args) {
int i, j;
int score;
WUGraph g, t;
DFSVertex[] vertArray;
System.out.println("Running minimum spanning tree test.");
System.out.println("Creating empty graph.");
g = new WUGraph();
System.out.println("Adding " + VERTICES + " vertices.");
vertArray = new DFSVertex[VERTICES];
for (i = 0; i < VERTICES; i++) {
vertArray[i] = new DFSVertex();
vertArray[i].number = i;
g.addVertex(vertArray[i]);
}
addRandomEdges(g, vertArray);
for (i = 0; i < vertArray.length; i++) {
for (j = 0; j < vertArray.length; j++) {
if (g.isEdge(vertArray[i], vertArray[j])) {
System.out.print(" " + g.weight(vertArray[i], vertArray[j]));
} else {
System.out.print(" *");
}
}
System.out.println();
}
System.out.println("Finding the minimum spanning tree.");
t = Kruskal.minSpanTree(g);
for (i = 0; i < vertArray.length; i++) {
for (j = 0; j < vertArray.length; j++) {
if (t.isEdge(vertArray[i], vertArray[j])) {
System.out.print(" " + t.weight(vertArray[i], vertArray[j]));
} else {
System.out.print(" *");
}
}
System.out.println();
}
DFSTest(g, t, vertArray);
if (tree) {
System.out.println("One point for creating a tree.");
if (minTree) {
System.out.println("Two points for creating a minimum spanning tree.");
score = 3;
} else {
System.out.println("Not a minimum spanning tree.");
score = 1;
}
} else {
System.out.println("Not a tree.");
score = 0;
}
System.out.println("Your Kruskal test score is " + score + " out of 3.");
System.out.println(" (Be sure also to run WUGTest.java.)");
}
}
class DFSVertex {
boolean visited;
int number;
}
| [
"[email protected]"
] | |
bd1bd4935ab9712f8eaacf4aa4724fdca4a894eb | 1829bea13a6647817ffddc9c73e96ec69fc90712 | /src/main/java/org/snpeff/snpEffect/VcfAnnotator.java | 2c1b201a287225b03f4d01d2bb51e12a00ba17de | [] | no_license | mbourgey/SnpEff | 637938836d85d0a857c0d38d5293aa1b512806fb | ca44f61338d49f4780b42140ab538348e2b177d1 | refs/heads/master | 2021-01-18T06:45:20.386620 | 2016-02-29T17:02:39 | 2016-02-29T17:02:39 | 52,807,651 | 0 | 0 | null | 2016-02-29T16:55:01 | 2016-02-29T16:55:01 | null | UTF-8 | Java | false | false | 1,282 | java | package org.snpeff.snpEffect;
import org.snpeff.fileIterator.VcfFileIterator;
import org.snpeff.vcf.VcfEntry;
/**
* Annotate a VCF file: E.g. add information to INFO column
*
*/
public interface VcfAnnotator {
/**
* Add annotation headers to VCF file
*
* @return true if OK, false on error
*/
public boolean addHeaders(VcfFileIterator vcfFile);
/**
* Annotate a VCF file entry
*
* @return true if the entry was annotated
*/
public boolean annotate(VcfEntry vcfEntry);
/**
* This method is called after all annotations have been performed.
* The vcfFile might have already been closed by this time
* (i.e. the VcfFileIterator reached the end).
*
* @return true if OK, false on error
*/
public boolean annotateFinish();
/**
* Initialize annotator: This method is called after vcfFile
* is opened, but before the header is output.
* The first vcfEntry might have (and often has) already been
* read from the file.
*
* @return true if OK, false on error
*/
public boolean annotateInit(VcfFileIterator vcfFile);
/**
* Set configuration
*/
public void setConfig(Config config);
/**
* Set debug mode
*/
public void setDebug(boolean debug);
/**
* Set verbose mode
*/
public void setVerbose(boolean verbose);
}
| [
"[email protected]"
] | |
7bec98a86d5a4d537aadc204c4fb46ebf437100a | 50b968e19a4a95318ff9d48fc4f364a67717f02e | /app/src/androidTest/java/com/example/spinner_sueldo/ExampleInstrumentedTest.java | ef25b386ef0e261b4bf4b4085e30d4c4f4b149a1 | [] | no_license | YovGitLb/Spinner_Sueldo | 1faeb427da7784320c190b98e02681f922853c3f | 82718d9e0540e466138535f7ec844f16b6aa983f | refs/heads/master | 2022-07-31T19:35:08.708085 | 2020-05-24T05:08:17 | 2020-05-24T05:08:17 | 266,473,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package com.example.spinner_sueldo;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.spinner_sueldo", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
2a25b528047cdec61bcac049439d299c25793051 | cdd6d7eabbba1adfcb3d09459482bdafabea5ea9 | /Java_Multithreading/src/main/java/Level_2/lvl_2_task_3/OurUncaughtExceptionHandler.java | f7e650b775fd229283759d889b7f0003b778295b | [] | no_license | AvengerDima/JavaRush | dde5f2cffeff1449a38dc29c6c6c75b49cb698bd | 7805a3adf61fff3ae2762b86807c67befb31c814 | refs/heads/master | 2021-12-02T02:52:49.800659 | 2021-11-19T17:40:38 | 2021-11-19T17:40:38 | 256,775,964 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,337 | java | package Level_2.lvl_2_task_3;
public class OurUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
@Override
public void uncaughtException(Thread t, Throwable e) {
final String string = "%s : %s : %s";
if (lvl_2_task_3.FIRST_THREAD_NAME.equals(t.getName())) {
System.out.println(getFormattedStringForFirstThread(t, e, string));
} else if (lvl_2_task_3.SECOND_THREAD_NAME.equals(t.getName())) {
System.out.println(getFormattedStringForSecondThread(t, e, string));
} else {
System.out.println(getFormattedStringForOtherThread(t, e, string));
}
}
protected String getFormattedStringForOtherThread(Thread t, Throwable e, String string) {
String result = String.format(string, e.getClass().getSimpleName(), e.getCause(), t.getName());
return result;
}
protected String getFormattedStringForSecondThread(Thread t, Throwable e, String string) {
String result = String.format(string, e.getCause(), e.getClass().getSimpleName(), t.getName());
return result;
}
protected String getFormattedStringForFirstThread(Thread t, Throwable e, String string) {
String result = String.format(string, t.getName(), e.getClass().getSimpleName(), e.getCause());
return result;
}
}
| [
"[email protected]"
] | |
59fd0deb0cc2f34e071d2dddda7cd496b109e306 | 1c9bdf7e53599fa79f4e808a6daf1bab08b35a00 | /peach/app/src/main/java/com/xygame/second/sg/comm/bean/TimerDuringBean.java | 3cb9669c3ed6837beabdc92d8b3253e268c51324 | [] | no_license | snoylee/GamePromote | cd1380613a16dc0fa8b5aa9656c1e5a1f081bd91 | d017706b4d6a78b5c0a66143f6a7a48fcbd19287 | refs/heads/master | 2021-01-21T20:42:42.116142 | 2017-06-18T07:59:38 | 2017-06-18T07:59:38 | 94,673,520 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,595 | java | package com.xygame.second.sg.comm.bean;
import com.xygame.second.sg.jinpai.UsedTimeBean;
import com.xygame.second.sg.jinpai.bean.ScheduleTimeBean;
import java.io.Serializable;
import java.util.List;
/**
* Created by tony on 2016/8/10.
*/
public class TimerDuringBean implements Serializable {
private List<FreeTimeBean> timers;
private FreeTimeBean timersOfDate;
private List<ServiceTimeDateBean> dateDatas;
private List<ScheduleTimeBean> scheduleTimeBeans;
private List<UsedTimeBean> usedTimeBeans;
public List<UsedTimeBean> getUsedTimeBeans() {
return usedTimeBeans;
}
public void setUsedTimeBeans(List<UsedTimeBean> usedTimeBeans) {
this.usedTimeBeans = usedTimeBeans;
}
public List<ServiceTimeDateBean> getDateDatas() {
return dateDatas;
}
public void setDateDatas(List<ServiceTimeDateBean> dateDatas) {
this.dateDatas = dateDatas;
}
public List<FreeTimeBean> getTimers() {
return timers;
}
public void setTimers(List<FreeTimeBean> timers) {
this.timers = timers;
}
public List<ScheduleTimeBean> getScheduleTimeBeans() {
return scheduleTimeBeans;
}
public void setScheduleTimeBeans(List<ScheduleTimeBean> scheduleTimeBeans) {
this.scheduleTimeBeans = scheduleTimeBeans;
}
public FreeTimeBean getTimersOfDate() {
return timersOfDate;
}
public void setTimersOfDate(FreeTimeBean timersOfDate) {
this.timersOfDate = timersOfDate;
}
}
| [
"[email protected]"
] | |
04146305f84d5ac5c5adc47576477cdeb06e9a81 | a8494cf6cb4b25b7a9cc3dbda022f50e26e73168 | /src/main/java/app/service/form/TableFormFieldService.java | 363bdaa1ae15d96fa5d30926177ad9dfc99cc145 | [] | no_license | SteveZhangF/ddd | ab1c763ac7d2c33d2e7b8d8e1ff4a29aa02a82d9 | b0882f985cf3ec6f21ab0a420f9f814969841fee | refs/heads/master | 2021-01-10T15:05:42.506250 | 2015-12-12T08:34:48 | 2015-12-12T08:34:48 | 43,917,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 643 | java | /*
* Copyright (c) 2015. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
* Vestibulum commodo. Ut rhoncus gravida arcu.
*/
package app.service.form;
import app.model.forms.TableFormField;
import app.newService.IBaseGenericService;
/**
* Created by steve on 11/12/15.
*/
public interface TableFormFieldService extends IBaseGenericService<TableFormField,String> {
}
| [
"[email protected]"
] | |
acc4ecdd5c3c9f4ffa664850c90cf778c8566662 | 3ac7ef00869dd1ba4ecd70a8ce3f00fbd54fbe96 | /Exercises/Generics/pr01/Box.java | 970737a99b0849777bfb22b1f1e7ca51dea0444b | [] | no_license | StefanValerievMaslarski/Java_OOP_2_July_2016 | 53f8f00549893173135193b694d733b3c08fe04c | a1948913ee800ea154ef5e49ea5e3ec924c5e9e7 | refs/heads/master | 2021-01-12T15:22:31.719015 | 2016-10-24T06:50:03 | 2016-10-24T06:50:03 | 71,760,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 672 | java | package generics.pr01;
public class Box<T> {
private static final int DEFAULT_CAPACITY = 16;
private T element;
// private T[] elements;
// private int index;
@SuppressWarnings("unchecked")
Box(T element) {
this.element = element;
// this.elements = (T[]) new Object[DEFAULT_CAPACITY];
// this.index = 0;
}
// public void add(T element) {
// this.elements[index] = element;
// this.index++;
// }
//
// public T[] getElements() {
// return this.elements;
// }
@Override
public String toString() {
return element.getClass() + ": " + String.valueOf(this.element);
}
}
| [
"[email protected]"
] | |
aad88076a7406da03542c001d5e82f82e046964d | c67cbd22f9bc3c465fd763fdf87172f2c8ec77d4 | /Desktop/Please Work/build/Android/Preview/app/src/main/java/com/foreign/Fuse/Controls/Native/Android/ViewGroup.java | ac15a139c2afe91d378b122c4ed1311fff8391a1 | [] | no_license | AzazelMoreno/Soteria-project | 7c58896d6bf5a9ad919bde6ddc2a30f4a07fa0d4 | 04fdb71065941176867fb9007ecf38bbf851ad47 | refs/heads/master | 2020-03-11T16:33:22.153713 | 2018-04-19T19:47:55 | 2018-04-19T19:47:55 | 130,120,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,027 | java | package com.foreign.Fuse.Controls.Native.Android;
// fuse defined imports
import com.uno.UnoObject;
import com.uno.BoolArray;
import com.uno.ByteArray;
import com.uno.CharArray;
import com.uno.DoubleArray;
import com.uno.FloatArray;
import com.uno.IntArray;
import com.uno.LongArray;
import com.uno.ObjectArray;
import com.uno.ShortArray;
import com.uno.StringArray;
import com.Bindings.UnoHelper;
import com.Bindings.UnoWrapped;
import com.Bindings.ExternedBlockHost;
public class ViewGroup
{
static void debug_log(Object message)
{
android.util.Log.d("PleaseWork", (message==null ? "null" : message.toString()));
}
public static void AddView227(final Object parentHandle,final Object childHandle)
{
android.view.ViewGroup viewGroup = (android.view.ViewGroup)parentHandle;
android.view.View childView = (android.view.View)childHandle;
viewGroup.addView(childView);
}
public static void AddView1228(final Object parentHandle,final Object childHandle,final int index)
{
android.view.ViewGroup viewGroup = (android.view.ViewGroup)parentHandle;
android.view.View childView = (android.view.View)childHandle;
viewGroup.addView(childView, index);
}
public static Object Create229()
{
android.widget.FrameLayout frameLayout = new com.fuse.android.views.ViewGroup(com.fuse.Activity.getRootActivity());
frameLayout.setFocusable(true);
frameLayout.setFocusableInTouchMode(true);
frameLayout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
return frameLayout;
}
public static void RemoveView230(final Object parentHandle,final Object childHandle)
{
android.view.ViewGroup viewGroup = (android.view.ViewGroup)parentHandle;
android.view.View childView = (android.view.View)childHandle;
viewGroup.removeView(childView);
}
}
| [
"[email protected]"
] | |
614b318909ac9dfb33b0f98063e76b5264359a0c | 354ea2bd46fe9ed6f55d36845d4a002a4d09d8e8 | /src/leverage/game/version/VersionMeta.java | fac8ad9f970984e55d9b1eee3a3ba1171af801be | [] | no_license | MacKey-255/LEVERAGE-Launcher | 84c22536fabc041b9ab888f63dee03ccb8814c83 | ac3d929d08c7bc86873a1451fb37fb2799dc200d | refs/heads/master | 2020-04-20T18:52:25.049189 | 2019-08-02T21:10:23 | 2019-08-02T21:10:23 | 169,033,845 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 845 | java | package leverage.game.version;
public class VersionMeta {
private final String id;
private final String url;
private final VersionType type;
public VersionMeta(String id, String url, VersionType type) {
this.id = id;
this.url = url;
this.type = type;
}
public final String getID() {
return id;
}
public final String getURL() {
return url;
}
public final VersionType getType() {
return type;
}
@Override
public final boolean equals(Object o) {
return o instanceof VersionMeta && id.equalsIgnoreCase(((VersionMeta) o).id);
}
@Override
public final int hashCode() {
return id.hashCode();
}
@Override
public final String toString() {
return id;
}
}
| [
"[email protected]"
] | |
d6e96a7f72f2d604bfc5d42281dd3137718ac507 | 5f040de47af8bcd6b5f12a33c2430f84551d97d7 | /app/src/test/java/com/yasir/android/tabsapplication/ExampleUnitTest.java | 95be28e99d82c6c38e9bacf09efad45b9f8a50de | [] | no_license | yasirdev/Overlay_Loader_with_Image | 901df3bbacce4d89c2bfd4f896c49d7a8dfabed1 | 960158875bf9f7081101168aeb72dbcf875a47aa | refs/heads/master | 2020-09-21T06:26:24.076538 | 2016-09-09T00:58:57 | 2016-09-09T00:58:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.yasir.android.tabsapplication;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
f329f5489029e58667a9f96066163ab0208e3545 | c54a46af9fe7cbe604f9792ae8cfc644c6aa11c9 | /app/src/main/java/com/Telstra/sample/repository/ContentRepository.java | 103aec6d8d5b6fb4d24d2259411f419f914e978f | [] | no_license | arunkumar2289/TelstraApp | e65490abd2f4b97b9c8f49daaf3d9585221ab782 | a1e79edf17cf0719c468a5de296b20e2824ab7e4 | refs/heads/master | 2021-04-29T22:03:11.228107 | 2018-02-26T12:23:08 | 2018-02-26T12:23:08 | 121,630,327 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,616 | java | package com.Telstra.sample.repository;
import android.text.TextUtils;
import android.util.Log;
import com.Telstra.sample.model.ImageData;
import com.Telstra.sample.model.LiveData;
import java.util.Iterator;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ContentRepository {
private RetrofitService retrofitService;
private static ContentRepository contentRepository;
LiveData liveData;
private ContentRepository() {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(RetrofitService.HTTPS_API_CONTENT_URL)
.addConverterFactory(GsonConverterFactory.create())
.build();
retrofitService = retrofit.create(RetrofitService.class);
}
public synchronized static ContentRepository getInstance() {
if (contentRepository == null) {
if (contentRepository == null) {
contentRepository = new ContentRepository();
}
}
return contentRepository;
}
public void getProjectList(final RetrofitDataStatus dataStatus) {
retrofitService.getProjectList().enqueue(new Callback<LiveData>() {
@Override
public void onResponse(Call<LiveData> call, Response<LiveData> response) {
dataStatus.onSuccess(response.body());
}
@Override
public void onFailure(Call<LiveData> call, Throwable t) {
dataStatus.onFailure();
}
});
}
}
| [
"Krpappan@2289"
] | Krpappan@2289 |
22b28450bbb834e68ac95864cdd8f04d4f09b77d | 782f9efaf6f1bf14086224845a072c6fd45dde5a | /app/src/main/java/com/dlf/weizx/model/NaviModel.java | f04221985e8fa835052c58564aa2861714d806c5 | [] | no_license | DF-du/WeiZX | 745b8514e0f4fb62b7bd6784e71b83133bdca04a | d18aeeb2fc0ab1d7bc9d453e40421a90c4bed4da | refs/heads/master | 2022-11-29T12:13:53.664759 | 2020-08-12T06:09:19 | 2020-08-12T06:09:19 | 284,498,820 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package com.dlf.weizx.model;
import com.dlf.weizx.base.BaseModel;
import com.dlf.weizx.bean.NaviBean;
import com.dlf.weizx.net.HttpUtil;
import com.dlf.weizx.net.ResultCallBack;
import com.dlf.weizx.net.ResultSubscriber;
import com.dlf.weizx.net.RxUtils;
public class NaviModel extends BaseModel {
public void getData(final ResultCallBack<NaviBean> callBack) {
addDisposable(
HttpUtil.getInstance()
.getWanService()
.getNavi()
.compose(RxUtils.<NaviBean>rxSchedulerHelper())
.subscribeWith(new ResultSubscriber<NaviBean>() {
@Override
public void onNext(NaviBean naviBean) {
callBack.onSuccess(naviBean);
}
})
);
}
}
| [
"[email protected]"
] | |
5a970c4acbe3e2db0cabc42714f2aeb717b7e2c6 | 766905a2296632a6aa28e7fd6b90a96e8344c1fd | /app/src/main/java/com/ferran/taskinator/MainActivity.java | e56870ebd52d57249d58a6381dfafdea05c93d9c | [] | no_license | ferranramirez/Taskinator | ee2c708cb57f3bdd2159afc94f5acf05139e526b | 9c5ae5cf3dc1fe429d67bbf54e4bb93fa353567f | refs/heads/master | 2020-04-09T00:24:42.948647 | 2018-11-30T18:56:03 | 2018-11-30T18:56:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,502 | java | package com.ferran.taskinator;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.ferran.taskinator.tabs.AllFragment;
import com.ferran.taskinator.tabs.MonthFragment;
import com.ferran.taskinator.tabs.SomedayFragment;
import com.ferran.taskinator.tabs.TodayFragment;
public class MainActivity extends AppCompatActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
*/
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
mViewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mViewPager));
/*FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View view) {
final android.support.v4.app.FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
android.app.Fragment prev = getFragmentManager().findFragmentByTag("dialog");
ft.addToBackStack(null);
final MyDialogFragment dialogFragment = new InsertDialogFragment();
dialogFragment.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
Snackbar.make(view, "Task added", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
dialogFragment.show(ft, "dialog");
}
});*/
}
/*
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}*/
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(null, container, false);
//int tabNumber = getArguments().getInt(ARG_SECTION_NUMBER);
return rootView;
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
Fragment fragment;
if(position == 0) fragment = new TodayFragment();
else if(position == 1) fragment = new MonthFragment();
else if(position == 2) fragment = new SomedayFragment();
else fragment = new AllFragment();
return fragment;
}
@Override
public int getCount() {
// Show 4 total pages.
return 4;
}
}
}
| [
"[email protected]"
] | |
a2b72cdf8f04c037228f8629ce3b6e3ddbd86e5b | 2870a300ca7ae1950a5b10d953086595ffcc47f2 | /src/SS18/PROG2/UE/Adresse.java | 022e07ad4b87f28020191762e43781f7ad168ae3 | [] | no_license | annebond/BWI | d27f4f31a5a034dc83a394afa45a832087fd8961 | 46d04b9eb13082e966f7fa9391dd5356f8c09bfc | refs/heads/master | 2018-09-11T00:15:35.706289 | 2018-07-04T07:15:19 | 2018-07-04T07:15:19 | 108,734,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 114 | java | package SS18.PROG2.UE;
public class Adresse {
public String strasse;
public String PLZ;
public String Ort;
}
| [
"[email protected]"
] | |
a689a1472fed8ab6b9d6310c40fa3fdc46383e7f | fe8e180380a3b71e040cbfb482d16f37cb349c07 | /app/src/main/java/com/bitpops/barcode/Model/Transfer.java | 81e028ba38246c96b79948ead2e50020432c9d76 | [] | no_license | YadgarovIslombek/InventoryPortal | 11eb1242c86164ab1daa83de4238c13db7d02e60 | 2c30e1996e1c3179b7605d45d94628e2f6dad4c0 | refs/heads/master | 2022-04-01T11:15:25.922941 | 2020-02-05T21:21:08 | 2020-02-05T21:21:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.bitpops.barcode.Model;
public class Transfer {
public String from = "";
public String to = "";
public String sales_person_id = "";
public String sales_person_name = "";
public Transfer(String _from, String _to, String _sales_person_id, String _sales_person_name)
{
from = _from;
to = _to;
sales_person_id = _sales_person_id;
sales_person_name = _sales_person_name;
}
}
| [
"[email protected]"
] | |
2950f55dff53f84a2ee16f11e216d33332860145 | 94210bec6f4ebb0f76abab59c188289852c79b54 | /src/main/java/com/fileserver/app/works/bucket/BucketController.java | 20c1d780bf39f105033c3f5f6bd557c38fe1e5da | [] | no_license | ApilPokhrel/FileServer_V2 | a07d907139d0a9389b32570a1aa7b68aa05d1ffa | 1ce2f8cc7e47806780ed6c630182e0284d496629 | refs/heads/master | 2022-07-30T11:24:44.952079 | 2019-06-05T11:58:42 | 2019-06-05T11:58:42 | 189,935,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,063 | java | package com.fileserver.app.works.bucket;
import com.fileserver.app.config.Variables;
import com.fileserver.app.handler.DateAndTime;
import com.fileserver.app.handler.KeyGen;
import com.fileserver.app.works.bucket.entity.BucketModel;
import com.fileserver.app.works.bucket.entity.SaturationModel;
import com.fileserver.app.works.user.UserSchema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class BucketController {
Variables variables = new Variables();
private DateAndTime dateAndTime;
@Autowired
public BucketController(DateAndTime dateAndTime){
this.dateAndTime = dateAndTime;
}
public BucketSchema setBucket(BucketModel bucketModel, UserSchema user) throws Exception {
BucketSchema bucketSchema = null;
KeyGen keyGen = new KeyGen();
try {
List<String> methods = Arrays.asList(bucketModel.getAllowed_methods().split("\\s*,\\s*"));
if(bucketModel.getName().split(" ").length > 1){
throw new Exception("Name Cannot have space");
}
List<String> file_type = Arrays.asList(bucketModel.getAllowed_file_type().split("\\s*,\\s*"));
List<String> keys = Arrays.asList(bucketModel.getOwners().split("\\s*,\\s*"));
bucketSchema = new BucketSchema();
bucketSchema.setName(bucketModel.getName().toLowerCase());
bucketSchema.setThreshold(Integer.parseInt(bucketModel.getThreshold()));
bucketSchema.setAllowed_file_type(file_type);
bucketSchema.setAllowed_methods(methods);
bucketSchema.setSaturation(new SaturationModel(100000, 1, 0));
bucketSchema.setSize_used(0);
bucketSchema.setCreateAt(dateAndTime.isoTimeNow());
List<String> owners = new ArrayList<>();
owners.add(user.getKey().get(user.getKey().size() - 1));
if(keys != null) {
for (String key : keys) {
if(!key.trim().isEmpty()){
System.out.println(keyGen.decodeKey(key));
owners.add(key);
}
}
}
bucketSchema.setOwners(owners);
}catch (Exception ex){
throw new Exception(ex.getMessage());
}
return bucketSchema;
}
public void bucketFolder(String name) throws Exception {
name = name.toLowerCase().trim();
File file = new File(variables.SERVER_FOLDER+name);//Bucket Folder
File fileSat = new File(variables.SERVER_FOLDER+name+"/"+1);//Saturation Folder
try{
file.mkdir();
}catch(SecurityException ex){
throw new Exception(ex.getMessage());
}
try{
fileSat.mkdir();
}catch(SecurityException ex){
throw new Exception(ex.getMessage());
}
}
}
| [
"[email protected]"
] | |
240aa8d4e12f18434417868daf3a7f71bc8d9253 | 490429ac31f3fdec4b9ba27d6e840928e756ce76 | /src/main/java/com/bharath/ws/soap/dto/CreditCardInfo.java | 3ac2aa043d9946460751e7840e448b30d45defe6 | [] | no_license | rzuniga64/javafirstws | 3cc99858413cdaa38804477e2f14a52b0116f024 | a39c6b1f86b35a12b49e1befb00187effb52559d | refs/heads/master | 2020-04-26T06:12:09.888169 | 2019-03-02T07:23:13 | 2019-03-02T07:23:13 | 173,357,538 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package com.bharath.ws.soap.dto;
import java.util.Date;
import javax.xml.bind.annotation.XmlType;
@XmlType(name = "CreditCardInfo")
public class CreditCardInfo {
String cardNumber;
private Date expirtyDate;
String firstName;
String lastName;
String secCode;
String Address;
public String getCardNumber() {
return cardNumber;
}
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getSecCode() {
return secCode;
}
public void setSecCode(String secCode) {
this.secCode = secCode;
}
public String getAddress() {
return Address;
}
public void setAddress(String address) {
Address = address;
}
public Date getExpirtyDate() {
return expirtyDate;
}
public void setExpirtyDate(Date expirtyDate) {
this.expirtyDate = expirtyDate;
}
}
| [
"[email protected]"
] | |
448ba7eb4b1f723ade457adf85989b9c75595d07 | d433f3ac33d98a71be39d0e9be6ea6f80de4d2b0 | /src/main/java/com/accelad/automation/ltpsice/output/raw/RawFileInputStreamReader.java | 74d6c3c9260e08f073c807c838976b779f0c3b64 | [] | no_license | Lemania/ltspice-bridge | 68d7b1a276554c7a852cf6e7f98df2c7b14fc128 | 192bc484dc91fe9b5922ae2870204067a5ff6ae3 | refs/heads/master | 2020-03-26T13:49:56.835995 | 2017-01-22T12:22:09 | 2017-01-22T12:22:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,057 | java | package com.accelad.automation.ltpsice.output.raw;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteOrder;
import java.nio.charset.Charset;
public class RawFileInputStreamReader {
private static final Charset RAW_FILE_CHARSET = Charset.forName("UTF-16LE");
public static final int READ_BUFFER_SIZE = 65536;
private final DataInputStream dataInputStream;
public RawFileInputStreamReader(InputStream in) {
BufferedInputStream bis = new BufferedInputStream(in, READ_BUFFER_SIZE);
dataInputStream = new DataInputStream(bis);
}
public void close() throws IOException {
dataInputStream.close();
}
protected String readLine()
throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while (true) {
int data = dataInputStream.read();
baos.write(data);
if (data == -1)
return null;
if (data == '\n' || data == '\r') {
baos.write(dataInputStream.read());
break;
}
}
String string = new String(baos.toByteArray(), RAW_FILE_CHARSET);
return string.substring(0, string.length() - 1);
}
private Complex readDoubleComplex() throws IOException {
double real = readDouble();
double imaginary = readDouble();
return new Complex(real, imaginary);
}
double readDouble() throws IOException {
long longValue = dataInputStream.readLong();
if (ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN)
longValue = Long.reverseBytes(longValue);
return Double.longBitsToDouble(longValue);
}
float readFloat() throws IOException {
int lt = dataInputStream.readInt();
if (ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN)
lt = Integer.reverseBytes(lt);
return Float.intBitsToFloat(lt);
}
}
| [
"[email protected]"
] | |
41c859dd50441825abe618a768ba4d171ca8dd01 | d93a5c3107021baa241372592446a66b692ff03e | /Lab3/src/userInterface/ViewAccountJPanel.java | b51863129624fc7c056ee577400ac9398960a45c | [] | no_license | rohan-kapadnis/Application-Engineering-And-Development | db4ab0d15033c56bd20281213abb690d69018611 | 02215999bb447a82de0c244767badb0be4b40b88 | refs/heads/master | 2021-01-03T11:34:17.611315 | 2020-02-12T17:35:23 | 2020-02-12T17:35:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,715 | 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 userInterface;
import business.Account;
import java.awt.CardLayout;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author rohan
*/
public class ViewAccountJPanel extends javax.swing.JPanel {
private JPanel userProcessContainer;
private Account account;
/**
* Creates new form ViewAccountJPanel
*/
ViewAccountJPanel(JPanel userProcessContainer, Account account) {
initComponents();
this.userProcessContainer = userProcessContainer;
this.account = account;
populateAccountDetails();
btnSave.setEnabled(false);
btnUpdate.setEnabled(true);
}
private void populateAccountDetails(){
txtRoutingNumber.setText(account.getRoutingNumber());
txtAccountNumber.setText(account.getAccountNumber());
txtBankName.setText(account.getBankName());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
txtRoutingNumber = new javax.swing.JTextField();
txtAccountNumber = new javax.swing.JTextField();
txtBankName = new javax.swing.JTextField();
btnBack = new javax.swing.JButton();
btnSave = new javax.swing.JButton();
btnUpdate = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setPreferredSize(new java.awt.Dimension(900, 600));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setText("Create Account");
jLabel2.setText("Routing Number:");
jLabel3.setText("Account Number:");
jLabel4.setText("Bank Name:");
txtRoutingNumber.setEnabled(false);
txtRoutingNumber.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtRoutingNumberActionPerformed(evt);
}
});
txtAccountNumber.setEnabled(false);
txtBankName.setEnabled(false);
btnBack.setText("<<Back");
btnBack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnBackActionPerformed(evt);
}
});
btnSave.setText("Save");
btnSave.setEnabled(false);
btnSave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSaveActionPerformed(evt);
}
});
btnUpdate.setText(" Update");
btnUpdate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateActionPerformed(evt);
}
});
jLabel5.setText("View Account");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(btnBack))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(99, 99, 99)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(92, 92, 92))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5)
.addGap(24, 24, 24)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnSave)
.addGap(18, 18, 18)
.addComponent(btnUpdate))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtBankName, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
.addComponent(txtAccountNumber)
.addComponent(txtRoutingNumber))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 764, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(56, 56, 56)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtRoutingNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtAccountNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel4)
.addGap(6, 6, 6))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addGap(90, 90, 90)
.addComponent(txtBankName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(29, 29, 29)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnSave)
.addComponent(btnUpdate))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 180, Short.MAX_VALUE)
.addComponent(btnBack)
.addGap(179, 179, 179))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 900, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 600, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
);
}// </editor-fold>//GEN-END:initComponents
private void txtRoutingNumberActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtRoutingNumberActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_txtRoutingNumberActionPerformed
private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBackActionPerformed
// TODO add your handling code here:
userProcessContainer.remove(this);
CardLayout layout = (CardLayout) userProcessContainer.getLayout();
layout.previous(userProcessContainer);
}//GEN-LAST:event_btnBackActionPerformed
private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUpdateActionPerformed
// TODO add your handling code here:
txtRoutingNumber.setEnabled(true);
txtAccountNumber.setEnabled(true);
txtBankName.setEnabled(true);
btnSave.setEnabled(true);
btnUpdate.setEnabled(false);
}//GEN-LAST:event_btnUpdateActionPerformed
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
// TODO add your handling code here:
account.setRoutingNumber(txtRoutingNumber.getText());
account.setAccountNumber(txtAccountNumber.getText());
account.setBankName(txtBankName.getText());
btnSave.setEnabled(false);
btnUpdate.setEnabled(true);
JOptionPane.showMessageDialog(null,"Account updated Successfully");
}//GEN-LAST:event_btnSaveActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnBack;
private javax.swing.JButton btnSave;
private javax.swing.JButton btnUpdate;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField txtAccountNumber;
private javax.swing.JTextField txtBankName;
private javax.swing.JTextField txtRoutingNumber;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
f4ecf99bda02afc11284cc4bfdc44628e6f8e23f | 8946b569c02af825f060826747f86d48a8b968d1 | /1JavaWorkBench/BaiduApi/src/main/java/util/Const.java | facc70483a9a6b7cfd14dd71eff5adc3b1564787 | [] | no_license | chrgu000/MyProject-1 | 312aa357114ec514368ecad034c5819215bf33fa | d9c7344b7a22c8c67b7450d80b0e3cdbfed36ea1 | refs/heads/master | 2020-05-22T14:56:05.613471 | 2018-08-31T06:59:15 | 2018-08-31T06:59:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 114 | java | package util;
public class Const {
public static final String PropertyPath = "config/myConfig.properites";
}
| [
"[email protected]"
] | |
c68003b85d9613f111ed2d4cda1047bf0d97fb86 | 2d616ab5bd61d8412bb6fe52525b55197e1809b6 | /de.hannesniederhausen.storynotes.model/src-gen/de/hannesniederhausen/storynotes/model/impl/GenericCategoryImpl.java | 17d2b799eb907bb0e14dd1883be55030cfae33f6 | [] | no_license | hannesN/storynotes | 011c0e6f1e38f23f5762ae82a440795061393148 | 8a67b8b5567a1f2074432b331d94736fb824782c | refs/heads/master | 2021-01-10T20:25:42.357158 | 2014-11-10T01:09:13 | 2014-11-10T01:09:13 | 1,959,676 | 0 | 0 | null | 2014-11-10T01:09:14 | 2011-06-27T10:46:07 | Java | UTF-8 | Java | false | false | 1,191 | java | /**
* Copyright (c) 2011 Hannes Niederhausen.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Hannes Niederhausen - Initial API and implementation
*
*/
package de.hannesniederhausen.storynotes.model.impl;
import de.hannesniederhausen.storynotes.model.GenericCategory;
import de.hannesniederhausen.storynotes.model.StorynotesPackage;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Generic Category</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class GenericCategoryImpl extends CategoryImpl implements
GenericCategory {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GenericCategoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StorynotesPackage.Literals.GENERIC_CATEGORY;
}
} //GenericCategoryImpl
| [
"[email protected]"
] | |
b4107b99f2bab7b350a66a5a535eea0b9ce04e70 | f3e3166668717891b15fd822a7bd180d724377e7 | /KnifesEdge/src/main/java/com/knifesedge/controllers/AuthController.java | ac12f1060b8d836b581117e0ed932f61ffbcc07b | [] | no_license | CWRiddle/KnifesEdge | d0d6b148fb404b60297ca8b352ec9e6575443dd1 | 44514089337153d163a0c7377dcf549537a62e80 | refs/heads/main | 2023-08-16T02:37:26.189115 | 2021-10-16T17:04:28 | 2021-10-16T17:04:28 | 417,892,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,064 | java | package com.knifesedge.controllers;
import java.security.Principal;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.knifesedge.entities.User;
import com.knifesedge.services.AuthService;
import com.knifesedge.services.UserService;
@RestController
public class AuthController {
@Autowired
private AuthService authService;
@Autowired
private UserService uService;
@PostMapping("register")
public User register(@RequestBody User user, HttpServletResponse res) {
if (user == null) {
res.setStatus(400);
}
user = authService.register(user);
return user;
}
@GetMapping("authenticate")
public User authenticate(Principal principal) {
return uService.findByUsername(principal.getName());
}
}
| [
"[email protected]"
] | |
a625069a3a753fc2d5394b0497347b6176aaba2c | c69f2a524369c03bf68cc474c37d06ebdd197612 | /app/src/main/java/com/yunkakeji/alibabademo/base/fragment/EventBusFragment.java | 2d8e311679aea9150f2692e7d492ddc8aba49102 | [] | no_license | 2253355063/AlibabaDemo | 880f77794100ffad43ee754ae31d08def77c76f6 | 5f976dd7997f98656989b42f48d465c37204c2fd | refs/heads/master | 2020-11-25T17:27:59.147900 | 2019-12-18T06:23:56 | 2019-12-18T06:23:56 | 228,772,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 996 | java | package com.yunkakeji.alibabademo.base.fragment;
import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.JsonObject;
import com.yunkakeji.alibabademo.net.basic.JsonTag;
import org.simple.eventbus.EventBus;
import org.simple.eventbus.Subscriber;
import org.simple.eventbus.ThreadMode;
import androidx.fragment.app.Fragment;
/**
* Fragment抽象类
* Fragment中事件总线的注册和取消
* 事件总线消息接收和显示
*/
public abstract class EventBusFragment extends Fragment {
@Override
public void onResume() {
super.onResume();
EventBus.getDefault().register(this);
}
@Override
public void onPause() {
super.onPause();
EventBus.getDefault().unregister(this);
}
@Subscriber(mode = ThreadMode.MAIN)
protected void receive(JsonObject jsonObject) {
if (jsonObject.has(JsonTag.TAG_ERROR)) {
ToastUtils.showShort(jsonObject.get(JsonTag.TAG_ERROR).getAsString());
}
}
}
| [
"[email protected]"
] | |
39e92f362dd27394da462cd77fc34cfbc4f785a5 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2018/4/FileUserRepository.java | 4eb0f85cd4d06223f88eaca2b5736147d2482817 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,640 | java | /*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.server.security.auth;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.kernel.impl.security.User;
import org.neo4j.logging.Log;
import org.neo4j.logging.LogProvider;
import org.neo4j.server.security.auth.exception.FormatException;
import static org.neo4j.server.security.auth.ListSnapshot.FROM_MEMORY;
import static org.neo4j.server.security.auth.ListSnapshot.FROM_PERSISTED;
/**
* Stores user auth data. In memory, but backed by persistent storage so changes to this repository will survive
* JVM restarts and crashes.
*/
public class FileUserRepository extends AbstractUserRepository
{
private final File authFile;
private final FileSystemAbstraction fileSystem;
// TODO: We could improve concurrency by using a ReadWriteLock
private final Log log;
private final UserSerialization serialization = new UserSerialization();
public FileUserRepository( FileSystemAbstraction fileSystem, File file, LogProvider logProvider )
{
this.fileSystem = fileSystem;
this.authFile = file;
this.log = logProvider.getLog( getClass() );
}
@Override
public void start() throws Throwable
{
clear();
ListSnapshot<User> onDiskUsers = readPersistedUsers();
if ( onDiskUsers != null )
{
setUsers( onDiskUsers );
}
}
@Override
protected ListSnapshot<User> readPersistedUsers() throws IOException
{
if ( fileSystem.fileExists( authFile ) )
{
long readTime;
List<User> readUsers;
try
{
readTime = fileSystem.lastModifiedTime( authFile );
readUsers = serialization.loadRecordsFromFile( fileSystem, authFile );
}
catch ( FormatException e )
{
log.error( "Failed to read authentication file \"%s\" (%s)",
authFile.getAbsolutePath(), e.getMessage() );
throw new IllegalStateException( "Failed to read authentication file: " + authFile );
}
return new ListSnapshot<>( readTime, readUsers, FROM_PERSISTED );
}
return null;
}
@Override
protected void persistUsers() throws IOException
{
serialization.saveRecordsToFile( fileSystem, authFile, users );
}
@Override
public ListSnapshot<User> getPersistedSnapshot() throws IOException
{
if ( lastLoaded.get() < fileSystem.lastModifiedTime( authFile ) )
{
return readPersistedUsers();
}
synchronized ( this )
{
return new ListSnapshot<>( lastLoaded.get(), new ArrayList<>( users ), FROM_MEMORY );
}
}
}
| [
"[email protected]"
] | |
15e7d8ea27ca6c19f2862d4d9aec244f6119077f | 591d83511d8c43f7d0bd6a66318e298885104591 | /app/src/main/java/com/franvara/sports/app/main/MainActivity.java | c63792b490650ac8a2cad511820ac4f0b06337c5 | [] | no_license | franvara/Sports | 446f3323e93a424b51afe5cf4d565030b9c5cdfc | b8872015c26f28516b0b54d6c11f5bdeda4388bb | refs/heads/master | 2020-04-09T10:13:28.628670 | 2018-12-03T22:47:42 | 2018-12-03T22:47:42 | 160,262,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,047 | java | package com.franvara.sports.app.main;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Toast;
import com.franvara.sports.Injector;
import com.franvara.sports.R;
import com.franvara.sports.app.utils.GenericUtils;
import com.franvara.sports.domain.model.Player;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
public class MainActivity extends AppCompatActivity
implements IMainView {
//region Fields & Constants
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.rv_main)
RecyclerView recyclerView;
@BindView(R.id.srl_main)
SwipeRefreshLayout swipeRefreshLayout;
@BindView(R.id.fl_progress_container)
FrameLayout fl_progress_container;
Unbinder unbinder;
private MainPresenter mPresenter;
private MainRVAdapter rvAdapter;
//endregion
//region Lifecycle
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
unbinder = ButterKnife.bind(this);
setSupportActionBar(toolbar);
mPresenter = new MainPresenter(this, Injector.provideUseCaseHandler(),
Injector.provideGetPlayersUseCase(this));
mPresenter.loadPlayers();
}
@Override
public void onResume() {
super.onResume();
}
@Override
protected void onDestroy() {
super.onDestroy();
unbinder.unbind();
}
//endregion
//region IMainView implementation
@Override
public void presentRecyclerView() {
recyclerView.setHasFixedSize(true);
final LinearLayoutManager llm = new LinearLayoutManager(this);
recyclerView.setLayoutManager(llm);
rvAdapter = new MainRVAdapter();
recyclerView.setAdapter(rvAdapter);
}
@Override
public void setupSwipeRefresh() {
swipeRefreshLayout.setOnRefreshListener(() -> {
mPresenter.loadPlayers();
swipeRefreshLayout.setRefreshing(false);
});
}
@Override
public void addPlayersToList(List<Player> playerList) {
swipeRefreshLayout.setRefreshing(false);
rvAdapter.addPlayers(playerList);
if (!GenericUtils.isNetworkConnectionAvailable(this)) showToast(getString(R.string.no_internet_connection));
}
@Override
public void showToast(String error) {
Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
}
@Override
public void showProgress() {
fl_progress_container.setVisibility(View.VISIBLE);
}
@Override
public void hideProgress() {
fl_progress_container.setVisibility(View.GONE);
}
//endregion
}
| [
"[email protected]"
] | |
e46111d9558c99ea18de382163e423ad40213442 | b305c071aed5398adcd57dd4dfdb12a7209c9f50 | /inmobiliaria-web/src/main/java/com/proinsalud/sistemas/web/digital_turn/DigitalTurnSliderBean.java | 9b5912ff08f2007cdc5b9de77a1edb6ba0058842 | [] | no_license | johnefe/inmobiliariav2 | d99be77efc726718d6be7551b368ea444d9db850 | 5212593e3f98d2040c0fe66fc598743fe8a982bb | refs/heads/master | 2020-03-20T22:23:19.401521 | 2018-06-19T23:00:21 | 2018-06-19T23:00:21 | 137,795,903 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,260 | java | package com.proinsalud.sistemas.web.digital_turn;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.apache.commons.logging.Log;
import org.primefaces.event.FileUploadEvent;
import org.primefaces.model.UploadedFile;
import org.springframework.beans.factory.annotation.Autowired;
import com.proinsalud.sistemas.core.digital_turn.model.Slider;
import com.proinsalud.sistemas.core.digital_turn.service.ISliderService;
import com.proinsalud.sistemas.web.util.App;
import com.proinsalud.sistemas.web.util.UtilWeb;
/**
* @author Ingeniero Jhon Frey Diaz
* @datetime 22/02/2018 - 3:15:29 p. m.
*/
@ManagedBean
@ViewScoped
public class DigitalTurnSliderBean implements Serializable {
private static final long serialVersionUID = -924733383539179402L;
private static final Log LOG = App.getLogger(DigitalTurnSliderBean.class);
@Autowired
private ISliderService iSliderService;
private UploadedFile uploadFile;
private InputStream inputStream;
private List<Slider> sliders;
private Slider slider;
private String destination = "H:\\proinsaludv3\\proinsaludApp\\proinsalud-web\\src\\main\\webapp\\resources\\assets\\img\\";
private boolean showForm;
private boolean crearDiapositiva;
private boolean updateDiapositiva;
public DigitalTurnSliderBean() {
super();
}
@PostConstruct
public void init() {
App.initInjectionAutowired(this);
slider = new Slider();
sliders = iSliderService.findAllEntity();
}
public void loadDiapositivaSlider(Slider diapositiva) {
try {
updateDiapositiva = true;
showForm=true;
slider = iSliderService.findEntityById(diapositiva.getId());
} catch (Exception e) {
UtilWeb.printError(LOG, e);
}
}
public void createSlider() {
try {
uploadIcon();
if(slider.getUrlImage() !=null) {
slider=iSliderService.persistEntity(slider);
}
} catch (Exception e) {
UtilWeb.printError(LOG, e);
}
cancel();
}
public void updateDiapositiva() {
try {
uploadIcon();
if (slider != null) {
if (slider.getId() != null) {
slider = iSliderService.mergeEntity(slider);
uploadFile = null;
}
cancel();
init();
}
} catch (Exception e) {
UtilWeb.printError(LOG, e);
}
}
public void formSlider() {
crearDiapositiva = true;
showForm=true;
}
public void uploadIcon() throws Exception {
try {
if (uploadFile != null && !uploadFile.getFileName().isEmpty()) {
slider.setUrlImage(uploadFile.getFileName());
copyFile(uploadFile.getFileName(), uploadFile.getInputstream());
}
} catch (IOException e) {
UtilWeb.printError(LOG, e);
throw new Exception(e);
}
}
public void uploadFile(FileUploadEvent event) {
uploadFile = event.getFile();
try {
inputStream = uploadFile.getInputstream();
} catch (IOException e) {
e.printStackTrace();
}
}
public void copyFile(String fileName, InputStream in) {
try {
OutputStream out = new FileOutputStream(new File(destination + fileName));
int read = 0;
byte[] bytes = new byte[1024];
while ((read = in.read(bytes)) != -1) {
out.write(bytes, 0, read);
}
in.close();
out.flush();
out.close();
} catch (IOException e) {
UtilWeb.printError(LOG, e);
}
}
public void cancel() {
init();
showForm = false;
updateDiapositiva=false;
crearDiapositiva=false;
}
public List<Slider> getSliders() {
return sliders;
}
public Slider getSlider() {
return slider;
}
public void setSlider(Slider slider) {
this.slider = slider;
}
public boolean isShowForm() {
return showForm;
}
public UploadedFile getUploadFile() {
return uploadFile;
}
public void setUploadFile(UploadedFile uploadFile) {
this.uploadFile = uploadFile;
}
public InputStream getInputStream() {
return inputStream;
}
public void setInputStream(InputStream inputStream) {
this.inputStream = inputStream;
}
public boolean isCrearDiapositiva() {
return crearDiapositiva;
}
public boolean isUpdateDiapositiva() {
return updateDiapositiva;
}
}
| [
"[email protected]"
] | |
7c325afb290a6e48db467a84f42a3791e5648fed | 87b99b5ee2dd5b7c3200b9e544aeb03226f179be | /src/join/ProducerConsumerTest.java | d7752b3dc4bd9dc4e6ff86a5ec068bd5e9867218 | [] | no_license | cendi2005/thread | ba23f14db98b1a99529425ae1fa0009f0297cd6c | 8630ece2d234eef7c7c61cc827821301f106d71c | refs/heads/master | 2021-01-20T08:30:49.071561 | 2018-02-13T13:53:19 | 2018-02-13T13:53:19 | 90,157,387 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | package join;
public class ProducerConsumerTest {
public static void main(String[] args) {
PublicResource resource = new PublicResource();
new Thread(new ProducerThread(resource)).start();
new Thread(new ConsumerThread(resource)).start();
new Thread(new ProducerThread(resource)).start();
new Thread(new ConsumerThread(resource)).start();
new Thread(new ProducerThread(resource)).start();
new Thread(new ConsumerThread(resource)).start();
}
}
| [
"[email protected]"
] | |
a595c88f0522da1a0d69a5721fa2499d09b3539e | 48b576ff495f14787ec343f48d30c7a9edb49375 | /Scheduling/ShortestJobFirst.java | a977285212e0e61f33f462daf2b6b653aaea3bdc | [] | no_license | Taenerys/GUI_OS_Project | f4f8143b74141870fdf5727d0c73402b4d0dccc6 | a253106919ae74f642371d8e24b84c15bb33d1eb | refs/heads/master | 2022-07-07T01:01:16.757539 | 2020-05-17T00:40:48 | 2020-05-17T00:40:48 | 260,992,198 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,854 | java | package Scheduling;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.util.Comparator;
import java.util.Random;
import java.util.ArrayList;
class Job {
//field variables for the job
private int processTime;
private int timeRemaining;
private int timeArrival;
private int id;
//constructor to intialize time remaining and arrival time
public Job(int id, int processTime, int timeArrival) {
this.id = id;
this.processTime = processTime;
this.timeRemaining = processTime;
this.timeArrival = timeArrival;
}
public int getId(){
return id;
}
public int getProcessTime() {
return processTime;
}
//setter for time remaining
public void setTimeRemaining(int timeRemaining) {
this.timeRemaining = timeRemaining;
}
//getter for time remaining
public int getTimeRemaining() {
return timeRemaining;
}
//getter for time arrival
public int getTimeArrival() {
return timeArrival;
}
@Override
public String toString() {
return "Job{" +
"processTime=" + processTime +
", timeRemaining=" + timeRemaining +
", timeArrival=" + timeArrival +
'}';
}
}
/**
* This class extends Scheduler using shortest process next
*/
class ShortestProcessNext extends Scheduler {
public ShortestProcessNext(){
super();
}
//implement the sort method for the shortest time remaining scheduler
protected void sort(){
//sorts the queued jobs on custom comparator (time remaining)
queued_jobs.sort(new Comparator<Job>() {
@Override
public int compare(Job o1, Job o2) {
if(o1.getProcessTime() < o2.getProcessTime()){
return -1;
}
else if(o1.getProcessTime() > o2.getProcessTime()){
return 1;
}
else{
return 0;
}
}
});
}
}
/**
* This class extends Scheduler using shortest time remaining
*/
class ShortestTimeRemaining extends Scheduler{
public ShortestTimeRemaining(){
//intialize all variables
super();
}
//implement the sort method for the shortest time remaining scheduler
protected void sort(){
//sorts the queued jobs on custom comparator (time remaining)
queued_jobs.sort(new Comparator<Job>() {
@Override
public int compare(Job o1, Job o2) {
if(o1.getTimeRemaining() < o2.getTimeRemaining()){
return -1;
}
else if(o1.getTimeRemaining() > o2.getTimeRemaining()){
return 1;
}
else{
return 0;
}
}
});
}
}
/**
* This class represents a scheduler
* It uses a priority queue under the hood
* Schedulers should inherit from this one to implement the priority queue
*/
public class Scheduler {
//instance variables
protected ArrayList<Job> all_jobs;
protected ArrayList<Job> queued_jobs;
protected ArrayList<Job> finished_jobs;
protected int cycleCount;
private ArrayList<Job> gant;
//Constructor initializes everything
public Scheduler() {
all_jobs = new ArrayList<Job>();
queued_jobs = new ArrayList<Job>();
finished_jobs = new ArrayList<Job>();
gant = new ArrayList<Job>();
cycleCount = 0;
}
/**
* Adds a job to the future jobs array
* @param j the job to add
*/
public void addJob(Job j){
all_jobs.add(j);
}
public ArrayList<Job> getAll_jobs() {
return all_jobs;
}
| [
"[email protected]"
] | |
b6a7bcad9a7b5a31f9af18b27c822ff5efc8fe72 | daade325bc943b1f212801eb056ec60781f94706 | /code/MyApplication/app/src/main/java/com/example/myapplication/Activity/OfflineReservationActivity.java | eac5546d6162c99ad86e0bb3afd6200f51df2663 | [] | no_license | Vin616161/Telehealth | 8b27c04fe722796cdb93421e07b0b17f573c8329 | a756411f6e86b5ced82d02efda1cf4a69541f600 | refs/heads/master | 2020-07-10T14:41:10.939676 | 2019-08-25T11:50:45 | 2019-08-25T11:50:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,700 | java | package com.example.myapplication.Activity;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import com.example.myapplication.R;
import com.example.myapplication.Utils.Constant;
import com.example.myapplication.Utils.NetRequestService;
import com.example.myapplication.View.TitleLayout;
import java.util.Calendar;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
public class OfflineReservationActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener ,View.OnClickListener{
private TitleLayout titleLayout;
private Spinner distance;
private Spinner language;
private Spinner sex;
private static String dis;
private static String lan;
private static String ssex;
private Button search;
private LinearLayout time;
private int mYear;
private int mMonth;
private int mDay;
private TextView textView;
private int diseaseId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_offline_reservation);
ActionBar actionBar=getSupportActionBar();
if(actionBar != null){
actionBar.hide();
}
textView=findViewById(R.id.time_text);
titleLayout = findViewById(R.id.title);
titleLayout.setTitle("线下预约");
titleLayout.setNextGone();
titleLayout.setOnBackClickListener(new TitleLayout.OnBackClickListener() {
@Override
public void onMenuBackClick() {
finish();
}
});
search=(Button)findViewById(R.id.search_button);
search.setOnClickListener(this);
time=findViewById(R.id.time);
time.setOnClickListener(this);
distance=(Spinner)findViewById(R.id.distance);
language=(Spinner)findViewById(R.id.language);
sex=(Spinner)findViewById(R.id.sex);
ArrayAdapter<CharSequence> adapter1 = ArrayAdapter.createFromResource(
OfflineReservationActivity.this, R.array.distance_array,
android.R.layout.simple_spinner_item);
adapter1.setDropDownViewResource(R.layout.spinner_item);
distance.setAdapter(adapter1);
ArrayAdapter<CharSequence> adapter2 = ArrayAdapter.createFromResource(
OfflineReservationActivity.this, R.array.language_array,
android.R.layout.simple_spinner_item);
adapter2.setDropDownViewResource(R.layout.spinner_item);
language.setAdapter(adapter2);
ArrayAdapter<CharSequence> adapter3 = ArrayAdapter.createFromResource(
OfflineReservationActivity.this, R.array.sex_array,
android.R.layout.simple_spinner_item);
adapter2.setDropDownViewResource(R.layout.spinner_item);
sex.setAdapter(adapter3);
distance.setOnItemSelectedListener(this);
language.setOnItemSelectedListener(this);
sex.setOnItemSelectedListener(this);
Intent intent=getIntent();
diseaseId=intent.getIntExtra("diseaseId",0);
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
switch (adapterView.getId()){
case R.id.distance:
dis =adapterView.getItemAtPosition(i).toString();
break;
case R.id.language:
lan=adapterView.getItemAtPosition(i).toString();
break;
case R.id.sex:
ssex=adapterView.getItemAtPosition(i).toString();
break;
default:
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
finish();
}
return true;
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.search_button:
Intent intent=new Intent(OfflineReservationActivity.this,OfflineDoctorActivity.class);
intent.putExtra("time",textView.getText().toString());
intent.putExtra("diseaseId",diseaseId);
startActivity(intent);
break;
case R.id.time:
Calendar calendar=Calendar.getInstance();
mYear=calendar.get(Calendar.YEAR);
mMonth=calendar.get(Calendar.MONTH);
mDay=calendar.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dialog=new DatePickerDialog(OfflineReservationActivity.this, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
mYear=year;
mMonth=month;
mDay=dayOfMonth;
textView.setText(String.valueOf(mYear)+"-"+String.valueOf(mMonth+1)+"-"+String.valueOf(mDay));
}
},mYear,mMonth,mDay);
dialog.show();
break;
}
}
}
| [
"[email protected]"
] | |
56986f5283e4543e13561fcc5927105f42106998 | d2b4b6ac33c126418383957bce0931829c6a82cd | /SumRootToLeafNumbers.java | 918445f2eb77f3595f13eaa24d29e23590fe46c5 | [] | no_license | raninagare/Trees-2 | dca86a7ae7d15e333bd3f4d80ddbc17e19085712 | 26b014dafab5423f7223aeeb6a59319fa6b8b111 | refs/heads/master | 2022-07-22T03:31:52.557246 | 2020-05-14T02:30:57 | 2020-05-14T02:30:57 | 263,780,325 | 0 | 0 | null | 2020-05-14T01:03:13 | 2020-05-14T01:03:13 | null | UTF-8 | Java | false | false | 2,772 | java | package com.ds.rani.tree;
import java.util.Stack;
/**
* Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
*
* An example is the root-to-leaf path 1->2->3 which represents the number 123.
*
* Find the total sum of all root-to-leaf numbers.
*
* Note: A leaf is a node with no children.
*
* Example:
*
* Input: [1,2,3]
* 1
* / \
* 2 3
* Output: 25
* Explanation:
* The root-to-leaf path 1->2 represents the number 12.
* The root-to-leaf path 1->3 represents the number 13.
* Therefore, sum = 12 + 13 = 25.
* Example 2:
*
* Input: [4,9,0,5,1]
* 4
* / \
* 9 0
* / \
* 5 1
* Output: 1026
* Explanation:
* The root-to-leaf path 4->9->5 represents the number 495.
* The root-to-leaf path 4->9->1 represents the number 491.
* The root-to-leaf path 4->0 represents the number 40.
* Therefore, sum = 495 + 491 + 40 = 1026.
*/
//Approach:Using inorder traversal approach,while traversing I am maining stack of visited nodes
// and sum from root to that node
//Time Complexity:o(n) where n is number of nodes
//Space Complexity: o(h) where h is height of the tree
public class SumRootToLeafNumbers {
/**
* find sum
* @param root root node of tree
* @return sum
*/
public int sumNumbers(TreeNode root) {
return helper( root );
}
/**
*
* @param root
* @return
*/
int helper(TreeNode root) {
int result = 0;
int sum = 0;
//For null tree
if (root == null)
return result;
//Maintain Pair of Node,sum(sum form root to that node)
Stack<Pair> stack = new Stack<>();
TreeNode curr = root;
//Inorder traversal
while (!stack.isEmpty() || curr != null) {
//go on left
if (curr != null) {
sum = sum * 10 + curr.val;
stack.push( new Pair( curr, sum ) );
curr = curr.left;
} else {
//curr is null here so pop value from
Pair pair = stack.pop();
curr = pair.getNode();
sum = pair.getSum();
if (curr.left == null && curr.right == null)
result = result + sum;
curr = curr.right;
}
}
return result;
}
}
/**
* TreeNode class
*/
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
}
}
class Pair {
TreeNode node;
int sum;
Pair(TreeNode node, int sum) {
this.node = node;
this.sum = sum;
}
public TreeNode getNode() {
return node;
}
public int getSum() {
return sum;
}
}
| [
"[email protected]"
] | |
f3785433046c26b3ec35a6648993941b3005540f | e4ad8db240e4a1d0b8cef27da7a6d62cf6e19667 | /app/src/main/java/basti/coryphaei/com/blankboard/ScannerUtils.java | da34ff2c44929111514d5642d8d0b2631bc2d338 | [] | no_license | basti-shi031/BlankBoard | 9a7fe21cf10a5277b8022ba6c824f093a184b298 | 0559bce30beb1569580393fe6f171610a64692fb | refs/heads/master | 2021-01-10T14:03:01.601185 | 2015-11-05T08:53:48 | 2015-11-05T08:53:48 | 45,599,188 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,270 | java | package basti.coryphaei.com.blankboard;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
/**
* @author: HouSheng
*
* @类 说 明: 图片扫描工具类
*/
public class ScannerUtils {
// 扫描的三种方式
public static enum ScannerType {
RECEIVER, MEDIA
}
// 首先保存图片
public static boolean saveImageToGallery(Context context, Bitmap bitmap, ScannerType type) {
boolean saveSuccess = false;
File appDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"blankboard");
if (!appDir.exists()) {
// 目录不存在 则创建
appDir.mkdirs();
}
String fileName = System.currentTimeMillis() + ".jpg";
File file = new File(appDir, fileName);
try {
FileOutputStream fos = new FileOutputStream(file);
bitmap.compress(CompressFormat.JPEG, 100, fos); // 保存bitmap至本地
fos.flush();
fos.close();
saveSuccess = true;
} catch (Exception e) {
e.printStackTrace();
} finally {
if (type == ScannerType.RECEIVER) {
ScannerByReceiver(context, file.getAbsolutePath());
} else if (type == ScannerType.MEDIA) {
ScannerByMedia(context, file.getAbsolutePath());
}
if (!bitmap.isRecycled()) {
// bitmap.recycle(); 当存储大图片时,为避免出现OOM ,及时回收Bitmap
System.gc(); // 通知系统回收
}
}
return saveSuccess;
}
/** Receiver扫描更新图库图片 **/
private static void ScannerByReceiver(Context context, String path) {
context.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"
+ path)));
Log.v("TAG", "receiver scanner completed");
}
/** MediaScanner 扫描更新图片图片 **/
private static void ScannerByMedia(Context context, String path) {
MediaScannerConnection.scanFile(context, new String[] {path}, null, null);
Log.v("TAG", "media scanner completed");
}
}
| [
"[email protected]"
] | |
5e7396358ff54ceea9354a0335c03d707932c9df | 66308199f3e6025b2e54b2efe4b40420534f3a66 | /Slackpad.java | ef02a21c5c34f71dea61d32c39decb886bbccef0 | [] | no_license | mattss/slackerpad | 9117e8787dae3eab6f887f874515d9e7493c2d7e | d82db2cd72922d8effdd225da076090f52108dd6 | refs/heads/master | 2020-12-06T07:41:59.219377 | 2016-09-07T15:07:57 | 2016-09-07T15:07:57 | 67,614,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,684 | java | /* Matthew Sital-Singh
ms1473
COMS12100 Assignment: Scene
*/
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.filechooser.*;
/** Slackpad.java
Slackpad is a work-avoidance tool which simulates
a normal text editor.
However, when in 'Slacker mode', the program
will respond to keystrokes by printing out the contents
of the file last 'opened'.
**/
public class Slackpad extends JFrame {
/** Main constructor
Draws GUI components to the frame
and makes it visible
*/
public Slackpad() {
note = this;
Container panel = getContentPane();
GridBagLayout gbl = new GridBagLayout();
panel.setLayout(gbl);
GridBagConstraints gbc = new GridBagConstraints();
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.fill = GridBagConstraints.BOTH;
panel.add(scrollview, gbc);
ImageIcon icon = getMyImage("slack.gif");
setIconImage(icon.getImage());
setSize(800, 600);
setTitle("Slackpad");
addWindowListener(new CloseWindow());
setJMenuBar(mainBar);
mainBar.setLayout(new BorderLayout());
mainBar.add(menuBar, BorderLayout.NORTH);
menuBar.add(fileMenu);
fileMenu.setMnemonic('F');
fileMenu.add(newMenuItem);
fileMenu.add(openMenuItem);
fileMenu.add(exitMenuItem);
menuBar.add(toolsMenu);
toolsMenu.setMnemonic('T');
toolsMenu.add(modeCheckBox);
toolsMenu.add(setTitleMenuItem);
toolsMenu.add(skipMenuItem);
menuBar.add(helpMenu);
helpMenu.setMnemonic('H');
helpMenu.add(aboutMenuItem);
helpMenu.add(readmeMenuItem);
Ears menuEars = new Ears();
String[] tmp = lib.getNames();
for (int i=0; i < tmp.length; i++) {
StoryMenuItem smi = new StoryMenuItem(tmp[i]);
smi.addActionListener(menuEars);
storyMenuItem.add(smi);
}
toolsMenu.add(storyMenuItem);
newButton = new JButton(getMyImage("new.gif"));
openButton = new JButton(getMyImage("open.gif"));
newButton.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
mainBar.add(buttonBar, BorderLayout.SOUTH);
buttonBar.add(newButton);
openButton.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
buttonBar.add(openButton);
newMenuItem.addActionListener(menuEars);
openMenuItem.addActionListener(menuEars);
exitMenuItem.addActionListener(menuEars);
modeCheckBox.addActionListener(menuEars);
setTitleMenuItem.addActionListener(menuEars);
skipMenuItem.addActionListener(menuEars);
aboutMenuItem.addActionListener(menuEars);
readmeMenuItem.addActionListener(menuEars);
newButton.addActionListener(menuEars);
openButton.addActionListener(menuEars);
contents.setText(lib.getReadme());
setVisible(true);
}
/** Connects the 'source' buffer to a file
specified by the string
@param filename the file to 'open'
*/
private boolean getFile(String filename) {
try {
FileReader fr = new FileReader(filename);
source = new BufferedReader(fr);
cFilename = filename;
usingFile = true;
} catch (Exception e) {
//e.printStackTrace();
errorMessage("Could not open file \'" + filename + "\'");
return false;
}
return true;
}
/** Connects the 'source' buffer to a predefined
String contained in the Slackwords class
@param story name of the 'story' to find
*/
private void getStoryString(String story) {
StringReader sr = new StringReader(lib.getStory(story));
source = new BufferedReader(sr);
cStory = story;
usingFile = false;
}
/** 'Reloads' the current contents - effectively
pointing the source to the beginning of the buffer
*/
private void reloadPage() {
if (usingFile) getFile(cFilename);
else getStoryString(cStory);
}
/** Gets an image
@param location where to find the image
*/
private ImageIcon getMyImage(String loc) {
return new ImageIcon(note.getClass().getResource(loc));
//return new ImageIcon(loc);
}
/** Shows an error message dialog
@param message error to display
*/
private void errorMessage(String message) {
infoMessage("Error", message);
}
/** Shows an information dialog
@param title the title of the dialog
@param message the message to display
*/
private void infoMessage(String title, String message) {
JOptionPane.showMessageDialog(note, message, title,
JOptionPane.INFORMATION_MESSAGE);
}
/** SlackpadTextArea class which overrides
the 'processKeyEvent' method of JTextArea
so that keypresses can be captured and
dealt with
*/
private class SlackpadTextArea extends JTextArea {
public SlackpadTextArea(int width, int height) {
super(width, height);
}
protected void processKeyEvent(KeyEvent key) {
if (editing) {
super.processKeyEvent(key);
}
else {
if (key.getID() == KeyEvent.KEY_TYPED) {
setCaretPosition(getText().length());
try {
char tmp = (char)source.read();
append("" + tmp);
} catch (Exception e) {
//e.printStackTrace();
}
}
}
}
}
/**
Main action listener to capture events from the buttons
and carry out the appropriate action
*/
private class Ears implements ActionListener {
public void actionPerformed(ActionEvent e) {
Object clicked = e.getSource();
if (clicked == exitMenuItem) {
System.exit(0);
}
else if (clicked == modeCheckBox) {
editing = !modeCheckBox.isSelected();
}
else if (clicked == newMenuItem ||
clicked == newButton) {
contents.setText("");
reloadPage();
}
else if (clicked == openMenuItem ||
clicked == openButton) {
JFileChooser chooser = new JFileChooser();
chooser.addChoosableFileFilter(new TextFilter());
int returnVal = chooser.showOpenDialog(note);
if(returnVal == JFileChooser.APPROVE_OPTION) {
getFile(chooser.getSelectedFile().getPath());
}
}
else if (clicked == setTitleMenuItem) {
String inputValue =
JOptionPane.showInputDialog((JFrame)note,
"Set title",
"Document 1 - Microsoft Word",
JOptionPane.INFORMATION_MESSAGE);
if (inputValue != null)
note.setTitle(inputValue);
}
else if (clicked == skipMenuItem) {
boolean isInt = false;
int lines = 0;
String inputValue =
JOptionPane.showInputDialog((JFrame)note,
"Skip n lines (max 1000)",
"10",
JOptionPane.INFORMATION_MESSAGE);
try {
lines = Integer.parseInt(inputValue);
isInt = true;
} catch (Exception ie) {
isInt = false;
errorMessage("Invalid number of lines");
}
if (isInt) {
String tmp = "";
try {
if (lines <= 1000) {
for (int i=0; i<lines; i++) {
if ((tmp = source.readLine()) != null)
contents.append(tmp + "\n");
}
}
else {
errorMessage("Invalid number of lines");
}
} catch (Exception re) {
// Do nothing
}
}
}
else if (clicked instanceof StoryMenuItem) {
getStoryString(((StoryMenuItem)clicked).getText());
}
else if (clicked == aboutMenuItem) {
infoMessage("About",
"Slackpad 2003 (v1.0)\n\n"
+ "A program by Matthew Sital-Singh");
}
else if (clicked == readmeMenuItem) {
contents.setText(lib.getReadme());
}
}
}
/** Custom FileFilter to show only .txt files
*/
private class TextFilter extends javax.swing.filechooser.FileFilter {
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
String extension = null;
String s = f.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1) {
extension = s.substring(i+1).toLowerCase();
}
if (extension != null) {
if (extension.equals("txt")) {
return true;
} else {
return false;
}
}
return false;
}
public String getDescription() {
return "Text files (*.txt)";
}
}
/** Extra class to differentiate the Story menu items
from normal menu items
*/
private class StoryMenuItem extends JMenuItem {
public StoryMenuItem(String name) {
super(name);
}
}
/**
Causes the program to exit when the main
window is closed
*/
private class CloseWindow extends WindowAdapter {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
/** Main method
Creates a new instance of Slackpad
*/
public static void main(String[] args) {
Slackpad np = new Slackpad();
}
/** The slackpad */
private Slackpad note;
/** Library */
private Slackwords lib = new Slackwords();
/** The menu bar */
private JMenuBar mainBar = new JMenuBar();
private JMenuBar menuBar = new JMenuBar();
private JMenuBar buttonBar = new JMenuBar();
private JMenu fileMenu = new JMenu("File");
private JMenuItem newMenuItem = new JMenuItem("New...");
private JMenuItem openMenuItem = new JMenuItem("Open...");
private JMenuItem exitMenuItem = new JMenuItem("Exit");
private JMenu toolsMenu = new JMenu("Tools");
private JCheckBoxMenuItem modeCheckBox = new JCheckBoxMenuItem("Slacker mode");
private JMenuItem setTitleMenuItem = new JMenuItem("Set title...");
private JMenuItem skipMenuItem = new JMenuItem("Skip lines...");
private JMenu storyMenuItem = new JMenu("Load auto-text");
private JMenu helpMenu = new JMenu("Help");
private JMenuItem aboutMenuItem = new JMenuItem("About...");
private JMenuItem readmeMenuItem = new JMenuItem("View readme");
/** The buttons */
private JButton newButton;
private JButton openButton;
/** Text area and scrollpane */
private SlackpadTextArea contents = new SlackpadTextArea(800, 1000);
private JScrollPane scrollview = new JScrollPane (contents);
/** File IO stuff */
private BufferedReader source;
/** Mode */
private boolean editing = true;
private boolean usingFile = false;
private String cFilename;
private String cStory;
}
| [
"[email protected]"
] | |
b1bd2aab873a343e0bc4abc4e252cae316be97ca | 6ef4869c6bc2ce2e77b422242e347819f6a5f665 | /devices/google/Pixel 2/29/QPP6.190730.005/src/framework/android/drm/DrmInfo.java | 5b087944b28958be33f96b63757fe65067f44ef8 | [] | no_license | hacking-android/frameworks | 40e40396bb2edacccabf8a920fa5722b021fb060 | 943f0b4d46f72532a419fb6171e40d1c93984c8e | refs/heads/master | 2020-07-03T19:32:28.876703 | 2019-08-13T03:31:06 | 2019-08-13T03:31:06 | 202,017,534 | 2 | 0 | null | 2019-08-13T03:33:19 | 2019-08-12T22:19:30 | Java | UTF-8 | Java | false | false | 2,792 | java | /*
* Decompiled with CFR 0.145.
*/
package android.drm;
import android.drm.DrmInfoRequest;
import android.drm.DrmUtils;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
public class DrmInfo {
private final HashMap<String, Object> mAttributes = new HashMap();
private byte[] mData;
private final int mInfoType;
private final String mMimeType;
public DrmInfo(int n, String charSequence, String string2) {
this.mInfoType = n;
this.mMimeType = string2;
try {
this.mData = DrmUtils.readBytes((String)charSequence);
}
catch (IOException iOException) {
this.mData = null;
}
if (this.isValid()) {
return;
}
charSequence = new StringBuilder();
((StringBuilder)charSequence).append("infoType: ");
((StringBuilder)charSequence).append(n);
((StringBuilder)charSequence).append(",mimeType: ");
((StringBuilder)charSequence).append(string2);
((StringBuilder)charSequence).append(",data: ");
((StringBuilder)charSequence).append(Arrays.toString(this.mData));
((StringBuilder)charSequence).toString();
throw new IllegalArgumentException();
}
public DrmInfo(int n, byte[] arrby, String string2) {
this.mInfoType = n;
this.mMimeType = string2;
this.mData = arrby;
if (this.isValid()) {
return;
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("infoType: ");
stringBuilder.append(n);
stringBuilder.append(",mimeType: ");
stringBuilder.append(string2);
stringBuilder.append(",data: ");
stringBuilder.append(Arrays.toString(arrby));
throw new IllegalArgumentException(stringBuilder.toString());
}
public Object get(String string2) {
return this.mAttributes.get(string2);
}
public byte[] getData() {
return this.mData;
}
public int getInfoType() {
return this.mInfoType;
}
public String getMimeType() {
return this.mMimeType;
}
boolean isValid() {
byte[] arrby = this.mMimeType;
boolean bl = arrby != null && !arrby.equals("") && (arrby = this.mData) != null && arrby.length > 0 && DrmInfoRequest.isValidType(this.mInfoType);
return bl;
}
public Iterator<Object> iterator() {
return this.mAttributes.values().iterator();
}
public Iterator<String> keyIterator() {
return this.mAttributes.keySet().iterator();
}
public void put(String string2, Object object) {
this.mAttributes.put(string2, object);
}
}
| [
"[email protected]"
] | |
d3e6b3308ddc7ee602a511c3a3431cabdee4138f | f36c062c245d64e774a28e5b203b0d06a6cee895 | /ResponsiPBO/ResponsiPbo/src/responsipbo/Main.java | 928f859b63de0e0481c87c046d3e2f851890cf34 | [] | no_license | Burhan1100/Prak-PBO | 3a5d2ff3c31bf5da8ee0a64b9266d8beedbed018 | 9368d1adec48eb4a237662afbb3a05d88454ad46 | refs/heads/master | 2021-01-02T20:03:25.775155 | 2020-05-21T01:47:49 | 2020-05-21T01:47:49 | 239,778,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | 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 responsipbo;
/**
*
* @author Burhan
*/
public class Main {
public static void main(String[] args) {
MenuView menuView = new MenuView();
MenuController menuController = new MenuController(menuView);
}
} | [
"[email protected]"
] | |
a7b88eaddd576a4a6e523a7ebe0dfcbfc3c32e88 | 53e2c2773b7dda422f2956ee0168d5ff98e01f51 | /mjfast-admin/src/main/java/com/mjcio/mjfast/admin/common/config/SwaggerConfig.java | 546f7b8d4eb0c16a2689073ba84b84c8917793a9 | [] | no_license | mjcio/mjfast | a6579a05cff858581c59ec7beaa371f05235c376 | 956fc2352e2aa89eb1389af4a2d117102ca3ba75 | refs/heads/master | 2020-03-19T20:25:51.258986 | 2018-06-12T00:43:37 | 2018-06-12T00:43:37 | 136,901,385 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,021 | java | /**
* Copyright 2018 人人开源 http://www.renren.io
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.mjcio.mjfast.admin.common.config;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* Swagger配置
*
* @author Mark [email protected]
* @since 3.0.0 2018-01-16
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
// 加了ApiOperation注解的类,生成接口文档
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 包下的类,生成接口文档
.apis(RequestHandlerSelectors.basePackage("io.renren.modules.job.controller"))
.paths(PathSelectors.any()).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("企业快速开发框架在线API").description("在线API文档")
.termsOfServiceUrl("http://www.renren.io").version("3.2.0").build();
}
} | [
"[email protected]"
] | |
b5d6ea94cc6770bd4c3f2f95ea7e721ff62731f6 | b2e4f25035290d7f1937e1cfb8ca51e09412fe99 | /app/src/main/java/bo/hlva/glostudio/project/Resources.java | a2666390b315e4f3d707cf4de1b3deda6fd5f747 | [] | no_license | denverku/Glo-Studio-IDE | d9b413354bc05f8de4f07e8ffe0a05540b557db9 | a900909a67070f7b09745ac78891ab302198e1ea | refs/heads/main | 2023-06-21T17:13:47.925440 | 2021-07-23T04:09:04 | 2021-07-23T04:09:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,886 | java | package bo.hlva.glostudio.project;
import java.io.File;
import bo.hlva.glostudio.utils.FileUtils;
public class Resources {
private File dirRes;
//values resource
private File dirDrawable;
private File dirLayout;
private File dirMenu;
private File dirMipmap;
private File dirValues;
private File styles;
private File strings;
private File colors;
// contructor
public Resources(File dirRes){
this.dirRes = dirRes;
}
public void builderResources(){
dirDrawable = FileUtils.createNewFolder(dirRes,"drawable");
dirLayout = FileUtils.createNewFolder(dirRes,"layout");
dirMenu = FileUtils.createNewFolder(dirRes,"menu");
dirMipmap = FileUtils.createNewFolder(dirRes,"mipmap");
dirValues = FileUtils.createNewFolder(dirRes,"values");
colors = FileUtils.createNewFile(dirValues,"colors.xml");
styles = FileUtils.createNewFile(dirValues,"styles.xml");
strings = FileUtils.createNewFile(dirValues,"strings.xml");
}
/*
* @methods return files manager
* @return File
*/
public File getStyles(){
return this.styles;
}
public File getStrings(){
return this.strings;
}
public File getColors(){
return this.colors;
}
/*******************************/
/*
* @methods return folder
* @return File
*/
public File getDirDrawble(){
return this.dirDrawable;
}
public File getDirLayout(){
return this.dirLayout;
}
public File getDirMenu(){
return this.dirMenu;
}
public File getDirMipMap(){
return this.dirMipmap;
}
public File getDirValues(){
return this.dirValues;
}
/****************************/
}
| [
"[email protected]"
] | |
108d955c0544d373716d67c3ffd791ca499e0c12 | 4ef1b972593f699a71e4eca7ee1010aa231f52cc | /app/src/main/java/com/hotniao/video/model/bean/HnLiveNoticeBean.java | 93ddd84a6844bfa4013c762ce0f5985b6a4f8973 | [] | no_license | LoooooG/youyou | e2e8fb0f576a6e2daf614d1186303ec7ce7bdf4a | 5bff0de57159ab3dda075343b83ff4a461df66e2 | refs/heads/master | 2020-12-03T12:52:00.462951 | 2020-02-17T10:29:59 | 2020-02-17T10:29:59 | 231,321,844 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,351 | java | package com.hotniao.video.model.bean;
import java.util.List;
/**
* Copyright (C) 2017,深圳市红鸟网络科技股份有限公司 All rights reserved.
* 项目名称:youbo
* 类描述:开播设置用户列表数据
* 创建人:mj
* 创建时间:2017/9/7 18:04
* 修改人:
* 修改时间:
* 修改备注:
* Version: 1.0.0
*/
public class HnLiveNoticeBean {
/**
* follows : {"items":[{"anchor_level":"0","is_remind":"Y","user_avatar":"http://static.greenlive.1booker.com//upload/image/20171017/1508229933469682.png","user_id":"9","user_intro":"卡拉卡拉吧","user_level":"0","user_nickname":"天行哈哈"}],"next":2,"page":1,"pagesize":1,"pagetotal":2,"prev":1,"total":2}
* remind_total : 2
*/
private FollowsBean follows;
private String remind_total;
private String is_remind;// 全部提醒设置,Y:开启,N:关闭
public String getIs_remind() {
return is_remind;
}
public void setIs_remind(String is_remind) {
this.is_remind = is_remind;
}
public FollowsBean getFollows() {
return follows;
}
public void setFollows(FollowsBean follows) {
this.follows = follows;
}
public String getRemind_total() {
return remind_total;
}
public void setRemind_total(String remind_total) {
this.remind_total = remind_total;
}
public static class FollowsBean {
/**
* items : [{"anchor_level":"0","is_remind":"Y","user_avatar":"http://static.greenlive.1booker.com//upload/image/20171017/1508229933469682.png","user_id":"9","user_intro":"卡拉卡拉吧","user_level":"0","user_nickname":"天行哈哈"}]
* next : 2
* page : 1
* pagesize : 1
* pagetotal : 2
* prev : 1
* total : 2
*/
private int next;
private int page;
private int pagesize;
private int pagetotal;
private int prev;
private int total;
private List<ItemsBean> items;
public int getNext() {
return next;
}
public void setNext(int next) {
this.next = next;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getPagesize() {
return pagesize;
}
public void setPagesize(int pagesize) {
this.pagesize = pagesize;
}
public int getPagetotal() {
return pagetotal;
}
public void setPagetotal(int pagetotal) {
this.pagetotal = pagetotal;
}
public int getPrev() {
return prev;
}
public void setPrev(int prev) {
this.prev = prev;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public List<ItemsBean> getItems() {
return items;
}
public void setItems(List<ItemsBean> items) {
this.items = items;
}
public static class ItemsBean {
/**
* anchor_level : 0
* is_remind : Y
* user_avatar : http://static.greenlive.1booker.com//upload/image/20171017/1508229933469682.png
* user_id : 9
* user_intro : 卡拉卡拉吧
* user_level : 0
* user_nickname : 天行哈哈
*/
private String anchor_level;
private String is_remind;
private String user_avatar;
private String user_id;
private String user_intro;
private String user_level;
private String user_nickname;
public String getAnchor_level() {
return anchor_level;
}
public void setAnchor_level(String anchor_level) {
this.anchor_level = anchor_level;
}
public String getIs_remind() {
return is_remind;
}
public void setIs_remind(String is_remind) {
this.is_remind = is_remind;
}
public String getUser_avatar() {
return user_avatar;
}
public void setUser_avatar(String user_avatar) {
this.user_avatar = user_avatar;
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public String getUser_intro() {
return user_intro;
}
public void setUser_intro(String user_intro) {
this.user_intro = user_intro;
}
public String getUser_level() {
return user_level;
}
public void setUser_level(String user_level) {
this.user_level = user_level;
}
public String getUser_nickname() {
return user_nickname;
}
public void setUser_nickname(String user_nickname) {
this.user_nickname = user_nickname;
}
}
}
}
| [
"[email protected]"
] | |
8e5ac403f1a74fd92e7629d9b8536c830e06fe35 | 5feb555778caf493f99810418832c806f2bd7019 | /gm4g_pos_server_dev_phk/.svn/pristine/8e/8e5ac403f1a74fd92e7629d9b8536c830e06fe35.svn-base | 9f5960fa5b6c9a7ec853bd279b76742f388a93a7 | [] | no_license | Juliezmx/pos-training | 8fe5ae9efa896515c87149d1305d78fcab8042ce | 8842ebc0ee9696e4bc0128b5d60d8c6cb2efa870 | refs/heads/master | 2020-05-18T05:43:06.929447 | 2019-04-30T07:39:27 | 2019-04-30T07:39:27 | 184,214,589 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,554 | package app;
import java.util.ArrayList;
import commonui.FormConfirmBox;
import core.Controller;
import templatebuilder.TemplateBuilder;
import virtualui.VirtualUIForm;
import virtualui.VirtualUIFrame;
/** interface for the listeners/observers callback method */
interface FormConfirmOrderDialogListener {
void formConfirmOrderDialog_Timeout();
}
public class FormConfirmOrderDialog extends VirtualUIForm implements FrameConfirmOrderDialogListener {
TemplateBuilder m_oTemplateBuilder;
private FrameConfirmOrderDialog m_oFrameConfirmOrderDialog;
private boolean m_bUserCancel;
/** list of interested listeners (observers, same thing) */
private ArrayList<FormConfirmOrderDialogListener> listeners;
private FuncCheck m_oFuncCheck;
/** add a new ModelListener observer for this Model */
public void addListener(FormConfirmOrderDialogListener listener) {
listeners.add(listener);
}
public FormConfirmOrderDialog(Controller oParentController, FuncCheck o_FuncCheck, int iCashierTimer) {
super(oParentController);
m_oTemplateBuilder = new TemplateBuilder();
m_bUserCancel = false;
listeners = new ArrayList<FormConfirmOrderDialogListener>();
// Load form from template file
m_oTemplateBuilder.loadTemplate("frmConfirmOrderDialog.xml");
// Background Cover Page
VirtualUIFrame oCoverFrame = new VirtualUIFrame();
m_oTemplateBuilder.buildFrame(oCoverFrame, "fraCoverFrame");
this.attachChild(oCoverFrame);
m_oFrameConfirmOrderDialog = new FrameConfirmOrderDialog(o_FuncCheck);
m_oTemplateBuilder.buildFrame(m_oFrameConfirmOrderDialog, "fraConfirmOrderDialog");
m_oFrameConfirmOrderDialog.addListener(this);
this.attachChild(m_oFrameConfirmOrderDialog);
if (iCashierTimer > 0){
m_oFrameConfirmOrderDialog.setConfirmOrderDialogTimeout(iCashierTimer);
m_oFrameConfirmOrderDialog.setConfirmOrderDialogTimeoutTimer(true);
}
m_oFuncCheck = o_FuncCheck;
}
public boolean isUserCancel() {
return m_bUserCancel;
}
@Override
public void frameConfirmOrderDialog_clickClose() {
this.finishShow();
}
@Override
public void frameConfirmOrderDialog_clickBack(String sTable, String sTableExtension) {
m_bUserCancel = true;
this.finishShow();
}
@Override
public void frameConfirmOrderDialog_timeout() {
for (FormConfirmOrderDialogListener listener : listeners) {
m_oFrameConfirmOrderDialog.setConfirmOrderDialogTimeoutTimer(false);
if (AppGlobal.g_oFuncStation.get().getOrderingTimeoutOption() == FuncStation.ORDERING_TIMEOUT_OPTION_QUIT_CHECK_DIRECTLY
&& m_oFuncCheck != null) {
listener.formConfirmOrderDialog_Timeout();
this.finishShow();
} else {
// Show the option
FormConfirmBox oFormConfirmBox = new FormConfirmBox(AppGlobal.g_oLang.get()._("continue_process"),
AppGlobal.g_oLang.get()._("new_order"), this);
oFormConfirmBox.setTitle(AppGlobal.g_oLang.get()._("attention"));
oFormConfirmBox.setMessage(AppGlobal.g_oLang.get()._("order_time_out_is_reached"));
oFormConfirmBox.setTimeout(30 * 1000);
oFormConfirmBox.setTimeoutChecking(true);
oFormConfirmBox.show();
oFormConfirmBox.setTimeoutChecking(false);
if (oFormConfirmBox.isOKClicked()) {
// Continue order and restart the ordering timeout
m_oFrameConfirmOrderDialog.setConfirmOrderDialogTimeoutTimer(true);
} else {
listener.formConfirmOrderDialog_Timeout();
this.finishShow();
}
}
}
}
}
| [
"admin@DESKTOP-34K1G8K"
] | admin@DESKTOP-34K1G8K |
|
51c741ee95f50e135249f84f202e25f6b32f2ae3 | f66e2ad3fc0f8c88278c0997b156f5c6c8f77f28 | /Android/GooglePlay/app/src/main/java/com/mwqi/http/HttpRetry.java | 188e4c032994277340cca2445526fac695989bc7 | [
"Apache-2.0"
] | permissive | flyfire/Programming-Notes-Code | 3b51b45f8760309013c3c0cc748311d33951a044 | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | refs/heads/master | 2020-05-07T18:00:49.757509 | 2019-04-10T11:15:13 | 2019-04-10T11:15:13 | 180,750,568 | 1 | 0 | Apache-2.0 | 2019-04-11T08:40:38 | 2019-04-11T08:40:38 | null | UTF-8 | Java | false | false | 2,821 | java | package com.mwqi.http;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.HashSet;
import javax.net.ssl.SSLHandshakeException;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;
import android.os.SystemClock;
public class HttpRetry implements HttpRequestRetryHandler {
// 重试休息的时间
private static final int RETRY_SLEEP_TIME_MILLIS = 1000;
// 网络异常,继续
private static HashSet<Class<?>> exceptionWhitelist = new HashSet<Class<?>>();
// 用户异常,不继续(如,用户中断线程)
private static HashSet<Class<?>> exceptionBlacklist = new HashSet<Class<?>>();
static {
// 以下异常不需要重试,这样异常都是用于造成或者是一些重试也无效的异常
exceptionWhitelist.add(NoHttpResponseException.class);// 连上了服务器但是没有Response
exceptionWhitelist.add(UnknownHostException.class);// host出了问题,一般是由于网络故障
exceptionWhitelist.add(SocketException.class);// Socket问题,一般是由于网络故障
// 以下异常可以重试
exceptionBlacklist.add(InterruptedIOException.class);// 连接中断,一般是由于连接超时引起
exceptionBlacklist.add(SSLHandshakeException.class);// SSL握手失败
}
private final int maxRetries;
public HttpRetry(int maxRetries) {
this.maxRetries = maxRetries;
}
@Override
public boolean retryRequest(IOException exception, int executionCount, HttpContext context) {
boolean retry = true;
// 请求是否到达
Boolean b = (Boolean) context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
boolean sent = (b != null && b.booleanValue());
if (executionCount > maxRetries) {
// 尝试次数超过用户定义的测试
retry = false;
} else if (exceptionBlacklist.contains(exception.getClass())) {
// 线程被用户中断,则不继续尝试
retry = false;
} else if (exceptionWhitelist.contains(exception.getClass())) {
// 出现的异常需要被重试
retry = true;
} else if (!sent) {
// 请求没有到达
retry = true;
}
// 如果需要重试
if (retry) {
// 获取request
HttpUriRequest currentReq = (HttpUriRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
// POST请求难道就不需要重试?
//retry = currentReq != null && !"POST".equals(currentReq.getMethod());
retry = currentReq != null;
}
if (retry) {
// 休眠1秒钟后再继续尝试
SystemClock.sleep(RETRY_SLEEP_TIME_MILLIS);
} else {
exception.printStackTrace();
}
return retry;
}
} | [
"[email protected]"
] | |
282fdc95b4c0c3352407f1ba04fb6eb39d468bd9 | e17a89b19fc227e5bac5444389d51b08e265f643 | /tennis-bar-invite/src/main/java/com/shenghesun/invite/comment/controller/CommentController.java | 7c36c8d5e13f93d3e6e86a85a9a3f191ff6d083e | [] | no_license | KevinDingFeng/tennis-bar | 6e39142fb52cb2e75d4dd6a6addd3b1db5f666a7 | 6dd619a3dc21748702bbe3d88b13433dfc3bbc69 | refs/heads/master | 2020-03-28T14:01:36.006918 | 2018-10-08T20:05:34 | 2018-10-08T20:05:34 | 148,452,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,074 | java | package com.shenghesun.invite.comment.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.shenghesun.invite.cache.RedisResultCache;
import com.shenghesun.invite.comment.entity.Comment;
import com.shenghesun.invite.comment.entity.CommentLabel.LabelType;
import com.shenghesun.invite.comment.service.CommentLabelService;
import com.shenghesun.invite.comment.service.CommentService;
import com.shenghesun.invite.config.wx.WxConfig;
import com.shenghesun.invite.game.entity.ApplyJoinGame;
import com.shenghesun.invite.game.entity.ApplyJoinGame.ApplyJoinGameStatus;
import com.shenghesun.invite.game.entity.Game;
import com.shenghesun.invite.game.service.ApplyJoinGameService;
import com.shenghesun.invite.game.service.GameService;
import com.shenghesun.invite.utils.JsonUtils;
import com.shenghesun.invite.wx.entity.WxUserInfo;
import com.shenghesun.invite.wx.service.WxUserInfoService;
@RestController
@RequestMapping(value = "/api/comment")
public class CommentController {
@Autowired
private CommentService commentService;
@Autowired
private RedisResultCache redisResultCache;
@Autowired
private ApplyJoinGameService applyJoinGameService;
@Autowired
private GameService gameService;
@Autowired
private WxUserInfoService wxUserInfoService;
@Autowired
private CommentLabelService commentLabelService;
/**
* 设置允许自动绑定的属性名称
*
* @param binder
* @param req
*/
@InitBinder("entity")
private void initBinder(ServletRequestDataBinder binder,
HttpServletRequest req) {
List<String> fields = new ArrayList<String>(Arrays.asList("gameStar", "courtStar", "presentStar","presentUser","gameLabels","courtLabels","gameId", "wxUserInfoId"));
switch (req.getMethod().toLowerCase()) {
case "post": // 新增
binder.setAllowedFields(fields.toArray(new String[fields.size()]));
break;
default:
break;
}
}
/**
* 预处理,一般用于新增和修改表单提交后的预处理
*
* @param id
* @param req
* @return
*/
@ModelAttribute("entity")
public Comment prepare(
@RequestParam(value = "id", required = false) Long id,
HttpServletRequest req) {
String method = req.getMethod().toLowerCase();
if (id != null && id > 0 && "post".equals(method)) {// 修改表单提交后数据绑定之前执行
return commentService.findById(id);
} else if ("post".equals(method)) {// 新增表单提交后数据绑定之前执行
return new Comment();
} else {
return null;
}
}
/**
*
* @param id
* @param comment
* @param result
* @param wxUserIds 提交到场的,实体中默认所有人都没到场
* @return
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
public JSONObject update(@RequestParam(value = "id", required = false) Long id,
@Validated @ModelAttribute("entity") Comment comment, BindingResult result,
@RequestParam(value = "wxUserIds", required = false) Long[] wxUserIds) {
if(result.hasErrors()) {
return JsonUtils.getFailJSONObject("输入内容有误");
}
if(id != null) {
comment.setId(id);
}
Game game = gameService.findById(comment.getGameId());
comment.setGame(game);
WxUserInfo wxUser = wxUserInfoService.findById(comment.getWxUserInfoId());
comment.setWxUserInfo(wxUser);
comment = commentService.save(comment);//
if(wxUserIds != null && wxUserIds.length > 0) {
Long gameId = comment.getGameId();
//更新参与者数据
applyJoinGameService.updatePresentedByGameIdAndInWxUserIds(true, gameId, wxUserIds);
}
return JsonUtils.getSuccessJSONObject();
}
@RequestMapping(value = "/detail", method = RequestMethod.GET)
public JSONObject detail(HttpServletRequest request,
@RequestParam(value = "gameId") Long gameId) {
// 获取当前用户信息
String result = redisResultCache.getResultByToken(request.getHeader(WxConfig.CUSTOM_TOKEN_NAME));
Long authWxUserInfoId = Long.parseLong(result);// TODO
//获取评论信息
Comment comment = commentService.findByGameIdAndWxUserInfoId(gameId, authWxUserInfoId);
JSONObject json = new JSONObject();
if(comment == null) {
comment = new Comment();
comment.setGameId(gameId);
comment.setWxUserInfoId(authWxUserInfoId);
}
json.put("comment", comment);
Game game = gameService.findById(gameId);
if(game.getOrganizerId().longValue() == authWxUserInfoId.longValue()) {
//作为发起者,才可以获取参与用户信息
List<ApplyJoinGame> joinWxUser = applyJoinGameService.findByGameIdAndApplyJoinGameStatus(gameId, ApplyJoinGameStatus.Agree);
json.put("joinWxUser", joinWxUser);
}
return JsonUtils.getSuccessJSONObject(json);
}
/**
* 获取所有评论标签
* @param request
* @return
*/
@SuppressWarnings("rawtypes")
@RequestMapping(value="/labels",method = RequestMethod.GET)
public JSONObject getTypeLabel(HttpServletRequest request){
JSONObject json = new JSONObject();
List gameLabels = commentLabelService.findByLabelType(LabelType.GameLabel);
List courtLabels = commentLabelService.findByLabelType(LabelType.CourtLabel);
json.put("gameLabel", gameLabels);
json.put("courtLabel", courtLabels);
return JsonUtils.getSuccessJSONObject(json);
}
}
| [
"[email protected]"
] | |
ce233beaa910ed73bf5842673bc71eb8ccaa8450 | 2a6dc20826d961ef28dc94d3320fb0a15a505a3d | /src/main/java/com/riadh/samples/MyCustomIOException.java | 94e31dba7b8d5f077c40272db75b1960138ea375 | [] | no_license | riadh-mnasri/unit-testing-demo | 10e50f2d7b611cfff00717cb117bc2ef2d361ebe | 6ab23285bfbdf2f14d662e59ff705f4a47527af1 | refs/heads/master | 2021-01-02T08:47:28.780055 | 2013-05-14T15:12:19 | 2013-05-14T15:12:19 | 10,040,516 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package com.riadh.samples;
/**
* @author Riadh MNASRI
*
*/
public class MyCustomIOException extends Exception {
private static final long serialVersionUID = 1L;
public MyCustomIOException() {
}
/**
* @param message
*/
public MyCustomIOException(String message) {
super(message);
}
/**
* @param cause
*/
public MyCustomIOException(Throwable cause) {
super(cause);
}
/**
* @param message
* @param cause
*/
public MyCustomIOException(String message, Throwable cause) {
super(message, cause);
}
}
| [
"[email protected]"
] | |
38cd6556ac1a1b4c6f5912384154869739145a1d | e6aff698b6902023960d27ca7e82fa315768d613 | /src/main/java/com/martwykotek/library/LibraryApp.java | 964d47353e637bd8d59b97599a5adbeb94f43ab2 | [] | no_license | dawidklos/library | 4d60375246f61ffbd10345c5d11ebfcb87b20d82 | 13169f1b38342fd513207cffd6c668d5165e6a0a | refs/heads/master | 2020-04-04T12:07:56.880671 | 2018-11-02T20:29:14 | 2018-11-02T20:29:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,983 | java | package com.martwykotek.library;
import com.martwykotek.library.config.ApplicationProperties;
import com.martwykotek.library.config.DefaultProfileUtil;
import io.github.jhipster.config.JHipsterConstants;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.core.env.Environment;
import javax.annotation.PostConstruct;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
@SpringBootApplication
@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class})
public class LibraryApp {
private static final Logger log = LoggerFactory.getLogger(LibraryApp.class);
private final Environment env;
public LibraryApp(Environment env) {
this.env = env;
}
/**
* Initializes library.
* <p>
* Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile
* <p>
* You can find more information on how profiles work with JHipster on <a href="https://www.jhipster.tech/profiles/">https://www.jhipster.tech/profiles/</a>.
*/
@PostConstruct
public void initApplication() {
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
log.error("You have misconfigured your application! It should not run " +
"with both the 'dev' and 'prod' profiles at the same time.");
}
if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) {
log.error("You have misconfigured your application! It should not " +
"run with both the 'dev' and 'cloud' profiles at the same time.");
}
}
/**
* Main method, used to run the application.
*
* @param args the command line arguments
*/
public static void main(String[] args) {
SpringApplication app = new SpringApplication(LibraryApp.class);
DefaultProfileUtil.addDefaultProfile(app);
Environment env = app.run(args).getEnvironment();
logApplicationStartup(env);
}
private static void logApplicationStartup(Environment env) {
String protocol = "http";
if (env.getProperty("server.ssl.key-store") != null) {
protocol = "https";
}
String serverPort = env.getProperty("server.port");
String contextPath = env.getProperty("server.servlet.context-path");
if (StringUtils.isBlank(contextPath)) {
contextPath = "/";
}
String hostAddress = "localhost";
try {
hostAddress = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
log.warn("The host name could not be determined, using `localhost` as fallback");
}
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\t{}://localhost:{}{}\n\t" +
"External: \t{}://{}:{}{}\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
env.getProperty("spring.application.name"),
protocol,
serverPort,
contextPath,
protocol,
hostAddress,
serverPort,
contextPath,
env.getActiveProfiles());
}
}
| [
"[email protected]"
] | |
516a481c2b081af61a8f6eabc0bf99b75a4efef5 | 992f90e5dac36f9b08ade49db8b1f465a337c337 | /springboot-caffeine/src/main/java/org/dante/springboot/SpringbootCaffeineApplication.java | a9262167d6c42771d72d3b72027e795604a17574 | [] | no_license | dante7qx/springboot | 03d0b9089d96aa967a21f20b46a368027549cc83 | a1ba1b05bbc7e7c495729d2aa803cd537e6037b0 | refs/heads/master | 2023-08-16T15:57:22.602187 | 2023-03-24T06:59:50 | 2023-03-24T06:59:50 | 92,372,653 | 2 | 2 | null | 2023-07-12T14:11:46 | 2017-05-25T06:30:47 | JavaScript | UTF-8 | Java | false | false | 410 | java | package org.dante.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
@EnableCaching
@SpringBootApplication
public class SpringbootCaffeineApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootCaffeineApplication.class, args);
}
}
| [
"[email protected]"
] | |
b424e958de3f25d1527563a8915883ced12c4df2 | 0329da1b165fbc224ce1b8571396048d843b1b7a | /代码/androidintentfilter/gen/com/example/androidintentfilter/R.java | 0abc942e953059d9ada8099fd22976917d26bf91 | [] | no_license | wangwangla/AndroidSensor | 9710ed2e8afd7fcdcd6f33e8cd53745bc72a5a12 | f2d90c5d32278513f363e7045fdf9e3a2e7c0df5 | refs/heads/master | 2021-12-15T01:21:29.559622 | 2021-12-04T01:55:22 | 2021-12-04T01:55:22 | 184,209,229 | 15 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,835 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example.androidintentfilter;
public final class R {
public static final class attr {
}
public static final class dimen {
/** Default screen margins, per the Android Design guidelines.
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
*/
public static final int activity_horizontal_margin=0x7f040000;
public static final int activity_vertical_margin=0x7f040001;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
}
public static final class id {
public static final int action_settings=0x7f080001;
public static final int btn=0x7f080000;
}
public static final class layout {
public static final int activity_main=0x7f030000;
public static final int activity_show=0x7f030001;
}
public static final class menu {
public static final int main=0x7f070000;
public static final int show=0x7f070001;
}
public static final class string {
public static final int action_settings=0x7f050002;
public static final int app_name=0x7f050000;
public static final int hello_world=0x7f050001;
public static final int title_activity_show=0x7f050003;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f060000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f060001;
}
}
| [
"[email protected]"
] | |
3a23e56937b465adbc8ec1f089a1190deda000f4 | b9e1f1cbd070e910488db9851f5f787c648c88d6 | /cometride-server/src/main/java/utdallas/ridetrackers/server/datatypes/TimeRange.java | 9396bab0e05f862708d50a4cd0c55c2b296e7b82 | [] | no_license | mLautz/cometride | c7a98d69ca298081ca98039abd5cafb956f0a56e | 9e52d1115ac26545e6727864c9f8e0f8f8c5c2ea | refs/heads/master | 2020-04-16T11:32:01.706890 | 2015-04-29T11:06:31 | 2015-04-29T11:06:31 | 32,052,753 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package utdallas.ridetrackers.server.datatypes;
import org.omg.CORBA.TRANSACTION_MODE;
/**
* Created by matt lautz on 4/9/2015.
*/
public class TimeRange {
private String start;
private String end;
public TimeRange() {}
public TimeRange(String start, String end) {
this.start = start;
this.end = end;
}
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start;
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end;
}
}
| [
"[email protected]"
] | |
e5d7f3475913b093817a1bc0d963fca6ee8c952f | 9ea19ff224b97d8d1f3af09193a8b41d6bbb1c57 | /app/src/main/java/elliajah/ro/readtogo/elliajah/ro/readtogo/sqlite/BookModel.java | 5f19d77240372bf3317da3d126e2d87abc9accfb | [] | no_license | sneaker102/ReadToGo | d68973060eed897bc3d56c08b59acc7ca619ccf7 | b374ccb2d88eec2cf46da2c4371fc4ab42b3a531 | refs/heads/master | 2020-05-19T03:57:52.899472 | 2019-05-03T20:01:02 | 2019-05-03T20:01:02 | 184,813,577 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,851 | java | package elliajah.ro.readtogo.elliajah.ro.readtogo.sqlite;
public class BookModel {
public static final String TABLE_NAME = "books";
public static final String COLUMN_ID = "id";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_AUTHOR = "author";
public static final String COLUMN_GENRE = "genre";
public static final String COLUMN_GRADE = "grade";
public static final String COLUMN_PERSONAL_NOTES = "personal_notes";
public static final String COLUMN_EDITURA="editura";
public static final String COLUMN_IS_FINISHED="is_finished";
public static final String COLUMN_TIMESTAMP = "timestamp";
public static final String SELECT_ALL_QUERY = "SELECT * FROM "+TABLE_NAME;
private int id,mIsFinished;
private String mName,mAuthor,mGenre,mGrade,mPersonalNotes,mEditura,mTimesStamp;
public static final String CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + "("
+ COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
+ COLUMN_NAME + " TEXT NOT NULL,"
+COLUMN_AUTHOR + " TEXT NOT NULL,"
+COLUMN_GENRE + " TEXT,"
+COLUMN_GRADE + " INTEGER,"
+COLUMN_PERSONAL_NOTES + " TEXT,"
+COLUMN_EDITURA + " TEXT,"
+COLUMN_IS_FINISHED + " INTEGER,"
+ COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
+ ")";
public BookModel(int id, String mName, String mAuthor, String mGenre, String mGrade, String mPersonalNotes,int mIsFinished,String mEditura ,String mTimesStamp){
this.id=id;
this.mName=mName;
this.mAuthor=mAuthor;
this.mGenre=mGenre;
this.mGrade=mGrade;
this.mPersonalNotes=mPersonalNotes;
this.mEditura=mEditura;
this.mIsFinished=mIsFinished;
this.mTimesStamp=mTimesStamp;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getmName() {
return mName;
}
public void setmName(String mName) {
this.mName = mName;
}
public String getmAuthor() {
return mAuthor;
}
public String getmEditura() {
return mEditura;
}
public void setmEditura(String mEditura) {
this.mEditura = mEditura;
}
public void setmAuthor(String mAuthor) {
this.mAuthor = mAuthor;
}
public String getmGenre() {
return mGenre;
}
public void setmGenre(String mGenre) {
this.mGenre = mGenre;
}
public String getmGrade() {
return mGrade;
}
public int getmIsFinished() {
return mIsFinished;
}
public void setmIsFinished(int mIsFinished) {
this.mIsFinished = mIsFinished;
}
public void setmGrade(String mGrade) {
this.mGrade = mGrade;
}
public String getmPersonalNotes() {
return mPersonalNotes;
}
public void setmPersonalNotes(String mPersonalNotes) {
this.mPersonalNotes = mPersonalNotes;
}
public String getmTimesStamp() {
return mTimesStamp;
}
public void setmTimesStamp(String mTimesStamp) {
this.mTimesStamp = mTimesStamp;
}
@Override
public String toString() {
return "BookModel{" +
"id=" + id +
", mIsFinished=" + mIsFinished +
", mName='" + mName + '\'' +
", mAuthor='" + mAuthor + '\'' +
", mGenre='" + mGenre + '\'' +
", mGrade='" + mGrade + '\'' +
", mPersonalNotes='" + mPersonalNotes + '\'' +
", mEditura='" + mEditura + '\'' +
", mTimesStamp='" + mTimesStamp + '\'' +
'}';
}
}
| [
"[email protected]"
] | |
8c5e7abf6b4b88f30de3546eade322633d028eb7 | 4041fdf47e68750ca3e102ad2012fba9aca0a0f2 | /src/main/java/API_testing/json_parsing.java | 7e4c45582e157abf6b91eb561759e8f7c7429776 | [] | no_license | lokesh0138/API | e76620edeb975444547e07854037e253dc2d0762 | a1c32dd65113cff888bd334be35c71bdbc91efc5 | refs/heads/master | 2023-07-09T08:21:22.071986 | 2021-08-13T09:32:20 | 2021-08-13T09:32:20 | 395,593,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,161 | java | package API_testing;
import static org.testng.Assert.assertEquals;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.Test;
import io.restassured.path.json.JsonPath;
public class json_parsing {
// Print No of courses returned by API
static JsonPath js=new JsonPath(add_palce.sumvalidate());
@Test(priority=1)
public void coursecount()
{
//JsonPath js=new JsonPath(add_palce.sumvalidate());
int count=js.getInt("courses.size()");
System.out.println(count);
}
//Print Purchase Amount
@Test(priority=2)
public void purchaseamount()
{
//JsonPath js=new JsonPath(add_palce.sumvalidate());
int purchaseamount=js.getInt("dashboard.purchaseAmount");
System.out.println(purchaseamount);
}
//Print Title of the first course
@Test(priority=3)
public void firsttitle()
{
System.out.println(js.get("courses[0].title").toString());
//JsonPath js=new JsonPath(add_palce.sumvalidate());
}
//Print All course titles and their respective Prices
@Test(priority=4)
public void allcourse_tile()
{
//int count=json_parsing.coursecount();
//json_parsing jp=new json_parsing();
//int count=jp.coursecount();
int count=js.getInt("courses.size()");
for(int i=0;i<count;i++)
{
System.out.println(js.get("courses["+i+"].title"));
System.out.println(js.getInt("courses["+i+"].price"));
}
}
//Print no of copies sold by RPA Course
@Test(priority=5)
public void RPA_copies()
{
int count=js.getInt("courses.size()");
for(int i=0;i<count;i++)
{
String title=js.get("courses["+i+"].title").toString();
if(title.equalsIgnoreCase("RPA"))
{
int copies=js.getInt("courses["+i+"].copies");
System.out.println(copies);
break;
}
}
}
//SumValidation
@Test(priority=6)
public void sumvalidation()
{
int purchaseamount=js.getInt("dashboard.purchaseAmount");
int sum=0;
int count=js.getInt("courses.size()");
for(int i=0;i<count;i++)
{
int price=js.getInt("courses["+i+"].price");
int copies=js.getInt("courses["+i+"].copies");
int amount=price*copies;
sum=sum+amount;
}
Assert.assertEquals(sum, purchaseamount);
}
}
| [
"[email protected]"
] | |
d7d6ffcb63daba10c80dab41659c6c3a4d4df87c | 6bd982b493c692c537e6ea6e041d9c16eed11a8e | /Forelesning02/PlayingWithIntents/app/src/main/java/no/hiof/larseknu/playingwithintents/MainActivity.java | 94c3f6fe145db76d391ec8a0db1f4e160b1ddda3 | [] | no_license | larseknu/android_programmering_h2017 | 38f0cfec2c15a17e5390b5b1af3a412cfc113f44 | 4131a3331bb74233ef6f9ec004fb6d09398b59e5 | refs/heads/master | 2021-01-19T15:17:21.025024 | 2017-10-26T06:38:12 | 2017-10-26T06:38:12 | 100,956,501 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,216 | java | package no.hiof.larseknu.playingwithintents;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends Activity {
private int counter = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void startOtherActivity(View view) {
// Call OtherActivity with an explicit intent
Intent intent = new Intent(this, OtherActivity.class);
startActivity(intent);
}
public void implicitlyStartOtherActivity(View view) {
// Call OtherActivity with an implicit intent
Intent intent = new Intent("no.hiof.larseknu.playingwithintents.action.OTHER_ACTIVITY");
startActivity(intent);
}
public void showTime(View view) {
// Show date with an implicit intent
Intent intent = new Intent("no.hiof.larseknu.playingwithintents.action.SHOW_TIME");
// Sets a flag that the opened activity should be deleted from the history stack when the user navigates away from it
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
}
public void showDate(View view) {
// Show time with an implicit intent
Intent intent = new Intent("no.hiof.larseknu.playingwithintents.action.SHOW_DATE");
startActivity(intent);
}
public void openWebsite(View view) {
// Create an intent that we want to view something
Intent intent = new Intent("android.intent.action.VIEW");
// This is what we want to view
Uri uri = Uri.parse("http://www.hiof.no");
intent.setData(uri);
startActivity(intent);
}
public void runServiceJob(View view) {
// We want to send a different number to the service each time
counter++;
// We want to produce Android clones... or kittens
String product = "Android clones";
if (counter % 2 == 0)
product = "Kittens";
// Start our service
MyIntentService.startActionProduce(this, product, counter);
}
} | [
"[email protected]"
] | |
ec3ccead77a555008fa9668dca8d3dbe9be5b04e | b2236e8254d98c882184b6a24d8d418a38b5eb59 | /cgv/Main.java | 33730a5afe8e020f93cb0e9b876eb762da4753f2 | [] | no_license | kangtaeksu/hometraining | ca68872443f55b76828760d0de6d7d01812dfa53 | b183f5caaca405f56ff4758e2a75cf2af6721d54 | refs/heads/master | 2023-03-26T11:47:40.044413 | 2021-03-09T08:29:57 | 2021-03-09T08:29:57 | 345,282,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,562 | java | package kosta.cgv;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.Buffer;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Cinema cinema = new Cinema();
BufferedReader br = null;
String name = null;
int phoneNum = 0;
int balance = 0;
while (true) {
try {
br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("영화를 등록하시겠습니까?");
System.out.print("y / n : ");
String answer = br.readLine();
if (answer.equals("y")) {
cinema.addMoive();
} else {
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
BufferedReader brc = null;
try {
System.out.println("회원정보 등록");
brc = new BufferedReader(new InputStreamReader(System.in));
System.out.print("이름: ");
name = brc.readLine();
brc = new BufferedReader(new InputStreamReader(System.in));
System.out.print("전화번호: ");
phoneNum = Integer.parseInt(brc.readLine());
brc = new BufferedReader(new InputStreamReader(System.in));
System.out.print("잔액: ");
balance = Integer.parseInt(brc.readLine());
} catch (Exception e) {
e.printStackTrace();
}
// 고객 생성
Customer customer = new Customer(name, phoneNum, balance);
cinema.showMovieList();
while (true) {
BufferedReader br1 = null;
System.out.println("1.예매 2.티켓출력 3.리뷰 4.종료");
String menu = null;
try {
br1 = new BufferedReader(new InputStreamReader(System.in));
System.out.print("메뉴를 선택해 주세요: ");
menu = br.readLine();
} catch (Exception e) {
e.printStackTrace();
}
switch (menu) {
case "1":
cinema.reservation(customer);
cinema.pay(customer, customer.getReserve());
break;
case "2":
cinema.printTicket(customer.getReserve());
break;
case "3":
reviewWriter rw = new reviewWriter();
reviewReader rr = new reviewReader();
Scanner sc = new Scanner(System.in);
System.out.print("리뷰작성하려면 1번, 리뷰를 보려면 2번을 입력해주세요 : ");
String n = sc.nextLine();
if (n.equals("1")) {
System.out.print("리뷰하고 싶은 영화의 제목을 먼저 작성하세요 : ");
rw.addReview();
} else if (n.equals("2")) {
rr.lookReview();
}
break;
case "4":
System.out.println("종료");
return;
}
}
}
} | [
"[email protected]"
] | |
b4cbeaa3895bc6f799230895e673fe33f486cd87 | 06b9cec5a51bd8526744b635dc594e2a1a553c02 | /nanowrimo/src/main/java/nanowrimo/com/nanowrimo/Exception/GlobalExceptionHandler.java | b76172344005368d84e04f655c306181d99bdf40 | [] | no_license | AlexY86/NaNoWriMo | b6fe811e7423b018d607cb2c248c903b7b5c032e | 158e55cb0c27075267d98320051275ce24adc423 | refs/heads/main | 2023-08-30T09:00:24.952863 | 2021-10-25T19:10:51 | 2021-10-25T19:10:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package nanowrimo.com.nanowrimo.Exception;
import java.util.Date;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.context.request.WebRequest;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(ResourceNotFoundException.class)
public ResponseEntity<?> resourceNotFoundException(ResourceNotFoundException ex, WebRequest request) {
ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false));
return new ResponseEntity<>(errorDetails, HttpStatus.NOT_FOUND);
}
@ExceptionHandler(Exception.class)
public ResponseEntity<?> globleExcpetionHandler(Exception ex, WebRequest request) {
ErrorDetails errorDetails = new ErrorDetails(new Date(), ex.getMessage(), request.getDescription(false));
return new ResponseEntity<>(errorDetails, HttpStatus.INTERNAL_SERVER_ERROR);
}
}
| [
"[email protected]"
] | |
49c5f8b10dc8e1be12e4c9dae40da319d6615dab | 35016cb55dcbebef7393c8751ec3d2c9b260d5f6 | /TRSoa-master/TRSoa-master/TRSoa/target/generated-sources/archetype/src/main/resources/archetype-resources/src/main/java/dao/ProjectDAO.java | 1887aa55d5d72c3c68151b12117a832c70e11627 | [] | no_license | chaosssliu/practice | 6a5f13448d113260b9b08c42e132a4a3808c043d | da091688dfeb125fed06e031195ab76d9707e54e | refs/heads/master | 2022-06-24T14:20:38.213285 | 2022-06-10T21:40:50 | 2022-06-10T21:40:50 | 96,723,079 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.dao;
import ${package}.entity.Project;
import ${package}.vo.ProjectVO;
import java.util.List;
/**
* Created by Dawei on 9/1/16.
*/
public interface ProjectDAO {
Project saveProject(Project project);
List<Project> getProject();
List<ProjectVO> getProjectNameList();
}
| [
"[email protected]"
] | |
b643e0fb3a1c0570215ef36089e5f4dc7b3bc358 | c4ff86f81a68084f7c406fdf7c0d1487672f5fa4 | /src/main/java/com/raaldi/banker/repository/CurrencyRepository.java | bb08b1f335b530bdc4aceda5a3fe0d107d678de8 | [] | no_license | RaalDi/banker | a48140b476a763ff7c47e5471f4230f976cd0832 | 7feb1dc42835d88b4c68c830b7fd598c181ae932 | refs/heads/master | 2021-05-04T10:35:35.097041 | 2016-12-24T03:58:46 | 2016-12-24T03:58:46 | 54,799,488 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package com.raaldi.banker.repository;
import com.raaldi.banker.model.Currency;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository("currencyRepository")
public interface CurrencyRepository extends CrudRepository<Currency, Long> {
}
| [
"[email protected]"
] | |
2ea17201c46218a0a75d9548241ed8b0243043a4 | 8982c38c298225ad7e29627e11a9b1e08d1cd1a9 | /src/main/java/com/aerothinker/plandb/config/package-info.java | e06e6722086603c3c1260aed8a219dbc2a46a6f8 | [] | no_license | bigjungle/example-multitenancy | 4e49b110e4909d7f5945337f286740df36662cdf | 6c42d8f0832f90e2b8f63c1d4aeeadc6d670ffb1 | refs/heads/master | 2020-04-16T22:30:14.949844 | 2019-03-19T03:40:16 | 2019-03-19T03:40:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | /**
* Spring Framework configuration files.
*/
package com.aerothinker.plandb.config;
| [
"[email protected]"
] | |
7c431310f4a6ed09d7262f2d487615abeb8d2726 | a4a17277c6faf61713b46063ce9b4456ac73928a | /app/src/main/java/com/bytedance/xly/util/LogUtil.java | 823b01f9db0363581d7b9fbbb524cddf866010ec | [] | no_license | guoziren/techtrainingcamp-client-5 | 024e784187a46460f483069245420986a7ca78cf | e026bb60397de4973f14872b231acbcdcc352c5d | refs/heads/master | 2022-11-06T01:40:23.038553 | 2020-06-23T12:21:54 | 2020-06-23T12:21:54 | 266,136,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,339 | java | package com.bytedance.xly.util;
import android.util.Log;
/*
* 包名: com.blts.himalaya.utils
* 文件名: LogUtil
* 创建时间: 2020/4/7 1:27 PM
*
*/
public class LogUtil {
public static String sTAG = "LogUtil";
//控制是否要输出log
public static boolean sIsRelease = false;
/**
* 如果是要发布了,可以在application里面把这里release一下,这样子就没有log输出了
*/
public static void init(String baseTag, boolean isRelease) {
sTAG = baseTag;
sIsRelease = isRelease;
}
public static void d(String TAG, String content) {
if (!sIsRelease) {
Log.d("[" + sTAG + "]" + TAG, content);
}
}
public static void v(String TAG, String content) {
if (!sIsRelease) {
Log.v("[" + sTAG + "]" + TAG, content);
}
}
public static void i(String TAG, String content) {
if (!sIsRelease) {
Log.i("[" + sTAG + "]" + TAG, content);
}
}
public static void w(String TAG, String content) {
if (!sIsRelease) {
Log.w("[" + sTAG + "]" + TAG, content);
}
}
public static void e(String TAG, String content) {
if (!sIsRelease) {
Log.e("[" + sTAG + "]" + TAG, content);
}
}
}
| [
"[email protected]"
] | |
25498f239d1ca54df49011e77cbaacc7f973d9c3 | 7410044d3fb74321e40979fcb60363cd2eda340e | /springaop/src/main/java/com/neuedu/ttc/bean/Dept.java | c258b5a75852c06726cc5624df1564bfa11d864b | [] | no_license | a981899115/repo2 | 68188ce420af8a23b66c64d19f46c93cccaeb5c4 | 078cf72099c81232dc77a68234f9294404de618c | refs/heads/master | 2022-12-26T14:32:00.319427 | 2019-12-09T07:47:16 | 2019-12-09T07:47:16 | 226,813,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 448 | java | package com.neuedu.ttc.bean;
public class Dept {
private int deptno;
private String dname;
private String loc;
public int getDeptno() {
return deptno;
}
public void setDeptno(int deptno) {
this.deptno = deptno;
}
public String getDname() {
return dname;
}
public void setDname(String dname) {
this.dname = dname;
}
public String getLoc() {
return loc;
}
public void setLoc(String loc) {
this.loc = loc;
}
}
| [
"[email protected]"
] | |
d8612397394769cf6cc598025b113317b80b4d8b | 7faee5eb3e19209460d06b1aae3ff0f3b98f24df | /src/test/java/org/fastquery/bean/PManager.java | 3db457262816ef134d44b11783151fe9cb133caf | [
"Apache-2.0"
] | permissive | adian98/fastquery | e70b918d50bf67923f24b5351ce8a87547405fa3 | a934426bb81f2900ddc4aa574bdd2e2a9d26bf63 | refs/heads/master | 2020-05-04T15:14:15.450303 | 2019-04-03T02:47:28 | 2019-04-03T02:47:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,988 | java | /*
* Copyright (c) 2016-2088, fastquery.org and/or its affiliates. All rights reserved.
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information, please see http://www.fastquery.org/.
*
*/
package org.fastquery.bean;
import java.util.ArrayList;
import java.util.List;
import org.fastquery.core.Id;
/**
*
* @author xixifeng ([email protected])
*/
public class PManager {
@Id
private Long pmuid; // 物管员帐号ID
private Long punitId; // 物业单位ID
private String mobile; // 唯一约束,登录帐号
private String password;// 密码
private Byte isActive = 0;// 是否激活 0未激活,1激活
private Byte isdm = 0; // 是否是设备管理员(0否,1是)可管理门禁,蓝牙设备
private Byte isReg = 0; // 是否可进行人员登记(0:否,1:是,默认:0) 可操作people
private Byte pmRole = 0; // 物管员角色
// (0:其他,1:物业主任,2:保安经理,3:保安队长,4:保安,88:维修人员/技工)
private String realName; // 真实姓名
private Byte gender = 0; // 性别(0:保密,1:男,2:女)
private String head; // 头像
private Byte isOnline = 0; // 是否在线 (0:否,1:是,默认:0)
private String hxuser; // 环信帐号(用于门禁呼叫)
private String hxpass; // 环信密码(用于门禁呼叫)
private String hxRoomId; // 环信聊天房间Id(用于对讲广播)
private Long createUid = 0L;// 默认:0 创建人UID
private Long lastUpdateUid;// 默认:0 最后修改人UID --云平台
private int[] ins = new int[] {};
private List<String> lists = new ArrayList<>();
public PManager() {
}
public PManager(Long punitId, String mobile, String password, Byte isdm, Byte isReg, Byte pmRole, String realName, Byte gender) {
this.punitId = punitId;
this.mobile = mobile;
this.password = password;
this.isdm = isdm;
this.isReg = isReg;
this.pmRole = pmRole;
this.realName = realName;
this.gender = gender;
}
public Long getPmuid() {
return pmuid;
}
public Long getPunitId() {
return punitId;
}
public String getMobile() {
return mobile;
}
public String getPassword() {
return password;
}
public Byte getIsActive() {
return isActive;
}
public Byte getIsdm() {
return isdm;
}
public Byte getIsReg() {
return isReg;
}
public Byte getPmRole() {
return pmRole;
}
public String getRealName() {
return realName;
}
public Byte getGender() {
return gender;
}
public String getHead() {
return head;
}
public Byte getIsOnline() {
return isOnline;
}
public String getHxuser() {
return hxuser;
}
public String getHxpass() {
return hxpass;
}
public String getHxRoomId() {
return hxRoomId;
}
public Long getCreateUid() {
return createUid;
}
public Long getLastUpdateUid() {
return lastUpdateUid;
}
public void setPmuid(Long pmuid) {
this.pmuid = pmuid;
}
public void setPunitId(Long punitId) {
this.punitId = punitId;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public void setPassword(String password) {
this.password = password;
}
public void setIsActive(Byte isActive) {
this.isActive = isActive;
}
public void setIsdm(Byte isdm) {
this.isdm = isdm;
}
public void setIsReg(Byte isReg) {
this.isReg = isReg;
}
public void setPmRole(Byte pmRole) {
this.pmRole = pmRole;
}
public void setRealName(String realName) {
this.realName = realName;
}
public void setGender(Byte gender) {
this.gender = gender;
}
public void setHead(String head) {
this.head = head;
}
public void setIsOnline(Byte isOnline) {
this.isOnline = isOnline;
}
public void setHxuser(String hxuser) {
this.hxuser = hxuser;
}
public void setHxpass(String hxpass) {
this.hxpass = hxpass;
}
public void setHxRoomId(String hxRoomId) {
this.hxRoomId = hxRoomId;
}
public void setCreateUid(Long createUid) {
this.createUid = createUid;
}
public void setLastUpdateUid(Long lastUpdateUid) {
this.lastUpdateUid = lastUpdateUid;
}
public int[] getIns() {
return ins;
}
public void setIns(int[] ins) {
this.ins = ins;
}
public List<String> getLists() {
return lists;
}
public void setLists(List<String> lists) {
this.lists = lists;
}
}
| [
"[email protected]"
] | |
cb24dfa1b4210389810d05234e4817c3d99c6ab4 | a747308a571b7111083dcac51b7cbb4c9de1c89e | /regular-expression-engine/src/main/java/domain/SymbolTransition.java | 92f3b28d0988009048ce06660367d9cc3460c094 | [
"MIT"
] | permissive | strajama/regular-expression-engine | b4410890082afbd8865b912205241b00abe2d2e0 | d4cccfa41ff18c82438f1d2cabd99c65f5574a0b | refs/heads/master | 2020-04-29T04:23:29.867410 | 2019-05-05T11:38:47 | 2019-05-05T11:38:47 | 175,845,684 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package domain;
/**
* SymbolTransition implements Transition-interface
*
* @author strajama
*/
public class SymbolTransition implements Transition {
private State from;
private State to;
private char symbol;
/**
* Creates new SymbolTransition
*
* @param from - state where the transition begins
* @param to - state where transition ends
* @param symbol - symbol that is needed for using transition
*/
public SymbolTransition(State from, State to, char symbol) {
this.from = from;
this.to = to;
this.symbol = symbol;
}
/**
* Gives the information about transitions beginning state
*
* @return - state where the transition begins
*/
public State getFrom() {
return from;
}
/**
* Gives the information about the transitions end state
*
* @return - state where the transition ends
*/
public State getTo() {
return to;
}
/**
* Gives the information which symbol that is needed for using transition
*
* @return symbol-character
*/
public char getSymbol() {
return symbol;
}
/**
* Gives the information if state is symbol transition
*
* @return true
*/
public boolean hasSymbol() {
return true;
}
}
| [
"[email protected]"
] | |
c63cb72fae07344895ba4219b4fdee2942325a4b | 1bf8e0a65acb4159ce24747ef7fec95f9c73a5c9 | /src/main/java/com/ssm/rwsxx/dao/RwsxxDao.java | 792e0c918aff0dcb5ade6679e0881e2ac9fad582 | [] | no_license | sunshuaiqi888/sunshuaiqi_SSM | 12f9b41b1d5ee7d5c0836bfb43868fce27839c0a | 488787fd68eebc1f0c801e5a02610646fc21f92c | refs/heads/master | 2022-11-30T20:25:10.765015 | 2020-08-20T09:37:16 | 2020-08-20T09:37:16 | 285,792,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.ssm.rwsxx.dao;
import com.ssm.rwsxx.bean.RwsBean;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by sunsq on 2020/8/6.
*/
@Repository
public interface RwsxxDao {
List<RwsBean> rwslist() throws Exception;
}
| [
"[email protected]"
] | |
7b4bc412d2816af6d747b0a85a9a3bcaa9450fe3 | e037de4eb12225f77ac3d8d64ef38dd021e61348 | /EntregaSegundoExamen/TstWSProdPojo/build/generated-sources/jax-ws/wsprod/FindAllResponse.java | 0b368ae07c156fd235ef3697f8f26caedf30c571 | [] | no_license | FAltamiranoZ/SistemasDeComercioElectronico | 7a63ad6219cae066fea2c5b8c98628f000daef24 | cd26c5dde33d99ea1b3bbd78560c7088d42bf097 | refs/heads/main | 2023-02-13T13:25:35.758588 | 2021-01-04T00:31:56 | 2021-01-04T00:31:56 | 326,528,240 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,816 | java |
package wsprod;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Clase Java para findAllResponse complex type.
*
* <p>El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
*
* <pre>
* <complexType name="findAllResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://wsProd/}product" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "findAllResponse", propOrder = {
"_return"
})
public class FindAllResponse {
@XmlElement(name = "return")
protected List<Product> _return;
/**
* Gets the value of the return property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the return property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReturn().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Product }
*
*
*/
public List<Product> getReturn() {
if (_return == null) {
_return = new ArrayList<Product>();
}
return this._return;
}
}
| [
"[email protected]"
] | |
e54759c2bc50338606310b4ecb1261e2eeef25ec | 77fa526a7b4cf490a2ceab66d5eb6831a3750776 | /java/org/apache/tomcat/jni/Time.java | ad19dd1089ac7d6699e40c39b551e0836e81a84f | [
"Apache-2.0",
"LicenseRef-scancode-unknown"
] | permissive | srividyac09/tomcat-native | 5390308a74ebe31be357e18e145100048cce5d0a | 4f52ed907f44b2a400f79f137e3021e7e7f8cad5 | refs/heads/main | 2023-06-27T16:29:53.038445 | 2021-07-23T04:49:38 | 2021-07-23T04:49:38 | 388,088,489 | 0 | 0 | Apache-2.0 | 2021-07-21T11:03:04 | 2021-07-21T11:03:03 | null | UTF-8 | Java | false | false | 2,640 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tomcat.jni;
/** Time
*
* @author Mladen Turk
*
* @deprecated The scope of the APR/Native Library will be reduced in Tomcat
* 10.1.x / Tomcat Native 2.x onwards to only include those
* components required to provide OpenSSL integration with the NIO
* and NIO2 connectors.
*/
@Deprecated
public class Time {
/** number of microseconds per second */
public static final long APR_USEC_PER_SEC = 1000000L;
/** number of milliseconds per microsecond */
public static final long APR_MSEC_PER_USEC = 1000L;
/**
* @param t The time
* @return apr_time_t as a second
*/
public static long sec(long t)
{
return t / APR_USEC_PER_SEC;
}
/**
* @param t The time
* @return apr_time_t as a msec
*/
public static long msec(long t)
{
return t / APR_MSEC_PER_USEC;
}
/**
* number of microseconds since 00:00:00 January 1, 1970 UTC
* @return the current time
*/
public static native long now();
/**
* Formats dates in the RFC822
* format in an efficient manner.
* @param t the time to convert
* @return the formatted date
*/
public static native String rfc822(long t);
/**
* Formats dates in the ctime() format
* in an efficient manner.
* Unlike ANSI/ISO C ctime(), apr_ctime() does not include
* a \n at the end of the string.
* @param t the time to convert
* @return the formatted date
*/
public static native String ctime(long t);
/**
* Sleep for the specified number of micro-seconds.
* <br><b>Warning :</b> May sleep for longer than the specified time.
* @param t desired amount of time to sleep.
*/
public static native void sleep(long t);
}
| [
"[email protected]"
] | |
7e5baad1af43808686b85516ab5bf3207070e071 | d77964aa24cfdca837fc13bf424c1d0dce9c70b9 | /spring-boot/src/main/java/org/springframework/boot/context/logging/ClasspathLoggingApplicationListener.java | d3319aca3b55182d614872bf492326aa7a5f3f6e | [] | no_license | Suryakanta97/Springboot-Project | 005b230c7ebcd2278125c7b731a01edf4354da07 | 50f29dcd6cea0c2bc6501a5d9b2c56edc6932d62 | refs/heads/master | 2023-01-09T16:38:01.679446 | 2018-02-04T01:22:03 | 2018-02-04T01:22:03 | 119,914,501 | 0 | 1 | null | 2022-12-27T14:52:20 | 2018-02-02T01:21:45 | Java | UTF-8 | Java | false | false | 3,158 | java | /*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.context.logging;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.GenericApplicationListener;
import org.springframework.context.event.SmartApplicationListener;
import org.springframework.core.ResolvableType;
import java.net.URLClassLoader;
import java.util.Arrays;
/**
* A {@link SmartApplicationListener} that reacts to
* {@link ApplicationEnvironmentPreparedEvent environment prepared events} and to
* {@link ApplicationFailedEvent failed events} by logging the classpath of the thread
* context class loader (TCCL) at {@code DEBUG} level.
*
* @author Andy Wilkinson
* @since 2.0.0
*/
public final class ClasspathLoggingApplicationListener
implements GenericApplicationListener {
private static final int ORDER = LoggingApplicationListener.DEFAULT_ORDER + 1;
private static final Log logger = LogFactory
.getLog(ClasspathLoggingApplicationListener.class);
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (logger.isDebugEnabled()) {
if (event instanceof ApplicationEnvironmentPreparedEvent) {
logger.debug("Application started with classpath: " + getClasspath());
} else if (event instanceof ApplicationFailedEvent) {
logger.debug(
"Application failed to start with classpath: " + getClasspath());
}
}
}
@Override
public int getOrder() {
return ORDER;
}
@Override
public boolean supportsEventType(ResolvableType resolvableType) {
Class<?> type = resolvableType.getRawClass();
if (type == null) {
return false;
}
return ApplicationEnvironmentPreparedEvent.class.isAssignableFrom(type)
|| ApplicationFailedEvent.class.isAssignableFrom(type);
}
@Override
public boolean supportsSourceType(Class<?> sourceType) {
return true;
}
private String getClasspath() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader instanceof URLClassLoader) {
return Arrays.toString(((URLClassLoader) classLoader).getURLs());
}
return "unknown";
}
}
| [
"[email protected]"
] | |
de40b7387326663beb2c9e0680057fc83cda6ea9 | eadca070d221e93595f4fde112a73b7439c9a24a | /wiki-src/net/hillsdon/reviki/vc/ChangeNotificationDispatcher.java | 335720a5507e122731b8b74b9bfc80fc22a1701d | [
"Apache-2.0"
] | permissive | CoreFiling/reviki | fcbee0dcb66ad71ab0d3bddf194ab3aa2148fc9f | 37f53c5396bf7720183c7b808d769884c576e858 | refs/heads/master | 2023-03-17T13:12:37.692458 | 2023-03-14T18:00:55 | 2023-03-14T18:00:55 | 17,807,727 | 7 | 7 | null | 2017-04-06T17:10:24 | 2014-03-16T19:53:07 | Java | UTF-8 | Java | false | false | 803 | java | /**
* Copyright 2008 Matthew Hillsdon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.hillsdon.reviki.vc;
import java.io.IOException;
public interface ChangeNotificationDispatcher {
void sync() throws PageStoreAuthenticationException, PageStoreException, IOException;
}
| [
"[email protected]"
] | |
2a358dd27287a0c11ddc7d60ce403163a63fbb12 | 36c0a0e21f3758284242b8d2e40b60c36bd23468 | /src/main/java/com/datasphere/engine/manager/resource/consumer/log/LogSqlBuilder.java | dc7a8c7d57cb5cd1b073be914e7c605aa85fe0aa | [
"LicenseRef-scancode-mulanpsl-1.0-en"
] | permissive | neeeekoooo/datasphere-service | 0185bca5a154164b4bc323deac23a5012e2e6475 | cb800033ba101098b203dbe0a7e8b7f284319a7b | refs/heads/master | 2022-11-15T01:10:05.530442 | 2020-02-01T13:54:36 | 2020-02-01T13:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,099 | java | /*
* Copyright 2019, Huahuidata, Inc.
* DataSphere is licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at:
* http://license.coscl.org.cn/MulanPSL
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v1 for more details.
*/
package com.datasphere.engine.manager.resource.consumer.log;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.datasphere.engine.manager.resource.common.NoSuchConsumerException;
import com.datasphere.engine.manager.resource.model.Consumer;
import com.datasphere.engine.manager.resource.model.ConsumerBuilder;
import com.datasphere.engine.manager.resource.model.Registration;
@Component
public class LogSqlBuilder implements ConsumerBuilder {
@Value("${consumers.log.enable}")
private boolean enabled;
private static LogSqlConsumer _instance;
@Override
public String getType() {
return LogSqlConsumer.TYPE;
}
@Override
public String getId() {
return LogSqlConsumer.ID;
}
@Override
public Set<String> listProperties() {
return new HashSet<String>();
}
@Override
public boolean isAvailable() {
return enabled;
}
@Override
public Consumer build() throws NoSuchConsumerException {
if (!enabled) {
throw new NoSuchConsumerException();
}
// use singleton
if (_instance == null) {
_instance = new LogSqlConsumer();
// explicitly call init() since @postconstruct won't work here
_instance.init();
}
return _instance;
}
@Override
public Consumer build(Map<String, Serializable> properties) throws NoSuchConsumerException {
return build();
}
@Override
public Consumer build(Registration reg) throws NoSuchConsumerException {
return build();
}
}
| [
"[email protected]"
] | |
b4d2ee8f2c40a1cb345a19e7cced5773f71b06dc | 545d1aa7075c423ac22d5057684d444c72d9a8c2 | /codes/1417-Reformat-The-String/Java/main1.java | 75347eb0823816f472e4e3f790ee1f329253eb12 | [] | no_license | Stackingrule/LeetCode-Solutions | da9420953b0e56bb76f026f5c1a4a48cd404641d | 3f7d22dd94eef4e47f3c19c436b00c40891dc03b | refs/heads/main | 2023-08-28T00:43:37.871877 | 2021-10-14T02:55:42 | 2021-10-14T02:55:42 | 207,331,384 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 855 | java | class Solution {
public String reformat(String s) {
List<Character> digits = new ArrayList<>();
List<Character> characters = new ArrayList<>();
for (char c : s.toCharArray()) {
if (Character.isDigit(c)) {
digits.add(c);
} else {
characters.add(c);
}
}
if (Math.abs(digits.size() - characters.size()) >= 2) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean digit = (digits.size() >= characters.size() ? true : false);
for (int i = 0; i < s.length(); i++) {
if (digit) {
sb.append(digits.remove(0));
} else {
sb.append(characters.remove(0));
}
digit = !digit;
}
return sb.toString();
}
} | [
"[email protected]"
] | |
6624647431993b8d33e79c47ce898cb60d93fba0 | d33e9f808a2f57de2ef5824b1eb39d44ee9fb43c | /year2/semester2/mpp/java/TripClientServer/TripCommon/src/main/java/net/Response.java | 5607f47744447125cadb491f9ab5272c81fb48f4 | [] | no_license | maria-lazar/education | 8e494ec0dd004cae9d0006464a396b0de2c4f447 | 6eb3ebff507209f8216b47bad97138f0208c4806 | refs/heads/master | 2021-08-29T07:17:14.014286 | 2021-08-09T15:54:30 | 2021-08-09T15:54:30 | 253,291,675 | 0 | 0 | null | 2021-08-09T15:56:47 | 2020-04-05T17:25:35 | Java | UTF-8 | Java | false | false | 1,013 | java | package net;
import java.io.Serializable;
public class Response implements Serializable {
private ResponseType type;
private Object data;
private Response(){};
public ResponseType type(){
return type;
}
public Object data(){
return data;
}
private void type(ResponseType type){
this.type=type;
}
private void data(Object data){
this.data=data;
}
@Override
public String toString(){
return "Response{" +
"type='" + type + '\'' +
", data='" + data + '\'' +
'}';
}
public static class Builder{
private Response response=new Response();
public Builder type(ResponseType type) {
response.type(type);
return this;
}
public Builder data(Object data) {
response.data(data);
return this;
}
public Response build() {
return response;
}
}
}
| [
"[email protected]"
] | |
0ac759fa216e8ed2455dfaf08a12a0fae2fd3f59 | 8f92e60b825c768bfd7d51b08f3383726c57c3b4 | /atcrowdfunding-manager-impl/src/main/java/com/atguigu/atcrowdfunding/manager/service/impl/RoleServiceImpl.java | 6efa3cc5ac5d2b4a68cc1f329bc90ffef5367a25 | [] | no_license | McChakLeung/atcrowdfunding-maven | 2f60aac960ed458c4f26e20e59dbeb883ef64cdc | 3cd909e63de185ae1a8dfe47329b7df1cb5a2c37 | refs/heads/master | 2022-12-22T18:41:35.361797 | 2019-08-28T09:45:05 | 2019-08-28T09:45:05 | 195,016,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,369 | java | package com.atguigu.atcrowdfunding.manager.service.impl;
import com.atguigu.atcrowdfunding.bean.Permission;
import com.atguigu.atcrowdfunding.bean.Role;
import com.atguigu.atcrowdfunding.bean.RolePermission;
import com.atguigu.atcrowdfunding.manager.dao.RoleMapper;
import com.atguigu.atcrowdfunding.manager.service.RoleService;
import com.atguigu.atcrowdfunding.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class RoleServiceImpl implements RoleService {
@Autowired
private RoleMapper roleMapper;
@Override
public Page<Role> queryRoleListByParams(Map<String, Object> params) {
//初始化Page对象
Page<Role> page = new Page((Integer) params.get("pageno"),(Integer)params.get("pagesize"));
//根据初始化Page类对象获得起始行的值
Integer startline = page.getStartline();
//将startline存入到参数集合中
params.put("startline",startline);
//将数据库中查询出来的Role数据查询出来并存放到page对象中,将page对象返回给控制器
List<Role> roleList = roleMapper.queryRoleListByParams(params);
page.setDatalist(roleList);
return page;
}
@Override
public List<Permission> queryPermissionByRoleID(Integer roleId) {
return roleMapper.queryPermissionByRoleID(roleId);
}
@Override
public Integer processAssignPermission(Integer roleId, List<Integer> ids) {
//删除roleId对应的权限
roleMapper.deletePermissionByRoleID(roleId);
//组装RolePermission类,否则无法插入到数据库中
List<RolePermission> rolePermissionList = new ArrayList<>();
for (Integer permissionID: ids) {
RolePermission rolePermission = new RolePermission();
rolePermission.setRoleid(roleId);
rolePermission.setPermissionid(permissionID);
rolePermissionList.add(rolePermission);
}
//保存需要修改的数据到中间表
Integer count = roleMapper.saveRolePermission(rolePermissionList);
return count;
}
@Override
public List queryRoleInfo(Integer id) {
return roleMapper.queryRoleInfo(id);
}
}
| [
"[email protected]"
] | |
694caabb0be0dc425374c4374a84eaf90a745c0d | 07cf6b36c2008e94cc07261de389070c97b5b6b3 | /app/src/main/java/id/web/setoelkahfi/top10downloader/MainActivity.java | 7ece391d0fa3b6345aa59b55cade46709cde24f6 | [] | no_license | setoelkahfi/Top-10-Downloader | 0ac9b74a191a32c935aed77af0dfca27de2cfa48 | 740590724cac465752d771901da193a25b7dae3a | refs/heads/master | 2021-01-10T04:16:21.247151 | 2016-01-20T03:07:45 | 2016-01-20T03:07:45 | 50,000,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,268 | java | package id.web.setoelkahfi.top10downloader;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class MainActivity extends AppCompatActivity {
private String mFileContents;
private Button buttonParse;
private ListView listApps;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
buttonParse = (Button) findViewById(R.id.buttonParse);
buttonParse.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ParseApplications parseApplications = new ParseApplications(mFileContents);
parseApplications.process();
ArrayAdapter<Application> arrayAdapter = new ArrayAdapter<Application>(
MainActivity.this, R.layout.list_item, parseApplications.getApplications());
listApps.setAdapter(arrayAdapter);
}
});
listApps = (ListView) findViewById(R.id.listApps);
DownloadData downloadData = new DownloadData();
downloadData.execute("http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topfreeapplications/limit=10/xml");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
private class DownloadData extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... strings) {
mFileContents = downloadXMLFile(strings[0]);
if (mFileContents == null) {
Log.d("DownloadData", "Error downloading data.");
}
return mFileContents;
}
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
Log.d("DownloadData","Result was: " + result);
}
private String downloadXMLFile(String urlPath) {
StringBuilder tempBuffer = new StringBuilder();
try {
URL url = new URL(urlPath);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
int response = connection.getResponseCode();
Log.d("DownloadData", "The response code was " + response);
InputStream inputStream = connection.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
int characterRead;
char[] inputBuffer = new char[500];
while (true) {
characterRead = inputStreamReader.read(inputBuffer);
if (characterRead <= 0) break;
tempBuffer.append(String.copyValueOf(inputBuffer, 0, characterRead));
}
return tempBuffer.toString();
} catch (IOException e) {
Log.d("DownloadData", "IO Exception reading data: " + e.getMessage());
} catch (SecurityException e) {
Log.d("DownloadData", "Security exception. Needs permissions? Permission denied " + e.getMessage());
}
return null;
}
}
}
| [
"[email protected]"
] | |
d502378a5515faa7f15d241e410881f82224c430 | d48cfe7bb65c3169dea931f605d62b4340222d75 | /chinahrd-hrbi/base/src/main/java/net/chinahrd/module/SysMenuDefine.java | b53da3b4035cb9eae40808ca0ac433b0c0407efa | [] | no_license | a559927z/doc | 7b65aeff1d4606bab1d7f71307d6163b010a226d | 04e812838a5614ed78f8bbfa16a377e7398843fc | refs/heads/master | 2022-12-23T12:09:32.360591 | 2019-07-15T17:52:54 | 2019-07-15T17:52:54 | 195,972,411 | 0 | 0 | null | 2022-12-16T07:47:50 | 2019-07-09T09:02:38 | JavaScript | UTF-8 | Java | false | false | 459 | java | /**
*net.chinahrd.cache
*/
package net.chinahrd.module;
import net.chinahrd.core.menu.MenuRegisterAbstract;
/**
* @author htpeng
*2016年10月11日下午11:52:52
*/
public class SysMenuDefine extends MenuRegisterAbstract{
/* (non-Javadoc)
* @see net.chinahrd.core.menu.MenuRegisterAbstract#getFileInputSteam()
*/
@Override
protected String getXmlPath() {
// TODO Auto-generated method stub
return "menu.xml";
}
}
| [
"[email protected]"
] | |
a2389712aee5343a7a4415040da1f83f372b08d8 | 0cce680f4d8eeb10a411ed73371f6e2e4976bf33 | /rosjava/src/main/java/org/ros/internal/transport/tcp/TcpServerHandshakeHandler.java | 2cc2af91ec1e14afbc45fc153192667f2bd9a7cd | [] | no_license | fabiancook/faybecook-clone | e47fa7d5af5cb2a5290cf70608f38a296cdbf606 | 8f1d00e5e4d388943ac1fc3ba8f77c51e8f66e7a | refs/heads/master | 2021-01-10T22:11:50.561195 | 2012-05-02T13:13:38 | 2012-05-02T13:13:38 | 32,115,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,151 | java | /*
* Copyright (C) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.ros.internal.transport.tcp;
import com.google.common.base.Preconditions;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandler;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
import org.ros.exception.RosRuntimeException;
import org.ros.internal.node.server.NodeIdentifier;
import org.ros.internal.node.service.DefaultServiceServer;
import org.ros.internal.node.service.ServiceManager;
import org.ros.internal.node.service.ServiceResponseEncoder;
import org.ros.internal.node.topic.DefaultPublisher;
import org.ros.internal.node.topic.SubscriberIdentifier;
import org.ros.internal.node.topic.TopicIdentifier;
import org.ros.internal.node.topic.TopicParticipantManager;
import org.ros.internal.transport.ConnectionHeader;
import org.ros.internal.transport.ConnectionHeaderFields;
import org.ros.namespace.GraphName;
import java.util.Map;
/**
* A {@link ChannelHandler} which will process the TCP server handshake.
*
* @author [email protected] (Damon Kohler)
* @author [email protected] (Ken Conley)
*/
public class TcpServerHandshakeHandler extends SimpleChannelHandler {
private final TopicParticipantManager topicParticipantManager;
private final ServiceManager serviceManager;
public TcpServerHandshakeHandler(TopicParticipantManager topicParticipantManager,
ServiceManager serviceManager) {
this.topicParticipantManager = topicParticipantManager;
this.serviceManager = serviceManager;
}
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
ChannelBuffer incomingBuffer = (ChannelBuffer) e.getMessage();
ChannelPipeline pipeline = e.getChannel().getPipeline();
Map<String, String> incomingHeader = ConnectionHeader.decode(incomingBuffer);
if (incomingHeader.containsKey(ConnectionHeaderFields.SERVICE)) {
handleServiceHandshake(e, pipeline, incomingHeader);
} else {
handleSubscriberHandshake(ctx, e, pipeline, incomingHeader);
}
super.messageReceived(ctx, e);
}
private void handleServiceHandshake(MessageEvent e, ChannelPipeline pipeline,
Map<String, String> incomingHeader) {
GraphName serviceName = new GraphName(incomingHeader.get(ConnectionHeaderFields.SERVICE));
Preconditions.checkState(serviceManager.hasServer(serviceName));
DefaultServiceServer<?, ?> serviceServer = serviceManager.getServer(serviceName);
e.getChannel().write(serviceServer.finishHandshake(incomingHeader));
String probe = incomingHeader.get(ConnectionHeaderFields.PROBE);
if (probe != null && probe.equals("1")) {
e.getChannel().close();
} else {
pipeline.replace(TcpServerPipelineFactory.LENGTH_FIELD_PREPENDER, "ServiceResponseEncoder",
new ServiceResponseEncoder());
pipeline.replace(this, "ServiceRequestHandler", serviceServer.newRequestHandler());
}
}
private void handleSubscriberHandshake(ChannelHandlerContext ctx, MessageEvent e,
ChannelPipeline pipeline, Map<String, String> incomingHeader) throws InterruptedException,
Exception {
Preconditions.checkState(incomingHeader.containsKey(ConnectionHeaderFields.TOPIC),
"Handshake header missing field: " + ConnectionHeaderFields.TOPIC);
GraphName topicName = new GraphName(incomingHeader.get(ConnectionHeaderFields.TOPIC));
Preconditions.checkState(topicParticipantManager.hasPublisher(topicName),
"No publisher for topic: " + topicName);
DefaultPublisher<?> publisher = topicParticipantManager.getPublisher(topicName);
ChannelBuffer outgoingBuffer = publisher.finishHandshake(incomingHeader);
Channel channel = ctx.getChannel();
ChannelFuture future = channel.write(outgoingBuffer).await();
if (!future.isSuccess()) {
throw new RosRuntimeException(future.getCause());
}
String nodeName = incomingHeader.get(ConnectionHeaderFields.CALLER_ID);
publisher.addSubscriber(new SubscriberIdentifier(NodeIdentifier.forName(nodeName),
new TopicIdentifier(topicName)), channel);
// Once the handshake is complete, there will be nothing incoming on the
// channel. So, we replace the handshake handler with a handler which will
// drop everything.
pipeline.replace(this, "DiscardHandler", new SimpleChannelHandler());
}
}
| [
"[email protected]"
] | |
4d102ec3c04016d93f69049d875e947b7c42ed13 | 4f1a952eae22bd06d178ee19c53579f24cee94ea | /src/main/java/com/example/cinema/service/CinemaInitServiceImpl.java | 72be5f63d3f09965d5241ba8dea3ba26c107e81d | [] | no_license | ElMehdiMoqtad/Cinema_project_JEE | d3aa001738d1ceb8a7041a66c607c55a09176599 | ef078db119c58766066cca63434bcbe7e3a80381 | refs/heads/main | 2023-06-09T03:37:58.839826 | 2021-06-29T22:02:08 | 2021-06-29T22:02:08 | 381,501,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,530 | java | package com.example.cinema.service;
import com.example.cinema.Entity.*;
import com.example.cinema.dao.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.stream.Stream;
@Transactional
@Service
public class CinemaInitServiceImpl implements ICinemaInitService{
@Autowired
private VilleRepository villeRepository;
@Autowired
private CinemaRepository cinemaRepository;
@Autowired
private SalleRepository salleRepository;
@Autowired
private PlaceRepository placeRepository;
@Autowired
private SeanceRepository seanceRepository;
@Autowired
private CategoryRepository categoryRepository;
@Autowired
private FilmRepository filmRepository;
@Autowired
private ProjectionRepository projectionRepository;
@Autowired
private TicketRepository ticketRepository;
@Override
public void initVilles() {
Stream.of("Casablanca","Marrakech","Rabat","Tanger").forEach(nameVille->{
Ville ville = new Ville();
ville.setName(nameVille);
villeRepository.save(ville);
});
}
@Override
public void initCinemas() {
villeRepository.findAll().forEach(ville->{
Stream.of("Megarama","Imax","Founon","Chahrazad","Daouliz").forEach(nameCinema->{
Cinema cinema=new Cinema();
cinema.setName(nameCinema);
cinema.setVille(ville);
cinema.setNombreSalles(3+(int)(Math.random()*7));
cinemaRepository.save(cinema);
});
});
}
@Override
public void initSeances() {
DateFormat dateFormat= new SimpleDateFormat("HH:mm");
Stream.of("12:00","14:00","16:00","18:00","20:00").forEach(s ->{
Seance seance = new Seance();
try{
seance.setHeureDebut(dateFormat.parse(s));
seanceRepository.save(seance);
}catch(ParseException e ){
e.printStackTrace();
}
});
}
@Override
public void initTickets() {
projectionRepository.findAll().forEach(p->{
p.getSalle().getPlaces().forEach(place -> {
Ticket ticket = new Ticket();
ticket.setPlace(place);
ticket.setPrix(p.getPrix());
ticket.setProjection(p);
ticket.setReserve(false);
ticketRepository.save(ticket);
});
});
}
@Override
public void initSalles() {
cinemaRepository.findAll().forEach(cinema ->{
for(int i=0;i<cinema.getNombreSalles();i++){
Salle salle = new Salle();
salle.setName("Salle"+(i+1));
salle.setCinema(cinema);
salle.setNombreplace(15+(int)(Math.random()*10));
salleRepository.save(salle);
}
});
}
@Override
public void initProjections() {
double[] prices=new double[] {30,45,60,70,85,100};
List<Film> films=filmRepository.findAll();
villeRepository.findAll().forEach(ville->{
ville.getCinemas().forEach(cinema -> {
cinema.getSalles().forEach(salle->{
int index=new Random().nextInt(films.size());
Film film=films.get(index);
seanceRepository.findAll().forEach(seance -> {
Projection projection =new Projection();
projection.setDateProjection(new Date());
projection.setFilm(film);
projection.setPrix(prices[new Random().nextInt(prices.length)]);
projection.setSalle(salle);
projection.setSeance(seance);
projectionRepository.save(projection);
});
});
});
});
};
@Override
public void initFilms() {
double[] durees=new double[] {1,2,1,3,1,2};
List<Category> categories=categoryRepository.findAll();
Stream.of("Inception","Papillon","Hacksaw Ridge","WrathofMan","NoBody","Lansky").forEach(titrefilm->{
Film film = new Film();
film.setTitre(titrefilm);
film.setDuree(durees[new Random().nextInt(durees.length)]);
film.setPhoto(titrefilm.replaceAll(" ","")+".jpg");
film.setCategory(categories.get(new Random().nextInt(categories.size())));
filmRepository.save(film);
});
}
@Override
public void initCategories() {
Stream.of("Histoire","Action","Drama","Horreur").forEach(cat->{
Category categorie = new Category();
categorie.setName(cat);
categoryRepository.save(categorie);
});
}
@Override
public void initPlaces() {
salleRepository.findAll().forEach(salle -> {
for(int i = 0 ; i< salle.getNombreplace(); i++){
Place place = new Place();
place.setNumero(i+1);
place.setSalle(salle);
placeRepository.save(place);
}
});
}
}
| [
"[email protected]"
] | |
8c966f71274bfa2b17656d8b14f79251fae1ddc8 | 82de1e98e30a0836b892f00e07bfcc0954dbc517 | /hotcomm-data/hotcomm-data-service/src/main/java/com/hotcomm/data/web/controller/comm/BaseController.java | 97e1df152f1a310efb90756519a4a0b63137e863 | [] | no_license | jiajiales/hangkang-qingdao | ab319048b61f6463f8cf1ac86ac5c74bd3df35d7 | 60a0a4b1d1fb9814d8aa21188aebbf72a1d6b25d | refs/heads/master | 2020-04-22T17:07:34.569613 | 2019-02-13T15:14:07 | 2019-02-13T15:14:07 | 170,530,164 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,284 | java | package com.hotcomm.data.web.controller.comm;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hotcomm.data.bean.vo.sys.MemberResource;
import com.hotcomm.data.bean.vo.sys.MemberVO;
import com.hotcomm.framework.utils.PropertiesHelper;
import com.hotcomm.framework.utils.RedisHelper;
import com.hotcomm.framework.web.exception.HKException;
@Component
public class BaseController {
@Resource
HttpServletRequest request;
@Resource
private RedisHelper redisHelper;
protected MemberVO getLoginMember() {
MemberVO result = null;
try {
String token = request.getParameter("token");
if (PropertiesHelper.devModel.equals("test")&&token==null) {
result = new MemberVO();
result.setMemberName("admin");
return result;
}
String userJson = redisHelper.get(token);
ObjectMapper mapper = new ObjectMapper();
MemberResource memberResource = mapper.readValue(userJson, MemberResource.class);
result = memberResource.getMember();
} catch (Exception e) {
throw new HKException("USER_TOKEN_001", "获取当前登入用户信息失败");
}
return result;
}
}
| [
"[email protected]"
] | |
4f729b04229401dc43dfc141c693fd29690619a3 | a74087db2120fc58671f6887ac00447882a52ef9 | /app/src/main/java/home/smart/fly/animations/utils/AppUtils.java | 4d98727c6fc27a52a9724f35ab021bd47ad8e101 | [
"Apache-2.0"
] | permissive | silexcorp/AndroidAnimationExercise | 308087657305b80d493722cfa72045718b08b242 | 26c039436ce0c5c7a89782092203c04e5e284db4 | refs/heads/master | 2020-08-26T22:35:09.736013 | 2019-10-23T02:25:34 | 2019-10-23T02:25:34 | 217,169,115 | 1 | 0 | Apache-2.0 | 2019-10-23T23:06:42 | 2019-10-23T23:06:42 | null | UTF-8 | Java | false | false | 3,426 | java | package home.smart.fly.animations.utils;
/**
* @author: zhuyongging
* @since: 2019-02-24
*/
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
public class AppUtils {
/**
* 获取应用程序名称
*/
public static synchronized String getAppName(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
int labelRes = packageInfo.applicationInfo.labelRes;
return context.getResources().getString(labelRes);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* [获取应用程序版本名称信息]
*
* @param context
* @return 当前应用的版本名称
*/
public static synchronized String getVersionName(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
return packageInfo.versionName;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* [获取应用程序版本名称信息]
*
* @param context
* @return 当前应用的版本名称
*/
public static synchronized int getVersionCode(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
return packageInfo.versionCode;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
/**
* [获取应用程序版本名称信息]
*
* @param context
* @return 当前应用的版本名称
*/
public static synchronized String getPackageName(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo(
context.getPackageName(), 0);
return packageInfo.packageName;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 获取图标 bitmap
*
* @param context
*/
public static synchronized Bitmap getBitmap(Context context) {
PackageManager packageManager = null;
ApplicationInfo applicationInfo = null;
try {
packageManager = context.getApplicationContext()
.getPackageManager();
applicationInfo = packageManager.getApplicationInfo(
context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
applicationInfo = null;
}
Drawable d = packageManager.getApplicationIcon(applicationInfo); //xxx根据自己的情况获取drawable
BitmapDrawable bd = (BitmapDrawable) d;
Bitmap bm = bd.getBitmap();
return bm;
}
}
| [
"[email protected]"
] | |
48d89a01a3aa5e339090c8b585b18a9d1fb06201 | 789693570586cf0b92eb8af9a10daef25e298eb6 | /Server/DVServer/src/com/avci/dvserver/connection/UDPServer.java | b4f750937487d4ba5ae289263a711ac3195deab6 | [] | no_license | mavci/Dehset-ul-Vahset | 6782d6d0bce030bc2ad71bdec9483fac9a117d62 | e12e8bc6c74b99df0d6ce646b4a3a88a0cd3c298 | refs/heads/master | 2021-01-17T05:39:01.723678 | 2012-03-23T16:55:39 | 2012-03-23T16:55:39 | 3,761,574 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,479 | java | package com.avci.dvserver.connection;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import com.avci.dvserver.DVServer;
public class UDPServer {
public static DatagramSocket socket;
static byte[] receiveData = new byte[1024];
static byte[] sendData;
static HashMap<String, Client> clients = new HashMap<String, Client>();
private UDPDataRecerviedListener listener;
public UDPServer(final int port) {
new Thread() {
public void run() {
try {
socket = new DatagramSocket(port);
while (true) {
DatagramPacket receivePacket = new DatagramPacket(receiveData, 1024);
socket.receive(receivePacket);
readPacket(receivePacket);
}
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}.start();
}
private void readPacket(final DatagramPacket receivePacket)
throws IOException {
new Thread(new Runnable() {
@Override
public void run() {
final String data = new String(receivePacket.getData()).substring(0, receivePacket.getLength());
InetAddress IP = receivePacket.getAddress();
int port = receivePacket.getPort();
String key = IP.toString() + ":" + port;
final Client client;
if (clients.containsKey(key)) {
client = clients.get(key);
} else {
client = addClient(IP, port);
}
client.timeout = System.currentTimeMillis() / 1000L;
new Thread() {
public void run() {
listener.UDPDataRecervied(data, client);
}
}.start();
}
}).start();
}
public void echo(String data, Client client) {
synchronized (clients) {
for (Iterator<Entry<String, Client>> itr = clients.entrySet().iterator(); itr.hasNext();) {
Entry<String, Client> entry = itr.next();
Client c = entry.getValue();
if (c.equals(client) || c.id == 0 || DVServer.users.get(c.id) == null || !DVServer.users.get(c.id).ready)
continue;
if (c.timeout < (System.currentTimeMillis() / 1000L) - 60) {
itr.remove();
continue;
}
c.send(data);
}
}
}
public Client addClient(InetAddress IP, int port) {
System.out.println("+++ " + IP.toString() + ":" + port);
Client client = new Client(IP, port);
clients.put(IP.toString() + ":" + port, client);
return client;
}
public class Client {
static final int IDLE = 0;
static final int LOGGED = 1;
InetAddress IP;
public int port, id = 0;
long timeout;
public int state = IDLE;
public String name, phoneKey, key;
public Client(InetAddress IP, int port) {
this.IP = IP;
this.port = port;
this.timeout = System.currentTimeMillis() / 1000L;
this.key = IP.toString() + ":" + port;
}
public void send(String data) {
sendData = data.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData,
sendData.length, IP, port);
try {
socket.send(sendPacket);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void setListener(UDPDataRecerviedListener listener) {
this.listener = listener;
}
public interface UDPDataRecerviedListener {
public void UDPDataRecervied(String data, UDPServer.Client c);
}
}
| [
"[email protected]"
] | |
9c126a9edd7d51ed3f01b187c5d47c5178fd57f1 | b2d4f0155af651294890b7695ffbd061d575d85c | /contactapp/src/main/java/com/nana/contactapp/command/LoginCommand.java | 62f418854c51c5581d27e1d1504c9b20d82a2a8d | [] | no_license | nfebrian13/contactapp | f1561bfc9cd2f60bdeb219ff5ab32e8bbf0bc8bd | c0b97ff65b06ec22dc75e0da42312dfd87e2ff3e | refs/heads/master | 2020-04-16T09:26:07.744508 | 2019-01-28T04:28:48 | 2019-01-28T04:28:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | package com.nana.contactapp.command;
public class LoginCommand {
private String loginName;
private String password;
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"[email protected]"
] | |
3f26d56fb1cbb05390bbce8ed697e9a426580345 | bb159b1aa013cebe1dac778246953ea41732d468 | /gostCaseStudy/src/test/java/com/cucumber/gost/StepDefinitions/TestRunner.java | fd7de5f5d45c07c4b77438d3064f42775af92e35 | [] | no_license | karthik289/cc_Automation_Poc | fafcd7aa89e57811333b09f78c12395c7bd1cd20 | c95fdc3d3f3b17849c6d5c50df6a66020a743ec2 | refs/heads/master | 2021-03-12T20:45:05.649602 | 2017-05-16T13:17:52 | 2017-05-16T13:17:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.cucumber.gost.StepDefinitions;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(plugin = "json:target/cucumber-report.json", features = "src/test/java", glue = "com.cucumber.gost.StepDefinitions", format = {
"pretty", "html:target/cucumber" })
public class TestRunner {
}
| [
"[email protected]"
] | |
4a1b675bd4971a1a196a0b38efecea6054a49a26 | c79021ef201a8a784929f0c6337ccba305d02389 | /src/test/java/com/github/springbootdemotest/SpringbootDemoTestApplicationTests.java | f10ab4d67a93a78497a11153298f0cc12fd28fd3 | [] | no_license | li-zhang-yu/springboot-demo-test | 8c28ff77f4fcb3004aac0d13dfbff81d645e26b5 | 83263fb589c57e23d5766d732e90d4ffc2ac607c | refs/heads/master | 2020-06-01T23:10:19.944963 | 2019-06-11T14:27:14 | 2019-06-11T14:27:14 | 190,961,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.github.springbootdemotest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringbootDemoTestApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
3e31db2f9cc8d020a1d9937315be1942d2d5ab17 | 164ff372cfc8d6177c210367501869008c0479e9 | /app/src/main/java/activities/Person.java | 1e800743ef580a713946b669c9473659d1e4ce1d | [] | no_license | javadi92/Document | 8dbd91b6ed0ad124674d0b45bd6d4e4d7b0c7f3b | a6f4e51388f327529db8d3605aec25be2e009191 | refs/heads/master | 2020-05-01T05:56:52.742330 | 2019-04-08T21:04:05 | 2019-04-08T21:04:05 | 177,316,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,539 | java | package activities;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.farhad_javadi.drawerlayout.App;
import com.example.farhad_javadi.drawerlayout.MainActivity;
import com.example.farhad_javadi.drawerlayout.R;
public class Person extends AppCompatActivity {
ImageView imgPerson;
TextView tvPersonName,tvDocumentNumber;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.person_page);
//initialize views
imgPerson=(ImageView)findViewById(R.id.img_person);
tvPersonName=(TextView)findViewById(R.id.tv_person);
tvDocumentNumber=(TextView)findViewById(R.id.tv_document_number);
//get image,name and document number from selected item in persons page
Cursor cursor=App.dbHelper.personsGetDataById(MainActivity.id+"");
if(cursor.moveToFirst()){
do{
tvPersonName.setText(cursor.getString(1));
tvDocumentNumber.setText("تعداد پرونده: "+cursor.getInt(2));
byte[] bitmapdata=cursor.getBlob(3);
Bitmap bitmap = BitmapFactory.decodeByteArray(bitmapdata, 0, bitmapdata.length);
imgPerson.setImageBitmap(bitmap);
}while (cursor.moveToNext());
}
}
}
| [
"[email protected]"
] | |
053d77d76494e3e6b1d9c97e1ebb51a5811c8ab5 | 8ee782eab105471611b64c6ecef9ea69dbad949d | /typeofdatas/readwritefields/exercicios/Teste1.java | 0566764f140c75433dd4cf5d97d16fe2dc0d3b78 | [] | no_license | jonatasrd/javaprogrammer | cb1a8020bf2cf677677929c0dcd500fa31cf2968 | ebb56cae2d9650fc2fdb7e9a2caebf858422e8a7 | refs/heads/master | 2021-04-06T09:11:06.904775 | 2018-06-22T11:31:46 | 2018-06-22T11:31:46 | 124,649,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 303 | java | package typeofdatas.readwritefields.exercicios;
class B{
int c;
void c(int c) {
c = c;
}
}
class Teste1 {
public static void main(String[] args) {
B b = new B();
b.c = 10;
System.out.println(b.c);
b.c(30);
System.out.println(b.c);
}
} | [
"[email protected]"
] | |
e9954c2ac7876ecad7c7ce8a39c446c81d088c31 | 4aafcb824f7c10002a439200b783ccda3d6f383f | /Matthieu/ProjetCPA/src/main/ConnectionMySQL.java | 1654265b7b23b7fdbd9ad3146989e8bb030d5b43 | [] | no_license | MAMCSD/MAMCSD-DEVELOPMENT-CPA-PROJET | 45d8b463480b7c7a89a9a9572874ecee806fd950 | 82e277744e0424f464ab62ed9b3da26f21929609 | refs/heads/master | 2021-01-20T09:36:41.136648 | 2017-06-30T10:31:20 | 2017-06-30T10:31:20 | 90,265,760 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,502 | java | package main;
import java.sql.*;
/**
*
* @author Stéphane
* Cette classe permet de réaliser la liaison avec la base de donnée
*
*/
public class ConnectionMySQL {
private Connection connection = null;
private String user, host;
private static boolean driverLoaded = false;
public static boolean isDriverLoaded(){
return driverLoaded;
}
public static void init() throws ClassNotFoundException, IllegalAccessException, InstantiationException{
if(!driverLoaded){
//Chargement du pilote
Class.forName("com.mysql.jdbc.Driver").newInstance();
driverLoaded = true;
}
}
public ConnectionMySQL() {
if(!driverLoaded){
throw new IllegalStateException("Cannot instantiate if driver is not loaded. Please call "+getClass().getName()+".init() method before invoking this constructor.");
}
}
public ConnectionMySQL(String host, String user) {
this();
this.host = "127.0.0.1";
this.user = "root";
}
public void connect() throws SQLException{
//Connexion a la base de données
//System.out.println("Connexion à la base de données");
String dBurl = "jdbc:mysql://"+host+"/auto_concept";
connection = DriverManager.getConnection(dBurl, user,"admin");
}
public ResultSet execute(String requete) throws SQLException{
//System.out.println("creation et execution de la requête :"+requete);
Statement stmt = connection.createStatement();
return stmt.executeQuery(requete);
}
public void close() throws SQLException{
connection.close();
}
} | [
"[email protected]"
] | |
b3a7ba1184d326f44e7bee6ebd9b478946722a2f | 70912919587fdc8c1ffe9d91c768fb5bac5a2bcd | /src/main/java/com/vodafone/charging/accountservice/dto/client/TransactionInfo.java | 3a38a7de05bf4ced994e33773a8edc7def7dddc3 | [] | no_license | jazzdup/vf-account-service | 76905cf07a8b097c08ce7ee63472fc0f43d99865 | 5c22b5fe6b0fb35a8f57bcf876472d8f44bbaaa7 | refs/heads/master | 2021-09-12T02:00:41.368672 | 2018-04-13T13:25:47 | 2018-04-13T13:25:47 | 129,400,957 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 347 | java | package com.vodafone.charging.accountservice.dto.client;
import lombok.Builder;
import lombok.Getter;
import lombok.NonNull;
import lombok.ToString;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@Component
@Builder
@Getter
@ToString
public class TransactionInfo {
@NonNull
private BigDecimal amount;
}
| [
"[email protected]"
] | |
e110eb23214189a0b34e4795928220b5fa3b2fbb | 13cbb329807224bd736ff0ac38fd731eb6739389 | /com/sun/xml/internal/bind/v2/model/core/TypeInfoSet.java | 4c5e104794ef015bd975de0334b06407dc77cf49 | [] | no_license | ZhipingLi/rt-source | 5e2537ed5f25d9ba9a0f8009ff8eeca33930564c | 1a70a036a07b2c6b8a2aac6f71964192c89aae3c | refs/heads/master | 2023-07-14T15:00:33.100256 | 2021-09-01T04:49:04 | 2021-09-01T04:49:04 | 401,933,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,450 | java | package com.sun.xml.internal.bind.v2.model.core;
import com.sun.xml.internal.bind.v2.model.nav.Navigator;
import java.util.Map;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
public interface TypeInfoSet<T, C, F, M> {
Navigator<T, C, F, M> getNavigator();
NonElement<T, C> getTypeInfo(T paramT);
NonElement<T, C> getAnyTypeInfo();
NonElement<T, C> getClassInfo(C paramC);
Map<? extends T, ? extends ArrayInfo<T, C>> arrays();
Map<C, ? extends ClassInfo<T, C>> beans();
Map<T, ? extends BuiltinLeafInfo<T, C>> builtins();
Map<C, ? extends EnumLeafInfo<T, C>> enums();
ElementInfo<T, C> getElementInfo(C paramC, QName paramQName);
NonElement<T, C> getTypeInfo(Ref<T, C> paramRef);
Map<QName, ? extends ElementInfo<T, C>> getElementMappings(C paramC);
Iterable<? extends ElementInfo<T, C>> getAllElements();
Map<String, String> getXmlNs(String paramString);
Map<String, String> getSchemaLocations();
XmlNsForm getElementFormDefault(String paramString);
XmlNsForm getAttributeFormDefault(String paramString);
void dump(Result paramResult) throws JAXBException;
}
/* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\com\sun\xml\internal\bind\v2\model\core\TypeInfoSet.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.0.7
*/ | [
"[email protected]"
] | |
75a65ca53f4fd4cd4035b8331a80f1dbfba6b484 | 49ee07d374e6f7c2b956442a41068b40d1e0d036 | /DopeWarsClassic/src/com/dopewarsplus/Item.java | 5470367c668a5fef878705bc45226747d394c00f | [] | no_license | Tubbz-alt/DopeWars-4 | 3b617c15bba792fe72b3c1b331e7a445ab1c4ed2 | 346d6acedcd535141edd9780f8ea16ed90f78045 | refs/heads/master | 2021-05-28T06:27:22.128239 | 2014-06-12T20:08:17 | 2014-06-12T20:08:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package com.dopewarsplus;
/**
* Items are purchasable things a player can buy, such as guns, bullet proof jackets etc
*/
public abstract class Item {
public final String name;
public final int value;
public final int size; // number of pockets the item occupies, may be 0
public Item(String name, int value, int size) {
this.name = name;
this.value = value;
this.size = size;
}
}
| [
"[email protected]"
] | |
b56f5dc8c825446194dd4013f38f75ad6c4ce4cd | 183d0698836ffbd70f74d85e657b9d6b83cfdd4a | /test/sk/kosickaakademia/lenart/person/PersonTest.java | 16bb3fcfaef2736393b6be69a609acc2845ca6f7 | [] | no_license | SamuelLenart/TicTacToeV0.2 | 220f48a23d03f348068556f0788aabbdb37acc9e | c4ccc15ed4d007ff0ee7e8412dedfe966552d783 | refs/heads/main | 2023-04-26T00:37:51.975782 | 2021-06-04T07:43:57 | 2021-06-04T07:43:57 | 370,985,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package sk.kosickaakademia.lenart.person;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class PersonTest {
@Test
void testHashCode() {
var person = new Person("Samo", "Rozsypany", 'm', 20);
assertEquals(10, person.hashCode());
person = new Person("Silvia", "Novakova", 'm', 25);
assertEquals(37, person.hashCode());
person = new Person ("David", "Rusniak", 'f', 20);
assertEquals(31, person.hashCode());
person = new Person ("Janka", "Mrkvickova", 'f', 20);
assertEquals(31, person.hashCode());
}
} | [
"[email protected]"
] | |
ec67e4ae078679703e4287f945185d1e2fb84e8f | 6aa8173702d8d196a3d1884a8e03ecbdaee56f6d | /src/main/java/io/naztech/jobharvestar/scraper/JanusHendersonEmea.java | 9ff2d80762d05ed293b4a04277ce99026b8cacb8 | [] | no_license | armfahim/Job-Harvester | df762053cf285da87498faa705ec7a099fce1ea9 | 51dbc836a60b03c27c52cb38db7c19db5d91ddc9 | refs/heads/master | 2023-08-11T18:30:56.842891 | 2020-02-27T09:16:56 | 2020-02-27T09:16:56 | 243,461,410 | 3 | 0 | null | 2023-07-23T06:59:54 | 2020-02-27T07:48:57 | Java | UTF-8 | Java | false | false | 901 | java | package io.naztech.jobharvestar.scraper;
import org.springframework.stereotype.Service;
import io.naztech.jobharvestar.crawler.ShortName;
import io.naztech.talent.model.SiteMetaData;
/**
* JANUS HENDERSON INVESTORS EMEA/APAC<br>
* URL: https://career8.successfactors.com/career?company=Janus&career_ns=job_listing_summary&navBarLevel=JOB_SEARCH
*
* @author tanbirul.hashan
* @since 2019-02-20
*/
@Service
public class JanusHendersonEmea extends AbstractSuccessfactors {
private static final String SITE = ShortName.JANUS_HENDERSON_INVESTORS_EMEA;
private String baseUrl;
@Override
public void setBaseUrl(SiteMetaData site) {
this.baseUrl = site.getUrl().substring(0, 34);
}
@Override
public String getSiteName() {
return SITE;
}
@Override
protected String getBaseUrl() {
return this.baseUrl;
}
@Override
protected String getNextAnchorId() {
return "45:_next";
}
}
| [
"[email protected]"
] | |
722e72703a50652953bc059ec891435abae20c2a | 35ced6eed4c0089f46aa57570e4cd5f6a86ff6a6 | /app/src/main/java/sprotecc/com/example/easyhealth/eh_sprotecc/MySportData/Model/MySportDataModel.java | 1f1bd617d3d1899e4bccbd28a4a0fb580cbc2c76 | [] | no_license | lyl090425/gem-Ecc | 75e8c0ea3ccd10cf8182bf8c6224549950f5d8e0 | 7bca8ba13e45b988b1fd594c1b4bba056652f2f8 | refs/heads/master | 2021-05-01T17:14:05.359175 | 2017-01-19T01:00:40 | 2017-01-19T01:00:40 | 79,400,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 931 | java | package sprotecc.com.example.easyhealth.eh_sprotecc.MySportData.Model;
import com.ruite.gem.modal.人员信息.UserInfo;
import com.ruite.gem.modal.运动健康.运动.SportRank;
import java.util.Date;
import java.util.List;
/**
* Created by adminHjq on 2016/12/16.
*/
public interface MySportDataModel {
//用户信息相关
public void startGetUserInfoThread(String usercode);
public void callbackUserInfo(UserInfo userInfo);
public void storeUserInfo(List<UserInfo> list);//单个用户也采用List.
public UserInfo getUserInfo(String code);
//打卡相关
public void startPushCardThread(String code, Date date);
public void callbackPushCard(UserInfo userInfo,Date date );
public void storePushCardInfo(UserInfo userInfo,Date date);//单个用户也采用List.
//运动数据上传
public void startUploadSportThread();
public void callbackUploadSport(boolean b);
}
| [
"[email protected]"
] | |
fb8c49a7fd0bc0e6f716b3057d3142dd9ad3f9db | ee3e30a6d5990432657214fedd81b2083c26ab28 | /hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/CqifRecommendationStrengthEnumFactory.java | d3019d5cb270227be442375ece5c540e9fa33c7b | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | herimakil/hapi-fhir | 588938b328e3c83809617b674ff25903c1541bab | 15cc76600069af8f3d7419575d4cfb9e4b613db0 | refs/heads/master | 2021-01-19T20:43:57.911661 | 2017-04-14T15:27:37 | 2017-04-14T15:27:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,643 | java | package org.hl7.fhir.dstu3.model.codesystems;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sat, Mar 4, 2017 06:58-0500 for FHIR v1.9.0
import org.hl7.fhir.dstu3.model.EnumFactory;
public class CqifRecommendationStrengthEnumFactory implements EnumFactory<CqifRecommendationStrength> {
public CqifRecommendationStrength fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("strong".equals(codeString))
return CqifRecommendationStrength.STRONG;
if ("weak".equals(codeString))
return CqifRecommendationStrength.WEAK;
throw new IllegalArgumentException("Unknown CqifRecommendationStrength code '"+codeString+"'");
}
public String toCode(CqifRecommendationStrength code) {
if (code == CqifRecommendationStrength.STRONG)
return "strong";
if (code == CqifRecommendationStrength.WEAK)
return "weak";
return "?";
}
public String toSystem(CqifRecommendationStrength code) {
return code.getSystem();
}
}
| [
"[email protected]"
] | |
2568aced417db733b70d31a8e4a4d676f7d60401 | 56708835a5f176075230ba0c0b936c0a67f5c76c | /componentlib/src/test/java/com/example/cheers/componentlib/ExampleUnitTest.java | 3848a3abb3db48fa94d423146cda6756ed707f8a | [] | no_license | clxr59/ComponentDemo | f70fa78ee9eda1b41ca34ec818fd9a296b03c126 | 89f6677f79952201e747bc9f21d820cb68eee802 | refs/heads/master | 2020-04-25T02:24:03.338281 | 2019-02-25T06:09:38 | 2019-02-25T06:09:38 | 172,437,770 | 10 | 1 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package com.example.cheers.componentlib;
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);
}
} | [
"[email protected]"
] | |
acc5bf0e6d505a76bcc8adb1444779af79da268b | 51fd89bdeb4e16d2092d4a0b353e5db4a7823327 | /user_service/src/main/java/ba/unsa/etf/nwt/user_service/config/SecurityConfig.java | f2c660b94df0919b00f27f31f776b75bac653c96 | [] | no_license | SamraMujcinovic/PetCare | d5366c149e37019feb000df1bc545d7ad05b43c6 | 95b29ad509e76891081bac33fead2ceef0f318c3 | refs/heads/master | 2023-07-02T18:00:24.322271 | 2021-07-13T16:32:51 | 2021-07-13T16:32:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,101 | java | package ba.unsa.etf.nwt.user_service.config;
import ba.unsa.etf.nwt.user_service.security.CustomUserDetailsService;
import ba.unsa.etf.nwt.user_service.security.JwtAuthenticationEntryPoint;
import ba.unsa.etf.nwt.user_service.security.JwtAuthenticationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.BeanIds;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(
securedEnabled = true,
jsr250Enabled = true,
prePostEnabled = true
)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private CustomUserDetailsService customUserDetailsService;
@Autowired
private JwtAuthenticationEntryPoint unauthorizedHandler;
@Bean
public JwtAuthenticationFilter jwtAuthenticationFilter() {
return new JwtAuthenticationFilter();
}
@Override
public void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
authenticationManagerBuilder
.userDetailsService(customUserDetailsService)
.passwordEncoder(passwordEncoder());
}
@Bean(BeanIds.AUTHENTICATION_MANAGER)
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.cors()
.and()
.csrf()
.disable()
.exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler)
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/",
"/favicon.ico",
"/**/*.png",
"/**/*.gif",
"/**/*.svg",
"/**/*.jpg",
"/**/*.html",
"/**/*.css",
"/**/*.js")
.permitAll()
.antMatchers("/api/auth/**", "/swagger-ui.html", "/swagger-resources/**",
"/v2/**", "/webjars/**", "/recovery/**", "/email/**")
.permitAll()
.antMatchers("/user/usernameCheck", "/user/emailCheck")
.permitAll()
.antMatchers(HttpMethod.GET, "/questions", "/eureka/**", "/login/token",
"/user/{username}", "/auth/load/**")
.permitAll()
.antMatchers(HttpMethod.POST)
.permitAll()
.anyRequest()
.authenticated();
// Add our custom JWT security filter
http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
}
}
| [
"[email protected]"
] | |
1f310ee776f4fe2ea1e57f5d233151dee6b76fe3 | ba8c312d46cd8836fe4cf543c6ce0ebfa150a624 | /src/main/java/com/group/FakeMyspace/models/Friend.java | b404de348be06b426ff3dc6fd4ddd0eb7064cc91 | [] | no_license | renchong1993/MySpace | 7dd6516ec78b40d1bc16b03a296704e8c991e206 | e1cfcd2f319d72b59c7ba820f47faddc34460920 | refs/heads/main | 2023-08-12T07:26:18.427845 | 2021-09-28T04:11:18 | 2021-09-28T04:11:18 | 411,132,540 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,404 | java | package com.group.FakeMyspace.models;
import java.util.Date;
import javax.persistence.CascadeType;
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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
@Entity
//@TypeConverter(name="booleanToInteger", boolean = Integer.class) <-Try to convery boolean to int
@Table(name="friends")
public class Friend {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
private boolean approve; //default as 0 and change to 1 if receiver approves, the all friend list show only the approve.Ture
@Column(updatable=false)
private Date createAt;
private Date updatedAt;
@PrePersist
protected void onCreate() {
this.createAt = new Date();
}
@PreUpdate
protected void onUpdate() {
this.updatedAt = new Date();
}
//================ Relationship =================//
//===== M21 User&Frienfds =====//
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_id")
private User owner;
//===== 121 Friend&User =====//
@OneToOne(mappedBy="oneFriend", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
private User oneUser;
//================ Constructor =================//
public Friend() {
}
public Friend(User owner, User oneUser) {
this.owner = owner;
this.oneUser = oneUser;
}
//================ Getter&Setter =================//
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User getOwner() {
return owner;
}
public void setOwner(User owner) {
this.owner = owner;
}
public User getOneUser() {
return oneUser;
}
public void setOneUser(User oneUser) {
this.oneUser = oneUser;
}
public Date getCreateAt() {
return createAt;
}
public void setCreateAt(Date createAt) {
this.createAt = createAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public boolean isApprove() {
return approve;
}
public void setApprove(boolean approve) {
this.approve = approve;
}
}
| [
"[email protected]"
] | |
bae625aa6f707835c4a2401c01cbe970f3d0201f | 9d118916a2f6529e7b91875914dc57f6255437fb | /app/src/main/java/com/comers/shenwu/instant_run/android/tools/ir/common/ProtocolConstants.java | 62a8b0fdb203ab6415c919225d648a3bf3445493 | [] | no_license | comerss/NewFrame | 0db8555bc1907463cb17649fb276d0852d214ef8 | 264209a312c009e7f96825a2041536917b1263b3 | refs/heads/master | 2020-03-19T20:46:49.898026 | 2019-10-30T14:49:43 | 2019-10-30T14:49:43 | 136,916,331 | 11 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | package com.comers.shenwu.instant_run.android.tools.ir.common;
public abstract interface ProtocolConstants
{
public static final long PROTOCOL_IDENTIFIER = 890269988L;
public static final int PROTOCOL_VERSION = 4;
public static final int MESSAGE_PATCHES = 1;
public static final int MESSAGE_PING = 2;
public static final int MESSAGE_PATH_EXISTS = 3;
public static final int MESSAGE_PATH_CHECKSUM = 4;
public static final int MESSAGE_RESTART_ACTIVITY = 5;
public static final int MESSAGE_SHOW_TOAST = 6;
public static final int MESSAGE_EOF = 7;
public static final int MESSAGE_SEND_FILE = 8;
public static final int MESSAGE_SHELL_COMMAND = 9;
public static final int UPDATE_MODE_NONE = 0;
public static final int UPDATE_MODE_HOT_SWAP = 1;
public static final int UPDATE_MODE_WARM_SWAP = 2;
public static final int UPDATE_MODE_COLD_SWAP = 3;
}
/* Location: /Volumes/Work/works/Diooto/app/build/intermediates/incremental-runtime-classes/debug/instant-run.jar!/com/android/tools/ir/common/ProtocolConstants.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
273eb69f386f92b9a02fa1b60d9f19328fd28cf1 | 1e109337f4a2de0d7f9a33f11f029552617e7d2e | /jcatapult-mvc/tags/1.0.17/src/java/main/org/jcatapult/mvc/validation/EmailValidator.java | baefb88e322dabaf7a01d219325db80f53b674c8 | [] | no_license | Letractively/jcatapult | 54fb8acb193bc251e5984c80eba997793844059f | f903b78ce32cc5468e48cd7fde220185b2deecb6 | refs/heads/master | 2021-01-10T16:54:58.441959 | 2011-12-29T00:43:26 | 2011-12-29T00:43:26 | 45,956,606 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,746 | java | /*
* Copyright (c) 2001-2007, JCatapult.org, 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package org.jcatapult.mvc.validation;
import java.util.regex.Pattern;
import org.jcatapult.mvc.validation.annotation.Email;
/**
* <p>
* This class verifies that the value is an email address using a relaxed regex
* (because the all two letter TLDs are allowed).
* </p>
*
* @author Brian Pontarelli
*/
public class EmailValidator implements Validator<Email> {
public static final Pattern emailPattern = Pattern.compile("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+(?:[a-z]{2}|aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel)");
/**
* @param annotation Not used.
* @param container Not used.
* @param value The value to check.
* @return True if the value matches the pattern, false otherwise.
*/
public boolean validate(Email annotation, Object container, Object value) {
if (value == null) {
return true;
}
String email = value.toString();
return emailPattern.matcher(email.toLowerCase()).matches();
}
} | [
"bpontarelli@b10e9645-db3f-0410-a6c5-e135923ffca7"
] | bpontarelli@b10e9645-db3f-0410-a6c5-e135923ffca7 |
21d2b46c12d6c329448879e5a1a9a3cf8c745d6e | 7351dfffc2fcf3dbe708168ef51c55c756f4b68f | /src/main/java/ru/demi/interview/preparation/arrays/NewYearChaos.java | 05529cbb2e71c6a38e8f9f2139f921ff1a0f4074 | [] | no_license | dmitry-izmerov/hackerrank | 87e63090b50fa6a80a8d5705f24041cb8af0f5d5 | d38ef6713bba068e49c2724bf2abd656b42f8a29 | refs/heads/master | 2021-04-03T06:18:08.376959 | 2019-09-13T18:51:39 | 2019-09-13T18:51:39 | 124,564,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,291 | java | package ru.demi.interview.preparation.arrays;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.stream.Collectors;
/**
* Complete the function which must print an integer representing the minimum number of bribes necessary,
* or Too chaotic if the line configuration is not possible.
*/
public class NewYearChaos {
private static final String BAD_CASE_MESSAGE = "Too chaotic";
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int tItr = 0; tItr < t; tItr++) {
int n = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
int[] q = new int[n];
String[] qItems = scanner.nextLine().split(" ");
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int i = 0; i < n; i++) {
int qItem = Integer.parseInt(qItems[i]);
q[i] = qItem;
}
minimumBribes(q);
}
scanner.close();
}
private static void minimumBribes(int[] ar) {
List<Integer> nums = Arrays.stream(ar).boxed().collect(Collectors.toList());
Map<Integer, Integer> swapCounter = new HashMap<>();
int numSwaps = 0;
int numSwapsPerIteration;
do {
numSwapsPerIteration = 0;
for (int i = 0; i < ar.length - 1; i++) {
Integer left = nums.get(i);
Integer right = nums.get(i + 1);
if (left > right) {
if (swapCounter.getOrDefault(left, 0) == 2) {
System.out.println(BAD_CASE_MESSAGE);
return;
}
swapCounter.computeIfPresent(left, (k, v) -> v + 1);
swapCounter.putIfAbsent(left, 1);
nums.set(i + 1, left);
nums.set(i, right);
++numSwapsPerIteration;
}
}
numSwaps += numSwapsPerIteration;
} while (numSwapsPerIteration != 0);
System.out.println(numSwaps);
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.