blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9818c3778256cfba7c549169a9527dfccddaaab3 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/java-undertow-server/generated/src/main/java/org/openapitools/model/ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.java | a67975fdf4c5fe85d0e63f58d13962d258d073b2 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 4,160 | java | package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen", date = "2019-08-05T00:56:20.785Z[GMT]")
public class ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo {
private String pid = null;
private String title = null;
private String description = null;
private ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties = null;
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo pid(String pid) {
this.pid = pid;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("pid")
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo title(String title) {
this.title = title;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("title")
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo description(String description) {
this.description = description;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("description")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
/**
**/
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo properties(ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties) {
this.properties = properties;
return this;
}
@ApiModelProperty(value = "")
@JsonProperty("properties")
public ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties getProperties() {
return properties;
}
public void setProperties(ComDayCqReplicationImplContentDurboBinaryLessContentBuilderProperties properties) {
this.properties = properties;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo = (ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo) o;
return Objects.equals(pid, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.pid) &&
Objects.equals(title, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.title) &&
Objects.equals(description, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.description) &&
Objects.equals(properties, comDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo.properties);
}
@Override
public int hashCode() {
return Objects.hash(pid, title, description, properties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComDayCqReplicationImplContentDurboBinaryLessContentBuilderInfo {\n");
sb.append(" pid: ").append(toIndentedString(pid)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
3b992b71f2f9fb620eff80917dd98c0b3520beff | e8ee01c0f6baf20249347b023a1a8784de4e984f | /src/Praktikum9/src/tugas2/Manusia.java | 938064ddba1bd79a3ca49512c6a91a39c41cc740 | [] | no_license | titaw1/Praktikum-PBO-2020 | 5cdd6431e7381296d849774efef2560836ba467d | 5bf1fd3e1f39d5d7626b632490ea0606501d537a | refs/heads/master | 2023-02-08T13:01:59.150180 | 2020-12-29T13:00:43 | 2020-12-29T13:00:43 | 293,171,854 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | 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 tugas2;
/**
*
* @author tita
*/
public class Manusia {
public void bernafas(){
System.out.println("Manusia Bernafas");
}
public void makan(){
System.out.println("Manusia Makan");
}
}
| [
"wijayantitita094@gmail.com"
] | wijayantitita094@gmail.com |
c6bd2a73684c6ae746bd3176b078a6bf68fd7c99 | ba34cc3648cbfe8b4a0bf8814879463a50c7fd3a | /src/main/java/com/dillos/dillobot/annotations/Server.java | b8f6ef116ead12d2a3d9d2b09c3cdea8a747f58a | [] | no_license | jarrettkenny/dillo-bot | 18246848f400d180d63ec6e0c17980e7d58fb035 | c0fdd0f67b65ac99d10052ebd3b38ba088fd607c | refs/heads/master | 2022-12-04T18:23:02.519047 | 2020-08-29T20:39:20 | 2020-08-29T20:39:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.dillos.dillobot.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface Server {}
| [
"logsdonalex11@gmail.com"
] | logsdonalex11@gmail.com |
0a652562b3f9c095ddb72afab9fdc6c6c3f00530 | 05f593414e0deed21dbf8cccdad2b9e3fe0eaec8 | /app/src/main/java/com/dakshpokar/asn/notes.java | a58d73af16d3f2cab727afb0bf541b81d5d73cbe | [] | no_license | dakshpokar/AndroidSecureNotes | 3deb4d635938d34fd0a22362fdbbb26b6a99e34c | e10c2d613ee4c6f47c59bb7efdb1a48d9bb8d88b | refs/heads/master | 2020-03-26T11:19:27.217076 | 2018-08-15T10:17:09 | 2018-08-15T10:17:09 | 144,838,122 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,124 | java | package com.dakshpokar.asn;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.app.Fragment;
import android.support.design.widget.FloatingActionButton;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.Toast;
import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import static android.content.ContentValues.TAG;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* to handle interaction events.
* Use the {@link notes#newInstance} factory method to
* create an instance of this fragment.
*/
public class notes extends Fragment{
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
public static boolean open = false;
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
MotionEvent event;
DatabaseHelper mDatabaseHelper;
EditText title_text;
EditText note_text;
int ID;
String titleString, dateString, noteString;
boolean already = false;
public notes() {
titleString = "";
dateString = "";
noteString = "";
// Required empty public constructor
}
public void setCods(int cx, int cy)
{
this.cx = cx;
this.cy = cy;
}
public void setArgs(int ID, String title, String note, String date)
{
already = true;
this.ID = ID;
titleString = title;
noteString = note;
dateString = date;
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment notes.
*/
// TODO: Rename and change types and number of parameters
public static notes newInstance(String param1, String param2) {
notes fragment = new notes();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
int cx,cy;
@Override
public void onAttach(Context context) {
FloatingActionButton fab_add = ((Activity)context).getWindow().getDecorView().findViewById(R.id.fab_add);
View v = ((Activity)context).getWindow().getDecorView().getRootView();
int finalRadius = Math.max(v.getWidth(), v.getHeight());
Animator anim = ViewAnimationUtils.createCircularReveal(v, cx, cy, 0, finalRadius);
v.setBackgroundColor(getResources().getColor(R.color.noteback));
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
}
});
anim.setDuration(400);
anim.start();
super.onAttach(context);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
private void AddData(String title, String note, String date)
{
boolean insertData = mDatabaseHelper.addData(title, note, date);
}
private void ModifyData(int ID, String title, String note, String date)
{
mDatabaseHelper.modifyData(ID, title, note, date);
Toast.makeText(getActivity(), "Saved!", Toast.LENGTH_SHORT).show();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
final View v = inflater.inflate(R.layout.fragment_notes, container, false);
FloatingActionButton fab_save;
mDatabaseHelper = new DatabaseHelper(getActivity());
fab_save = (FloatingActionButton)v.findViewById(R.id.fab_save);
title_text = (EditText)v.findViewById(R.id.note_title);
note_text = (EditText)v.findViewById(R.id.note_info);
if(!titleString.equals(""))
{
title_text.setText(titleString);
}
if(!noteString.equals("")){
note_text.setText(noteString);
}
fab_save.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String title = title_text.getText().toString();
String note = note_text.getText().toString();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date;
String currentDateTime;
if(dateString.equals("")) {
date = new Date();
currentDateTime = formatter.format(date);
}
if (title.equals("") && note.equals("")) {
Toast.makeText(getActivity(), "Can`t save empty Note", Toast.LENGTH_SHORT).show();
} else {
if(already == false) {
currentDateTime = dateString;
AddData(title, note, currentDateTime);
title_text.setText("");
note_text.setText("");
}
else
{
date = new Date();
title = title_text.getText().toString();
note = note_text.getText().toString();
currentDateTime = formatter.format(date);
ModifyData(ID, title, note, currentDateTime);
}
}
}
});
return v;
}
// TODO: Rename method, update argument and hook method into UI event
public boolean saveNote(View v)
{
title_text = (EditText)v.findViewById(R.id.note_title);
note_text = (EditText)v.findViewById(R.id.note_info);
String title = title_text.getText().toString();
String note = note_text.getText().toString();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = new Date();
String currentDateTime = formatter.format(date);
if(title.equals("") && note.equals(""))
{
return true;
}
else {
if(already == false){
AddData(title, note, currentDateTime);
title_text.setText("");
note_text.setText("");
return false;
}
else if(already == true)
{
ModifyData(ID, title, note, currentDateTime);
return true;
}
}
return true;
}
@Override
public void onDetach() {
super.onDetach();
}
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
}
| [
"dakshpokar@gmail.com"
] | dakshpokar@gmail.com |
076058ddacfef6bb9afa419d82b044ea26990733 | a2132ba9271ca1096bb2f82db6aa52ab3ec18d95 | /src/com/gmail/erofeev/st/alexei/controlTwo/model/PurchaseOrder.java | 7a84da91e6f867f5d1f784e45b1489678e1a4e73 | [] | no_license | ErofeevAS/itacademy | a64c076c584e53cc008b16adab2957ea5e109d10 | 459f86fe4ed597671c0a19e7a8e45aad7acf2304 | refs/heads/master | 2020-04-12T04:39:30.367780 | 2019-02-14T16:08:15 | 2019-02-14T16:08:15 | 162,301,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.gmail.erofeev.st.alexei.controlTwo.model;
import javax.xml.bind.annotation.*;
import java.util.List;
@XmlRootElement(name = "PurchaseOrder", namespace = "http://www.it-academy.by")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {"orderDate", "item"})
public class PurchaseOrder {
@XmlAttribute(name = "OrderDate", required = true)
private String orderDate;
@XmlElement(name = "item", required = true)
private List<Item> item;
public PurchaseOrder() {
}
public String getOrderDate() {
return orderDate;
}
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public List<Item> getItem() {
return item;
}
public void setItem(List<Item> items) {
this.item = item;
}
}
| [
"spokeman152@gmail.com"
] | spokeman152@gmail.com |
8d903c925c9b40d34e319958a6d4eb7f48fe5cb3 | 682bfd40c3cc651a6196e8e368696e930370a618 | /kartoteks-service/src/main/java/ekol/kartoteks/domain/dto/CustomerServiceRepAuthorizedCompany.java | 423bb791360c307384c1f57992d4f0dd8f3e47f3 | [] | no_license | seerdaryilmazz/OOB | 3b27b67ce1cbf3f411f7c672d0bed0d71bc9b127 | 199f0c18b82d04569d26a08a1a4cd8ee8c7ba42d | refs/heads/master | 2022-12-30T09:23:25.061974 | 2020-10-09T13:14:39 | 2020-10-09T13:14:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,480 | java | package ekol.kartoteks.domain.dto;
import ekol.hibernate5.domain.embeddable.DateWindow;
import ekol.kartoteks.domain.Company;
import ekol.kartoteks.domain.CompanyEmployeeRelation;
/**
* Created by kilimci on 23/09/16.
*/
public class CustomerServiceRepAuthorizedCompany {
private Long relationId;
private Company company;
private DateWindow validDates;
public static CustomerServiceRepAuthorizedCompany withCompanyEmployeeRelation(CompanyEmployeeRelation relation){
CustomerServiceRepAuthorizedCompany authorizedCompany = new CustomerServiceRepAuthorizedCompany();
authorizedCompany.setCompany(relation.getCompanyRole().getCompany());
authorizedCompany.setRelationId(relation.getId());
DateWindow validDates = relation.getValidDates();
if(validDates == null){
validDates = relation.getCompanyRole().getDateRange();
}
authorizedCompany.setValidDates(validDates);
return authorizedCompany;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public Company getCompany() {
return company;
}
public void setCompany(Company company) {
this.company = company;
}
public DateWindow getValidDates() {
return validDates;
}
public void setValidDates(DateWindow validDates) {
this.validDates = validDates;
}
}
| [
"dogukan.sahinturk@ekol.com"
] | dogukan.sahinturk@ekol.com |
19865209db697717f70d688298d5d546a3f4914a | ca9bf5b3437ff9ae1000b34bac8df6391b2dc766 | /app/src/main/java/com/example/cloudypedia/fawrysurveillanceapp/Activites/PhotoActivity.java | ce63f43e547a4db4d446ffd41bad005a619bd2a6 | [] | no_license | ahmedelkashef/fawryfinal | 607b57e892f7c60a4e93b48ae90138d5994d216c | b58fc61198625d5dbbac29035f35e46999bcf869 | refs/heads/master | 2021-01-12T06:36:13.655474 | 2017-03-05T21:32:48 | 2017-03-05T21:32:48 | 77,392,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package com.example.cloudypedia.fawrysurveillanceapp.Activites;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.cloudypedia.fawrysurveillanceapp.R;
import com.example.cloudypedia.fawrysurveillanceapp.Utility;
import com.squareup.picasso.Picasso;
public class PhotoActivity extends AppCompatActivity {
ImageView photoimageview;
TextView nophototxt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_photo);
Utility.setActionBar(getSupportActionBar(),this, "home");
photoimageview = (ImageView) findViewById(R.id.photoimageView);
nophototxt = (TextView) findViewById(R.id.phototxt);
Bundle extras = getIntent().getExtras();
String photoUrl = extras.getString("photoUrl");
if(!photoUrl.equals("null")) {
Picasso.with(this).load(photoUrl).into(photoimageview);
nophototxt.setVisibility(View.INVISIBLE);
}
else
{
nophototxt.setVisibility(View.VISIBLE);
//nophototxt.setText("لا يوجد صورة");
}
}
}
| [
"ahmed.e.elkashef@gmail.com"
] | ahmed.e.elkashef@gmail.com |
1b3bfcf159f9a22e346b83eb045e0fef67cea1cf | ea7278a4bf5ae7602e0a98db96a82b84779d446c | /src/main/java/com/xiaoke/controller/web/RoleController.java | 29b8083f17945acd5c7dbac32cf9ad41f65b856f | [] | no_license | darkrain1990/xiaoke_sever | 9b32e7e7a1e2bfd906bb654bb2b076395c423978 | 53ca0dacb212f102418585a53e152c91292fa695 | refs/heads/master | 2016-09-12T18:15:03.000830 | 2016-05-15T03:28:14 | 2016-05-15T03:28:14 | 58,799,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,467 | java | package com.xiaoke.controller.web;
import com.xiaoke.entity.Role;
import com.xiaoke.entity.vo.SysAuthorities;
import com.xiaoke.entity.SysRoleAuthorities;
import com.xiaoke.entity.qo.SysRoleQO;
import com.xiaoke.entity.vo.PageBean;
import com.xiaoke.service.RoleService;
import com.xiaoke.service.SysRoleAuthoritiesService;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/role")
public class RoleController {
@Autowired
private RoleService roleService;
@Autowired
private SysRoleAuthoritiesService service;
Logger logger = LoggerFactory.getLogger(SysUsersController.class);
/**
* 显示角色分页对象
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月17日
*/
@RequestMapping("/searchRole")
@ResponseBody
public String seacheRole(int index,int pageSize,String roleName, int systemId) throws UnsupportedEncodingException {
/*
* index:当前页面索引
* pagesize:页面大小 所显示的总条数
* roleName:角色名称
* systemId:所属系统id
* */
//解决编码格式问题
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
SysRoleQO sq=new SysRoleQO(index,pageSize,ro,systemId);
PageBean<Role> page=roleService.searchRoleByCondition(sq);
Map<String, Object> map = new HashMap<String, Object>();
map.put("pageTotal", page.getPageTotal());
map.put("index", index);
//页面只显示flag=1的角色 除去roles中flag为0的角色
List<Role> roles=page.getList();
map.put("roles", roles);
JSONObject json = JSONObject.fromObject(map);
return json.toString();
}
/**
* 添加角色
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月16日 下午2:20:34
*/
@ResponseBody
@RequestMapping("/add")
public String addRole(String roleName,String roleDesc,Integer systemId,Integer enabled,Integer issys) throws UnsupportedEncodingException {
//设置可能出现中文字段 存入数据库的编码格式
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
String des=new String(roleDesc.getBytes("iso-8859-1"),"utf-8");
Role role=new Role(ro,des,enabled,issys,systemId);
JSONObject json = roleService.addRoles(role);
return json.toString();
}
/**
* 删除角色
* @author wwh
* @Date 2016年3月17日
*/
@ResponseBody
@RequestMapping("/dele/{id}")
public String deleteRole(@PathVariable String id){
JSONObject json = new JSONObject();
//System.out.println(id);
try {
json=roleService.delRoelById(id);
} catch (Exception e) {
logger.error(e.getMessage());
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 修改角色
* @author wwh
* @throws UnsupportedEncodingException
* @Date 2016年3月22日
*/
@RequestMapping("/update")
@ResponseBody
public String updateRole(int id,String roleName,String roleDesc,Integer systemId,Integer enabled,Integer issys) throws UnsupportedEncodingException{
JSONObject json = new JSONObject();
String ro=new String(roleName.getBytes("iso-8859-1"),"utf-8");
String des=new String(roleDesc.getBytes("iso-8859-1"),"utf-8");
Role role=new Role(ro,des,enabled,issys,1,systemId);
try {
json=roleService.updateRoleById(role);
} catch (Exception e) {
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 给角色添加或者删除权限
* @author wwh
* */
@RequestMapping("/addordel")
@ResponseBody
public String addordelAuthorities(int roleId,int authorityId,String flag){
JSONObject json = new JSONObject();
JSONObject str = new JSONObject();
str=service.selrole(new SysRoleAuthorities(roleId, authorityId) );
Boolean bool=(Boolean) str.get("result");
try {
if(flag.equalsIgnoreCase("del")){//给角色删除权限操作
if(bool){//判断数据库中该角色是否有对应的权限 有 就删除
json = service.delRoleAuthorities(new SysRoleAuthorities(roleId, authorityId));
}else{
}
}else{//给角色添加权限操作
if(bool){
}else{
json = service.addRoleAuthorities(new SysRoleAuthorities(roleId, authorityId));
}
}
} catch (Exception e) {
logger.error(e.getMessage());
json.put("ERROR", "服务器异常 error_code(500)");
}
return json.toString();
}
/**
* 显示系统所有的权限
* */
@RequestMapping("/show/{systemId}")
@ResponseBody
public String showAuthorities(@PathVariable int systemId){
JSONObject json = new JSONObject();
List<SysAuthorities> list=service.findAuthorities(systemId);
json.put("result", list);
return json.toString();
}
/**
* 查询角色所拥有的权限
* */
@RequestMapping("/sel")
@ResponseBody
public String selRole(int roleId,int authorityId){
JSONObject json = new JSONObject();
SysRoleAuthorities sys=new SysRoleAuthorities(roleId, authorityId);
json = service.selrole(sys);
return json.toString();
}
}
| [
"darkrain1990@hotmail.com"
] | darkrain1990@hotmail.com |
c33dabf75eed3cd8315f3ffea434d3c6f18fd649 | 6cc2595fb4fce1646d623a702ff37a20598da7a4 | /schema/ab-products/solutions/common/src/test/org/springframework/security/providers/ldap/ad/AllTestsRealServer.java | 7268ce2c294b300a2612203386414f4f7b50b70f | [] | no_license | ShyLee/gcu | 31581b4ff583c04edc64ed78132c0505b4820b89 | 21a3f9a0fc6e4902ea835707a1ec01823901bfc3 | refs/heads/master | 2020-03-13T11:43:41.450995 | 2018-04-27T04:51:27 | 2018-04-27T04:51:27 | 131,106,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package org.springframework.security.providers.ldap.ad;
import junit.framework.*;
/**
*
* <p>
* Uses real LDAP/ActiveDirectory server. {See AbstractLdapIntegrationTests}
*
* @author Valery Tydykov
*
*/
public class AllTestsRealServer extends TestCase {
public AllTestsRealServer(String s) {
super(s);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(org.springframework.security.providers.ldap.ad.populator.AllTestsRealServer
.suite());
suite
.addTest(org.springframework.security.providers.ldap.ad.authenticator.AllTestsRealServer
.suite());
return suite;
}
}
| [
"lixinwo@vip.qq.com"
] | lixinwo@vip.qq.com |
10c0b1b54113aac5ce2515c2713f80e83fa39e33 | da181f89e0b26ffb3fc5f9670a3a5f8f1ccf0884 | /CoreGestionTextilLevel/src/ar/com/textillevel/modulos/personal/entidades/contratos/Contrato.java | 0916688a82fee4c7f4f81c4eaffb511f35d6cad7 | [] | no_license | nacho270/GTL | a1b14b5c95f14ee758e6b458de28eae3890c60e1 | 7909ed10fb14e24b1536e433546399afb9891467 | refs/heads/master | 2021-01-23T15:04:13.971161 | 2020-09-18T00:58:24 | 2020-09-18T00:58:24 | 34,962,369 | 2 | 1 | null | 2016-08-22T22:12:57 | 2015-05-02T20:31:49 | Java | UTF-8 | Java | false | false | 2,358 | java | package ar.com.textillevel.modulos.personal.entidades.contratos;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TIPO", discriminatorType = DiscriminatorType.STRING)
@Table(name = "T_PERS_CONTRATO")
public abstract class Contrato implements Serializable {
private static final long serialVersionUID = -5568165283881971480L;
private Integer id;
private String pathArchivoContrato;
private Integer idTipoContrato;
@Id
@Column(name="P_ID")
@GeneratedValue(strategy=GenerationType.AUTO)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Transient
public ETipoContrato getTipoContrato() {
return ETipoContrato.getById(getIdTipoContrato());
}
@Override
@Transient
public String toString(){
return getTipoContrato().getDescripcion();
}
@Column(name="A_PATH_ARCHIVO",nullable=true)
public String getPathArchivoContrato() {
return pathArchivoContrato;
}
public void setPathArchivoContrato(String pathArchivoContrato) {
this.pathArchivoContrato = pathArchivoContrato;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Contrato other = (Contrato) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Column(name="A_ID_TIPO_CONTRATO",nullable=false)
protected Integer getIdTipoContrato() {
return idTipoContrato;
}
protected void setIdTipoContrato(Integer idTipoContrato) {
this.idTipoContrato = idTipoContrato;
}
}
| [
"ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316"
] | ignaciocicero@gmail.com@9de48aec-ec99-11dd-b2d9-215335d0b316 |
1a9e1ad7048305c05bb9d04a2491c8c97297eb22 | 8f4dc6d22e28bedfce0bc9478abecdcba7e396f6 | /app/src/main/java/com/dg/designstudy/Factory/StaticFactory.java | bfc5ca3b6ce3e535096a28a308fb84f7d6721bc3 | [] | no_license | dugdugang/DesignStudy | 7ec12329112d6d0d57b1e4a38b534130fe697e60 | 5d2b02fe51ab08137127d890b3eaae8dc39a7dcc | refs/heads/master | 2021-04-27T05:06:55.774978 | 2018-03-05T09:54:24 | 2018-03-05T09:54:24 | 122,591,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 228 | java | package com.dg.designstudy.Factory;
/**
* Created by Administrator on 2018/2/27 0027.
* 静态工厂模 式
*/
public class StaticFactory {
public static Product createProduct() {
return new ProductA();
}
}
| [
"513642676@qq.com"
] | 513642676@qq.com |
bf3c7b7fa38cf0524d1820405ce13631dcb0f795 | 7653e008384de73b57411b7748dab52b561d51e6 | /SrcGame/dwo/gameserver/handler/bypasses/ManorManager.java | 1381ff729b1fbcf85653db124df4d2cc656be204 | [] | no_license | BloodyDawn/Ertheia | 14520ecd79c38acf079de05c316766280ae6c0e8 | d90d7f079aa370b57999d483c8309ce833ff8af0 | refs/heads/master | 2021-01-11T22:10:19.455110 | 2017-01-14T12:15:56 | 2017-01-14T12:15:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,648 | java | package dwo.gameserver.handler.bypasses;
import dwo.gameserver.handler.BypassHandlerParams;
import dwo.gameserver.handler.CommandHandler;
import dwo.gameserver.handler.TextCommand;
import dwo.gameserver.instancemanager.castle.CastleManager;
import dwo.gameserver.instancemanager.castle.CastleManorManager;
import dwo.gameserver.model.actor.L2Npc;
import dwo.gameserver.model.actor.instance.L2PcInstance;
import dwo.gameserver.model.world.residence.castle.Castle;
import dwo.gameserver.network.game.components.SystemMessageId;
import dwo.gameserver.network.game.serverpackets.BuyListSeed;
import dwo.gameserver.network.game.serverpackets.SystemMessage;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowCropInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowCropSetting;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowManorDefaultInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowProcureCropDetail;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSeedInfo;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSeedSetting;
import dwo.gameserver.network.game.serverpackets.packet.show.ExShowSellCropList;
import org.apache.log4j.Level;
/**
* Manor functions handler.
*
* @author L2J
* @author GODWORLD
* @author Yorie
*/
public class ManorManager extends CommandHandler<String>
{
@TextCommand("manor_menu_select")
public boolean manorMenu(BypassHandlerParams params)
{
L2PcInstance activeChar = params.getPlayer();
L2Npc manager = activeChar.getLastFolkNPC();
if(!activeChar.isInsideRadius(manager, L2Npc.INTERACTION_DISTANCE, true, false))
{
return false;
}
try
{
Castle castle = manager.getCastle();
if(CastleManorManager.getInstance().isUnderMaintenance())
{
activeChar.sendActionFailed();
activeChar.sendPacket(SystemMessageId.THE_MANOR_SYSTEM_IS_CURRENTLY_UNDER_MAINTENANCE);
return true;
}
int ask = Integer.parseInt(params.getQueryArgs().get("ask"));
int state = Integer.parseInt(params.getQueryArgs().get("state"));
int time = Integer.parseInt(params.getQueryArgs().get("time"));
int castleId;
castleId = state < 0 ? castle.getCastleId() : state;
switch(ask)
{
case 1: // Seed purchase
if(castleId == castle.getCastleId())
{
activeChar.sendPacket(new BuyListSeed(activeChar.getAdenaCount(), castleId, castle.getSeedProduction(CastleManorManager.PERIOD_CURRENT)));
}
else
{
activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.HERE_YOU_CAN_BUY_ONLY_SEEDS_OF_S1_MANOR).addString(manager.getCastle().getName()));
}
break;
case 2: // Crop sales
activeChar.sendPacket(new ExShowSellCropList(activeChar, castleId, castle.getCropProcure(CastleManorManager.PERIOD_CURRENT)));
break;
case 3: // Current seeds (Manor info)
if(time == 1 && !CastleManager.getInstance().getCastleById(castleId).isNextPeriodApproved())
{
activeChar.sendPacket(new ExShowSeedInfo(castleId, null));
}
else
{
activeChar.sendPacket(new ExShowSeedInfo(castleId, CastleManager.getInstance().getCastleById(castleId).getSeedProduction(time)));
}
break;
case 4: // Current crops (Manor info)
if(time == 1 && !CastleManager.getInstance().getCastleById(castleId).isNextPeriodApproved())
{
activeChar.sendPacket(new ExShowCropInfo(castleId, null));
}
else
{
activeChar.sendPacket(new ExShowCropInfo(castleId, CastleManager.getInstance().getCastleById(castleId).getCropProcure(time)));
}
break;
case 5: // Basic info (Manor info)
activeChar.sendPacket(new ExShowManorDefaultInfo());
break;
case 6: // Buy harvester
manager.showBuyList(activeChar, 0);
break;
case 7: // Edit seed setup
if(castle.isNextPeriodApproved())
{
activeChar.sendPacket(SystemMessageId.A_MANOR_CANNOT_BE_SET_UP_BETWEEN_6_AM_AND_8_PM);
}
else
{
activeChar.sendPacket(new ExShowSeedSetting(castle.getCastleId()));
}
break;
case 8: // Edit crop setup
if(castle.isNextPeriodApproved())
{
activeChar.sendPacket(SystemMessageId.A_MANOR_CANNOT_BE_SET_UP_BETWEEN_6_AM_AND_8_PM);
}
else
{
activeChar.sendPacket(new ExShowCropSetting(castle.getCastleId()));
}
break;
case 9: // Edit sales (Crop sales)
activeChar.sendPacket(new ExShowProcureCropDetail(state));
break;
default:
return false;
}
return true;
}
catch(Exception e)
{
log.log(Level.ERROR, e);
}
return false;
}
} | [
"echipachenko@gmail.com"
] | echipachenko@gmail.com |
6ff8580224ebb8a29ce201e727b90fc5a0ebead6 | 6b23d8ae464de075ad006c204bd7e946971b0570 | /WEB-INF/plugin/api/src/jp/groupsession/v2/api/schedule/prefarence/worktime/ApiSchPrefWorkTimeForm.java | b5b3e313fd8277cc1c7499b8186bcf15c0aff1da | [] | no_license | kosuke8/gsession | a259c71857ed36811bd8eeac19c456aa8f96c61e | edd22517a22d1fb2c9339fc7f2a52e4122fc1992 | refs/heads/master | 2021-08-20T05:43:09.431268 | 2017-11-28T07:10:08 | 2017-11-28T07:10:08 | 112,293,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,267 | java | package jp.groupsession.v2.api.schedule.prefarence.worktime;
import jp.groupsession.v2.api.AbstractApiForm;
import jp.groupsession.v2.api.GSValidateApi;
import jp.groupsession.v2.struts.msg.GsMessage;
import org.apache.struts.action.ActionErrors;
/**
*
* <br>[機 能] スケジュール日間表示時間帯設定取得WEBAPIフォーム
* <br>[解 説]
* <br>[備 考]
*
* @author JTS
*/
public class ApiSchPrefWorkTimeForm extends AbstractApiForm {
/** ユーザSID*/
private String usrSid__;
/**
* <p>usrSid を取得します。
* @return usrSid
*/
public String getUsrSid() {
return usrSid__;
}
/**
* <p>usrSid をセットします。
* @param usrSid usrSid
*/
public void setUsrSid(String usrSid) {
usrSid__ = usrSid;
}
/**
*
* <br>[機 能] 入力チェック
* <br>[解 説]
* <br>[備 考]
* @param gsMsg GsMessage
* @return errors
*/
public ActionErrors validateCheck(
GsMessage gsMsg) {
ActionErrors errors = new ActionErrors();
GSValidateApi.validateSid(errors, usrSid__, "usrSid",
"usrSid", false);
return errors;
}
}
| [
"PK140601-29@PK140601-29"
] | PK140601-29@PK140601-29 |
c205a3b0657d6e3eacd356ee3969c56b2a3534b6 | 20919e14e453932ca10bf95e8fd40b46b5219e90 | /src/com/ansorgit/plugins/bash/editor/highlighting/codeHighlighting/PostHighlightingPass.java | 697fc2dbc2751540acfd9f06f586654f797a2053 | [
"Apache-2.0"
] | permissive | stefano-garzarella/BashSupport | 69c38429471401528d6f361c8b62d4433ddee401 | 7b487e023dd05a6b9ed5a429d421103f524b1598 | refs/heads/master | 2020-12-01T01:18:22.263323 | 2015-03-14T14:12:25 | 2015-03-14T14:12:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,472 | java | package com.ansorgit.plugins.bash.editor.highlighting.codeHighlighting;
import com.ansorgit.plugins.bash.editor.inspections.inspections.UnusedFunctionDefInspection;
import com.ansorgit.plugins.bash.lang.psi.BashVisitor;
import com.ansorgit.plugins.bash.lang.psi.api.BashFunctionDefName;
import com.ansorgit.plugins.bash.lang.psi.api.function.BashFunctionDef;
import com.intellij.codeHighlighting.Pass;
import com.intellij.codeHighlighting.TextEditorHighlightingPass;
import com.intellij.codeInsight.daemon.HighlightDisplayKey;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
import com.intellij.codeInsight.daemon.impl.UpdateHighlightersUtil;
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInspection.InspectionProfile;
import com.intellij.codeInspection.reference.UnusedDeclarationFixProvider;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiRecursiveElementWalkingVisitor;
import com.intellij.psi.PsiReference;
import com.intellij.psi.search.searches.ReferencesSearch;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.Query;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class PostHighlightingPass extends TextEditorHighlightingPass {
private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.PostHighlightingPass");
@NotNull
private final Project project;
@NotNull
private final PsiFile file;
@Nullable
private final Editor editor;
@NotNull
private final Document document;
private HighlightDisplayKey unusedSymbolInspection;
private int startOffset;
private int endOffset;
private Collection<HighlightInfo> highlights;
PostHighlightingPass(@NotNull Project project, @NotNull PsiFile file, @Nullable Editor editor, @NotNull Document document) {
super(project, document, true);
this.project = project;
this.file = file;
this.editor = editor;
this.document = document;
startOffset = 0;
endOffset = file.getTextLength();
}
@Override
public List<HighlightInfo> getInfos() {
return highlights == null ? null : new ArrayList<HighlightInfo>(highlights);
}
public static HighlightInfo createUnusedSymbolInfo(@NotNull PsiElement element, @NotNull String message, @NotNull final HighlightInfoType highlightInfoType) {
HighlightInfo info = HighlightInfo.newHighlightInfo(highlightInfoType).range(element).descriptionAndTooltip(message).create();
UnusedDeclarationFixProvider[] fixProviders = Extensions.getExtensions(UnusedDeclarationFixProvider.EP_NAME);
for (UnusedDeclarationFixProvider provider : fixProviders) {
IntentionAction[] fixes = provider.getQuickFixes(element);
for (IntentionAction fix : fixes) {
QuickFixAction.registerQuickFixAction(info, fix);
}
}
return info;
}
@Override
public void doCollectInformation(@NotNull final ProgressIndicator progress) {
final List<HighlightInfo> highlights = new ArrayList<HighlightInfo>();
collectHighlights(highlights, progress);
this.highlights = highlights;
}
private void collectHighlights(@NotNull final List<HighlightInfo> result, @NotNull final ProgressIndicator progress) {
ApplicationManager.getApplication().assertReadAccessAllowed();
InspectionProfile profile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile();
unusedSymbolInspection = HighlightDisplayKey.findById(UnusedFunctionDefInspection.ID);
boolean findUnusedFunctions = profile.isToolEnabled(unusedSymbolInspection, file);
if (findUnusedFunctions) {
final BashVisitor bashVisitor = new BashVisitor() {
@Override
public void visitFunctionDef(BashFunctionDef functionDef) {
HighlightingKeys.IS_UNUSED.set(functionDef, null);
if (!PsiUtilCore.hasErrorElementChild(functionDef)) {
HighlightInfo highlightInfo = processFunctionDef(functionDef, progress);
if (highlightInfo != null) {
result.add(highlightInfo);
}
}
}
};
file.accept(new PsiRecursiveElementWalkingVisitor() {
@Override
public void visitElement(PsiElement element) {
element.accept(bashVisitor);
super.visitElement(element);
}
});
}
}
private static HighlightInfo processFunctionDef(BashFunctionDef functionDef, ProgressIndicator progress) {
BashFunctionDefName nameSymbol = functionDef.getNameSymbol();
if (nameSymbol != null) {
Query<PsiReference> search = ReferencesSearch.search(functionDef, functionDef.getUseScope(), true);
progress.checkCanceled();
PsiReference first = search.findFirst();
progress.checkCanceled();
if (first == null) {
HighlightingKeys.IS_UNUSED.set(functionDef, Boolean.TRUE);
return createUnusedSymbolInfo(nameSymbol, "Unused function definition", HighlightInfoType.UNUSED_SYMBOL);
}
}
return null;
}
@Override
public void doApplyInformationToEditor() {
if (highlights == null || highlights.isEmpty()) {
return;
}
UpdateHighlightersUtil.setHighlightersToEditor(myProject, myDocument, startOffset, endOffset, highlights, getColorsScheme(), Pass.POST_UPDATE_ALL);
BashPostHighlightingPassFactory.markFileUpToDate(file);
}
}
| [
"github@joachim-ansorg.de"
] | github@joachim-ansorg.de |
87ae9c50e52730c71e8c1ae6e0347427a81f9d11 | a10cb748c5597851ed6cf9d04cafac6eb6c8f377 | /week-01/day-4-5/src/Variables/FavouriteNumber.java | 08cba827af90f3b1167c7bec4c1ede8c95923222 | [] | no_license | green-fox-academy/szbarna-asd | 9dba837c9186c9cde100c03b4d98018a32128473 | 8c85e747644e66a11a69f7efed789d6055653dbd | refs/heads/master | 2020-09-25T02:45:20.176555 | 2020-03-03T20:54:49 | 2020-03-03T20:54:49 | 225,899,785 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 209 | java | package Variables;
public class FavouriteNumber {
public static void main(String[] args) {
int favouriteNumber=7;
System.out.println("My favourite number is: " + favouriteNumber);
}
}
| [
"barna.efs@gmail.com"
] | barna.efs@gmail.com |
40c29c06abb3fc3491642430a9c61afc7dbb719a | 80cd5720fedb1af3d9179009c5e78f7b14bd3bd3 | /src/main/java/com/bridgelabz/MyBinaryTree.java | 118d5cf4c189a306823b85de9a4852e6086027cf | [] | no_license | rinkeshdubey22/HashTable_BinarySearchTree_DS_Java | 05522e8f6d8e17f7aa3d875d539f121024ebc790 | aa57c6cd2955ff5ab77f58926fb83a8eff04b86f | refs/heads/master | 2023-04-02T10:12:21.373346 | 2021-04-01T09:06:22 | 2021-04-01T09:06:22 | 352,743,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,572 | java | package com.bridgelabz;
public class MyBinaryTree<K extends Comparable<K>> {
MyBinaryNode<K> root;
public void add(K key) {
this.root = this.addRecursively(root, key);
}
private MyBinaryNode<K> addRecursively(MyBinaryNode<K> current, K key) {
if (current == null)
return new MyBinaryNode<>(key);
int compareResult;
compareResult = key.compareTo(current.key);
if (compareResult == 0) return current;
if (compareResult < 0) {
current.left = addRecursively(current.left, key);
} else {
current.right = addRecursively(current.right, key);
}
return current;
}
public int getSize() {
return this.getSizeRecursive(root);
}
private int getSizeRecursive(MyBinaryNode<K> current) {
return current == null ? 0 : 1 + this.getSizeRecursive(current.left)
+ this.getSizeRecursive(current.right);
}
public MyBinaryNode<K> SearchRecursively(MyBinaryNode<K> current, K key) {
if (current == null) {
return null;
}
int compareResult = key.compareTo(current.key);
if (compareResult == 0) {
return current;
} else if (compareResult < 0) {
return SearchRecursively(current.left, key);
} else {
return SearchRecursively(current.right, key);
}
}
public boolean search(K key) {
if (SearchRecursively(root, key) != null) {
return true;
}
return false;
}
}
| [
"rinkeshdubey2@gmail.com"
] | rinkeshdubey2@gmail.com |
e60710d4402ab923e072320c43fd9a68fb8a5df5 | 3bab81792c722411c542596fedc8e4b1d086c1a9 | /src/main/java/com/gome/maven/analysis/AnalysisScopeUtil.java | aea76c9bdc99be4502f5da0dca5467a649dfb56c | [] | no_license | nicholas879110/maven-code-check-plugin | 80d6810cc3c12a3b6c22e3eada331136e3d9a03e | 8162834e19ed0a06ae5240b5e11a365c0f80d0a0 | refs/heads/master | 2021-04-30T07:09:42.455482 | 2018-03-01T03:21:21 | 2018-03-01T03:21:21 | 121,457,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | /*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gome.maven.analysis;
import com.gome.maven.openapi.actionSystem.DataKey;
public class AnalysisScopeUtil {
public static final DataKey<AnalysisScope> KEY = DataKey.create("analysisScope");
}
| [
"zhangliewei@gome.com.cn"
] | zhangliewei@gome.com.cn |
b93c685e63d6e229b533fbb6980530ee15b7bb22 | c66257e39e77c2354167e5b99f57c414c1727bf5 | /src/task2/LocalitySortReducer.java | ac76081a8e2c81538426ee108c8becbe123b955d | [] | no_license | jiaxililearn/MapReduce_Movies | eb02c42a18b973493dbfc5585f56b0643702b318 | 3d31fa5f1a58a06b5a6c0925ab74a10e4fa64fb7 | refs/heads/master | 2021-06-09T04:16:05.015011 | 2017-01-04T00:01:11 | 2017-01-04T00:01:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,028 | java | package join;
import java.io.IOException;
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 java.util.Set;
import java.util.Map.Entry;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.Reducer.Context;
import org.apache.hadoop.io.IntWritable;
public class LocalitySortReducer extends Reducer<IntWritable, Text, Text, Text> {
private Text keyOut = new Text(), valOut = new Text();
private int counter = 0;
public void reduce(IntWritable key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
for (Text val : values) {
if (counter < 10){
keyOut.set(val.toString());
valOut.set(key.toString());
context.write(keyOut, valOut);
counter++;
}
}
}
}
| [
"jili2506@pc-3e79-0.it.usyd.edu.au"
] | jili2506@pc-3e79-0.it.usyd.edu.au |
0e3aec4397c2af513025b242a580392e0f832061 | be1df0979b508c13acaf706489026771161ce56c | /Uley/uley/src/main/java/com/example/julia/uley/common/PackageType.java | 2fd3ea16e9cba87dde0c09c3f2d4f0b7047e2120 | [] | no_license | Pochatkin/MyRep | 84e6bda44190e8f60c3a174597e36ab6bceaa36e | a1e716703383adb39b71249f79ac70c042b91432 | refs/heads/master | 2020-05-21T14:06:45.249271 | 2017-06-05T12:56:43 | 2017-06-05T12:56:43 | 46,584,151 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | package com.example.julia.uley.common;
/**
* Created by Julia on 23.11.2015.
*/
public enum PackageType {
//server client req
REQ_SEARCH,
REQ_SIGN_IN,
REQ_SIGN_OUT,
REQ_SIGN_UP,
REQ_SEND_MESSAGE,
//server response
RESP_SIGN_IN_OK,
RESP_SIGN_IN_FAILED,
RESP_SIGN_UP_OK,
RESP_SIGN_UP_USER_ALREADY_EXIST,
RESP_SIGN_UP_LOGIN_FILTER_FAILED,
RESP_SIGN_UP_PASS_FILTER_FAILED,
RESP_SIGN_OUT_OK,
RESP_MESSAGE_DELIVERED, // client response too
RESP_MESSAGE_IN_QUEUE,
RESP_MESSAGE_USER_NOT_FOUND,
RESP_SEARCH_ANSWER,
RESP_SERVER_ERROR;
}
| [
"m.a.pochatkin@gmail.com"
] | m.a.pochatkin@gmail.com |
e1ba83bbab24dfbf84c5a9844690f4597c934b14 | 18c2c56640b3125dc6f18975fecf83eb5888fec0 | /src/test/java/com/example/TestArithmetic/collection/skipList/SkipListNode.java | 19616b6f373234946a8a7bcabc4c095d0596fca5 | [] | no_license | zhuxiaoqing-com/AQS | 8111b0c4d29282a5b4c030210410d37fa9869101 | ad8715c83a863ca615d26c6d52a3243477fd6e18 | refs/heads/develop | 2022-10-30T10:05:46.009213 | 2021-03-16T13:02:52 | 2021-03-16T13:02:52 | 148,271,523 | 2 | 1 | null | 2022-10-04T23:55:35 | 2018-09-11T06:34:32 | Java | UTF-8 | Java | false | false | 1,658 | java | package com.example.TestArithmetic.collection.skipList;
public class SkipListNode<T> {
public int key;
public T value;
public SkipListNode<T> down, right;// 上下左右四个指针
public SkipListNode(int key, SkipListNode<T> down) {
this.key = key;
this.down = down;
}
public SkipListNode(int key, SkipListNode<T> right, SkipListNode<T> down) {
this.key = key;
this.right = right;
this.down = down;
}
public SkipListNode(int key, T value, SkipListNode<T> right, SkipListNode<T> down) {
this.key = key;
this.value = value;
this.down = down;
this.right = right;
}
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
public T getValue() {
return value;
}
public void setValue(T value) {
this.value = value;
}
public SkipListNode<T> getDown() {
return down;
}
public void setDown(SkipListNode<T> down) {
this.down = down;
}
public SkipListNode<T> getRight() {
return right;
}
public void setRight(SkipListNode<T> right) {
this.right = right;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
if (!(o instanceof SkipListNode<?>)) {
return false;
}
SkipListNode<T> ent = (SkipListNode<T>) o;
return (ent.getKey() == key) && (ent.getValue() == value);
}
@Override
public String toString() {
return "key-value:" + key + "-" + value;
}
}
| [
"594012917@qq.com"
] | 594012917@qq.com |
3f5b8dd0e46d76e55f1678896cb710870b826877 | ff9928e127574b4b764b64f99fc9b09013c9e2c0 | /ibator-core/src/main/java/org/apache/ibatis/ibator/generator/ibatis2/model/BaseRecordGenerator.java | 438ea8c035fe8737c2837222bd6386f7338c7782 | [
"Apache-2.0"
] | permissive | ivaneye/IntellijWeb | be6c2558bf8a76d42b60dd86f8b74a8b8af738c2 | 40c1c7a24dc9fa6a6db5f51a3edb5015a0086221 | refs/heads/master | 2020-04-09T11:55:07.316234 | 2012-06-19T14:50:21 | 2012-06-19T14:50:21 | 4,605,677 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,517 | java | /*
* Copyright 2008 The Apache Software Foundation
*
* 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.apache.ibatis.ibator.generator.ibatis2.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.ibatis.ibator.api.CommentGenerator;
import org.apache.ibatis.ibator.api.FullyQualifiedTable;
import org.apache.ibatis.ibator.api.IbatorPlugin;
import org.apache.ibatis.ibator.api.IntrospectedColumn;
import org.apache.ibatis.ibator.api.dom.java.CompilationUnit;
import org.apache.ibatis.ibator.api.dom.java.Field;
import org.apache.ibatis.ibator.api.dom.java.FullyQualifiedJavaType;
import org.apache.ibatis.ibator.api.dom.java.JavaVisibility;
import org.apache.ibatis.ibator.api.dom.java.Method;
import org.apache.ibatis.ibator.api.dom.java.TopLevelClass;
import org.apache.ibatis.ibator.generator.AbstractJavaGenerator;
import org.apache.ibatis.ibator.generator.RootClassInfo;
import org.apache.ibatis.ibator.internal.util.messages.Messages;
/**
*
* @author Jeff Butler
*
*/
public class BaseRecordGenerator extends AbstractJavaGenerator {
public BaseRecordGenerator() {
super();
}
@Override
public List<CompilationUnit> getCompilationUnits() {
FullyQualifiedTable table = introspectedTable.getFullyQualifiedTable();
progressCallback.startTask(
Messages.getString("Progress.8", table.toString())); //$NON-NLS-1$
IbatorPlugin plugins = ibatorContext.getPlugins();
CommentGenerator commentGenerator = ibatorContext.getCommentGenerator();
TopLevelClass topLevelClass = new TopLevelClass(introspectedTable.getBaseRecordType());
topLevelClass.setVisibility(JavaVisibility.PUBLIC);
commentGenerator.addJavaFileComment(topLevelClass);
FullyQualifiedJavaType superClass = getSuperClass();
if (superClass != null) {
topLevelClass.setSuperClass(superClass);
topLevelClass.addImportedType(superClass);
}
List<IntrospectedColumn> introspectedColumns;
if (includePrimaryKeyColumns()) {
if (includeBLOBColumns()) {
introspectedColumns = introspectedTable.getAllColumns();
} else {
introspectedColumns = introspectedTable.getNonBLOBColumns();
}
} else {
if (includeBLOBColumns()) {
introspectedColumns = introspectedTable.getNonPrimaryKeyColumns();
} else {
introspectedColumns = introspectedTable.getBaseColumns();
}
}
String rootClass = getRootClass();
for (IntrospectedColumn introspectedColumn : introspectedColumns) {
if (RootClassInfo.getInstance(rootClass, warnings).containsProperty(introspectedColumn)) {
continue;
}
Field field = getJavaBeansField(introspectedColumn);
if (plugins.modelFieldGenerated(field, topLevelClass, introspectedColumn,
introspectedTable, IbatorPlugin.ModelClassType.BASE_RECORD)) {
topLevelClass.addField(field);
topLevelClass.addImportedType(field.getType());
}
Method method = getJavaBeansGetter(introspectedColumn);
if (plugins.modelGetterMethodGenerated(method, topLevelClass,
introspectedColumn, introspectedTable, IbatorPlugin.ModelClassType.BASE_RECORD)) {
topLevelClass.addMethod(method);
}
method = getJavaBeansSetter(introspectedColumn);
if (plugins.modelSetterMethodGenerated(method, topLevelClass,
introspectedColumn, introspectedTable, IbatorPlugin.ModelClassType.BASE_RECORD)) {
topLevelClass.addMethod(method);
}
}
List<CompilationUnit> answer = new ArrayList<CompilationUnit>();
if (ibatorContext.getPlugins().modelBaseRecordClassGenerated(topLevelClass, introspectedTable)) {
answer.add(topLevelClass);
}
return answer;
}
private FullyQualifiedJavaType getSuperClass() {
FullyQualifiedJavaType superClass;
if (introspectedTable.getRules().generatePrimaryKeyClass()) {
superClass = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType());
} else {
String rootClass = getRootClass();
if (rootClass != null) {
superClass = new FullyQualifiedJavaType(rootClass);
} else {
superClass = null;
}
}
return superClass;
}
private boolean includePrimaryKeyColumns() {
return !introspectedTable.getRules().generatePrimaryKeyClass()
&& introspectedTable.hasPrimaryKeyColumns();
}
private boolean includeBLOBColumns() {
return !introspectedTable.getRules().generateRecordWithBLOBsClass()
&& introspectedTable.hasBLOBColumns();
}
}
| [
"ivan.pig@foxmail.com"
] | ivan.pig@foxmail.com |
c62a486855264843f647afce3ae5d40643fdf6a0 | d092c182f763daf53fb5f5fb973e4fcaaf2fb3cc | /ble-common/src/main/java/no/nordicsemi/android/ble/common/profile/bp/BloodPressureMeasurementCallback.java | e810731f4cfa59e76434e68d9906dd98267173e1 | [
"BSD-3-Clause"
] | permissive | NethunterJack/Android-BLE-Common-Library | 7a6c487ca63a6eff1f03bb5d3eb28c56f8a42f09 | 68804b065c23d8d04155a80267d3146d1a70bfd8 | refs/heads/master | 2020-04-11T01:42:28.557487 | 2018-11-08T11:33:11 | 2018-11-08T11:33:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,398 | java | /*
* Copyright (c) 2018, Nordic Semiconductor
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package no.nordicsemi.android.ble.common.profile.bp;
import android.bluetooth.BluetoothDevice;
import android.support.annotation.FloatRange;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.Calendar;
@SuppressWarnings("unused")
public interface BloodPressureMeasurementCallback extends BloodPressureTypes {
/**
* Callback called when Blood Pressure Measurement packet has been received.
* Use {@link #toKPa(float, int)} or {@link #toMmHg(float, int)} to convert pressure units.
*
* @param device the target device.
* @param systolic the systolic compound of blood pressure measurement.
* @param diastolic the diastolic compound of blood pressure measurement.
* @param meanArterialPressure the mean arterial pressure compound of blood pressure measurement.
* @param unit the measurement unit, one of {@link #UNIT_mmHg} or {@link #UNIT_kPa}.
* @param pulseRate an optional pulse rate in beats per minute.
* @param userID an optional user ID. Value 255 means 'unknown user'.
* @param status an optional measurement status.
* @param calendar an optional measurement timestamp.
*/
void onBloodPressureMeasurementReceived(@NonNull final BluetoothDevice device,
@FloatRange(from = 0) final float systolic,
@FloatRange(from = 0) final float diastolic,
@FloatRange(from = 0) final float meanArterialPressure,
@BloodPressureUnit final int unit,
@Nullable @FloatRange(from = 0) final Float pulseRate,
@Nullable @IntRange(from = 0, to = 255) final Integer userID,
@Nullable final BPMStatus status,
@Nullable final Calendar calendar);
}
| [
"aleksander.nowakowski@nordicsemi.no"
] | aleksander.nowakowski@nordicsemi.no |
3455ca4f0259c9a9585d4b7acce945b050831596 | 8d1d8b98cb9a819e31b1cf01b3cf6b95561c867f | /androidclient/src/org/uab/android/eventreporter/lists/FGCExpandableList.java | 0c4950837c43af217c235c8c853cf793f66c863f | [
"MIT"
] | permissive | cristiantanas/Incidencies-2.0 | a7187015f722ba770f72e673fe9db99045830470 | 20ceea4ff1cd94bfc2d593d17c5d5d0c4f059a8d | refs/heads/master | 2021-08-07T19:56:13.542212 | 2017-11-08T21:49:23 | 2017-11-08T21:49:23 | 110,027,074 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,049 | java | package org.uab.android.eventreporter.lists;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.uab.android.eventreporter.R;
import org.uab.android.eventreporter.ReportSendActivity;
import org.uab.android.eventreporter.utils.Utils;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ExpandableListActivity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.SimpleExpandableListAdapter;
import android.widget.TextView;
public class FGCExpandableList extends ExpandableListActivity {
private static final int FGC_ID = 1;
private static final String GROUP_ID = "group";
private static final String CHILDREN_ID = "children";
private String username = "";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
username = getIntent().getStringExtra("username");
setListAdapter(new SimpleExpandableListAdapter(this,
getGroups(),
android.R.layout.simple_expandable_list_item_1,
new String[] {GROUP_ID},
new int[] {android.R.id.text1},
getChildren(),
android.R.layout.simple_list_item_single_choice,
new String[] {CHILDREN_ID},
new int[] {android.R.id.text1}));
getExpandableListView().setOnChildClickListener(new OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
int uniqueLineId = FGC_ID * 10 + groupPosition;
String stationName = ((TextView) v).getText().toString();
startActivity(new Intent(getApplicationContext(), ReportSendActivity.class)
.putExtra("username", username)
.putExtra("service", Utils.FGC_INCIDENTS)
.putExtra("line", uniqueLineId)
.putExtra("station", stationName)
.putExtra("stationHash", Utils.md5(stationName)));
return true;
}
});
}
private List<Map<String,String>> getGroups() {
String[] groups = getResources().getStringArray(R.array.fgc_lines);
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
Map<String,String> map;
for (String item : groups) {
map = new HashMap<String,String>();
map.put(GROUP_ID, item);
list.add(map);
}
return list;
}
private List<List<Map<String,String>>> getChildren() {
String[][] childrens = new String[][] {
getResources().getStringArray(R.array.fgc_l6_line),
getResources().getStringArray(R.array.fgc_s1_line),
getResources().getStringArray(R.array.fgc_s55_line),
getResources().getStringArray(R.array.fgc_s5_line),
getResources().getStringArray(R.array.fgc_s2_line),
getResources().getStringArray(R.array.fgc_l7_line)
};
List<List<Map<String,String>>> list = new ArrayList<List<Map<String,String>>>();
List<Map<String,String>> sublist;
Map<String,String> map;
for (String[] items : childrens) {
sublist = new ArrayList<Map<String,String>>();
for (String item : items) {
map = new HashMap<String,String>();
map.put(CHILDREN_ID, item);
sublist.add(map);
}
list.add(sublist);
}
return list;
}
@Override
protected Dialog onCreateDialog(int id) {
Dialog dialog = null;
if (id == 0) {
dialog = new ProgressDialog(this);
((ProgressDialog) dialog).setMessage("Obtenint informació...");
dialog.show();
} else if (id == 1) {
dialog = new AlertDialog.Builder(this)
.setMessage("No s'ha pogut obtenir la informació en aquest moment! " +
"Per favor, torni a intentar-ho més tard.")
.setNeutralButton(Utils.DISCARD, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.create();
}
return dialog;
}
}
| [
"c.tanas@gmail.com"
] | c.tanas@gmail.com |
05b07546c26f2c371497c7fbc5d41f7ab0c4a073 | 3d27e626a440f4aac439a28ac3e0c9790427822e | /src/main/java/br/com/udelblue/spring/boot/data/embedded/mongodb/domain/Thumbdrive.java | 318e50d447b18e9d181315d3dffc72f42293728e | [] | no_license | udelblue/embedded_mongodb | f679dc5e1972df3e6a6a76a4fb69f3878f8b1d80 | 048378c983247d5b6820d692a785f7e1c2be65ef | refs/heads/master | 2021-07-11T17:33:45.582845 | 2017-10-03T23:31:05 | 2017-10-03T23:31:05 | 105,713,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package br.com.udelblue.spring.boot.data.embedded.mongodb.domain;
public class Thumbdrive extends Product {
Integer gigabytes;
public Thumbdrive(Integer id, String company, String name, Integer gigabytes) {
super(id, company, name, Type.THUMBDRIVE);
this.gigabytes = gigabytes;
}
public Integer getGigabytes() {
return gigabytes;
}
}
| [
"cdsommers@gmail.com"
] | cdsommers@gmail.com |
7032bdeb10fee19926edc38e37d5884e77ba21f4 | c4635ee657174085d815d22c5b05dcc2dad1b07f | /app/src/test/java/com/example/bor/pizzeria/ExampleUnitTest.java | 840b67f66bcf3db9bf419089f7c69447d8efbc87 | [] | no_license | bor91k/Pizzeria | 89842ae52161d1027aa00c5cf9d08606913cc7d8 | aebe66f14b8bf3bf17cda038003d1685886d358c | refs/heads/master | 2020-03-30T14:24:53.220181 | 2018-10-02T20:30:05 | 2018-10-02T20:30:05 | 151,316,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.example.bor.pizzeria;
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);
}
} | [
"bor91k@gmail.com"
] | bor91k@gmail.com |
9b8f08de2d4b83aa69820ac3d7fd99cc9ba14e5a | 75962c018572404bba808afba3ff56a748436d4c | /Programming/Java/sem4/Lab6_1/src/bsu/fpmi/artsiushkevich/Main.java | d954213b74df4c91907ed3e9a9a93ad2cb6d50a6 | [] | no_license | thekirjava/BSU | 0f313df3ff9dda3df37efeeee813fbfd466a977e | 33d56c9adc9b6873f2bb360c0d7089dc458eb451 | refs/heads/master | 2021-11-20T14:07:55.287509 | 2021-10-17T19:37:07 | 2021-10-17T19:37:07 | 220,980,538 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 211 | java | package bsu.fpmi.artsiushkevich;
import javax.swing.*;
public class Main {
public static void main(String[] args) {
MainWindow window = new MainWindow();
window.setVisible(true);
}
}
| [
"thekirjava@yandex.by"
] | thekirjava@yandex.by |
f107d271243ab704ceaf2f9849bb5fab35a33167 | 3dbbe6d13223610f81e989aae3509910cc3fb7b4 | /src/test/java/com/zerobank/utilities/Driver.java | 090b02101e83d903416010253fb35d12d51b1f6a | [] | no_license | sofochka87/Zero-Bank | 7479868cdaa4339b1980d190151cc228ff71163a | e78f55687885b0d728021d21cadeca408f3437c3 | refs/heads/master | 2020-03-24T01:46:40.439499 | 2018-08-17T02:06:55 | 2018-08-17T02:06:55 | 142,351,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,448 | java | package com.zerobank.utilities;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Driver {
private Driver() {}
private static WebDriver driver;
public static WebDriver getDriver() {
if (driver == null) {
switch (ConfigurationReader.getProperty("browser")) {
case "firefox":
WebDriverManager.firefoxdriver().setup();
//driver = new FirefoxDriver();
DesiredCapabilities caps2 = DesiredCapabilities.firefox();
caps2.setPlatform(Platform.ANY);
try {
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),caps2);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
break;
case "chrome":
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
break;
case "ie":
WebDriverManager.iedriver().setup();
driver = new InternetExplorerDriver();
break;
}
}
return driver;
}
public static void closeDriver() {
if (driver != null) {
driver.quit();
driver = null;
}
}
}
| [
"pizzasonya@gmail.com"
] | pizzasonya@gmail.com |
54aba4f79dcbff4cada9d3d3b99922c0dc14277d | e1355210f2c3882a85c8a01ede651d4a5bc2bac8 | /assignments/week-7-assignment-6/iRemember/src/edu/vuum/mocca/ui/CreateStoryActivity.java | cd0f0a1deacb9817a453e49af9fc75646cb133f5 | [] | no_license | kittiekorn/MoCCA-POSA | 75b98344823612cd7fd887ab15d2df6bf2756869 | 262ff7236be6b836c11cc9ddaeb1677372964754 | refs/heads/master | 2021-01-16T17:47:25.944075 | 2015-07-28T19:04:22 | 2015-07-28T19:04:22 | 28,104,022 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 14,782 | java | /*
The iRemember source code (henceforth referred to as "iRemember") is
copyrighted by Mike Walker, Adam Porter, Doug Schmidt, and Jules White
at Vanderbilt University and the University of Maryland, Copyright (c)
2014, all rights reserved. Since iRemember is open-source, freely
available software, you are free to use, modify, copy, and
distribute--perpetually and irrevocably--the source code and object code
produced from the source, as well as copy and distribute modified
versions of this software. You must, however, include this copyright
statement along with any code built using iRemember that you release. No
copyright statement needs to be provided if you just ship binary
executables of your software products.
You can use iRemember software in commercial and/or binary software
releases and are under no obligation to redistribute any of your source
code that is built using the software. Note, however, that you may not
misappropriate the iRemember code, such as copyrighting it yourself or
claiming authorship of the iRemember software code, in a way that will
prevent the software from being distributed freely using an open-source
development model. You needn't inform anyone that you're using iRemember
software in your software, though we encourage you to let us know so we
can promote your project in our success stories.
iRemember is provided as is with no warranties of any kind, including
the warranties of design, merchantability, and fitness for a particular
purpose, noninfringement, or arising from a course of dealing, usage or
trade practice. Vanderbilt University and University of Maryland, their
employees, and students shall have no liability with respect to the
infringement of copyrights, trade secrets or any patents by DOC software
or any part thereof. Moreover, in no event will Vanderbilt University,
University of Maryland, their employees, or students be liable for any
lost revenue or profits or other special, indirect and consequential
damages.
iRemember is provided with no support and without any obligation on the
part of Vanderbilt University and University of Maryland, their
employees, or students to assist in its use, correction, modification,
or enhancement.
The names Vanderbilt University and University of Maryland may not be
used to endorse or promote products or services derived from this source
without express written permission from Vanderbilt University or
University of Maryland. This license grants no permission to call
products or services derived from the iRemember source, nor does it
grant permission for the name Vanderbilt University or
University of Maryland to appear in their names.
*/
package edu.vuum.mocca.ui;
import java.util.Calendar;
import java.util.Locale;
import android.content.Context;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.text.Editable;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import edu.vuum.mocca.R;
import edu.vuum.mocca.storage.MoocResolver;
import edu.vuum.mocca.storage.StorageUtilities;
import edu.vuum.mocca.storage.StoryCreator;
import edu.vuum.mocca.storage.StoryData;
/**
* The activity that allows a user to create and save a story.
*/
public class CreateStoryActivity extends StoryActivityBase {
// Tag used for debugging with Logcat
private final static String LOG_TAG = CreateStoryActivity.class
.getCanonicalName();
// Used as the request codes in startActivityForResult().
static final int CAMERA_PIC_REQUEST = 1;
static final int MIC_SOUND_REQUEST = 3;
// The various UI elements we use
TextView loginIdTV;
EditText storyIdET;
EditText titleET;
EditText bodyET;
Button audioCaptureButton;
Button videoCaptureButton;
EditText imageNameET;
Button imageCaptureButton;
EditText tagsET;
EditText creationTimeET;
EditText storyTimeET;
Button locationButton;
TextView imageLocation;
TextView videoLocation;
TextView audioLocation;
Button buttonCreate;
Button buttonClear;
Button buttonCancel;
TextView latitudeValue;
TextView longitudeValue;
DatePicker storyDate;
static Uri imagePath; // Making this static keeps it from getting GC'd when we take pictures
Uri fileUri;
String audioPath;
Location loc;
MoocResolver resolver;
Uri imagePathFinal = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Setup the UI
setContentView(R.layout.create_story_activity);
// Start a resolver to help us store/retrieve data from a database
resolver = new MoocResolver(this);
// Get references to all the UI elements
loginIdTV = (TextView) findViewById(R.id.story_create_value_login_id);
storyIdET = (EditText) findViewById(R.id.story_create_value_story_id);
titleET = (EditText) findViewById(R.id.story_create_value_title);
bodyET = (EditText) findViewById(R.id.story_create_value_body);
audioCaptureButton = (Button) findViewById(R.id.story_create_value_audio_link);
videoCaptureButton = (Button) findViewById(R.id.story_create_value_video_button);
imageNameET = (EditText) findViewById(R.id.story_create_value_image_name);
imageCaptureButton = (Button) findViewById(R.id.story_create_value_image_button);
tagsET = (EditText) findViewById(R.id.story_create_value_tags);
creationTimeET = (EditText) findViewById(R.id.story_create_value_creation_time);
locationButton = (Button) findViewById(R.id.story_create_value_location_button);
imageLocation = (TextView) findViewById(R.id.story_create_value_image_location);
videoLocation = (TextView) findViewById(R.id.story_create_value_video_location);
audioLocation = (TextView) findViewById(R.id.story_create_value_audio_location);
latitudeValue = (TextView) findViewById(R.id.story_create_value_latitude);
longitudeValue = (TextView) findViewById(R.id.story_create_value_longitude);
buttonClear = (Button) findViewById(R.id.story_create_button_reset);
buttonCancel = (Button) findViewById(R.id.story_create_button_cancel);
buttonCreate = (Button) findViewById(R.id.story_create_button_save);
storyDate = (DatePicker) findViewById(R.id.story_create_value_story_time_date_picker);
//Set the login ID, if it's been set
loginIdTV.setText(String.valueOf(LoginActivity.getLoginId(this)));
}
// Reset all the fields to their default values
public void buttonClearClicked (View v) {
storyIdET.setText("" + 0);
titleET.setText("" + "");
bodyET.setText("" + "");
imageNameET.setText("" + "");
tagsET.setText("" + "");
creationTimeET.setText("" + 0);
}
// Close this activity if the cancel button is clicked
public void buttonCancelClicked (View v) {
finish(); // same as hitting 'back' button
}
// Create a StoryData object from the input data and store it using the resolver
public void buttonCreateClicked (View v) {
Log.d(LOG_TAG, "create button pressed, creation time="
+ creationTimeET.getText());
// local Editables
Editable titleCreateable = titleET.getText();
Editable bodyCreateable = bodyET.getText();
Editable imageNameCreateable = imageNameET.getText();
Editable tagsCreateable = tagsET.getText();
Editable creationTimeCreateable = creationTimeET.getText();
Calendar cal = Calendar.getInstance();
cal.getTimeInMillis();
long loginId = 0;
long storyId = 0;
String title = "";
String body = "";
String audioLink = "";
String videoLink = "";
String imageName = "";
String imageData = "";
String tags = "";
long creationTime = 0;
long storyTime = 0;
double latitude = 0;
double longitude = 0;
// pull values from Editables
loginId = LoginActivity.getLoginId(this);
storyId = 1; // TODO Pull this from somewhere.
title = String.valueOf(titleCreateable.toString());
body = String.valueOf(bodyCreateable.toString());
if (audioPath != null) {
audioLink = audioPath;
}
if (fileUri != null) {
videoLink = fileUri.toString();
}
imageName = String.valueOf(imageNameCreateable.toString());
if (imagePathFinal != null) {
imageData = imagePathFinal.toString();
}
tags = String.valueOf(tagsCreateable.toString());
if (loc != null) {
latitude = loc.getLatitude();
longitude = loc.getLongitude();
}
Log.d(LOG_TAG, "creation time object:" + creationTimeCreateable);
Log.d(LOG_TAG, "creation time as string"
+ creationTimeCreateable.toString());
Calendar cal2 = Calendar.getInstance(Locale.ENGLISH);
creationTime = cal2.getTimeInMillis();
storyTime = StoryCreator.componentTimeToTimestamp(storyDate.getYear(),
storyDate.getMonth(), storyDate.getDayOfMonth(), 0, 0);
// new StoryData object with above info
StoryData newData = new StoryData(
-1,
// -1 row index, because there is no way to know which
// row it will go into
loginId, storyId, title, body, audioLink, videoLink,
imageName, imageData, tags, creationTime, storyTime,
latitude, longitude);
Log.d(LOG_TAG, "imageName"
+ imageNameET.getText());
Log.d(LOG_TAG,
"newStoryData:" + newData);
// insert it through Resolver to be put into the database
try {
resolver.insert(newData);
} catch (RemoteException e) {
Log.e(LOG_TAG,
"Caught RemoteException => " + e.getMessage());
e.printStackTrace();
}
finish(); // same as hitting 'back' button
}
/**
* Method to be called when Audio Clicked button is pressed.
*/
public void addAudioClicked(View aView) {
Log.v(LOG_TAG, "addAudioClicked(View) called.");
//Create an intent to start the SoundRecordActivity
Intent soundIntent = new Intent(this, SoundRecordActivity.class); // Line 275
// Tell the sound activity where to store the recorded audio.
String fileName = StorageUtilities.getOutputMediaFile(this, // Line 278
StorageUtilities.MEDIA_TYPE_AUDIO,
StorageUtilities.SECURITY_PUBLIC,
null).getAbsolutePath();
if (fileName == null)
return;
soundIntent.putExtra("FILENAME", fileName);
// Start the SoundRecordActivity
startActivityForResult(soundIntent, MIC_SOUND_REQUEST);
}
/**
* Method to be called when the Add Photo button is pressed.
*/
public void addPhotoClicked(View aView) {
Log.v(LOG_TAG, "addPhotoClicked(View) called."); // Line 297
// Create an intent that asks for an image to be captured
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
// Tell the capturing activity where to store the image
Uri uriPath = StorageUtilities.getOutputMediaFileUri(this, // Line 304
StorageUtilities.MEDIA_TYPE_IMAGE,
StorageUtilities.SECURITY_PUBLIC,
null);
if (uriPath == null)
return;
imagePath = uriPath;
cameraIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
imagePath);
// Start the activity
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST); // Line 317
}
/**
* Method to be called when the user clicks the "Get Location" button
* @param aView
*/
public void getLocationClicked(View aView) {
// Acquire a reference to the system Location Manager
final LocationManager locationManager = (LocationManager) this
.getSystemService(Context.LOCATION_SERVICE);
// Define a listener that responds to location updates
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
// Called when a new location is found by the network location
// provider.
Toast.makeText(getApplicationContext(),
"New Location obtained.", Toast.LENGTH_LONG).show(); // Line 337
setLocation(location);
locationManager.removeUpdates(this);
}
// We must define these to implement the interface, but we don't do anything when they're triggered.
public void onStatusChanged(String provider, int status,
Bundle extras) {
}
public void onProviderEnabled(String provider) {
}
public void onProviderDisabled(String provider) {
}
};
// Register the listener with the Location Manager to receive location
// updates
if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Log.d(LOG_TAG, "locationManager.isProviderEnabled = true/gps");
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER, 0, 0, locationListener);
Location location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
setLocation(location);
} else {
Toast.makeText(getApplicationContext(),
"GPS has yet to calculate location.", Toast.LENGTH_LONG)
.show();
}
} else {
Toast.makeText(getApplicationContext(), "GPS is not enabled.",
Toast.LENGTH_LONG).show();
}
}
/**
* Update the UI with a new location.
* @param location
*/
public void setLocation(Location location) {
Log.d(LOG_TAG, "setLocation =" + location); // Line 382
loc = location;
double latitude = loc.getLatitude();
double longitude = loc.getLongitude();
latitudeValue.setText("" + latitude);
longitudeValue.setText("" + longitude);
}
/**
* This is called when an activity that we've started returns a result.
*
* In our case, we're looking for the results returned from the SoundRecordActivity
* or the Camera Activity
*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.d(LOG_TAG, "CreateFragment onActivtyResult called. requestCode: "
+ requestCode + " resultCode:" + resultCode + "data:" + data);
if (requestCode == CreateStoryActivity.CAMERA_PIC_REQUEST) {
if (resultCode == CreateStoryActivity.RESULT_OK) {
// Image captured and saved to fileUri specified in the Intent
imagePathFinal = imagePath;
imageLocation.setText(imagePathFinal.toString());
} else if (resultCode == CreateStoryActivity.RESULT_CANCELED) {
// User cancelled the image capture
} else {
// Image capture failed, advise user
Toast.makeText(getApplicationContext(),
"Image capture failed.", Toast.LENGTH_LONG)
.show();
}
}
else if (requestCode == CreateStoryActivity.MIC_SOUND_REQUEST) {
// If we successfully recorded sound, grab the results.
if (resultCode == SoundRecordActivity.RESULT_OK) {
audioPath = (String) data.getExtras().get("data"); // Line 421
audioLocation.setText(audioPath.toString());
}
// If not, let the user know.
else {
Toast.makeText(this, "Sound capture failed.", Toast.LENGTH_LONG).show();
}
}
}
}
| [
"kittiekorn@gmail.com"
] | kittiekorn@gmail.com |
317ea09da25e60a7a82b7095b2bf208361ab5857 | fb41c04a4ead3b79625d0eb30ca85f0fd1c2d4c9 | /main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/SelectOverheadParameters.java | 55f1b57f927177d4f896b69b90c455879a2f6800 | [
"Apache-2.0",
"LicenseRef-scancode-takuya-ooura"
] | permissive | thhart/BoofCV | 899dcf1b4302bb9464520c36a9e54c6fe35969c7 | 43f25488673dc27590544330323c676f61c1a17a | refs/heads/SNAPSHOT | 2023-08-18T10:19:50.269999 | 2023-07-15T23:13:25 | 2023-07-15T23:13:25 | 90,468,259 | 0 | 0 | Apache-2.0 | 2018-10-26T08:47:44 | 2017-05-06T14:24:01 | Java | UTF-8 | Java | false | false | 5,071 | java | /*
* Copyright (c) 2021, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boofcv.alg.sfm.overhead;
import boofcv.struct.calib.CameraPinholeBrown;
import boofcv.struct.image.ImageBase;
import boofcv.struct.image.ImageType;
import georegression.struct.point.Point2D_F64;
import georegression.struct.se.Se3_F64;
/**
* Give a camera's intrinsic and extrinsic parameters, selects a reasonable overhead view to render the image onto. It
* attempts to maximize viewing area. The user can crop the height of the overhead view to reduce the amount of
* unusable image space in the map. This is particularly useful for cameras at an acute angle relative to the
* ground plane. Overhead cameras pointed downward should set it to 1.0
*
* @author Peter Abeles
*/
public class SelectOverheadParameters {
// used to project pixels onto the plane
CameraPlaneProjection proj = new CameraPlaneProjection();
// the selected overhead map values
int overheadWidth;
int overheadHeight;
double centerX;
double centerY;
// --- User specified parameters
// size of cells on the plane
double cellSize;
// determines the minimum resolution
double maxCellsPerPixel;
// used to crop the views's height. Specifies the fraction of the "optimal" height which is actually used.
double viewHeightFraction;
// local variables
Point2D_F64 plane0 = new Point2D_F64();
Point2D_F64 plane1 = new Point2D_F64();
/**
* Configure algorithm.
*
* @param cellSize Size of cells in plane in world units
* @param maxCellsPerPixel Specifies minimum resolution of a region in overhead image. A pixel in the camera
* can't overlap more than this number of cells. Higher values allow lower
* resolution regions. Try 4.
* @param viewHeightFraction Reduce the view height by this fraction to avoid excessive unusable image space. Set to
* 1.0 to maximize the viewing area and any value less than one to crop it.
*/
public SelectOverheadParameters( double cellSize, double maxCellsPerPixel, double viewHeightFraction ) {
this.cellSize = cellSize;
this.maxCellsPerPixel = maxCellsPerPixel;
this.viewHeightFraction = viewHeightFraction;
}
/**
* Computes the view's characteristics
*
* @param intrinsic Intrinsic camera parameters
* @param planeToCamera Extrinsic camera parameters which specify the plane
* @return true if successful or false if it failed
*/
public boolean process( CameraPinholeBrown intrinsic, Se3_F64 planeToCamera ) {
proj.setPlaneToCamera(planeToCamera, true);
proj.setIntrinsic(intrinsic);
// find a bounding rectangle on the ground which is visible to the camera and at a high enough resolution
double x0 = Double.MAX_VALUE;
double y0 = Double.MAX_VALUE;
double x1 = -Double.MAX_VALUE;
double y1 = -Double.MAX_VALUE;
for (int y = 0; y < intrinsic.height; y++) {
for (int x = 0; x < intrinsic.width; x++) {
if (!checkValidPixel(x, y))
continue;
if (plane0.x < x0)
x0 = plane0.x;
if (plane0.x > x1)
x1 = plane0.x;
if (plane0.y < y0)
y0 = plane0.y;
if (plane0.y > y1)
y1 = plane0.y;
}
}
if (x0 == Double.MAX_VALUE)
return false;
// compute parameters with the intent of maximizing viewing area
double mapWidth = x1 - x0;
double mapHeight = y1 - y0;
overheadWidth = (int)Math.floor(mapWidth/cellSize);
overheadHeight = (int)Math.floor(mapHeight*viewHeightFraction/cellSize);
centerX = -x0;
centerY = -(y0 + mapHeight*(1 - viewHeightFraction)/2.0);
return true;
}
/**
* Creates a new instance of the overhead view
*/
public <T extends ImageBase<T>> OverheadView createOverhead( ImageType<T> imageType ) {
OverheadView ret = new OverheadView();
ret.image = imageType.createImage(overheadWidth, overheadHeight);
ret.cellSize = cellSize;
ret.centerX = centerX;
ret.centerY = centerY;
return ret;
}
private boolean checkValidPixel( int x, int y ) {
if (!proj.pixelToPlane(x, y, plane0))
return false;
if (!proj.pixelToPlane(x + 1, y + 1, plane1))
return false;
double width = Math.abs(plane0.x - plane1.x);
double height = Math.abs(plane0.y - plane1.y);
if (width > maxCellsPerPixel*cellSize)
return false;
return !(height > maxCellsPerPixel*cellSize);
}
public int getOverheadWidth() {
return overheadWidth;
}
public int getOverheadHeight() {
return overheadHeight;
}
public double getCenterX() {
return centerX;
}
public double getCenterY() {
return centerY;
}
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
57383fa8eaec2b99fe78c902071e17c93d621e06 | e8a90e8ea77b132c53875f2034e25ac617adbbe6 | /passenger-trip/backend/src/main/java/edu/mum/ea/passenger/backend/entity/PassengerEntity.java | 18de9fbf55d507d517d2f7545f4f4701c2b64f9c | [] | no_license | lferasu/Carpool | 98447b0dacffb56429c16597880b08fa0a903d27 | dabb4406048b0cafc97d8cc5935cc28a60fc006e | refs/heads/master | 2023-01-20T11:48:04.437461 | 2019-11-22T02:46:31 | 2019-11-22T02:46:31 | 221,825,711 | 0 | 1 | null | 2023-01-07T11:57:03 | 2019-11-15T02:17:00 | Java | UTF-8 | Java | false | false | 208 | java | package edu.mum.ea.passenger.backend.entity;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data@NoArgsConstructor
public class PassengerEntity {
private String id;
private String name;
}
| [
"lferasu@yahoo.com"
] | lferasu@yahoo.com |
00d094bfa369ab3dc3017a814a9f2ac72c24cf69 | a6689bfcb181f6cb5fbab367e6b6f48738f239fc | /src/main/java/com/dropbox/core/v2/team/ListMemberDevicesArg.java | df05b8d5e99acead00bcd116f9b3dd3a8dcd2ca7 | [
"MIT"
] | permissive | VDenis/dropbox-sdk-java | 0df0fd0c3e225d26eaa7b27c52c1dc8bb38abc2e | d64515a8c6285c12dffd3d0bf0f2548d046125b6 | refs/heads/master | 2021-01-21T00:21:41.171499 | 2016-02-24T23:19:19 | 2016-02-24T23:19:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,460 | java | /* DO NOT EDIT */
/* This file was generated from team_devices.babel */
package com.dropbox.core.v2.team;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
import com.dropbox.core.json.JsonWriter;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import java.io.IOException;
public class ListMemberDevicesArg {
// struct ListMemberDevicesArg
private final String teamMemberId;
private final boolean includeWebSessions;
private final boolean includeDesktopClients;
private final boolean includeMobileClients;
/**
* Use {@link newBuilder} to create instances of this class without
* specifying values for all optional fields.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
* @param includeWebSessions Whether to list web sessions of the team's
* member.
* @param includeDesktopClients Whether to list linked desktop devices of
* the team's member.
* @param includeMobileClients Whether to list linked mobile devices of the
* team's member.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public ListMemberDevicesArg(String teamMemberId, boolean includeWebSessions, boolean includeDesktopClients, boolean includeMobileClients) {
if (teamMemberId == null) {
throw new IllegalArgumentException("Required value for 'teamMemberId' is null");
}
this.teamMemberId = teamMemberId;
this.includeWebSessions = includeWebSessions;
this.includeDesktopClients = includeDesktopClients;
this.includeMobileClients = includeMobileClients;
}
/**
* The default values for unset fields will be used.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public ListMemberDevicesArg(String teamMemberId) {
this(teamMemberId, true, true, true);
}
/**
* The team's member id
*
* @return value for this field, never {@code null}.
*/
public String getTeamMemberId() {
return teamMemberId;
}
/**
* Whether to list web sessions of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeWebSessions() {
return includeWebSessions;
}
/**
* Whether to list linked desktop devices of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeDesktopClients() {
return includeDesktopClients;
}
/**
* Whether to list linked mobile devices of the team's member
*
* @return value for this field, or {@code null} if not present. Defaults to
* true.
*/
public boolean getIncludeMobileClients() {
return includeMobileClients;
}
/**
* Returns a new builder for creating an instance of this class.
*
* @param teamMemberId The team's member id. Must not be {@code null}.
*
* @return builder for this class.
*
* @throws IllegalArgumentException If any argument does not meet its
* preconditions.
*/
public static Builder newBuilder(String teamMemberId) {
return new Builder(teamMemberId);
}
/**
* Builder for {@link ListMemberDevicesArg}.
*/
public static class Builder {
protected final String teamMemberId;
protected boolean includeWebSessions;
protected boolean includeDesktopClients;
protected boolean includeMobileClients;
protected Builder(String teamMemberId) {
if (teamMemberId == null) {
throw new IllegalArgumentException("Required value for 'teamMemberId' is null");
}
this.teamMemberId = teamMemberId;
this.includeWebSessions = true;
this.includeDesktopClients = true;
this.includeMobileClients = true;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeWebSessions Whether to list web sessions of the team's
* member. Defaults to {@code true} when set to {@code null}.
*
* @return this builder
*/
public Builder withIncludeWebSessions(Boolean includeWebSessions) {
if (includeWebSessions != null) {
this.includeWebSessions = includeWebSessions;
}
else {
this.includeWebSessions = true;
}
return this;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeDesktopClients Whether to list linked desktop devices
* of the team's member. Defaults to {@code true} when set to {@code
* null}.
*
* @return this builder
*/
public Builder withIncludeDesktopClients(Boolean includeDesktopClients) {
if (includeDesktopClients != null) {
this.includeDesktopClients = includeDesktopClients;
}
else {
this.includeDesktopClients = true;
}
return this;
}
/**
* Set value for optional field.
*
* <p> If left unset or set to {@code null}, defaults to {@code true}.
* </p>
*
* @param includeMobileClients Whether to list linked mobile devices of
* the team's member. Defaults to {@code true} when set to {@code
* null}.
*
* @return this builder
*/
public Builder withIncludeMobileClients(Boolean includeMobileClients) {
if (includeMobileClients != null) {
this.includeMobileClients = includeMobileClients;
}
else {
this.includeMobileClients = true;
}
return this;
}
/**
* Builds an instance of {@link ListMemberDevicesArg} configured with
* this builder's values
*
* @return new instance of {@link ListMemberDevicesArg}
*/
public ListMemberDevicesArg build() {
return new ListMemberDevicesArg(teamMemberId, includeWebSessions, includeDesktopClients, includeMobileClients);
}
}
@Override
public int hashCode() {
int hash = java.util.Arrays.hashCode(new Object [] {
teamMemberId,
includeWebSessions,
includeDesktopClients,
includeMobileClients
});
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
// be careful with inheritance
else if (obj.getClass().equals(this.getClass())) {
ListMemberDevicesArg other = (ListMemberDevicesArg) obj;
return ((this.teamMemberId == other.teamMemberId) || (this.teamMemberId.equals(other.teamMemberId)))
&& (this.includeWebSessions == other.includeWebSessions)
&& (this.includeDesktopClients == other.includeDesktopClients)
&& (this.includeMobileClients == other.includeMobileClients)
;
}
else {
return false;
}
}
@Override
public String toString() {
return _JSON_WRITER.writeToString(this, false);
}
public String toStringMultiline() {
return _JSON_WRITER.writeToString(this, true);
}
public String toJson(Boolean longForm) {
return _JSON_WRITER.writeToString(this, longForm);
}
public static ListMemberDevicesArg fromJson(String s) throws JsonReadException {
return _JSON_READER.readFully(s);
}
public static final JsonWriter<ListMemberDevicesArg> _JSON_WRITER = new JsonWriter<ListMemberDevicesArg>() {
public final void write(ListMemberDevicesArg x, JsonGenerator g) throws IOException {
g.writeStartObject();
ListMemberDevicesArg._JSON_WRITER.writeFields(x, g);
g.writeEndObject();
}
public final void writeFields(ListMemberDevicesArg x, JsonGenerator g) throws IOException {
g.writeFieldName("team_member_id");
g.writeString(x.teamMemberId);
g.writeFieldName("include_web_sessions");
g.writeBoolean(x.includeWebSessions);
g.writeFieldName("include_desktop_clients");
g.writeBoolean(x.includeDesktopClients);
g.writeFieldName("include_mobile_clients");
g.writeBoolean(x.includeMobileClients);
}
};
public static final JsonReader<ListMemberDevicesArg> _JSON_READER = new JsonReader<ListMemberDevicesArg>() {
public final ListMemberDevicesArg read(JsonParser parser) throws IOException, JsonReadException {
ListMemberDevicesArg result;
JsonReader.expectObjectStart(parser);
result = readFields(parser);
JsonReader.expectObjectEnd(parser);
return result;
}
public final ListMemberDevicesArg readFields(JsonParser parser) throws IOException, JsonReadException {
String teamMemberId = null;
Boolean includeWebSessions = null;
Boolean includeDesktopClients = null;
Boolean includeMobileClients = null;
while (parser.getCurrentToken() == JsonToken.FIELD_NAME) {
String fieldName = parser.getCurrentName();
parser.nextToken();
if ("team_member_id".equals(fieldName)) {
teamMemberId = JsonReader.StringReader
.readField(parser, "team_member_id", teamMemberId);
}
else if ("include_web_sessions".equals(fieldName)) {
includeWebSessions = JsonReader.BooleanReader
.readField(parser, "include_web_sessions", includeWebSessions);
}
else if ("include_desktop_clients".equals(fieldName)) {
includeDesktopClients = JsonReader.BooleanReader
.readField(parser, "include_desktop_clients", includeDesktopClients);
}
else if ("include_mobile_clients".equals(fieldName)) {
includeMobileClients = JsonReader.BooleanReader
.readField(parser, "include_mobile_clients", includeMobileClients);
}
else {
JsonReader.skipValue(parser);
}
}
if (teamMemberId == null) {
throw new JsonReadException("Required field \"team_member_id\" is missing.", parser.getTokenLocation());
}
return new ListMemberDevicesArg(teamMemberId, includeWebSessions, includeDesktopClients, includeMobileClients);
}
};
}
| [
"krieb@dropbox.com"
] | krieb@dropbox.com |
1acbf2425d9639da5756954b9d2c16db026a40d5 | ed519a9c80723b446cb3918574dcf0a24e5afb10 | /src/topic/Inheritance/square.java | 8146c9890308965183001e16ef78b247493c2cd7 | [] | no_license | nddhieu/JavaDemo | 6e905f632d4bd963cba552ba1a10ae62b9551924 | c627e1cd71fe4050e4835dc04bb0c74e7caff08c | refs/heads/master | 2020-04-09T16:19:11.277410 | 2018-12-21T08:50:27 | 2018-12-21T08:50:27 | 160,450,467 | 0 | 0 | null | 2018-12-21T05:58:09 | 2018-12-05T02:46:58 | Java | UTF-8 | Java | false | false | 201 | java | package topic.Inheritance;
public class square extends shape{
void draw(){
System.out.println("draw square");
}
void erase(){
System.out.println(("erase square"));
}
}
| [
"nddhieu@gmail.com"
] | nddhieu@gmail.com |
8dbd8535c17a43c8f4df7cce68150d70c7dee009 | 6ad6736333a92933f84971e336555811653ab1b4 | /src/main/java/cn/com/deepdata/elasticsearch/core/inter/ElasticsearchOperations.java | 52348be653d2a799290d0385101113b1e5213ac0 | [] | no_license | 344399160/es-client | 6728b1bd7bda02ccac921efb61ff944ba6cdae46 | 3fcaca0959227b3298136353ecd9ffa85de2cd05 | refs/heads/master | 2021-01-21T00:16:18.363074 | 2018-09-28T10:03:12 | 2018-09-28T10:03:12 | 101,865,036 | 5 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,256 | java | package cn.com.deepdata.elasticsearch.core.inter;
import cn.com.deepdata.elasticsearch.core.mapping.ElasticsearchPersistentEntity;
import cn.com.deepdata.elasticsearch.core.query.QueryConstructor;
import cn.com.deepdata.elasticsearch.model.Page;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.aggregations.AggregationBuilder;
import java.util.List;
import java.util.Map;
/**
* @Author: qiaobin
* @Description: ES服务接口
* @Date: Created in 11:48 2017/7/31
*/
public interface ElasticsearchOperations{
/**
* @return elasticsearch client
*/
Client getClient();
/**
* Create an index for a class
*
* @param indexName
*/
boolean createIndex(String indexName);
/**
* Create an index for a class
*
* @param clazz
*/
<T> boolean createIndex(Class<T> clazz);
/**
* delete an index for a class
*
* @param clazz
*/
<T> boolean deleteIndex(Class<T> clazz);
/**
* Create mapping for a class
*
* @param clazz
* @param <T>
*/
<T> boolean putMapping(Class<T> clazz);
<T> T save(T entity);
/**
* Create an index for a indexName and Settings
*
* @param indexName
* @param alias
* @param shards
* @param replicas
* @param refreshInterval
* @param indexStoreType
*/
void createIndex(String indexName, String alias, int shards, int replicas, String refreshInterval, String indexStoreType);
/**
* If index exists
*
* @param indexName
*/
boolean indexExist(String indexName);
/**
* find class by id
* @param id
* @param clazz
* @param <T>
*/
<T> T findById(String id, Class<T> clazz);
/**
* get @Document annotation contributions from a class
* @param clazz
*/
ElasticsearchPersistentEntity getPersistentEntityFor(Class clazz);
/**
* delete a class
* @param entity
* @param <T>
*/
<T> void delete(T entity);
/**
* delete a class
* @param id
* @param clazz
* @param <T>
*/
<T> void delete(String id, Class<T> clazz);
/**
* update a class
* @param <T>
* @param entity
*/
<T> T update(T entity);
/**
* update a class
* @param <T>
* @param _id
* @param entity
*/
<T> T update(String _id, T entity);
/**
* save entities
* @param entities
* @param <T>
*/
<T> void save(List<T> entities);
/**
* refresh index
* @param indexName
*/
void refresh(String indexName);
/**
* count index total documents
* @param clazz
* @param <T>
*/
<T> long count(Class<T> clazz);
/**
* count col total documents
* @param clazz
* @param <T>
*/
<T> long count(QueryConstructor constructor, String countBy, Class<T> clazz);
/**
* search from index
* @param constructor
* @param clazz
* @param <T>
*/
<T> Iterable<T> search(QueryConstructor constructor, Class<T> clazz);
/**
* search from index
* @param sql
* @param clazz
* @param <T>
*/
<T> Iterable<T> sqlQuery(String sql, Class<T> clazz);
/**
* search from index
* @param sql
* @param clazz
* @param <T>
*/
<T> Page<T> sqlPageQuery(String sql, Class<T> clazz);
/**
* search from index
* @param constructor
* @param includes
* @param excludes
* @param clazz
* @param <T>
* @return
*/
<T> List<Map<String, Object>> search(QueryConstructor constructor, String[] includes, String[] excludes, Class<T> clazz);
/**
* stat index column by search constructor
* @param constructor
* @param statBy
* @param clazz
* @param <T>
* @return
*/
<T> Map<String, Object> statSearch(QueryConstructor constructor, String statBy, Class<T> clazz);
/**
* stat index column by search constructor
* @param constructor
* @param agg
* @param clazz
* @param <T>
* @return
*/
<T> Map<String, Object> statSearch(QueryConstructor constructor, AggregationBuilder agg, Class<T> clazz);
}
| [
"qiaobin@deepdata.com.cn"
] | qiaobin@deepdata.com.cn |
d86baad96d4286bcd0f03461de8c2926db63c7c5 | 37ea413d226011b0950a836a0d5466f019633d59 | /JavaSEPro/src/chap04/sec03/Demo1.java | 52fc69c1b68c70de379ca9adf120c4b414c51bc5 | [] | no_license | magicmai/learn-java | 58931e1a2c379b376d3f6a7356147eb65fba303a | a83fb3cc80d4033acb64cea50b660d14ade2aed1 | refs/heads/master | 2020-03-16T13:13:47.493146 | 2018-05-10T05:53:38 | 2018-05-10T05:53:38 | 132,684,225 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 488 | java | package chap04.sec03;
public class Demo1 {
/**
* 把异常向外面抛
* @throws NumberFormatException
*/
public static void testThrows() throws NumberFormatException {
String s = "123a";
int a = Integer.parseInt(s);
System.out.println(a);
}
public static void main(String[] args) {
try {
testThrows();
System.out.println("OK");
} catch (Exception e) {
System.out.println("处理异常");
e.printStackTrace();
}
System.out.println("mark");
}
}
| [
"maijing_wy@163.com"
] | maijing_wy@163.com |
7b7a9937268d6b1400916996256fa1011286a77b | 56cd9bd526dff65d16e0b7bb0904f072b854c901 | /GameArena/src/main/java/me/dnorris/data/Method.java | 79d94db9ba9ba287307103100b15c89a8b589a09 | [] | no_license | danorris709/JavaPool | 04484211cd7a76a3f7fae8f4be8fb8cb4aa6f5e5 | e2adcf5f707d149aee5734dc77c89d84a3fc1622 | refs/heads/master | 2022-06-23T05:54:05.498791 | 2020-05-14T16:28:42 | 2020-05-14T16:28:42 | 257,666,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package me.dnorris.data;
/**
*
* Interface used for representation a function that takes one parameter but
* doesn't return anything.
*
* @param <T> The type of the parameter for the function
* @author https://github.com/danorris709
*/
public interface Method<T> {
/**
*
* Similar naming to {@link Runnable}. As can be represented by a lambda and thus there's no
* name that represents the function better.
*
* @param t The only parameter of type {@link T}
*/
void run(T t);
}
| [
"33832062+danorris709@users.noreply.github.com"
] | 33832062+danorris709@users.noreply.github.com |
6cc6e326af1e53113ea13d9086c0199f02cf85eb | 46b51ee1c9655b50e7f53f759c8fe347a35f811a | /src/main/java/org/isp/web/controllers/payments_controllers/PaymentsAdminController.java | c391c2c9a5ae1fd75912b2540465e6290e89cd7c | [] | no_license | shsimeonova/Internship-Platform | 7221c61979c8b948af073483ac13b1cb9a5679c6 | a0b2de5e63a97912434df35618bc7e30e2ac2193 | refs/heads/master | 2020-03-08T04:05:36.465498 | 2018-12-24T10:10:36 | 2018-12-24T10:10:36 | 127,911,213 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,514 | java | package org.isp.web.controllers.payments_controllers;
import org.isp.domain.Payment;
import org.isp.services.payment_services.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
@Controller
@RequestMapping("/admin/payments")
public class PaymentsAdminController {
private PaymentService paymentService;
@Autowired
public PaymentsAdminController(PaymentService paymentService) {
this.paymentService = paymentService;
}
@RequestMapping(value = "/activate/{taskId}", method = RequestMethod.GET)
private String makePaymentActive(@PathVariable(value = "taskId") String taskId, Model model){
try {
this.paymentService.makeActivePayment(taskId);
model.addAttribute("info");
} catch (IllegalArgumentException iae) {
model.addAttribute("error", iae.getMessage());
}
return "admin/admin-base";
}
@RequestMapping(value = "/all", method = RequestMethod.GET)
private String allPaymentsPanel(Model model){
List<Payment> allPayments = this.paymentService.getAll();
model.addAttribute("payments", allPayments);
return "admin/payments/all-payments-partial";
}
}
| [
"ssimeonova159@gmail.com"
] | ssimeonova159@gmail.com |
356623afc4d46b2d718476ff2f6004cbda6521fa | 7faeb3ef9662fcd965d0cfcbd1b7d384a58d1eff | /messenger/src/main/java/com/felixlaura/messenger/resources/ProfileResource.java | a43438ddc783e1f5c0f064cc64dbe910adfc981a | [] | no_license | felixala/messenger | 51a9a1aa86f8c243d4dd76ab2bbe570b0ae17c98 | b6156b2812bebc435c684d387a05e43808459042 | refs/heads/master | 2021-01-10T11:28:48.882891 | 2015-11-30T06:26:15 | 2015-11-30T06:26:15 | 46,945,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,587 | java | package com.felixlaura.messenger.resources;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.felixlaura.messenger.model.Profile;
import com.felixlaura.messenger.service.ProfileService;
@Path("/profiles")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class ProfileResource {
ProfileService profileService = new ProfileService();
/* @GET
public List<Profile> getProfiles() {
return profileService.getAllProfile();
}*/
@GET
public List<Profile> getProfiles(@QueryParam("lastName") String lastName) {
if(lastName != null){
return profileService.getAllProfileByLastName(lastName);
}
return profileService.getAllProfile();
}
@GET
@Path("/{profileName}")
public Profile getProfile(@PathParam("profileName") String profilename) {
return profileService.getProfile(profilename);
}
@POST
public Profile addProfile(Profile profile) {
return profileService.addProfile(profile);
}
@PUT
@Path("/{profileName}")
public Profile updateProfile(@PathParam("profileName") String profileName, Profile profile) {
profile.setProfileName(profileName);
return profileService.updateProfile(profile);
}
@DELETE
@Path("/{profileName}")
public void deleteProfile(@PathParam("profileName") String profileName) {
profileService.removeProfile(profileName);
}
}
| [
"felixgato8@gmail.com"
] | felixgato8@gmail.com |
b24cad3b12aeb83cdecc7ed8865d30f4d8f066aa | 1939fc7fc495dcd78d465698e5221ac85cbff0f8 | /api-common/src/main/java/com/bike/user/oauth/xiaomi/XiaomiOauthClient.java | 09684fbe4edfd8d8ee64d9ce56c97bc94f258fff | [] | no_license | maohaitao/hivier_demo | eda3e2fa41b9bbb308cbb5dfa93b69e1e296c339 | eed73138102166b3582b37768a0fb4dc3e8597cc | refs/heads/master | 2020-05-27T21:15:30.671972 | 2017-03-16T10:55:01 | 2017-03-16T10:55:01 | 83,643,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,685 | java | package com.bike.user.oauth.xiaomi;
import com.bike.user.model.OauthUser;
import com.bike.user.model.TAccount;
import com.bike.user.oauth.IOauthClient;
import com.g3.common.http.HttpClientUtil;
import com.google.gson.JsonObject;
import com.sf.common.exception.AppException;
import com.sf.common.reflection.property.PropertiesUtil;
import com.sf.common.util.CommonUtil;
import com.sf.common.util.JsonUtil;
/**
* Created by a700 on 16/10/28.
*/
public class XiaomiOauthClient implements IOauthClient {
private static final XiaomiConfig xiaomiConfig = PropertiesUtil.getConfig("xiaomiconfig.properties", XiaomiConfig.class);
public static void main(String[] args) {
XiaomiOauthClient xiaomiOauthClient = new XiaomiOauthClient();
try {
xiaomiOauthClient.getNickName("2882303761517458686", "V2_om3_-l6WFDYHfcaFCzTM1h7UmtQAxHwxjRYigiNytEbIJsPKV2yw-50A_Apx17UWHtULDqmpVGzcHb5WEbwn5pwYQdxLOdhFIPleS0GmRs6kKHeRbQzpreoUxLrKmPYY");
} catch (Exception e) {
e.printStackTrace();
}
}
public String authorize(String state) {
StringBuilder sb = new StringBuilder();
return sb.toString();
}
@Override
public String getAccessToken(String code) throws Exception {
return null;
}
@Override
public OauthUser getOauthUser(String code) throws Exception {
return null;
}
@Override
public TAccount getNickName(String clientId, String accessToken) throws Exception {
if (CommonUtil.isNull(accessToken)) {
throw new AppException(-6, "小米 accessToken 没有获取到响应参数,可能是用户取消了授权。 ");
}
String url = xiaomiConfig.getBaseURL() + "?clientId=" + xiaomiConfig.getClient_ID() + "&token=" + accessToken;
String responseText = HttpClientUtil.get(url).getStringData();
JsonObject json = JsonUtil.parse(responseText);
System.out.println("json=="+json);
if ("ok".equals(JsonUtil.getValue(json, "result"))) {
JsonObject data = json.getAsJsonObject("data");
System.out.println("data=="+data);
if (data != null) {
String nickname = JsonUtil.getValue(data, "miliaoNick");
TAccount account = new TAccount();
account.setNickName(nickname);
String userFace = JsonUtil.getValue(data, "miliaoIcon_90");
account.setUserFace(userFace);
account.setOpenId(JsonUtil.getValue(data, "userId"));
return account;
} else {
return null;
}
} else {
return null;
}
}
}
| [
"maohaitao@700bike.com"
] | maohaitao@700bike.com |
88b2bb849a62582cbbb6241c8c9e4b5d6c1c7bb1 | cc277e2e4117b3205d063e0e8501f557dc5f3d18 | /src/main/java/com/things/phydev/transport/DataLinkLayer.java | ae8bb0658432d0aa16101392ad8d77c378b0c3d9 | [] | no_license | iqnev/SmartDevices | b10bf46870660baceb273a4a8f09280827de44cf | 01de3d5382b36b0a9679223f88b9102b861f2d9b | refs/heads/master | 2020-12-25T16:47:54.249288 | 2017-05-05T20:28:20 | 2017-05-05T20:28:20 | 67,435,056 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,428 | java | /**
* Copyright (c) 2016 Ivelin Yanev <bgfortran@gmail.com>.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
package com.things.phydev.transport;
import com.things.phydev.communication.Packet;
import java.net.Socket;
public interface DataLinkLayer {
/**
* Performs serialization of the <code>Message</code> object in the
* appropriate data format.
*
* @param prMessage the <code>Message</code> object {@link Packet}.
* @return the data in appropriate format.
*/
public byte[] parsePacket(Packet prMessage);
/**
* Returns <code>Packet</code> object by input stream.
*
* @param connectionß
* @return the <code>Packet</code> object.
*/
public Packet getRequestPackage(Socket connection);
}
| [
"qnev89@gmail.com"
] | qnev89@gmail.com |
a3eed9e126ae85b56ad7772d244931b00b3379ae | 3a2878d17af4fbd8e3c1304e1e20a3101833fc18 | /src/org/nova/game/player/content/dungeoneering/DungeonPartyManager.java | 224ae61d1f99dc86afceac1098bd42eaa45fcca7 | [] | no_license | karimshan/nova-server | 452f2cdc1bd87c560d3e1ff7422e211cd12f976c | 861f9daa812372d74cfe7f45fceb8cab2853b4ca | refs/heads/master | 2021-05-14T17:40:34.624397 | 2018-01-02T21:06:29 | 2018-01-02T21:06:29 | 116,051,463 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,697 | java | package org.nova.game.player.content.dungeoneering;
import java.util.concurrent.CopyOnWriteArrayList;
import org.nova.game.player.Player;
import org.nova.game.player.Skills;
public final class DungeonPartyManager {
private String leader;
private int floor;
private int complexity;
private CopyOnWriteArrayList<DungeonPartyPlayer> team;
private DungeonManager dungeon;
public DungeonPartyManager(Player player) {
setLeader(player.getUsername());
team = new CopyOnWriteArrayList<DungeonPartyPlayer>();
team.add(new DungeonPartyPlayer(player));
setDefaults();
start(DungeonConstants.SMALL_DUNGEON); // temporary
}
public void setDefaults() {
floor = 1;
complexity = 1;
}
public void start(int size) {
if (dungeon != null)
return;
dungeon = new DungeonManager(this, size);
}
public int getComplexity() {
return complexity;
}
public int getFloor() {
return floor;
}
public int getFloorType() {
return DungeonUtils.getFloorType(floor);
}
public int getDungeoneeringLevel() {
int level = 120;
for (DungeonPartyPlayer player : team) {
int playerLevel = player.getPlayer().getSkills()
.getLevelFromXP(Skills.DUNGEONEERING);
if (playerLevel < level)
level = playerLevel;
}
return level;
}
public DungeonPartyPlayer getDPlayer(Player player) {
for (DungeonPartyPlayer p : team)
if (p.getPlayer() == player)
return p;
return null;
}
public CopyOnWriteArrayList<DungeonPartyPlayer> getTeam() {
return team;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
}
| [
"karim@192.168.1.236"
] | karim@192.168.1.236 |
67d66d6ac105bf3b2923b157ded1f537ee8e33c5 | 3e01d3a01b61a0b0c80d71964abf546a92be10eb | /src/main/java/com/atos/coderank/services/ProjectMetricsService.java | cdedf70469c3f62bb1db359233f93c97fd04b4c5 | [] | no_license | 0fprod/coderank | 5c61a3ef0dbaf10ffc071ff86d6f694580ba71e5 | 1fc2dca60206aaef254d8c384f6d94b8d4db712c | refs/heads/master | 2023-06-07T15:45:11.560280 | 2018-04-23T15:17:35 | 2018-04-23T15:17:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,505 | java | package com.atos.coderank.services;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.atos.coderank.components.SonarUtils;
import com.atos.coderank.entities.ProjectEntity;
import com.atos.coderank.entities.ProjectMetricsEntity;
import com.atos.coderank.repositories.ProjectMetricsRepository;
@Service("projectMetricsService")
public class ProjectMetricsService {
@Autowired
@Qualifier("sonarUtils")
private SonarUtils su;
@Autowired
@Qualifier("projectService")
private ProjectService ps;
@Autowired
@Qualifier("projectMetricsRepository")
private ProjectMetricsRepository pmr;
public ProjectMetricsEntity calcSonarQubeMetrics(ProjectEntity project) {
ProjectMetricsEntity pme = this.su.scanOneProject(project.getKey());
project.setProjectId(pme.getProject().getProjectId());
pme.setProject(project);
return pme;
}
public List<ProjectMetricsEntity> findAllMostRecent() {
return this.pmr.findMostRecents();
}
public ProjectMetricsEntity findMostRecentByProjectId(String projectId) {
return this.pmr.findMostRecentByProjectId(projectId);
}
public void deleteMetricsByProjectId(ProjectEntity project) {
List<ProjectMetricsEntity> list = project.getMetrics();
for (ProjectMetricsEntity entity : list)
this.pmr.deleteById(entity.getMetricsId());
}
}
| [
"A679647@MC0X97WC.ww930.my-it-solutions.net"
] | A679647@MC0X97WC.ww930.my-it-solutions.net |
7b766326e1e52df10acdd0d96e5224d469822e7b | 3bf6bab0051bebdfef770af7c9f845335a83c97b | /src/main/java/com/fuber/entities/Location.java | 0fae04c00b4811d82e7d7ee9c927098983f1b704 | [] | no_license | Jaskaranjit/fuber-app | df8094ca21232164873346f946297003ee3164d8 | 301c74d190f9b554062a09dc3580b8d4183dce66 | refs/heads/master | 2021-05-06T21:12:59.757713 | 2017-12-01T09:52:38 | 2017-12-01T09:52:38 | 112,571,070 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,042 | java | package com.fuber.entities;
/**
* POJO class for location parameters
* Created by Jaskaranjit on 11/30/17.
*/
public class Location
{
private double latitude;
private double longitude;
/**
* default constructor
*/
public Location()
{
// do nothing
}
/**
* Initialise the {@link Location}
* @param latitude latitude
* @param longitude longitude
*/
public Location( double latitude, double longitude )
{
this.latitude = latitude;
this.longitude = longitude;
}
public double getLatitude()
{
return latitude;
}
public double getLongitude()
{
return longitude;
}
public void setLatitude( double latitude )
{
this.latitude = latitude;
}
public void setLongitude( double longitude )
{
this.longitude = longitude;
}
@Override public String toString()
{
return "Location{" + "latitude=" + latitude + ", longitude=" + longitude + '}';
}
}
| [
"jaskaranjit@infrrd.ai"
] | jaskaranjit@infrrd.ai |
de9be81d5667a8f4ac8c3dd5d48d381927662124 | 1b17119f1ae56824623296f2bf5ed2c48f7fcf1c | /NonVeggies/src/main/java/com/nonveggies/entity/NvHookModuleExceptions.java | df6170691c33b40ea2c7d5a0364123791395b65f | [] | no_license | gauravsaxena1611/Non-Veggies | b03eed2d7ad535fb29c361075b0985231bee95d2 | efc480fa581fcad0707e2f7f3a8047a41dbf4a9d | refs/heads/master | 2020-03-18T17:30:59.909485 | 2018-05-27T09:55:38 | 2018-05-27T09:55:38 | 135,033,099 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,055 | java | package com.nonveggies.entity;
// Generated Jan 2, 2016 7:30:29 AM by Hibernate Tools 3.4.0.CR1
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* NvHookModuleExceptions generated by hbm2java
*/
@Entity
@Table(name = "nv_hook_module_exceptions", catalog = "NVPrestashop")
public class NvHookModuleExceptions implements java.io.Serializable {
private Integer idHookModuleExceptions;
private int idShop;
private int idModule;
private int idHook;
private String fileName;
public NvHookModuleExceptions() {
}
public NvHookModuleExceptions(int idShop, int idModule, int idHook) {
this.idShop = idShop;
this.idModule = idModule;
this.idHook = idHook;
}
public NvHookModuleExceptions(int idShop, int idModule, int idHook, String fileName) {
this.idShop = idShop;
this.idModule = idModule;
this.idHook = idHook;
this.fileName = fileName;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id_hook_module_exceptions", unique = true, nullable = false)
public Integer getIdHookModuleExceptions() {
return this.idHookModuleExceptions;
}
public void setIdHookModuleExceptions(Integer idHookModuleExceptions) {
this.idHookModuleExceptions = idHookModuleExceptions;
}
@Column(name = "id_shop", nullable = false)
public int getIdShop() {
return this.idShop;
}
public void setIdShop(int idShop) {
this.idShop = idShop;
}
@Column(name = "id_module", nullable = false)
public int getIdModule() {
return this.idModule;
}
public void setIdModule(int idModule) {
this.idModule = idModule;
}
@Column(name = "id_hook", nullable = false)
public int getIdHook() {
return this.idHook;
}
public void setIdHook(int idHook) {
this.idHook = idHook;
}
@Column(name = "file_name")
public String getFileName() {
return this.fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
}
| [
"gauravsaxena1611@gmail.com"
] | gauravsaxena1611@gmail.com |
36007ee460e54d251abb92a4ddaa5ca75fd89b1c | d0e2ec5174ba0faeaad081a9586e2c763e016894 | /src/main/java/com/example/Policeman.java | 764b1ae428747f4b249624e68ff5d0d58c826f48 | [] | no_license | luckytiger1/spring-builder | af1236e3176f5ba65793bd6547e1afb19804bec2 | 0b027ed86337a6b90cc1cfe2634092072ed5c8fa | refs/heads/main | 2023-04-03T23:48:38.286152 | 2021-04-15T17:54:28 | 2021-04-15T17:54:28 | 358,347,008 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 85 | java | package com.example;
public interface Policeman {
void makePeopleLeaveRoom();
}
| [
"daniyar.abc@gmail.com"
] | daniyar.abc@gmail.com |
552f19dea6c842fac56a75b8e18054c7cc9d0ba6 | 8b59d114418ce899754da07356b771983e7a860a | /src/Test_0/Number.java | 1473862d517b5780045f0042ad74eaa8935339f4 | [] | no_license | ivan-andreichuk/Test0_Java_Mentor | e62e4f0ea69f2eb86725b30c1ff3071cb469e3c9 | 17147aac230a121b82eea380b43e64c132084734 | refs/heads/master | 2023-02-11T02:57:46.656027 | 2021-01-02T02:40:44 | 2021-01-02T02:40:44 | 326,143,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 125 | java | package Test_0;
public class Number {
public int value;
public boolean geographyNumber;//True-Arabic, false-Roman
}
| [
"dollarz@my.my"
] | dollarz@my.my |
b0a4466f875313f19e27daf2b56dd96fd812b5b5 | cfd103d3556346e59f2fdb6017b4ce0bafbf686a | /src/test/java/PetsAmok/VirtualShelterPetTest.java | 44d20757589879cee914b1857965346bb1586950 | [] | no_license | kfiddle/ken-virtual-pets-amok | d367ff6bf1bdac10a4addcd74122b1d26009d7c3 | 54176c70914edac1798e3ab27b1c6c0b38b3f6bc | refs/heads/master | 2022-12-23T13:51:51.602663 | 2020-09-25T16:07:58 | 2020-09-25T16:07:58 | 296,653,204 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,012 | java | package PetsAmok;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class VirtualShelterPetTest {
VirtualPetShelter testShelter = new VirtualPetShelter();
RoboticDog roboDogTest = new RoboticDog("Samuel", 7, 16, 12);
RoboticCat roboCatTest = new RoboticCat("robocat", 9, 13, 70);
OrganicDog realDogTest = new OrganicDog("realdog", 2, 1, 35, 12);
OrganicCat realCatTest = new OrganicCat("realCat", 5, 8, 37, 11);
@Test
public void testCleaningLitterBox() {
testShelter.emptyLitterBox();
assertEquals(testShelter.getLitterBoxLevel(), 5);
}
@Test
public void testIfDifferentPetsAreInShelter() {
testShelter.addPet(roboDogTest);
testShelter.addPet(roboCatTest);
testShelter.addPet(realDogTest);
testShelter.addPet(realCatTest);
assertEquals(testShelter.pets.size(), 4);
assertEquals(testShelter.pets.get("Samuel"), roboDogTest);
}
@Test
public void testOurOilMethod() {
testShelter.addPet(roboDogTest);
testShelter.addPet(roboCatTest);
testShelter.addPet(realDogTest);
testShelter.oilAllRobots(14);
assertEquals(roboDogTest.getHealthLevel(), 0);
assertEquals(roboCatTest.getHealthLevel(), 40);
assertEquals(realDogTest.getHealthLevel(), 12);
}
@Test
public void testCleaningDogCages() {
testShelter.cleanAllCages();
assertEquals(realDogTest.getCageMess(), 4);
}
@Test
public void testTickMethod() {
testShelter.tick();
assertEquals(realCatTest.hunger, 11);
assertEquals(realDogTest.getCageMess(), 4);
}
@Test
public void testTotalHealthCalculation() {
testShelter.addPet(roboDogTest);
testShelter.addPet(roboCatTest);
testShelter.addPet(realDogTest);
testShelter.addPet(realCatTest);
int health = testShelter.totalHealthOfPets();
assertEquals(health, 66);
}
@Test
public void testFeedingAllPets() {
testShelter.addPet(realDogTest);
testShelter.addPet(realCatTest);
testShelter.feedAllPets(10);
assertEquals(realDogTest.hunger, 2);
}
@Test
public void testFeedingCatsOrDogs() {
testShelter.addPet(realDogTest);
testShelter.addPet(realCatTest);
testShelter.feedDogs(10);
testShelter.feedCats(10);
assertEquals(realDogTest.hunger, 2);
assertEquals(realCatTest.hunger, -9);
}
@Test
public void testWateringPets() {
testShelter.addPet(realDogTest);
testShelter.addPet(realCatTest);
testShelter.waterCats(5);
testShelter.waterDogs(5);
assertEquals(realCatTest.thirst, -3);
assertEquals(realDogTest.thirst, -3);
}
@Test
public void testDogWalking() {
testShelter.addPet(realDogTest);
testShelter.addPet(roboDogTest);
testShelter.walkDogs("RobotDog");
assertEquals(roboDogTest.getHappinessLevel(), 17);
testShelter.walkDogs("OrganicDog");
assertEquals(realDogTest.getHappinessLevel(), 43);
}
@Test
public void testPlayingCatch() {
testShelter.addPet(realDogTest);
testShelter.playCatch("OrganicDog");
assertEquals(realDogTest.happinessLevel, 45);
}
@Test
public void testChasingDogs() {
testShelter.addPet(realCatTest);
testShelter.chaseDogs("OrganicCat");
testShelter.dogsChased();
assertEquals(realCatTest.happinessLevel, 47);
assertEquals(realDogTest.happinessLevel, 35);
}
@Test
public void testHuntingMice() {
testShelter.addPet(realCatTest);
testShelter.addPet(roboCatTest);
testShelter.huntMice("OrganicCat");
testShelter.huntMice("RobotCat");
assertEquals(realCatTest.happinessLevel, 57);
assertEquals(roboCatTest.happinessLevel, 78);
}
}
| [
"kenjfiddle@gmail.com"
] | kenjfiddle@gmail.com |
6913df98b90bbf91396ffb7979ce62bd5dc0efff | a5918497b9483b6a328ebaceef17342e57a001ea | /src/test/java/com/wout/dolp/web/rest/ProgramResourceIntTest.java | 067364d3458e82f32464080a4ac4237017d71e44 | [] | no_license | dolps/wout | 28f328d40c2eab838e79f3143c6a722616ee14c9 | 3febf8b3814779b4054e8bc764ee135b784a1c94 | refs/heads/master | 2021-04-27T20:33:42.626315 | 2018-02-22T19:57:56 | 2018-02-22T19:57:56 | 122,381,266 | 0 | 0 | null | 2018-02-22T19:57:57 | 2018-02-21T19:15:07 | Java | UTF-8 | Java | false | false | 10,187 | java | package com.wout.dolp.web.rest;
import com.wout.dolp.WoutApp;
import com.wout.dolp.domain.Program;
import com.wout.dolp.repository.ProgramRepository;
import com.wout.dolp.service.ProgramService;
import com.wout.dolp.service.dto.ProgramDTO;
import com.wout.dolp.service.mapper.ProgramMapper;
import com.wout.dolp.web.rest.errors.ExceptionTranslator;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager;
import java.util.List;
import static com.wout.dolp.web.rest.TestUtil.createFormattingConversionService;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the ProgramResource REST controller.
*
* @see ProgramResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = WoutApp.class)
public class ProgramResourceIntTest {
private static final String DEFAULT_NAME = "AAAAAAAAAA";
private static final String UPDATED_NAME = "BBBBBBBBBB";
@Autowired
private ProgramRepository programRepository;
@Autowired
private ProgramMapper programMapper;
@Autowired
private ProgramService programService;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private EntityManager em;
private MockMvc restProgramMockMvc;
private Program program;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
final ProgramResource programResource = new ProgramResource(programService);
this.restProgramMockMvc = MockMvcBuilders.standaloneSetup(programResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setControllerAdvice(exceptionTranslator)
.setConversionService(createFormattingConversionService())
.setMessageConverters(jacksonMessageConverter).build();
}
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Program createEntity(EntityManager em) {
Program program = new Program()
.name(DEFAULT_NAME);
return program;
}
@Before
public void initTest() {
program = createEntity(em);
}
@Test
@Transactional
public void createProgram() throws Exception {
int databaseSizeBeforeCreate = programRepository.findAll().size();
// Create the Program
ProgramDTO programDTO = programMapper.toDto(program);
restProgramMockMvc.perform(post("/api/programs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(programDTO)))
.andExpect(status().isCreated());
// Validate the Program in the database
List<Program> programList = programRepository.findAll();
assertThat(programList).hasSize(databaseSizeBeforeCreate + 1);
Program testProgram = programList.get(programList.size() - 1);
assertThat(testProgram.getName()).isEqualTo(DEFAULT_NAME);
}
@Test
@Transactional
public void createProgramWithExistingId() throws Exception {
int databaseSizeBeforeCreate = programRepository.findAll().size();
// Create the Program with an existing ID
program.setId(1L);
ProgramDTO programDTO = programMapper.toDto(program);
// An entity with an existing ID cannot be created, so this API call must fail
restProgramMockMvc.perform(post("/api/programs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(programDTO)))
.andExpect(status().isBadRequest());
// Validate the Program in the database
List<Program> programList = programRepository.findAll();
assertThat(programList).hasSize(databaseSizeBeforeCreate);
}
@Test
@Transactional
public void getAllPrograms() throws Exception {
// Initialize the database
programRepository.saveAndFlush(program);
// Get all the programList
restProgramMockMvc.perform(get("/api/programs?sort=id,desc"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(program.getId().intValue())))
.andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME.toString())));
}
@Test
@Transactional
public void getProgram() throws Exception {
// Initialize the database
programRepository.saveAndFlush(program);
// Get the program
restProgramMockMvc.perform(get("/api/programs/{id}", program.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(program.getId().intValue()))
.andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()));
}
@Test
@Transactional
public void getNonExistingProgram() throws Exception {
// Get the program
restProgramMockMvc.perform(get("/api/programs/{id}", Long.MAX_VALUE))
.andExpect(status().isNotFound());
}
@Test
@Transactional
public void updateProgram() throws Exception {
// Initialize the database
programRepository.saveAndFlush(program);
int databaseSizeBeforeUpdate = programRepository.findAll().size();
// Update the program
Program updatedProgram = programRepository.findOne(program.getId());
// Disconnect from session so that the updates on updatedProgram are not directly saved in db
em.detach(updatedProgram);
updatedProgram
.name(UPDATED_NAME);
ProgramDTO programDTO = programMapper.toDto(updatedProgram);
restProgramMockMvc.perform(put("/api/programs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(programDTO)))
.andExpect(status().isOk());
// Validate the Program in the database
List<Program> programList = programRepository.findAll();
assertThat(programList).hasSize(databaseSizeBeforeUpdate);
Program testProgram = programList.get(programList.size() - 1);
assertThat(testProgram.getName()).isEqualTo(UPDATED_NAME);
}
@Test
@Transactional
public void updateNonExistingProgram() throws Exception {
int databaseSizeBeforeUpdate = programRepository.findAll().size();
// Create the Program
ProgramDTO programDTO = programMapper.toDto(program);
// If the entity doesn't have an ID, it will be created instead of just being updated
restProgramMockMvc.perform(put("/api/programs")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(programDTO)))
.andExpect(status().isCreated());
// Validate the Program in the database
List<Program> programList = programRepository.findAll();
assertThat(programList).hasSize(databaseSizeBeforeUpdate + 1);
}
@Test
@Transactional
public void deleteProgram() throws Exception {
// Initialize the database
programRepository.saveAndFlush(program);
int databaseSizeBeforeDelete = programRepository.findAll().size();
// Get the program
restProgramMockMvc.perform(delete("/api/programs/{id}", program.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<Program> programList = programRepository.findAll();
assertThat(programList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Program.class);
Program program1 = new Program();
program1.setId(1L);
Program program2 = new Program();
program2.setId(program1.getId());
assertThat(program1).isEqualTo(program2);
program2.setId(2L);
assertThat(program1).isNotEqualTo(program2);
program1.setId(null);
assertThat(program1).isNotEqualTo(program2);
}
@Test
@Transactional
public void dtoEqualsVerifier() throws Exception {
TestUtil.equalsVerifier(ProgramDTO.class);
ProgramDTO programDTO1 = new ProgramDTO();
programDTO1.setId(1L);
ProgramDTO programDTO2 = new ProgramDTO();
assertThat(programDTO1).isNotEqualTo(programDTO2);
programDTO2.setId(programDTO1.getId());
assertThat(programDTO1).isEqualTo(programDTO2);
programDTO2.setId(2L);
assertThat(programDTO1).isNotEqualTo(programDTO2);
programDTO1.setId(null);
assertThat(programDTO1).isNotEqualTo(programDTO2);
}
@Test
@Transactional
public void testEntityFromId() {
assertThat(programMapper.fromId(42L).getId()).isEqualTo(42);
assertThat(programMapper.fromId(null)).isNull();
}
}
| [
"broCode123"
] | broCode123 |
6b272a5aa04df2bd69b5d7dd675d15cfd91042c6 | e09bbe5565439e90d6261a0d0b0a12bf6134ee0d | /src/cn/wpeace/zktest/ConcurrentTest.java | ef10a9b6866b7ae507f488c0bf36d9514e346958 | [] | no_license | whatislife/zkDemo | c502efb6082af29c6ec410507feaffc06013a4ec | 589bdd624caadd3e3db75518122a5db0f1de1bea | refs/heads/master | 2021-08-22T11:13:54.036041 | 2017-11-30T03:04:11 | 2017-11-30T03:04:11 | 112,554,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,991 | java | package cn.wpeace.zktest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
public class ConcurrentTest {
private CountDownLatch startSignal = new CountDownLatch(1);//开始阀门
private CountDownLatch doneSignal = null;//结束阀门
private CopyOnWriteArrayList<Long> list = new CopyOnWriteArrayList<Long>();
private AtomicInteger err = new AtomicInteger();//原子递增
private ConcurrentTask[] task = null;
public ConcurrentTest(ConcurrentTask... task){
this.task = task;
if(task == null){
System.out.println("task can not null");
System.exit(1);
}
doneSignal = new CountDownLatch(task.length);
start();
}
/**
* @param args
* @throws ClassNotFoundException
*/
private void start(){
//创建线程,并将所有线程等待在阀门处
createThread();
//打开阀门
startSignal.countDown();//递减锁存器的计数,如果计数到达零,则释放所有等待的线程
try {
doneSignal.await();//等待所有线程都执行完毕
} catch (InterruptedException e) {
e.printStackTrace();
}
//计算执行时间
getExeTime();
}
/**
* 初始化所有线程,并在阀门处等待
*/
private void createThread() {
long len = doneSignal.getCount();
for (int i = 0; i < len; i++) {
final int j = i;
new Thread(new Runnable(){
public void run() {
try {
startSignal.await();//使当前线程在锁存器倒计数至零之前一直等待
long start = System.currentTimeMillis();
task[j].run();
long end = (System.currentTimeMillis() - start);
list.add(end);
} catch (Exception e) {
err.getAndIncrement();//相当于err++
}
doneSignal.countDown();
}
}).start();
}
}
/**
* 计算平均响应时间
*/
private void getExeTime() {
int size = list.size();
List<Long> _list = new ArrayList<Long>(size);
_list.addAll(list);
Collections.sort(_list);
long min = _list.get(0);
long max = _list.get(size-1);
long sum = 0L;
for (Long t : _list) {
sum += t;
}
long avg = sum/size;
System.out.println("min: " + min);
System.out.println("max: " + max);
System.out.println("avg: " + avg);
System.out.println("err: " + err.get());
}
//接口
public interface ConcurrentTask {
void run();
}
} | [
"1053400192@qq.com"
] | 1053400192@qq.com |
76bae25e369785b2ec5acea90819e32c366409fe | c61a85ba787f4e74a7154a05c07e0aa4af9b67e7 | /week15_hw1/src/IconWindow.java | 03f8452559e5336084668af45d03e544bda8e2e7 | [] | no_license | yuan3675/SED2017FALL | bdaa5489f158a84b8e67be250f04cfc7e6d3eebc | bf703cbc7ad71ddd726220d6cae4b868556fc395 | refs/heads/master | 2021-09-03T17:13:02.322205 | 2018-01-10T16:29:30 | 2018-01-10T16:29:30 | 108,546,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | public class IconWindow extends Window {
public IconWindow(WindowImpl impl) {
this.impl = impl;
}
public void drawBorder() {
drawText();
drawRect();
}
}
| [
"yuan3675@gmail.com"
] | yuan3675@gmail.com |
2de9fb70a0a97607b7a541c6ecafdf89bd025b7b | 79571f6a11c9ef757ec0aa19362c2c6f39fbc7a2 | /pfms/src/main/java/org/tom/pfms/service/impl/NbContactServiceImpl.java | f1f9ac91f50f914d60e82e3a50aa39e57184240d | [] | no_license | hanpoyang/pfms | 4f2081240c25f0586eaa6aa1082fa00d44b8bfd1 | 0c69b738806b3ad6dc9120a993d17809ae0ce31e | refs/heads/master | 2023-03-06T22:45:36.375632 | 2023-03-02T13:25:22 | 2023-03-02T13:25:22 | 80,273,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,840 | java | package org.tom.pfms.service.impl;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.tom.pfms.common.dto.NbContactDTO;
import org.tom.pfms.common.dto.PaginatedDTO;
import org.tom.pfms.common.dto.RequestParam;
import org.tom.pfms.common.exception.DaoException;
import org.tom.pfms.common.exception.ServiceException;
import org.tom.pfms.dao.NbContactDao;
import org.tom.pfms.service.BaseService;
import org.tom.pfms.service.NbContactService;
@Service
public class NbContactServiceImpl extends BaseService implements
NbContactService {
@Resource
NbContactDao nbContactDao;
@Override
public PaginatedDTO<NbContactDTO> queryNbContact(RequestParam rp)
throws ServiceException {
try{
return nbContactDao.queryNbContact(rp);
}catch(DaoException ex) {
log.error("queryNbContact", ex);
throw new ServiceException(ex);
}
}
@Override
public void insertNbContact(RequestParam rp) throws ServiceException {
try{
nbContactDao.insertNbContact(rp);
}catch(DaoException ex) {
log.error("insertNbContact", ex);
throw new ServiceException(ex);
}
}
@Override
public void updateNbContact(RequestParam rp) throws ServiceException {
try{
nbContactDao.updateNbContact(rp);
}catch(DaoException ex) {
log.error("updateNbContact", ex);
throw new ServiceException(ex);
}
}
@Override
public void deleteNbContact(RequestParam rp) throws ServiceException {
try{
nbContactDao.deleteNbContact(rp);
}catch(DaoException ex) {
log.error("deleteNbContact", ex);
throw new ServiceException(ex);
}
}
@Override
public void invalidNbContact(RequestParam rp) throws ServiceException {
try{
nbContactDao.invalidNbContact(rp);
}catch(DaoException ex) {
log.error("invalidNbContact", ex);
throw new ServiceException(ex);
}
}
}
| [
"hanpoyang@hotmail.com"
] | hanpoyang@hotmail.com |
f758ec63f8e62667141c706a88c3f4ccb77e98e7 | 930099631713d6253a7ff05f05bf6522cbba04d9 | /app/src/main/java/com/phoenixfeatherapp/intouch/FocusListener.java | 380f7adb98a5151a72618bf9e3a0fec4bbe5492b | [] | no_license | phoenixfeatherapps/InTouch | 37cbcfb3dd3b80123eb07f2eccff648ee44f3102 | ee1b26a327f69641a42d9ee0d1379aced2ddc6a4 | refs/heads/main | 2022-12-30T00:20:16.182388 | 2020-10-17T07:51:58 | 2020-10-17T07:51:58 | 302,840,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package com.phoenixfeatherapp.intouch;
import android.content.res.Resources;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.content.Context;
import android.view.View;
import static com.phoenixfeatherapp.intouch.Utility.validateIPAddress;
public class FocusListener implements View.OnFocusChangeListener {
private static final String TAG = "MainActivity";
private Context appContext = null;
public FocusListener() { }
public FocusListener(Context context) {
this.appContext = context;
}
@Override
public void onFocusChange(View v, boolean hasFocus) {
Log.i(TAG,"onFocusChange() - Entered - id == " + v.getId());
if(v.getId() == R.id.enterPartnerDeviceId) {
EditText editTextField = (EditText) v;
if (!hasFocus) {
Log.i(TAG, "onFocusChange() - does not have focus! - str == " + editTextField.getText().toString());
if ((editTextField.getText().toString().isEmpty())) {
Log.i(TAG, "onFocusChange() - field is empty!");
editTextField.setTextColor(0xAFAFAFAF);
editTextField.setText(R.string.input_ip_address);
}
Utility.hideSoftKeyboard(v);
}
else {
Log.i(TAG, "onFocusChange() - has focus! - str == " + editTextField.getText().toString());
if(editTextField.getText().toString().equals(appContext.getResources().getString(R.string.input_ip_address))) {
Log.i(TAG, "onFocusChange() - clearing field!");
editTextField.setText("");
editTextField.setTextColor(0xFF000000);
// Utility.showSoftKeyboard(v);
}
}
}
}
public void setFocusChangeListener(View v) {
v.setOnFocusChangeListener(this);
}
}
| [
"phoenixfeatherapps@gmail.com"
] | phoenixfeatherapps@gmail.com |
3bb8afb13426575ad521e64c716c8d7bd146fde6 | 599262c06e227882cdd74a132623f4eddbda5c72 | /src/main/java/com/db/quoters/TerminatorQuoter.java | b9232a3202630f60fde2e5ac1c083770a090531f | [] | no_license | Jeka1978/springdemo_forDB | 21f593a707647ded79641739032340c275304d59 | 440bea6f1ad1a5c2698c5776291af902bdc6e63a | refs/heads/master | 2021-01-21T02:19:46.567281 | 2017-09-01T15:32:26 | 2017-09-01T15:32:26 | 101,887,660 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | package com.db.quoters;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
import java.util.Arrays;
import java.util.List;
/**
* Created by Evegeny on 30/08/2017.
*/
@Component
public class TerminatorQuoter implements Quoter {
private List<String> messages;
@Value("${terminator}")
private void setMessages(String[] messages, @Value("${JAVA_HOME}") String javaHome) {
System.out.println("javaHome = " + javaHome);
this.messages = Arrays.asList(messages);
}
@Override
public void sayQuote() {
messages.forEach(System.out::println);
throw new DBRuntimeException("я встретил сам себя");
}
public void killAll() {
System.out.println("your are terminated....");
}
}
| [
"papakita2009"
] | papakita2009 |
1ccd3bf9675ec10e06c34fc1ad0c95e002d59d46 | 0a687de2d61470cbe8a6e0984c85bf4aa958b563 | /src/pack1/AccessModifier.java | 316691dd37a4521897470e51ac45b27d50b02355 | [] | no_license | brahmaqa1/MyRepo1 | a983a922895197e36206c9852bd345bb0de40faa | 1d8fb0019329153036d9e5620bf94362d55066aa | refs/heads/master | 2020-06-21T11:46:05.195463 | 2019-07-17T18:22:45 | 2019-07-17T18:22:45 | 197,440,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,109 | java | package pack1;
import login.loginclass;
public class AccessModifier {
public static void main(String[] args)
{
//get login pack.loginclass var
//loginclass l=loginclass();//Care ::: errro no new opeartie
loginclass l=new loginclass();// public class , we cna use in other package
// note:: if loginclass is non public , we cant create use in other package
System.out.println("l.publicvar="+l.publicvar);
l.publicvar="publ var val chnaged";
System.out.println("l.publicvar="+l.publicvar);
//System.out.println("l.privateva="+l.privatevar);//not visible
//l.privatevar="Prv chnage";// cant acees priavte var in other class of other pack
//priavtevar cannot be resolved or is not a field
//System.out.println("l.privateva="+l.privatevar);
//System.out.println("l.defStrvar="+l.defStrvar);//not visible
//l.defStrvar="def changed";// error def var of other pack can't be accessed in other package
//System.out.println("l.defStrvar="+l.defStrvar);
//l.protectvar="protchnage";// error not visible
//System.out.println("l.protectvarr="+l.protectvar);
}
}
| [
"brahma.qa1@gmail.com"
] | brahma.qa1@gmail.com |
e01b138745a5ed6836b2f127020b047f6329ef62 | b20ef95e527fa6a4641d2fb95668f6b77b0082e6 | /src/base/DI/KnightTest.java | d5f933cafafe46444c33758e7e75a7293835b44c | [] | no_license | icecsl/springPro | ad62c9db33c899e4d8cc56d349d231e1bf77a8d0 | e3646818a7db5690a92e13e5ce324544e8d9f04a | refs/heads/master | 2021-01-21T10:45:32.027026 | 2018-05-30T07:46:09 | 2018-05-30T07:46:09 | 101,984,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 504 | java | package base.DI;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Created by huangbingjing on 18/5/24.
*/
public class KnightTest {
public static void main(String[] args) {
//读取xml装载bean 获取knight - 构造器依赖注入
ApplicationContext context = new ClassPathXmlApplicationContext("xml/base/knight.xml");
Knight knight = (Knight) context.getBean("knight");
knight.embarkOnQuest();
}
}
| [
"huangbingjing@nonobank.com"
] | huangbingjing@nonobank.com |
7761ad239c6761fabe202fe66edd94fd509c7fe4 | d74fbdd8d6bfe1ab8fae4363b1034e70beee4d81 | /app/src/test/java/kr/hs/e_mirim/teenspolitics_master/ExampleUnitTest.java | 0c27697bf48cef787bf56696c6740e9423698eb3 | [] | no_license | shimeunji/Teenspolitics-master | 8dc2d3baa2c3efd91971ef61dec17619036965e1 | a6a282ba81f9683f4011b4f19898bc8b58eda69f | refs/heads/master | 2021-01-25T01:03:24.003621 | 2017-06-18T23:18:20 | 2017-06-18T23:18:20 | 94,716,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package kr.hs.e_mirim.teenspolitics_master;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"shimeunji991222@gmail.com"
] | shimeunji991222@gmail.com |
6bc02f4f404d0c363d7e457fe9ee7268504acc3f | 9720eebcbc60d7a5ed7fe9748f3827b5888b167a | /src/main/java/ItemCatalogManager.java | 9e241b0b40f514d672c281c31b1fe0254d29ec2f | [] | no_license | jc-johnson/Logistics-Application | 05c3ec0defb23a6e3644105f2e683810b6c0b5d0 | 83e1fb91857d8543fb25a724a3928f0ff5352984 | refs/heads/master | 2021-01-19T06:47:56.290947 | 2017-06-01T23:23:36 | 2017-06-01T23:23:36 | 87,500,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,997 | java | package src.main.java;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import src.main.java.exceptions.DataValidationException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Locale;
/**
* Created by Jordan on 5/9/2017.
*/
public final class ItemCatalogManager {
private HashMap<String, Integer> catalog = new HashMap<>();
private static ItemCatalogManager instance;
public static ItemCatalogManager getInstance() {
if (instance == null) {
instance = new ItemCatalogManager();
}
return instance;
}
private ItemCatalogManager() {}
public Integer getItemPrice(String itemID) {
return catalog.get(itemID);
}
public boolean isRealItem(String itemID) throws DataValidationException {
if (itemID.equals("") || itemID.isEmpty()) {
throw new DataValidationException("Empty string parameter");
}
if (catalog.containsKey(itemID)) return true;
return false;
}
public void parseItemsInventoryXML(String path) throws DataValidationException, ParseException {
if (path.equals("") || path.isEmpty()) {
throw new DataValidationException("Empty string parameter");
}
try {
// Open file path to xml
File xmlFile = new File(path); // File Path C:\Logistics-Program\LogisticsApplication\src\main\resources\ItemCatalog.xml
if (xmlFile == null) {
throw new FileNotFoundException();
}
// System.out.println("File found...");
// Build parser and parse
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document document = documentBuilder.parse(xmlFile);
// Optional but recommended
document.getDocumentElement().normalize();
// System.out.println("Root element : " + document.getDocumentElement().getNodeName());
NodeList nodeList = document.getElementsByTagName("Item");
// Print elements and add to hashmap
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
// System.out.println("\nCurrent Element : " + node.getNodeName());
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
String itemId = element.getAttribute("Id");
String itemPriceString = element.getElementsByTagName("price").item(0).getTextContent();
Integer price = Integer.parseInt(itemPriceString.replaceAll(",", ""));
// System.out.println("Item ID : " + itemId);
// System.out.println("Price : " + itemPrice);
catalog.put(itemId, price);
}
}
printItemsCatalog();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public void printItemsCatalog() {
System.out.println("Item Catalog: ");
System.out.println("");
for (HashMap.Entry entry : catalog.entrySet()) {
System.out.println(entry.getKey() + "\t:\t$ " + entry.getValue());
}
System.out.println("");
}
}
| [
"jjohnson@myself.com"
] | jjohnson@myself.com |
41247562304198580439a95dcd58cd2258632154 | b59540e988b52d1bb0d2be6dbe50c3d77b6bbc43 | /Assignment2/src/project/conventer_from_p1.java | 4939afa6fd7ade031f4860ba223d12c82387b780 | [] | no_license | Chener-Zhang/Network-and-Secutiry-Project | 3b7d929511e189571f96d89fd0fb17fc3a2b4ae7 | c43ad6902d928fa0dc6fb6ee392105db64c04fd1 | refs/heads/master | 2022-04-17T13:11:57.702960 | 2020-04-15T02:32:07 | 2020-04-15T02:32:07 | 236,056,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package project;
import java.util.StringTokenizer;
public class conventer_from_p1 {
String string;
byte[] Final;
public conventer_from_p1(String st) {
this.string = st;
}
public byte[] breaker() {
StringTokenizer symbal_breaker = new StringTokenizer(string, "[]");
String dele_begin_end = symbal_breaker.nextToken();
StringTokenizer multiTokenizer = new StringTokenizer(dele_begin_end, ", ");
int counter = 0;
while (multiTokenizer.hasMoreTokens()) {
String assgn = multiTokenizer.nextToken();
int i = Integer.parseInt(assgn);
byte b1 = (byte) i;
counter++;
}
//----------------------------------------->
Final = new byte[counter];
StringTokenizer symbal_breaker2 = new StringTokenizer(string, "[]");
String dele_begin_end2 = symbal_breaker2.nextToken();
StringTokenizer multiTokenizer2 = new StringTokenizer(dele_begin_end2, ", ");
int counter2 = 0;
while (multiTokenizer2.hasMoreTokens()) {
String assgn = multiTokenizer2.nextToken();
int i = Integer.parseInt(assgn);
byte b1 = (byte) i;
Final[counter2] = b1;
counter2++;
}
return Final;
}
}
| [
"55104326+tuh12085@users.noreply.github.com"
] | 55104326+tuh12085@users.noreply.github.com |
74249ebb7e92eda4d9264d71b1871ce0c0a04738 | c083d7f00c8ec192332872b6421f05a73a64ef8f | /src/com/company/emcare/model/ActionHist.java | 7a43819b480bbedb1d021a73fedb439a713011bb | [] | no_license | zhanhyii/EmCare | 074dd4eb064c2992754efdf2a6cd812f6c46341c | 7d7aafb34317d37b4d87fe30394fa22b785b4aa9 | refs/heads/master | 2016-09-05T08:57:05.707605 | 2013-01-25T06:42:57 | 2013-01-25T06:42:57 | 7,813,536 | 0 | 1 | null | 2013-01-25T06:42:57 | 2013-01-25T04:23:54 | JavaScript | UTF-8 | Java | false | false | 3,249 | java | package com.company.emcare.model;
import java.sql.Timestamp;
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.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
@Entity(name="action_hist")
public class ActionHist {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name="keyPerosnId")
private Person keyPerson;
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="minorPersonId")
private Person minorPerson;
@Column
private int actionType;
@ManyToOne
@JoinColumn(name="voiceId")
private Voice voice;
private Timestamp updateTime;
@Column
@Lob
private String comments;
public final static int NEW = 0x1;
public final static int ASSIGN= 0x2;
public final static int RESOLVE = 0x3;
public final static int CLOSE = 0x4;
public final static int REJECT =0x5;
public final static int REOPEN = 0x6;
public final static int INPROGRESS=0x7;
public static ActionHist constructActionHist(Voice voice,Person primaryPerson,Person secondaryPerson, int actionType,String comment){
ActionHist ah = new ActionHist();
ah.setKeyPerson(primaryPerson);
ah.setMinorPerson(secondaryPerson);
ah.setActionType(actionType);
ah.setUpdateTime(new Timestamp(System.currentTimeMillis()));
ah.setVoice(voice);
ah.setComments(comment);
return ah;
}
public static ActionHist constructActionHist(Voice voice,Person primaryPerson, int actionType,String comment){
return constructActionHist(voice,primaryPerson,null,actionType,comment);
}
public static ActionHist constructActionHist(Voice voice, Person primaryPerson, int actionType){
return constructActionHist(voice, primaryPerson, null, actionType,null);
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Person getKeyPerson() {
return keyPerson;
}
public void setKeyPerson(Person keyPerson) {
this.keyPerson = keyPerson;
}
public Person getMinorPerson() {
return minorPerson;
}
public void setMinorPerson(Person minorPerson) {
this.minorPerson = minorPerson;
}
public int getActionType() {
return actionType;
}
public void setActionType(int actionType) {
this.actionType = actionType;
}
public Voice getVoice() {
return voice;
}
public void setVoice(Voice voice) {
this.voice = voice;
}
public Timestamp getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Timestamp updateTime) {
this.updateTime = updateTime;
}
public String getComments() {
return comments;
}
public void setComments(String comments) {
this.comments = comments;
}
/*
* get action description
*/
public String getActionDesc(){
switch(actionType){
case NEW:
return "Submit";
case ASSIGN:
return "Assigned to " + minorPerson.getRealname();
case RESOLVE:
return "Resolved";
case CLOSE:
return "Closed";
case REJECT:
return "Rejected";
case REOPEN:
return "Reopened";
case INPROGRESS:
return "start processing";
default:
return "Submit";
}
}
}
| [
"setpsw@gmail.com"
] | setpsw@gmail.com |
d5f8bdf1d2de19ac5f75017f420b11d9c33865e6 | 2811d7a3ed750ccce0fb698b7d9c3a90c3e0efcd | /test/ups/bdconexion/BDConexionTest.java | 2d0a8e3d66c4aef202def6e1f4c89e268f808cbe | [] | no_license | DavidIsraelLeon/CitasMedicas | e5e8bfb0a577d695b82132f9274175ce79df4fa6 | ebdb394b16a3a4a53c947cbb676d5bf9cd03e537 | refs/heads/master | 2022-11-02T11:15:01.194797 | 2020-06-19T17:20:18 | 2020-06-19T17:20:18 | 273,416,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | 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 ups.bdconexion;
import java.sql.Connection;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Esteban
*/
public class BDConexionTest {
public BDConexionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of conectar method, of class BDConexion.
*/
@Test
public void testConectar() {
System.out.println("conectar");
Connection expResult = null;
Connection result = BDConexion.conectar();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of close method, of class BDConexion.
*/
@Test
public void testClose() {
System.out.println("close");
Connection con = null;
BDConexion.close(con);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
| [
"dilggallardos@hotmail.com"
] | dilggallardos@hotmail.com |
6e4ecb353c3fd8ce5332d2adf1c831f8bdb74dba | 36b2a202cdca6915f0c8ad8a03c92064fe0e7345 | /app/src/main/java/com/ckkj/enjoy/ui/music/MusicRankingListDetailActivity.java | 037328e28ae53c0a43b10bb5eb013aba1ccb4d24 | [] | no_license | zct1115/EnJoy | 92dd395ec00bea8de00c8b7d549206bac0e0bdf0 | f28b9f4f6cb1c3b36e7be2242487ac5bf67139f0 | refs/heads/master | 2021-07-15T08:16:28.098450 | 2017-10-23T14:20:45 | 2017-10-23T14:20:45 | 104,848,283 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,465 | java | package com.ckkj.enjoy.ui.music;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.aspsine.irecyclerview.IRecyclerView;
import com.ckkj.enjoy.R;
import com.ckkj.enjoy.adapter.MusicRankingListDetailAdapter;
import com.ckkj.enjoy.anims.LandingAnimator;
import com.ckkj.enjoy.anims.ScaleInAnimationAdapter;
import com.ckkj.enjoy.api.MusicApi;
import com.ckkj.enjoy.app.AppContent;
import com.ckkj.enjoy.base.BaseActivityWithoutStatus;
import com.ckkj.enjoy.bean.RankingListDetail;
import com.ckkj.enjoy.bean.SongDetailInfo;
import com.ckkj.enjoy.service.MediaPlayService;
import com.ckkj.enjoy.ui.music.presenter.RankinglistDetilsPresenter;
import com.ckkj.enjoy.ui.music.view.MusicRankingListDetailView;
import com.ckkj.enjoy.utils.ImageLoaderUtils;
import com.ckkj.enjoy.utils.StatusBarSetting;
import com.ckkj.enjoy.widget.LoadingDialog;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by zct11 on 2017/9/27.
*/
public class MusicRankingListDetailActivity extends BaseActivityWithoutStatus implements MusicRankingListDetailView , MusicRankingListDetailAdapter.onItemClickListener, MusicRankingListDetailAdapter.onPlayAllClickListener{
@BindView(R.id.iv_album_art)
ImageView ivAlbumArt;
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.rl_toobar)
RelativeLayout rlToobar;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.toolbar_layout)
CollapsingToolbarLayout toolbarLayout;
@BindView(R.id.app_bar)
AppBarLayout appBar;
@BindView(R.id.irv_song_detail)
IRecyclerView irvSongDetail;
@BindView(R.id.bottom_container)
FrameLayout bottomContainer;
private int mType;
private List<RankingListDetail.SongListBean> mList = new ArrayList<>();
private RankinglistDetilsPresenter presenter;
private MusicRankingListDetailAdapter mDetailAdapter;
private Context context;
private String mFields;
//请求返回的SongDetailInfo先存放在数组中,对应下标索引是其在集合中所处位置
private SongDetailInfo[] mInfos;
//song_id 对应的在集合中的位置
private HashMap<String, Integer> positionMap = new HashMap<>();
private static MediaPlayService.MediaBinder mMediaBinder;
private MediaPlayService mService;
private MediaServiceConnection mConnection;
//指示现在加入musicList集合中的元素下标应该是多少
private AtomicInteger index = new AtomicInteger(0);
private Intent mIntent;
private boolean isPlayAll = false;
private boolean isLocal;
@Override
public int getLayoutId() {
return R.layout.activity_rankinglist_detail;
}
@Override
public void initPresenter() {
presenter = new RankinglistDetilsPresenter(this);
}
@Override
public void initView() {
//用图片做背景
StatusBarSetting.setTranslucent(this);
context = this;
Intent intent = getIntent();
Bundle extras = intent.getExtras();
if (extras != null) {
mType = (int) extras.get("type");
}
//设置标题栏
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mFields = new MusicApi().encode("song_id,title,author,album_title,pic_big,pic_small,havehigh,all_rate,charge,has_mv_mobile,learn,song_source,korean_bb_song");
setRecyclerView();
//初始化服务连接
mConnection = new MediaServiceConnection();
if (mIntent == null) {
mIntent = new Intent(this, MediaPlayService.class);
startService(mIntent);
bindService(mIntent, mConnection, BIND_AUTO_CREATE);
}
}
private void setRecyclerView() {
mDetailAdapter = new MusicRankingListDetailAdapter(mContext, mList);
mDetailAdapter.setOnItemClickListener(this);
mDetailAdapter.setOnPlayAllClickListener(this);
irvSongDetail.setLayoutManager(new LinearLayoutManager(mContext));
irvSongDetail.setItemAnimator(new LandingAnimator());
irvSongDetail.setIAdapter(new ScaleInAnimationAdapter(mDetailAdapter));
irvSongDetail.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
LoadingDialog.showDialogForLoading(this).show();
presenter.requestRankListDetail(AppContent.MUSIC_URL_FORMAT, AppContent.MUSIC_URL_FROM, AppContent.MUSIC_URL_METHOD_RANKING_DETAIL, mType, 0, 100, mFields);
}
@Override
public void returnRankingListDetail(RankingListDetail detail) {
List<RankingListDetail.SongListBean> list = detail.getSong_list();
setUI(detail.getBillboard());
mList.addAll(list);
//初始化数组集合
mInfos = new SongDetailInfo[mList.size()];
mDetailAdapter.notifyDataSetChanged();
initMusicList();
}
@Override
public void returnSongDetail(SongDetailInfo info) {
System.out.println("回调次数:" + index);
if (mMediaBinder != null) {
if (mService == null) {
mService = mMediaBinder.getMediaPlayService();
}
if (info.getSonginfo() == null) {
// TODO: 2017/10/10 为空 不能播放 后续需要处理
} else {
Log.d("MusicRankingListDetailA", "info.getSonginfo():" + info.getSonginfo());
String song_id = info.getSonginfo().getSong_id();
Integer position = positionMap.get(song_id);
mInfos[position] = info;
}
int currentNumber = index.addAndGet(1);
if (currentNumber == mInfos.length) {
for (int i = 0; i < mInfos.length; i++) {
if (i == 0) {
//先清除之前的播放集合
mService.clearMusicList();
}
mService.addMusicList(mInfos[i]);
}
}
}
LoadingDialog.cancelDialogForLoading();
}
private void initMusicList() {
for (int i = 0; i < mList.size(); i++) {
RankingListDetail.SongListBean songDetail = mList.get(i);
String song_id = songDetail.getSong_id();
positionMap.put(song_id, i);
presenter.requestSongDetail(AppContent.MUSIC_URL_FROM_2, AppContent.MUSIC_URL_VERSION, AppContent.MUSIC_URL_FORMAT, AppContent.MUSIC_URL_METHOD_SONG_DETAIL
, song_id);
}
}
private void setUI(RankingListDetail.BillboardBean billboard) {
tvName.setText(billboard.getName());
ImageLoaderUtils.display(this, ivAlbumArt, billboard.getPic_s260());
}
@Override
public void onItemClick(int position) {
//播放单个
isPlayAll = false;
if (mService != null) {
mService.setPlayAll(false);
mService.playSong(position, isLocal);
}
}
private static class MediaServiceConnection implements ServiceConnection {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mMediaBinder = (MediaPlayService.MediaBinder) service;
}
@Override
public void onServiceDisconnected(ComponentName name) {
}
}
@Override
public void onItemClick() {
//播放全部
isPlayAll = true;
if (mService != null) {
mService.playAll(isLocal);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
unbindService(mConnection);
}
}
| [
"1278719957@qq.com"
] | 1278719957@qq.com |
f5f169b754dd146c48e736bdd3d993020807e82f | 3726265f8005bbacd826f32b6c434c2540b6599e | /uml/java/Model/personnes/Abonné.java | 6d4c681784f0d51965206747330300bfc35b2dbb | [] | no_license | didier-tp/poe-pega2 | 11bd93bd93c9b9d9dfd10a107f1e6fd5c7db0ef2 | 1f1cdc9ae4d466c40f6a2193c6e17cb56e04daee | refs/heads/main | 2023-07-11T02:24:09.617289 | 2021-08-20T15:21:18 | 2021-08-20T15:21:18 | 394,204,364 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | package personnes;
import java.util.*;
/**
*
*/
public class Abonné extends Personne {
/**
* Default constructor
*/
public Abonné() {
}
/**
*
*/
private Integer numero;
/**
*
*/
private Date dateAbonnement;
/**
*
*/
public void sePresenter() {
// TODO implement here
}
} | [
"didier@d-defrance.fr"
] | didier@d-defrance.fr |
73b405dd42fc95ed11fcbe97572b983a2b82a867 | 37f24afbf92e4760f5dfceedcb5289a3514179f7 | /src/leetcode/easy/FactorialTrailingZeroes.java | 081dd7cea35b210a78370b7510e470bf370b3c65 | [] | no_license | GY15/arithmetic | 9f51b8ff4c6c8e7a040783d65f146b3d3ed333c9 | c49da30b52803e03630325df000125889ef33ab9 | refs/heads/master | 2022-02-23T09:40:31.510870 | 2019-10-02T04:02:09 | 2019-10-02T04:02:09 | 109,135,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package leetcode.easy;
public class FactorialTrailingZeroes {
public int trailingZeroes(int n) {
int res = 0;
for (int i = 5; i <= n; i+=5){
int temp = i;
while(temp % 5 == 0 || temp % 10 ==0){
if (temp % 5 == 0){
res++;
temp*=2;
}else{
temp/=10;
res++;
}
}
}
return res;
}
}
| [
"151250040@smail.nju.edu.cn"
] | 151250040@smail.nju.edu.cn |
99c36f13f91c4fb3537ee704340c57ea4160fe41 | d648ff8df7a155cc3272b8d20f877ebabb92d3cd | /src/by/it/akulov/lesson06/TaskA2.java | 8ac6091d11180cf464f7587d2a6da96865e26174 | [] | no_license | th1nk-d1ff3r3nt/ComputerScience | b48a16aacd8055b6966cd073db3ac4987c83fbb6 | c7fb8049fbd42164db8168985e2685edd0374893 | refs/heads/master | 2023-04-29T07:07:27.298512 | 2018-12-20T13:17:24 | 2018-12-20T13:17:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,436 | java | package by.it.akulov.lesson06;
/*
toString() для класса Dog
Доработайте class Dog из задания A1. Создайте в классе Dog метод
public String toString(){
//метод должен вернуть строку экземляра класса в виде форматированной строки
//Пример:
Кличка: Шарик. Возраст: 5
}
Требования:
1. Программа не должна считывать данные с клавиатуры.
2. Создайте внутри метода main (класса TaskA2) две разных собаки (т.е. два объекта типа Dog)
3. Заполните поля собак используя сеттеры.
4. Первая - Шарик, 5 лет. Вторая - Тузик, 3 года.
5. Напечатайте этих двух собак, выводите собак как объект без геттеров.
Обратите внимание на точки и пробелы.
Вывод:
Кличка: Шарик. Возраст: 5
Кличка: Тузик. Возраст: 3
*/
public class TaskA2 {
public static void main(String[] args) {
Dog dog1 = new Dog("Шарик",5);
Dog dog2 = new Dog("Тузик",3);
System.out.println(dog1);
System.out.println(dog2);
}
}
| [
"dmitryakulov.official@gmail.com"
] | dmitryakulov.official@gmail.com |
61ae2db59461f8d7ea8f7c585986ca16bbb479a0 | 4118f7d8f74e6c0773517fd6b308df83c7cf3518 | /src/CoreJava/MainEntryPoint/TestRunner.java | e7c9ef44dfa2d1c441e17c1d5dc8c1f5e08262ad | [] | no_license | resv/PERSCHOLAS-JD-ASSIGNMENTS | 1fb0b2a7e7e4787276d77716a11b95a95fff4699 | a3051ca9c6d5c8f250ce54c6b658b3b4bedef1e7 | refs/heads/master | 2020-03-28T04:21:38.457643 | 2018-09-06T17:56:40 | 2018-09-06T17:56:40 | 147,709,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 453 | java | package CoreJava.MainEntryPoint;
public class TestRunner {
public static void main(String[] args) {
// Many things to consider working on this in the future and things I've learned.
// You can create an array string on the fly
// equality comparison with emails or another string should use .equals due to "@"char
// concurrent exception errors are and should be used with an irirator or boolean out
//
}
}
| [
"akim456@gmail.com"
] | akim456@gmail.com |
83723b052c0ba3878f2799d8db9b43b7d374c7c9 | 866f5c2a8a7999fb877ce5bb4cf359e88589d161 | /src/p1MainClasses/FilesGeneratorMain.java | 607430901b6e52512d193181d923d9eed0c6035b | [] | no_license | PentiumFallen/Data-Project-1 | 80654d861d093e7b3fb533ef840cc793373b2c68 | 0471544e33e20b3aa9e9811394ed1b519a74a94a | refs/heads/master | 2021-04-15T11:35:19.891950 | 2018-05-01T23:21:13 | 2018-05-01T23:21:13 | 126,051,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package p1MainClasses;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import dataGenerator.DataGenerator;
/**
* Generates the files for Part1
*
* Code belongs to professor
*/
public class FilesGeneratorMain {
public static void main(String[] args) throws FileNotFoundException {
if (args.length <= 3) {
int n = 20;
int m = 50;
int size = 50000;
if (args.length >= 1)
n = Integer.parseInt(args[0]);
if (args.length >= 2)
m = Integer.parseInt(args[1]);
if (args.length == 3)
size = Integer.parseInt(args[2]);
generateFiles(n, m, size);
}
else
System.out.println("Invalid number of parameters. Must be <= 2.");
}
private static void generateFiles(int n, int m, int size) throws FileNotFoundException {
String parentDirectory = "inputFiles"; // must exist in current directory
DataGenerator dg = new DataGenerator(n, m, size);
Object[][][] setsLists = dg.generateData();
PrintWriter paramsFile = new PrintWriter(new File(parentDirectory, "parameters.txt"));
paramsFile.println(n); // save parameter n
paramsFile.println(m); // save parameter m
paramsFile.close();
// create all the files for testing and grading with random integer values as
// content. Each such file represents a set, since there is no repetition of
// values. Some might end being empty...
for (int i=0; i<n; i++)
for (int j=0; j<m; j++) {
String fileName = "F_" + i + "_" + j + ".txt";
PrintWriter out = new PrintWriter(new File(parentDirectory, fileName));
for (int k=0; k<setsLists[i][j].length; k++)
out.println(setsLists[i][j][k]);
out.close();
}
}
}
| [
"raul.vargas@upr.edu"
] | raul.vargas@upr.edu |
abc6f080c90d9d8603ef5459b32fd73ac5204c24 | 3c21c815269243067aafb0b798912aba2b3af191 | /app/src/androidTest/java/ca/cours5b5/vladimirchrisphonte/ExampleInstrumentedTest.java | d33cd5364cbcd8af88d90aed9f69186f81ad95ac | [] | no_license | emvlad/1523208 | 582ad6594ff492adb72e8611f8fba0971669aba7 | 32172c68d84d5b545386e346a4e3521e8ede2bb5 | refs/heads/master | 2020-03-27T03:54:32.015158 | 2018-11-01T19:46:40 | 2018-11-01T19:46:40 | 145,897,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package ca.cours5b5.vladimirchrisphonte;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.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.getTargetContext();
assertEquals("ca.cours5b5.vladimirchrisphonte", appContext.getPackageName());
}
}
| [
"cevchris23@outlook.com"
] | cevchris23@outlook.com |
c269def799cd22523559114e056f4e32821a6656 | fed81804c560636b18ef08389ecd6057d6081685 | /src/main/java/com/lojalivros/models/dao/FuncionarioDAO.java | 79ec7ae80b1cb118b274fac928f71a54950d2b0b | [] | no_license | arthurmatosbsb/Loja-livros | e8b968b148b4b3fcb4e398c40bb8dee4b5847daf | 934218ac2af66d2ac429ba90186beaacda63653e | refs/heads/master | 2022-11-25T09:08:46.029440 | 2020-08-05T21:31:41 | 2020-08-05T21:31:41 | 285,405,920 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 886 | java | package com.lojalivros.models.dao;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.lojalivros.models.Funcionario;
public class FuncionarioDAO implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@PersistenceContext
EntityManager em;
private DAO<Funcionario> dao;
@PostConstruct
void init() {
this.dao = new DAO<Funcionario>(this.em, Funcionario.class);
}
public void adiciona(Funcionario t) {
dao.adiciona(t);
}
public void remove(Funcionario t) {
dao.remove(t);
}
public void atualiza(Funcionario t) {
dao.atualiza(t);
}
public List<Funcionario> listaTodos() {
return dao.listaTodos();
}
public Funcionario buscaPorId(Integer id) {
return dao.buscaPorId(id);
}
}
| [
"arthurmatosbsb@gmail.com"
] | arthurmatosbsb@gmail.com |
0e271ffce8e355d54d7b0eb9fcb155205891babd | 4163b0e3c8ef502fad496a72043fa699bf0b9c52 | /sixeco-xmall/freeter-admin/src/main/java/com/freeter/modules/pc/entity/view/CategoryView.java | e093ddcb987315c7fef8a4205da9af332747ed4e | [] | no_license | Onoderaharu/sixeco | 25fd03bead84c2bc84cee85abdb69adf8e4d3458 | 9536093e904feb44e9e12963b5b0276c0f14000f | refs/heads/master | 2020-03-24T23:11:53.779054 | 2018-08-01T08:10:10 | 2018-08-01T08:10:10 | 143,122,864 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,052 | java | package com.freeter.modules.pc.entity.view;
import com.freeter.modules.pc.entity.CategoryEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
* 分类表
* 后端返回视图实体辅助类
* (通常后端关联的表或者自定义的字段需要返回使用)
* @author xuchen
* @email 171998110@qq.com
* @date 2018-07-28 16:51:05
*/
@TableName("cn_category")
@ApiModel(value = "Category")
public class CategoryView extends CategoryEntity implements Serializable {
private static final long serialVersionUID = 1L;
public CategoryView(){
}
public CategoryView(CategoryEntity categoryEntity){
try {
BeanUtils.copyProperties(this, categoryEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"631878520@qq.com"
] | 631878520@qq.com |
719433ea6525172180e533b1ab19c1d0bf462212 | d8223191462e3c4c1bfbfb37269d4aa617f5a0f5 | /CRM/src/main/java/com/usinsa/crm/dao/OtherDAO.java | 26aa80b22fcaceeba3acc264524c504ce070edd0 | [] | no_license | ohk3726/CRM | a6d8cfc7839d2282c67d79bed9d768b112707cb7 | 7e17a415ec7a4c7db03795fdb3d6ac1147cf9571 | refs/heads/master | 2022-12-23T17:32:12.963263 | 2019-12-19T23:07:07 | 2019-12-19T23:07:07 | 227,682,395 | 0 | 0 | null | 2022-12-16T01:01:01 | 2019-12-12T19:36:45 | Java | UTF-8 | Java | false | false | 1,093 | java | package com.usinsa.crm.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.usinsa.crm.vo.CouponVO;
import com.usinsa.crm.vo.LevelVO;
import com.usinsa.crm.vo.MailVO;
import com.usinsa.crm.vo.OtherVO;
import com.usinsa.crm.vo.UserVO;
public interface OtherDAO {
List<OtherVO> other_coupon_list() throws Exception;
List<OtherVO> other_coupon_category() throws Exception;
List<OtherVO> other_select_coupon(OtherVO vo) throws Exception;
List<OtherVO> coupon_max() throws Exception;
int coupon_insert(OtherVO vo) throws Exception;
int coupon_update(OtherVO vo) throws Exception;
List<UserVO> other_user(UserVO vo) throws Exception;
List<UserVO> user_job() throws Exception;
List<LevelVO> level() throws Exception;
String[] user_email(@Param("user_id") String[] user_id) throws Exception;
String coupon_issued_id() throws Exception;
int coupon_mail_insert(MailVO vo) throws Exception;
int coupon_issued_insert(CouponVO vo) throws Exception;
String[] coupon_name(@Param("coupon_id") String[] coupon_id) throws Exception;
}
| [
"ohk3726@gmail.com"
] | ohk3726@gmail.com |
d706e20c437bb53f3e311ba9805f83065cc3555f | 1376cd07f9810fcc2de8a597cc039c6457c61a9c | /src/main/java/com/surveyor/service/impl/UserServiceImpl.java | 67d44579388333a0b2a1046f254f589ac3c212be | [] | no_license | fairy825/SurveyorWX | a8645790e61b6a4f891bf7d8c28d6028c4be19be | 52f0b040cc2570731d063a2ada1e0bfa9270e6ab | refs/heads/master | 2022-06-23T17:45:15.001426 | 2019-11-20T09:01:30 | 2019-11-20T09:01:30 | 211,759,177 | 0 | 0 | null | 2022-06-21T01:58:09 | 2019-09-30T02:26:05 | Java | UTF-8 | Java | false | false | 2,516 | java | package com.surveyor.service.impl;
import com.surveyor.service.UserService;
import org.n3r.idworker.Sid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion.User;
import com.surveyor.mapper.UsersMapper;
import com.surveyor.pojo.Users;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UsersMapper usersMapper;
@Autowired
private Sid sid;
@Transactional(propagation= Propagation.REQUIRED)
@Override
public void addPoint(String userId,float point) {
Users user = usersMapper.selectByPrimaryKey(userId);
user.setPoint(user.getPoint()+point);
usersMapper.updateByPrimaryKeySelective(user);
}
@Transactional(propagation= Propagation.SUPPORTS)
@Override
public boolean queryUsernameIsExist(String username) {
Users user = new Users();
user.setUsername(username);
Users result = usersMapper.selectOne(user);
return result==null?false:true;
}
@Transactional(propagation= Propagation.REQUIRED)
@Override
public void saveUser(Users user) {
String userId = sid.nextShort();
user.setId(userId);
user.setPoint(20);
usersMapper.insert(user);
}
@Transactional(propagation= Propagation.SUPPORTS)
@Override
public Users queryUserForLogin(String username,String password) {
Example userExample = new Example(Users.class);
Criteria criteria = userExample.createCriteria();
criteria.andEqualTo("username", username);
criteria.andEqualTo("password", password);
Users result = usersMapper.selectOneByExample(userExample);
return result;
}
@Transactional(propagation= Propagation.REQUIRED)
@Override
public void updateUserInfo(Users user) {
Example userExample = new Example(Users.class);
Criteria criteria = userExample.createCriteria();
criteria.andEqualTo("id",user.getId());
usersMapper.updateByExampleSelective(user, userExample);
}
@Transactional(propagation= Propagation.SUPPORTS)
@Override
public Users queryUserInfo(String userId) {
Example userExample = new Example(Users.class);
Criteria criteria = userExample.createCriteria();
criteria.andEqualTo("id",userId);
Users result = usersMapper.selectOneByExample(userExample);
return result;
}
}
| [
"1324240571@qq.com"
] | 1324240571@qq.com |
e32b1a11c5e8a14ee264ca41a665516579e8a4d4 | ade0068f0b256f46d5ea1e501d903cb164674be1 | /app/src/main/java/com/example/idpproject/CarparkSelection.java | 0b0e89f74b29a31e78b8129dde195b08e49c1c53 | [] | no_license | ms042087/idpProject | 2bd6ba8416586c0dac55c2ca50ea81d5ac75353a | 65992227407bcfcc7c8771af9770302f0c5058ab | refs/heads/master | 2021-09-12T21:43:22.277273 | 2018-04-05T06:24:29 | 2018-04-05T06:24:29 | 126,035,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,676 | java | package com.example.idpproject;
import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.os.AsyncTask;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
// Database
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
// ListView
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Law Kin Ping on 25/3/2018.
* Load data successfully on 4/4/2018
* Load data into ListView on 5/4/2018
*/
public class CarparkSelection extends Fragment {
ProgressDialog progressDialog;
ConnectionClass connectionClass;
ListView listview;
View root;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
root = inflater.inflate(R.layout.activity_carpark_selection,container,false);
listview = (ListView) root.findViewById(R.id.listView);
connectionClass = new ConnectionClass();
progressDialog=new ProgressDialog(getActivity());
return root;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getActivity().setTitle("Carpark Selection");
// Extract Information from database after the view is settled
DoExtractCarParkInfo doExtractCarParkInfo=new DoExtractCarParkInfo();
doExtractCarParkInfo.execute();
}
private class DoExtractCarParkInfo extends AsyncTask<String,String,String> {
boolean isSuccess=false;
// 建立一個 2D arrayList 裝data
ArrayList<ArrayList<String>> carParkInfo = new ArrayList<ArrayList<String>>();
// index for 有幾多行data
int i = 0;
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected String doInBackground(String... params) {
String z="";
try {
Connection con = connectionClass.CONN();
if (con == null) {
z = "Please check your internet connection";
} else {
String query="select * from carpark";
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery(query);
carParkInfo.add(new ArrayList<String>());
// 逐行data拎,第1個 column 係id,唔需要,第2個係 Name,第3個係vacancy
// array[0] 係 Name (data第2個),array[1]係 Distance,老作,array[2]係vacancy (data第3個)
while (rs.next()) {
carParkInfo.get(i).add(rs.getString(2));
carParkInfo.get(i).add("xkm");
carParkInfo.get(i).add(rs.getString(3));
i++;
carParkInfo.add(new ArrayList<String>());
}
isSuccess = true;
}
}
catch (Exception ex)
{
z = "Exceptions"+ex;
}
return z;
}
// 做一個 list 既 mapping <Key, Data>
// 呢度個Key 係 Name, Distance, Vacancy
@Override
protected void onPostExecute(String s) {
List<Map<String, Object>> items = new ArrayList<Map<String,Object>>();
Map<String, Object> title = new HashMap<String, Object>();
// 第一行: 標題
title.put("Name", "Name");
title.put("Distance", "Distance");
title.put("Vacancy", "Vacancy");
items.add(title);
// 第N行: data
for (int i=0;i < carParkInfo.size()-1;i++){
Map<String, Object> item = new HashMap<String, Object>();
item.put("Name", carParkInfo.get(i).get(0));
item.put("Distance", carParkInfo.get(i).get(1));
item.put("Vacancy", carParkInfo.get(i).get(2));
items.add(item);
}
// Load data 入去listview
SimpleAdapter adapter = new SimpleAdapter(
getActivity(),
items,
R.layout.style_listview,
new String[]{"Name", "Distance", "Vacancy"},
new int[]{R.id.tvName, R.id.tvDistance, R.id.tvVacancy}
){};
listview.setAdapter(adapter);
//
AdapterView.OnItemClickListener onClickListView = new AdapterView.OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Fragment fragment = new ParkingSpaceSelection();
FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.cotent_main,fragment).commit();
}
};
listview.setOnItemClickListener(onClickListView);
}
}
}
| [
"ms042087@gmail.com"
] | ms042087@gmail.com |
00a2cbdb8d9ea11915e64a8b856074e92216c4ef | 025407ef8cf22091498b1e73dd0f25fbe70888f1 | /A1-MiniS/src/java/lang/RecursiveDescentParser.java | fb60882e8b90db06d760bca5b365c3b5e2bae6ba | [] | no_license | TanJunHong/mysterious | 85747d8d761482f80aa383abf9f95fdd01f3c6e8 | 8acc34181ea40a35ae670b0ed222d9d400a0f7c7 | refs/heads/master | 2023-03-24T01:53:47.862297 | 2016-10-13T10:46:47 | 2016-10-13T10:46:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,664 | java | package lang;
import lang.RDPTemplate;
import lang.ast.LangScanner;
import static lang.ast.LangParser.Terminals.*;
public class RecursiveDescentParser extends RDPTemplate {
/**
* Entry hook to start parsing.
* @throws RuntimeException if the program is not syntactically correct
*/
public void parseProgram() {
statement();
}
public void statement() {
int token = peek();
switch(token) {
case ID:
assignStmt();
break;
case IF:
ifStmt();
break;
case FOR:
forStmt();
break;
default:
error("Unexpected token: " + NAMES[token]);
break;
}
}
public void forStmt() {
accept(FOR);
assignStmt();
accept(UNTIL);
expression();
accept(DO);
statement();
accept(OD);
}
public void ifStmt() {
accept(IF);
expression();
accept(THEN);
statement();
accept(FI);
}
public void assignStmt() {
accept(ID);
accept(EQ);
expression();
}
public void expression() {
int token = peek();
switch(token) {
case ID:
accept(ID);
break;
case NUMERAL:
accept(NUMERAL);
break;
case NOT:
accept(NOT);
expression();
break;
default:
error("Unexpected token: " + token);
break;
}
}
}
| [
"erik.bjareholt@gmail.com"
] | erik.bjareholt@gmail.com |
344f0435d69f0967376a4dc679d1ee09281e51a3 | 97d95ad49efb83a2e5be5df98534dc777a955154 | /applications/plugins/org.csstudio.swt.widgets/src/org/csstudio/swt/widgets/datadefinition/IntArrayWrapper.java | da629e5644e9c0acd342b54e4df5950afb154073 | [] | no_license | bekumar123/cs-studio | 61aa64d30bce53b22627a3d98237d40531cf7789 | bc24a7e2d248522af6b2983588be3b72d250505f | refs/heads/master | 2021-01-21T16:39:14.712040 | 2014-01-27T15:30:23 | 2014-01-27T15:30:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package org.csstudio.swt.widgets.datadefinition;
/**A wrapper for int[].
* @author Xihui Chen
*
*/
public class IntArrayWrapper implements IPrimaryArrayWrapper {
private int[] data;
public IntArrayWrapper(int[] data) {
this.data = data;
}
public void setData(int[] data) {
this.data = data;
}
public double get(int i) {
return data[i];
}
public int getSize() {
return data.length;
}
}
| [
"jan.hatje@desy.de"
] | jan.hatje@desy.de |
2fea341d30087ba9b2a603020f1f15e2be199a57 | 4efa5d3c2a0e3c84854737bf4bad12fcd5e9eb19 | /app/src/main/java/com/example/shuvendufirsttest/MainActivity.java | 28b60c9cd3072e5c0dce8f9d52952e3ad1663a77 | [] | no_license | shuvenduoffline/sampleApp | 6ceb001d5f265b1769f1c17360e5d9e4e1bd3570 | 06620a7cd3568ab4c2b72944db211b56c7fe4bdf | refs/heads/master | 2020-07-24T16:40:03.358823 | 2019-09-12T07:00:36 | 2019-09-12T07:00:36 | 207,985,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package com.example.shuvendufirsttest;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"shuvenduoffline@gmail.com"
] | shuvenduoffline@gmail.com |
19823185b7b8d09190d4e178ffe4b514b6e54fa7 | 23773dfb710452d6864e2a6039e36c62a7427e7a | /order-service/src/main/java/com/example/MSA_web/jpa/OrderRepository.java | 8fd32511fcc2be6ce5179719c5ef7c71b75956ea | [] | no_license | jje951122/Spring_Cloud-MSA_web | 351a4bc0d05da8f4a4a996d06b4486cec531df31 | f170f782a655252eb71cd23a8b822be7125334b0 | refs/heads/main | 2023-07-30T17:20:11.691683 | 2021-09-16T10:54:20 | 2021-09-16T10:54:20 | 407,122,060 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.example.MSA_web.jpa;
import org.springframework.data.repository.CrudRepository;
public interface OrderRepository extends CrudRepository<OrderEntity, Long> {
OrderEntity findByOrderId(String orderId);
Iterable<OrderEntity> findByUserId(String userId);
}
| [
"github.com/jje951122"
] | github.com/jje951122 |
0dfc7421b5e2de7a78bc1f8e7b27605656415a0a | 8aafdacfb0f594208e7b1364d293bed07790bfe9 | /springboot-sxgdhz/sxgdhz/sxgdhz-common/src/main/java/com/ruoyi/common/openoffice/ProcessPoolOfficeManager.java | a3442925366bd2cd378f0e140f22ce26828f5db2 | [] | no_license | sxgdhz226/sxgdhz-admin | 722221b989610314aa28bbf2f90c73cb2beaa08f | eb9b4c2288b5d523b9d1819eab631a06c65076ca | refs/heads/master | 2020-04-02T12:47:23.557097 | 2018-11-12T02:37:34 | 2018-11-12T02:37:34 | 154,451,851 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,069 | java | //
// JODConverter - Java OpenDocument Converter
// Copyright 2004-2012 Mirko Nasato and contributors
//
// JODConverter is Open Source software, you can redistribute it and/or
// modify it under either (at your option) of the following licenses
//
// 1. The GNU Lesser General Public License v3 (or later)
// -> http://www.gnu.org/licenses/lgpl-3.0.txt
// 2. The Apache License, Version 2.0
// -> http://www.apache.org/licenses/LICENSE-2.0.txt
//
package com.ruoyi.common.openoffice;
import com.ruoyi.common.openoffice.process.ProcessManager;
import java.io.File;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
class ProcessPoolOfficeManager implements OfficeManager {
private final BlockingQueue<PooledOfficeManager> pool;
private final PooledOfficeManager[] pooledManagers;
private final long taskQueueTimeout;
private volatile boolean running = false;
private final Logger logger = Logger.getLogger(ProcessPoolOfficeManager.class.getName());
public ProcessPoolOfficeManager(File officeHome, UnoUrl[] unoUrls, String[] runAsArgs, File templateProfileDir, File workDir,
long retryTimeout, long taskQueueTimeout, long taskExecutionTimeout, int maxTasksPerProcess,
ProcessManager processManager) {
this.taskQueueTimeout = taskQueueTimeout;
pool = new ArrayBlockingQueue<PooledOfficeManager>(unoUrls.length);
pooledManagers = new PooledOfficeManager[unoUrls.length];
for (int i = 0; i < unoUrls.length; i++) {
PooledOfficeManagerSettings settings = new PooledOfficeManagerSettings(unoUrls[i]);
settings.setRunAsArgs(runAsArgs);
settings.setTemplateProfileDir(templateProfileDir);
settings.setWorkDir(workDir);
settings.setOfficeHome(officeHome);
settings.setRetryTimeout(retryTimeout);
settings.setTaskExecutionTimeout(taskExecutionTimeout);
settings.setMaxTasksPerProcess(maxTasksPerProcess);
settings.setProcessManager(processManager);
pooledManagers[i] = new PooledOfficeManager(settings);
}
logger.info("ProcessManager implementation is " + processManager.getClass().getSimpleName());
}
public synchronized void start() throws OfficeException {
for (int i = 0; i < pooledManagers.length; i++) {
pooledManagers[i].start();
releaseManager(pooledManagers[i]);
}
running = true;
}
public void execute(OfficeTask task) throws IllegalStateException, OfficeException {
if (!running) {
throw new IllegalStateException("this OfficeManager is currently stopped");
}
PooledOfficeManager manager = null;
try {
manager = acquireManager();
if (manager == null) {
throw new OfficeException("no office manager available");
}
manager.execute(task);
} finally {
if (manager != null) {
releaseManager(manager);
}
}
}
public synchronized void stop() throws OfficeException {
running = false;
logger.info("stopping");
pool.clear();
for (int i = 0; i < pooledManagers.length; i++) {
pooledManagers[i].stop();
}
logger.info("stopped");
}
private PooledOfficeManager acquireManager() {
try {
return pool.poll(taskQueueTimeout, TimeUnit.MILLISECONDS);
} catch (InterruptedException interruptedException) {
throw new OfficeException("interrupted", interruptedException);
}
}
private void releaseManager(PooledOfficeManager manager) {
try {
pool.put(manager);
} catch (InterruptedException interruptedException) {
throw new OfficeException("interrupted", interruptedException);
}
}
public boolean isRunning() {
return running;
}
}
| [
"1600328315@qq.com"
] | 1600328315@qq.com |
c070883afe1037a85a92f6ed84c3c59b4b9fb003 | 8f8b5f8b802f83c614ad78af032fe9936e5ffb6e | /enterprise-web-services-camel/src/main/java/hmh/sap/rfc/ZvrelationType.java | 4258c89f25657cfdbaf0f7589a80d3eb1db0e38c | [] | no_license | praveen4students/hmh_backup | 1b8d54bfa241f5a6412ef2423f1547d6262a530c | 45630529b61126976ee0663d9f78b60690a65df7 | refs/heads/master | 2022-01-05T12:09:18.641190 | 2019-05-01T18:30:30 | 2019-05-01T18:30:30 | 114,189,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,458 | java | package hmh.sap.rfc;
public class ZvrelationType extends com.sap.aii.proxy.framework.core.AbstractType{
private static final com.sap.aii.proxy.framework.core.BaseTypeDescriptor staticDescriptor ;
private static final com.sap.aii.proxy.framework.core.GenerationInfo staticGenerationInfo = new com.sap.aii.proxy.framework.core.GenerationInfo("2.0", 1329337766957L) ;
private ZvrelationType.MetaData metadata = new MetaData(this) ;
static {
com.sap.aii.proxy.framework.core.BaseTypeDescriptor descriptor = createNewBaseTypeDescriptor(com.sap.aii.proxy.framework.core.XsdlConstants.XSDL_COMPLEX_TYPE, "urn:sap-com:document:sap:rfc:functions", "ZVRELATION", 1, 0, hmh.sap.rfc.ZvrelationType.class, com.sap.aii.proxy.framework.core.FactoryConstants.CONNECTION_TYPE_JCO, "ZVRELATION", 2, 4, -1, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<s0:type name=\"ZVRELATION\" xmlns:s0=\"urn:sap-com:document:sap:rfc:functions\"><ifr:container xmlns:ifr=\"urn:sap-com:ifr:v2:metamodel\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><ifr:descriptor><ifr:description language=\"en\">Structure for Relationships of customers</ifr:description></ifr:descriptor><ifr:properties><ifr:sourceSystem /><ifr:sourceClient>100</ifr:sourceClient><ifr:release>620 </ifr:release><ifr:category>structure</ifr:category><ifr:unicode1>true</ifr:unicode1><ifr:unicode2>true</ifr:unicode2><ifr:isFlatStructure>true</ifr:isFlatStructure></ifr:properties><ifr:definition><ifr:internalLength1>2</ifr:internalLength1><ifr:internalLength2>4</ifr:internalLength2></ifr:definition></ifr:container></s0:type>");
descriptorSetElementProperties(descriptor, 0, "PARVW", null, null, "unqualified", "http://www.w3.org/2001/XMLSchema:string", "urn:sap-com:document:sap:rfc:functions", false, 0, 1, false, null, "Parvw", java.lang.String.class, null, new java.lang.String[][]{{"maxLength", "2"}}, "PARVW", 0, 0, -1, 2, 4, -1, com.sap.mw.jco.JCO.TYPE_CHAR, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ifr:field name=\"PARVW\" category=\"simple\"><ifr:descriptor><ifr:description language=\"en\">Partner function</ifr:description></ifr:descriptor><ifr:properties><ifr:helpValuesSupported>false</ifr:helpValuesSupported><ifr:offset1>0</ifr:offset1><ifr:offset2>0</ifr:offset2></ifr:properties><ifr:definition><ifr:scalarType name=\"PARVW\"><ifr:properties><ifr:helpValuesSupported>false</ifr:helpValuesSupported><ifr:fixedValuesListDefined>false</ifr:fixedValuesListDefined><ifr:mixedCaseSupported>false</ifr:mixedCaseSupported><ifr:signedNumber>false</ifr:signedNumber></ifr:properties><ifr:definition><ifr:type>CHAR</ifr:type><ifr:abapType>C</ifr:abapType><ifr:length>2</ifr:length><ifr:internalLength1>2</ifr:internalLength1><ifr:internalLength2>4</ifr:internalLength2><ifr:decimals>0</ifr:decimals><ifr:outputLength>2</ifr:outputLength><ifr:conversionExit>PARVW</ifr:conversionExit></ifr:definition></ifr:scalarType></ifr:definition></ifr:field>");
staticDescriptor = descriptor;
}
protected ZvrelationType (com.sap.aii.proxy.framework.core.BaseTypeDescriptor descriptor, com.sap.aii.proxy.framework.core.GenerationInfo staticGenerationInfo, int connectionType) {
super(descriptor, staticGenerationInfo, connectionType);
}
public ZvrelationType () {
super(staticDescriptor, staticGenerationInfo, com.sap.aii.proxy.framework.core.FactoryConstants.CONNECTION_TYPE_JCO);
}
public void setParvw(java.lang.String Parvw) {
baseTypeData().setElementValue(0, Parvw);
}
public java.lang.String getParvw() {
return (java.lang.String)baseTypeData().getElementValueAsString(0);
}
public MetaData metadata() {
return metadata;
}
public static class MetaData implements java.io.Serializable {
private ZvrelationType parent ;
private static final long serialVersionUID = -386313361L ;
protected MetaData (ZvrelationType parent) {
this.parent = parent;
}
public com.sap.aii.proxy.framework.core.TypeMetaData typeMetadata() {
return (com.sap.aii.proxy.framework.core.TypeMetaData)parent.baseTypeMetaData();
}
public com.sap.aii.proxy.framework.core.JcoMetaData getParvw() {
return (com.sap.aii.proxy.framework.core.JcoMetaData)parent.baseTypeMetaData().getElement(0);
}
}
}
| [
"praveen.dyamappa@gmail.com"
] | praveen.dyamappa@gmail.com |
d73574eb2cc04a2260de3242fa689d25c119f953 | 7d33dc35747cd5b703082e0551e17615c8e9f01e | /app/src/test/java/com/example/money_manager/ExampleUnitTest.java | ea13ceb9752e1bce1f8e918bef8a789f9a97da4f | [] | no_license | HaAnhHung/Money_Manager | 7442f4d532609371da97b1e6079009c08e3921a9 | 82af8632ec964561bb9ca8b9d758df62f11433a1 | refs/heads/master | 2022-11-25T04:44:58.710978 | 2020-07-29T13:22:19 | 2020-07-29T13:22:19 | 282,345,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.example.money_manager;
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);
}
} | [
"hahunguetk62@gmail.com"
] | hahunguetk62@gmail.com |
056c17db7f3d077b706f1721c0fba1fba16933c5 | 1abfe17ced88681475e3ecb51d72533231cd14ab | /mifosng-provider/src/main/java/org/mifosng/platform/loanschedule/domain/DecliningBalanceMethodLoanScheduleGenerator.java | f1cf01dbf4725a39a84868a3fa8b84f28f98491d | [] | no_license | hugotechnologies/mifosx | 46b28b75074140652538f0776067c3a9392cd1a5 | b4faea9e5efd2f09b9919c6e45cee011c90a4fec | refs/heads/master | 2020-12-30T18:58:28.937613 | 2012-07-28T06:56:49 | 2012-07-28T06:56:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,782 | java | package org.mifosng.platform.loanschedule.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.mifosng.platform.api.data.CurrencyData;
import org.mifosng.platform.api.data.LoanSchedule;
import org.mifosng.platform.api.data.MoneyData;
import org.mifosng.platform.api.data.ScheduledLoanInstallment;
import org.mifosng.platform.currency.domain.MonetaryCurrency;
import org.mifosng.platform.currency.domain.Money;
import org.mifosng.platform.loan.domain.AmortizationMethod;
import org.mifosng.platform.loan.domain.LoanProductRelatedDetail;
public class DecliningBalanceMethodLoanScheduleGenerator implements
LoanScheduleGenerator {
private final ScheduledDateGenerator scheduledDateGenerator = new DefaultScheduledDateGenerator();
private final PaymentPeriodsInOneYearCalculator paymentPeriodsInOneYearCalculator = new DefaultPaymentPeriodsInOneYearCalculator();
private final PeriodicInterestRateCalculator periodicInterestRateCalculator = new PeriodicInterestRateCalculator();
private final PmtCalculator pmtCalculator = new PmtCalculator();
@Override
public LoanSchedule generate(
final LoanProductRelatedDetail loanScheduleInfo,
final LocalDate disbursementDate,
final LocalDate firstRepaymentDate,
final LocalDate interestCalculatedFrom, CurrencyData currencyData) {
List<ScheduledLoanInstallment> scheduledLoanInstallments = new ArrayList<ScheduledLoanInstallment>();
// 1. generate valid set of 'due dates' based on some of the 'loan attributes'
List<LocalDate> scheduledDates = this.scheduledDateGenerator.generate(loanScheduleInfo, disbursementDate, firstRepaymentDate);
// 2. determine the 'periodic' interest rate based on the 'repayment periods' so we can use
final BigDecimal periodInterestRateForRepaymentPeriod = this.periodicInterestRateCalculator.calculateFrom(loanScheduleInfo);
// 3. determine 'total payment' for each repayment based on pmt function (and hence the total due overall)
final MonetaryCurrency monetaryCurrency = loanScheduleInfo.getPrincipal().getCurrency();
final Money totalDuePerInstallment = this.pmtCalculator.calculatePaymentForOnePeriodFrom(loanScheduleInfo, periodInterestRateForRepaymentPeriod, monetaryCurrency);
final Money totalDue = this.pmtCalculator.calculateTotalRepaymentFrom(loanScheduleInfo, periodInterestRateForRepaymentPeriod, monetaryCurrency);
Money totalInterestDue = totalDue.minus(loanScheduleInfo.getPrincipal());
Money outstandingBalance = loanScheduleInfo.getPrincipal();
Money totalPrincipal = Money.zero(monetaryCurrency);
Money totalInterest = Money.zero(monetaryCurrency);
LocalDate idealDisbursementDateBasedOnFirstRepaymentDate = this.scheduledDateGenerator.idealDisbursementDateBasedOnFirstRepaymentDate(loanScheduleInfo, scheduledDates);
double interestCalculationGraceOnRepaymentPeriodFraction = this.paymentPeriodsInOneYearCalculator.calculateRepaymentPeriodAsAFractionOfDays(loanScheduleInfo.getRepaymentPeriodFrequencyType(),
loanScheduleInfo.getRepayEvery(), interestCalculatedFrom, scheduledDates, idealDisbursementDateBasedOnFirstRepaymentDate);
LocalDate startDate = disbursementDate;
int installmentNumber = 1;
for (LocalDate scheduledDueDate : scheduledDates) {
// number of days from startDate to this scheduledDate
int daysInPeriod = Days.daysBetween(startDate.toDateMidnight().toDateTime(), scheduledDueDate.toDateMidnight().toDateTime()).getDays();
Money interestForInstallment = this.periodicInterestRateCalculator.calculateInterestOn(outstandingBalance, periodInterestRateForRepaymentPeriod, daysInPeriod, loanScheduleInfo);
Money principalForInstallment = this.periodicInterestRateCalculator.calculatePrincipalOn(totalDuePerInstallment, interestForInstallment, loanScheduleInfo);
if (interestCalculationGraceOnRepaymentPeriodFraction >= Integer.valueOf(1).doubleValue()) {
Money graceOnInterestForRepaymentPeriod = interestForInstallment;
interestForInstallment = interestForInstallment.minus(graceOnInterestForRepaymentPeriod);
totalInterestDue = totalInterestDue.minus(graceOnInterestForRepaymentPeriod);
interestCalculationGraceOnRepaymentPeriodFraction = interestCalculationGraceOnRepaymentPeriodFraction - Integer.valueOf(1).doubleValue();
} else if (interestCalculationGraceOnRepaymentPeriodFraction > Double.valueOf("0.25") && interestCalculationGraceOnRepaymentPeriodFraction < Integer.valueOf(1).doubleValue()) {
Money graceOnInterestForRepaymentPeriod = interestForInstallment.multipliedBy(interestCalculationGraceOnRepaymentPeriodFraction);
interestForInstallment = interestForInstallment.minus(graceOnInterestForRepaymentPeriod);
totalInterestDue = totalInterestDue.minus(graceOnInterestForRepaymentPeriod);
interestCalculationGraceOnRepaymentPeriodFraction = Double.valueOf("0");
}
totalPrincipal = totalPrincipal.plus(principalForInstallment);
totalInterest = totalInterest.plus(interestForInstallment);
if (installmentNumber == loanScheduleInfo.getNumberOfRepayments()) {
Money principalDifference = totalPrincipal.minus(loanScheduleInfo.getPrincipal());
if (principalDifference.isLessThanZero()) {
principalForInstallment = principalForInstallment.plus(principalDifference.abs());
} else if (principalDifference.isGreaterThanZero()) {
principalForInstallment = principalForInstallment.minus(principalDifference.abs());
}
if (loanScheduleInfo.getAmortizationMethod().equals(
AmortizationMethod.EQUAL_INSTALLMENTS)) {
Money interestDifference = totalInterest.minus(totalInterestDue);
if (interestDifference.isLessThanZero()) {
interestForInstallment = interestForInstallment.plus(interestDifference.abs());
} else if (interestDifference.isGreaterThanZero()) {
interestForInstallment = interestForInstallment.minus(interestDifference.abs());
}
}
}
Money totalInstallmentDue = principalForInstallment.plus(interestForInstallment);
outstandingBalance = outstandingBalance.minus(principalForInstallment);
MoneyData principalPerInstallmentValue = MoneyData.of(currencyData, principalForInstallment.getAmount());
MoneyData interestPerInstallmentValue = MoneyData.of(currencyData, interestForInstallment.getAmount());
MoneyData totalInstallmentDueValue = MoneyData.of(currencyData, totalInstallmentDue.getAmount());
MoneyData outstandingBalanceValue = MoneyData.of(currencyData, outstandingBalance.getAmount());
ScheduledLoanInstallment installment = new ScheduledLoanInstallment(
Integer.valueOf(installmentNumber), startDate,
scheduledDueDate, principalPerInstallmentValue,
interestPerInstallmentValue,
totalInstallmentDueValue,
outstandingBalanceValue);
scheduledLoanInstallments.add(installment);
startDate = scheduledDueDate;
installmentNumber++;
}
return new LoanSchedule(scheduledLoanInstallments);
}
/**
* Future value of an amount given the number of payments, rate, amount of
* individual payment, present value and boolean value indicating whether
* payments are due at the beginning of period (false => payments are due at
* end of period)
*
* @param r
* rate
* @param n
* num of periods
* @param y
* pmt per period
* @param p
* future value
* @param t
* type (true=pmt at end of period, false=pmt at begining of
* period)
*/
public static double fv(double r, double n, double y, double p, boolean t) {
double retval = 0;
if (r == 0) {
retval = -1 * (p + (n * y));
} else {
double r1 = r + 1;
retval = ((1 - Math.pow(r1, n)) * (t ? r1 : 1) * y) / r - p
* Math.pow(r1, n);
}
return retval;
}
/**
* Present value of an amount given the number of future payments, rate,
* amount of individual payment, future value and boolean value indicating
* whether payments are due at the beginning of period (false => payments
* are due at end of period)
*
* @param r
* @param n
* @param y
* @param f
* @param t
*/
public static double pv(double r, double n, double y, double f, boolean t) {
double retval = 0;
if (r == 0) {
retval = -1 * ((n * y) + f);
} else {
double r1 = r + 1;
retval = (((1 - Math.pow(r1, n)) / r) * (t ? r1 : 1) * y - f)
/ Math.pow(r1, n);
}
return retval;
}
/**
* calculates the Net Present Value of a principal amount given the discount
* rate and a sequence of cash flows (supplied as an array). If the amounts
* are income the value should be positive, else if they are payments and
* not income, the value should be negative.
*
* @param r
* @param cfs
* cashflow amounts
*/
public static double npv(double r, double[] cfs) {
double npv = 0;
double r1 = r + 1;
double trate = r1;
for (int i = 0, iSize = cfs.length; i < iSize; i++) {
npv += cfs[i] / trate;
trate *= r1;
}
return npv;
}
/**
* PMT calculates a fixed monthly payment to be paid by borrower every 'period' to ensure loan is paid off in full (with interest).
*
* This monthly payment c depends upon
* the monthly interest rate r (expressed as a fraction, not a percentage,
* i.e., divide the quoted yearly percentage rate by 100 and by 12 to obtain
* the monthly interest rate), the number of monthly payments N called the
* loan's term, and the amount borrowed P known as the loan's principal; c
* is given by the formula:
*
* c = (r / (1 - (1 + r)^-N))P
*
* @param interestRateFraction
* @param numberOfPayments
* @param principal
* @param futureValue
* @param type
*/
public static double pmt(double interestRateFraction, double numberOfPayments, double principal, double futureValue, boolean type) {
double payment = 0;
if (interestRateFraction == 0) {
payment = -1 * (futureValue + principal) / numberOfPayments;
} else {
double r1 = interestRateFraction + 1;
payment = (futureValue + principal * Math.pow(r1, numberOfPayments)) * interestRateFraction
/ ((type ? r1 : 1) * (1 - Math.pow(r1, numberOfPayments)));
}
return payment;
}
/**
*
* @param r
* @param y
* @param p
* @param f
* @param t
*/
public static double nper(double r, double y, double p, double f, boolean t) {
double retval = 0;
if (r == 0) {
retval = -1 * (f + p) / y;
} else {
double r1 = r + 1;
double ryr = (t ? r1 : 1) * y / r;
double a1 = ((ryr - f) < 0) ? Math.log(f - ryr) : Math.log(ryr - f);
double a2 = ((ryr - f) < 0) ? Math.log(-p - ryr) : Math
.log(p + ryr);
double a3 = Math.log(r1);
retval = (a1 - a2) / a3;
}
return retval;
}
} | [
"keithwoodlock@gmail.com"
] | keithwoodlock@gmail.com |
bf4318163d1fb640e48ecfedffd331da1c16dade | c66de32d4b0f5167a9aea9d1a39819d9993be5c4 | /MyHM/app/src/main/java/com/example/myhm/NewReport.java | 894bb92187c035310515a9d5c56071a6191127cb | [] | no_license | simonettimartino/LAM | 99abaad2346b8d8d10ac53026754b9dc55728463 | 60f14424a5383a1680112bda3f43cd0f71cb867d | refs/heads/master | 2022-12-19T00:46:59.606792 | 2020-09-11T11:15:47 | 2020-09-11T11:15:47 | 262,596,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,156 | java | package com.example.myhm;
import android.app.DatePickerDialog;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.content.SharedPreferences;
import java.util.Calendar;
import static android.content.Context.MODE_PRIVATE;
public class NewReport extends Fragment implements AdapterView.OnItemSelectedListener {
private static final String TAG = "MainActivity";
public static final String SHARED_PREFS = "sharedPrefs";
private Spinner spinnerPeso, spinnerTemperatura, spinnerGlicemia;
private Button nuovoReport, aggiornaPriorita;
private EditText peso, temperatura, glicemia, note;
private int j, priorita, prioritaPeso, prioritaTemperatura, prioritaGlicemia;
private TextView data;
private String date;
private DatePickerDialog.OnDateSetListener mDateSetListener;
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_newreport, container, false);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(),
R.array.priority,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
nuovoReport = view.findViewById(R.id.buttonInviaR);
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
peso = view.findViewById(R.id.datoPeso);
temperatura = view.findViewById(R.id.datoTemperatura);
glicemia = view.findViewById(R.id.datoGlicemia);
note = view.findViewById(R.id.datoNote);
data = view.findViewById(R.id.datoData);
spinnerPeso = view.findViewById(R.id.prioritaPeso);
spinnerPeso.setAdapter(adapter);
spinnerPeso.setOnItemSelectedListener(this);
spinnerTemperatura = view.findViewById(R.id.prioritaTemperatura);
spinnerTemperatura.setAdapter(adapter);
spinnerTemperatura.setOnItemSelectedListener(this);
spinnerGlicemia = view.findViewById(R.id.prioritaGlicemia);
spinnerGlicemia.setAdapter(adapter);
spinnerGlicemia.setOnItemSelectedListener(this);
int kg = sharedPreferences.getInt("peso", 0);
spinnerPeso.setSelection(kg - 1);
int gc = sharedPreferences.getInt("temperatura", 0);
spinnerTemperatura.setSelection(gc - 1);
int gl = sharedPreferences.getInt("glicemia", 0);
spinnerGlicemia.setSelection(gl - 1);
data = (TextView) view.findViewById(R.id.datoData);
data.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
int day = cal.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dialog = new DatePickerDialog(
getActivity(),
android.R.style.Theme_Holo_Light_Dialog_MinWidth,
mDateSetListener,
year,month,day);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
});
mDateSetListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int year, int month, int day) {
month = month + 1;
Log.d(TAG, "onDateSet: mm/dd/yyy: " + month + "/" + day + "/" + year);
date = month + "/" + day + "/" + year;
data.setText(date);
}
};
aggiornaPriorita = view.findViewById(R.id.newPrio);
aggiornaPriorita.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt("peso", Integer.parseInt(spinnerPeso.getSelectedItem().toString()));
editor.putInt("temperatura",Integer.parseInt(spinnerTemperatura.getSelectedItem().toString()));
editor.putInt("glicemia",Integer.parseInt(spinnerGlicemia.getSelectedItem().toString()));
editor.apply();
}
});
nuovoReport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Reports rep = new Reports();
SharedPreferences sharedPreferences = getActivity().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
if (peso.getText().length() != 0 &&
temperatura.getText().length() != 0 &&
glicemia.getText().length() != 0 &&
data.getText().length() != 0) {
rep.setPeso(new Tupla(Double.parseDouble(peso.getText().toString()),Integer.parseInt(spinnerPeso.getSelectedItem().toString())));
editor.putInt("peso", Integer.parseInt(spinnerPeso.getSelectedItem().toString()));
rep.setTemperatura(new Tupla(Double.parseDouble(temperatura.getText().toString()),Integer.parseInt(spinnerTemperatura.getSelectedItem().toString())));
editor.putInt("temperatura",Integer.parseInt(spinnerTemperatura.getSelectedItem().toString()));
rep.setGlicemia(new Tupla(Double.parseDouble(glicemia.getText().toString()),Integer.parseInt(spinnerGlicemia.getSelectedItem().toString())));
editor.putInt("glicemia",Integer.parseInt(spinnerGlicemia.getSelectedItem().toString()));
editor.apply();
rep.setPriorita((Integer.parseInt(spinnerPeso.getSelectedItem().toString()) +
Integer.parseInt(spinnerTemperatura.getSelectedItem().toString()) +
Integer.parseInt(spinnerGlicemia.getSelectedItem().toString()))/3);
if (note.getText().length() != 0){
rep.setNote(note.getText().toString());
} else {
rep.setNote("");
}
rep.setData(date);
new AsyncTaskAggiungiReport().execute(rep);
peso.setText("");
temperatura.setText("");
glicemia.setText("");
data.setText("");
note.setText("");
int kg = sharedPreferences.getInt("peso", 0);
spinnerPeso.setSelection(kg - 1);
int gc = sharedPreferences.getInt("temperatura", 0);
spinnerTemperatura.setSelection(gc - 1);
int gl = sharedPreferences.getInt("glicemia", 0);
spinnerGlicemia.setSelection(gl - 1);
// Toast.makeText(view.getContext(), "Report inserito!", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(view.getContext(), "Inserici tutti i dati!", Toast.LENGTH_SHORT).show();
}
}
}
);
return view;
}
public class AsyncTaskAggiungiReport extends AsyncTask<Reports, Void, Void> {
@Override
protected Void doInBackground(Reports... report) {
MainActivity.appDatabase.dataAccessObject().aggiungiReport(report[0]);
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
Toast.makeText(getActivity(), "Report aggiunto",
Toast.LENGTH_LONG).show();
}
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
String text = adapterView.getItemAtPosition(i).toString();
j = Integer.parseInt(text);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
}
| [
"simonettimartino@gmai.com"
] | simonettimartino@gmai.com |
f4aa598b415f85c8b7361ecaea01550bc0b3872d | b1032f56672858150688a0c6952816d02940368d | /src/main/java/com/rua/redis/dao/IBaseDao.java | 53cacbddc1f583a6b7148e6d10f268ea1a0d3bcf | [] | no_license | StrongRua/gmds | 04deea2e3f71030ff31f05000af44f17c14dcc73 | 654ce75d6db8ccf17969f374d62bf377a31bac47 | refs/heads/master | 2020-06-15T09:32:24.134017 | 2016-12-03T11:29:05 | 2016-12-03T11:29:05 | 75,303,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | package com.rua.redis.dao;
import org.springframework.data.redis.core.RedisTemplate;
/**
* Created by Jacky on 2016/4/9.
*/
public interface IBaseDao<T> {
/**
* Spring
*
* @param redisTemplate
*/
// void setRedisTemplate(RedisTemplate<String, String> redisTemplate);
/**
* 保存对象
*
* @param t
* @return
*/
int save(T t);
/**
* 删除指定的对象
*
* @param key
* @return
*/
int delete(String key);
/**
* 修改对象
*
* @param t
*/
int update(T t);
/**
* 查询指定的对象
*
* @param key
* @return
*/
T get(String key);
/**
* 查询数据条数
*
* @return 总条数
*/
long getCount();
}
| [
"chimesi@live.com"
] | chimesi@live.com |
0f2b3857b02ea46a2a19889d9639e7b326180cfa | 731f38f02c581aba08248228a695014220ce474e | /widgetalarm/app/src/main/java/com/daeseong/widgetalarm/AlarmWidget.java | 8dd0681cfba7db9624174ebbb78f2c2f19c03f4a | [] | no_license | ImDaeseong/WidgetNService_test | 5a4ec704baf5b8f55ec10ca1f3f4d746fd56692f | aa621626f96756f81635f1b82cfd40f032a8e3da | refs/heads/master | 2022-10-11T03:45:14.049051 | 2022-09-21T22:16:07 | 2022-09-21T22:16:07 | 215,185,753 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,555 | java | package com.daeseong.widgetalarm;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.RemoteViews;
import java.text.SimpleDateFormat;
import java.util.Date;
public class AlarmWidget extends AppWidgetProvider {
private static final String TAG = AlarmWidget.class.getSimpleName();
private PendingIntent pendingIntent = null;
private long lMin = 1000 * 60 * 1;// Millisec * Second * Minute
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) {
Log.i(TAG, "updateAppWidget");
try {
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.alarm_widget);
remoteViews.setTextViewText(R.id.tv1, getTimeDate());
appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
}catch (Exception ex){
Log.i(TAG, ex.getMessage().toString());
}
}
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
Log.i(TAG, "onUpdate");
try {
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
Intent intent = new Intent(context, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), lMin, pendingIntent);
}catch (Exception ex){
Log.i(TAG, ex.getMessage().toString());
}
}
@Override
public void onEnabled(Context context) {
Log.i(TAG, "onEnabled");
}
@Override
public void onDisabled(Context context) {
Log.i(TAG, "onDisabled");
try {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}catch (Exception ex){
Log.i(TAG, ex.getMessage().toString());
}
}
private static String getTimeDate() {
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
return dateFormat.format(new Date());
}
}
| [
"cs93059@gmail.com"
] | cs93059@gmail.com |
bf3586caecf2c031d47a8bfdb53e35c0db30bbeb | 89a09e9daa8c5c817d129404d381f1c5fec61c08 | /eHour-wicketweb/src/main/java/net/rrm/ehour/ui/report/page/GlobalReportPage.java | aa23616e2326ee8f4c5e2d9ccbeb47f1e1c6a56c | [] | no_license | nolith/ehour | 6a57c5661c6dcef595722053ae656e265d680a4c | dbb1b9c128383aff0aed4454866d7aee90492415 | refs/heads/master | 2021-01-15T22:52:37.986322 | 2012-05-09T23:11:42 | 2012-05-09T23:11:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,905 | java | /*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.rrm.ehour.ui.report.page;
import java.util.ArrayList;
import java.util.List;
import net.rrm.ehour.report.criteria.ReportCriteria;
import net.rrm.ehour.ui.common.event.AjaxEvent;
import net.rrm.ehour.ui.common.model.KeyResourceModel;
import net.rrm.ehour.ui.report.page.command.DefaultGlobalReportPageAggregateCommand;
import net.rrm.ehour.ui.report.page.command.DefaultGlobalReportPageDetailedCommand;
import net.rrm.ehour.ui.report.page.command.GlobalReportPageAggregateCommand;
import net.rrm.ehour.ui.report.page.command.GlobalReportPageDetailedCommand;
import net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaAjaxEventType;
import net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaBackingBean;
import net.rrm.ehour.ui.report.panel.criteria.ReportCriteriaPanel;
import net.rrm.ehour.ui.report.panel.criteria.ReportTabbedPanel;
import net.rrm.ehour.ui.report.panel.criteria.type.ReportType;
import org.apache.wicket.authorization.strategies.role.annotations.AuthorizeInstantiation;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
/**
* Reporting
**/
@AuthorizeInstantiation("ROLE_CONSULTANT")
public class GlobalReportPage extends AbstractReportPage<ReportCriteriaBackingBean>
{
private static final long serialVersionUID = 6614404841734599622L;
private ReportTabbedPanel tabPanel;
private GlobalReportPageAggregateCommand aggregateCommand;
private GlobalReportPageDetailedCommand detailedCommand;
public GlobalReportPage()
{
this(new DefaultGlobalReportPageAggregateCommand(), new DefaultGlobalReportPageDetailedCommand());
}
public GlobalReportPage(GlobalReportPageAggregateCommand aggregateCommand, GlobalReportPageDetailedCommand detailedCommand)
{
super(new ResourceModel("report.global.title"));
this.aggregateCommand = aggregateCommand;
this.detailedCommand = detailedCommand;
final ReportCriteria reportCriteria = getReportCriteria();
final IModel<ReportCriteriaBackingBean> model = new CompoundPropertyModel<ReportCriteriaBackingBean>(new ReportCriteriaBackingBean(reportCriteria));
setDefaultModel(model);
List<ITab> tabList = new ArrayList<ITab>();
tabList.add(new AbstractTab(new KeyResourceModel("report.criteria.title"))
{
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
@Override
public Panel getPanel(String panelId)
{
return new ReportCriteriaPanel(panelId, model);
}
});
tabPanel = new ReportTabbedPanel("reportContainer", tabList);
add(tabPanel);
}
@Override
public boolean ajaxEventReceived(AjaxEvent ajaxEvent)
{
if (ajaxEvent.getEventType() == ReportCriteriaAjaxEventType.CRITERIA_UPDATED)
{
ReportCriteriaBackingBean backingBean = (ReportCriteriaBackingBean)getDefaultModelObject();
clearTabs();
if (backingBean.getReportType().equals(ReportType.AGGREGATE))
{
addAggregateReportPanelTabs (backingBean);
}
else
{
addDetailedReportPanelTabs(backingBean);
}
ajaxEvent.getTarget().addComponent(tabPanel);
}
return false;
}
/**
* Clear tabs except for the first one
*/
private void clearTabs()
{
List<ITab> tabs = tabPanel.getTabs();
while (tabs.size() > 1)
{
tabs.remove(1);
}
}
private void addAggregateReportPanelTabs(ReportCriteriaBackingBean backingBean)
{
List<ITab> tabs = aggregateCommand.createAggregateReportTabs(backingBean);
addTabs(tabs);
tabPanel.setSelectedTab(1);
}
private void addTabs(List<ITab> tabs)
{
for (ITab iTab : tabs)
{
tabPanel.addTab(iTab);
}
}
private void addDetailedReportPanelTabs(ReportCriteriaBackingBean backingBean)
{
List<ITab> tabs = detailedCommand.createDetailedReportTabs(backingBean);
addTabs(tabs);
tabPanel.setSelectedTab(1);
}
}
| [
"thies@te-con.nl"
] | thies@te-con.nl |
ccaa4ea9bcc18e3722c60216147d0fe700c88b16 | 9f232e22cfc9d5366ea23689dac7fda97f72faf5 | /lab3/src/main/java/com/room414/hospital/commands/duty/GetDutiesList.java | c0c9dba603b87fc5327407dffc0fc45233a810e5 | [] | no_license | melalex/pi | 911528014f9cec0c14ae8bd0294b7ca16df6afaa | cc33d2d33a01cf3b69efb9990e723a2d1f063194 | refs/heads/master | 2021-07-05T00:38:33.148905 | 2017-09-28T19:50:39 | 2017-09-28T19:50:39 | 103,520,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,734 | java | package com.room414.hospital.commands.duty;
import com.room414.hospital.anotations.Route;
import com.room414.hospital.commands.iternal.AbstractCommand;
import com.room414.hospital.commands.iternal.ExecutionResult;
import com.room414.hospital.commands.iternal.Routes;
import com.room414.hospital.commands.iternal.Views;
import com.room414.hospital.contexts.ApplicationContext;
import com.room414.hospital.domain.Pageable;
import com.room414.hospital.resolvers.provider.ArgumentResolverProvider;
import com.room414.hospital.routing.internal.HttpMethod;
import com.room414.hospital.services.DutyService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Route(method = HttpMethod.GET, path = Routes.DUTIES_LIST)
public class GetDutiesList extends AbstractCommand {
private static final String LAST_NAME_PARAM = "lastName";
private final DutyService dutyService = ApplicationContext.getInstance().getDutyService();
private final ArgumentResolverProvider argumentResolverProvider = ApplicationContext.getInstance().getArgumentResolverProvider();
@Override
protected ExecutionResult doExecute(HttpServletRequest request) {
Pageable pageable = argumentResolverProvider.provide(Pageable.class).resolve(request);
String lastName = request.getParameter(LAST_NAME_PARAM);
return ExecutionResult.builder()
.path(Views.DUTIES_LIST)
.model(dutyService.findByLastName(lastName, pageable))
.statusCode(HttpServletResponse.SC_OK)
.type(ExecutionResult.Type.FORWARD)
.build();
}
@Override
protected String rollbackView() {
return Views.DUTIES_LIST;
}
}
| [
"oleksandr_melashchenko@epam.com"
] | oleksandr_melashchenko@epam.com |
b529f4de1c44dd1b9f49bab175721e92a8458df5 | 4509ce64829f7bf3f680f446c605eb60208ea992 | /app/src/main/java/me/amplitudo/networkingapp/ui/ui/slideshow/SlideshowFragment.java | 25f2b0123eb6f1b5de5277b8cf94af253fd1af3b | [] | no_license | stevyhacker/basic-networking-android | 1812a8f597b8137822edb37ad9cd199d847fc6a0 | 1a5c032398aad8b8dadf1ef8b3d77c87bccd844b | refs/heads/master | 2020-09-21T07:36:56.650654 | 2019-12-13T07:33:35 | 2019-12-13T07:33:35 | 224,728,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,360 | java | package me.amplitudo.networkingapp.ui.ui.slideshow;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import me.amplitudo.networkingapp.AnimeAdapter;
import me.amplitudo.networkingapp.R;
import me.amplitudo.networkingapp.models.Result;
import me.amplitudo.networkingapp.models.SearchResultsResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import static me.amplitudo.networkingapp.ApiClient.apiService;
public class SlideshowFragment extends Fragment {
private SlideshowViewModel slideshowViewModel;
private AnimeAdapter adapter;
private ArrayList<Result> animeResults = new ArrayList<>();
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
slideshowViewModel = ViewModelProviders.of(this).get(SlideshowViewModel.class);
View root = inflater.inflate(R.layout.fragment_slideshow, container, false);
final TextView textView = root.findViewById(R.id.text_slideshow);
slideshowViewModel.getText().observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
final SearchView searchView = root.findViewById(R.id.search_view);
adapter = new AnimeAdapter(getContext(), animeResults);
RecyclerView animeList = root.findViewById(R.id.results_recycler_view);
animeList.setAdapter(adapter);
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
fetchResults(query);
return false;
}
@Override
public boolean onQueryTextChange(String query) {
return false;
}
});
return root;
}
private void fetchResults(String query) {
apiService.getSearchResults(query).enqueue(new Callback<SearchResultsResponse>() {
@Override
public void onResponse(Call<SearchResultsResponse> call, Response<SearchResultsResponse> response) {
if (response.isSuccessful()) {
animeResults.clear();
animeResults.addAll(response.body().getResults());
adapter.notifyDataSetChanged();
// Toast.makeText(
// MainActivity.this,
// "Results: " + response.body().getResults().size(),
// Toast.LENGTH_SHORT).show();
} else
Toast.makeText(getContext(), "Server error", Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(Call<SearchResultsResponse> call, Throwable t) {
}
});
}
} | [
"stevyhacker@gmail.com"
] | stevyhacker@gmail.com |
e596fe90c6b36cb4d91bbee511bce188f2e30e0a | 69011b4a6233db48e56db40bc8a140f0dd721d62 | /log/com/jshx/log/web/UserBehaviorLogAction.java | d0f6d9f0b755aed9f430934685706dc2a08009f7 | [] | no_license | gechenrun/scysuper | bc5397e5220ee42dae5012a0efd23397c8c5cda0 | e706d287700ff11d289c16f118ce7e47f7f9b154 | refs/heads/master | 2020-03-23T19:06:43.185061 | 2018-06-10T07:51:18 | 2018-06-10T07:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,088 | java | package com.jshx.log.web;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import net.sf.json.JsonConfig;
import net.sf.json.util.PropertyFilter;
import org.springframework.beans.factory.annotation.Autowired;
import com.jshx.core.base.action.BaseAction;
import com.jshx.core.base.vo.Pagination;
import com.jshx.log.entity.UserBehaviorLog;
import com.jshx.log.service.UserBehaviorLogService;
public class UserBehaviorLogAction extends BaseAction
{
private static final long serialVersionUID = 3456585809753588018L;
/**
* 主键ID列表,用于接收页面提交的多条主键ID信息
*/
private String ids;
/**
* 实体类
*/
private UserBehaviorLog userBehaviorLog = new UserBehaviorLog();
/**
* 业务类
*/
@Autowired
private UserBehaviorLogService userBehaviorLogService;
/**
* 修改新增标记,add为新增、mod为修改
*/
private String flag;
/**
* 分页信息
*/
private Pagination pagination;
private Date queryLoggedDateStart;
private Date queryLoggedDateEnd;
/**
* 执行查询的方法,返回json数据
*
*/
public void list() throws Exception{
Map<String, Object> paraMap = new HashMap<String, Object>();
if(pagination==null)
pagination = new Pagination(this.getRequest());
if(null != userBehaviorLog){
paraMap.put("behaviorId", userBehaviorLog.getBehavior().getId());
}
paraMap.put("queryLoggedDateStart", queryLoggedDateStart);
paraMap.put("queryLoggedDateEnd", queryLoggedDateEnd);
pagination = userBehaviorLogService.findByPage(pagination, paraMap);
final String filter = "loggedDate|id|logContent|user|displayName|time|remoteIp|";
JsonConfig config = new JsonConfig();
config.setJsonPropertyFilter(new PropertyFilter(){
public boolean apply(Object source, String name, Object value) {
if(filter.indexOf(name+"|")!=-1)
return false;
else
return true;
}
});
try{
convObjectToJson(pagination,config);
}catch(Exception e){
e.printStackTrace();
}
}
public String userBehaviorLogList(){
return SUCCESS;
}
/**
* 查看详细信息
*/
public String view() throws Exception{
if((null != userBehaviorLog)&&(null != userBehaviorLog.getId()))
userBehaviorLog = userBehaviorLogService.getById(userBehaviorLog.getId());
return VIEW;
}
/**
* 初始化修改信息
*/
public String initEdit() throws Exception{
view();
return EDIT;
}
/**
* 保存信息(包括新增和修改)
*/
public String save() throws Exception{
if ("add".equalsIgnoreCase(this.flag)){
userBehaviorLog.setDeptId(this.getLoginUserDepartmentId());
userBehaviorLog.setDelFlag(0);
userBehaviorLogService.save(userBehaviorLog);
}else{
userBehaviorLogService.update(userBehaviorLog);
}
return RELOAD;
}
/**
* 删除信息
*/
public String delete() throws Exception{
try{
userBehaviorLogService.deleteWithFlag(ids);
this.getResponse().getWriter().println("{\"result\":\"true\"}");
}catch(Exception e){
this.getResponse().getWriter().println("{\"result\":\"false\"}");
}
return null;
}
public String getIds(){
return ids;
}
public void setIds(String ids){
this.ids = ids;
}
public Pagination getPagination(){
return pagination;
}
public void setPagination(Pagination pagination){
this.pagination = pagination;
}
public UserBehaviorLog getUserBehaviorLog(){
return this.userBehaviorLog;
}
public void setUserBehaviorLog(UserBehaviorLog userBehaviorLog){
this.userBehaviorLog = userBehaviorLog;
}
public String getFlag(){
return flag;
}
public void setFlag(String flag){
this.flag = flag;
}
public Date getQueryLoggedDateStart(){
return this.queryLoggedDateStart;
}
public void setQueryLoggedDateStart(Date queryLoggedDateStart){
this.queryLoggedDateStart = queryLoggedDateStart;
}
public Date getQueryLoggedDateEnd(){
return this.queryLoggedDateEnd;
}
public void setQueryLoggedDateEnd(Date queryLoggedDateEnd){
this.queryLoggedDateEnd = queryLoggedDateEnd;
}
}
| [
"shellchange@sina.com"
] | shellchange@sina.com |
962badc469cc03dd10069c088ccc887a3614418c | 9b02cf3b984f4ae0742965622a3819169601ab02 | /src/org/jiaowei/alarmRescue/controller/EntityIDFactory.java | e1248fb1c5eeb226d4de6bc7b0ba00f6a563b9c7 | [] | no_license | wujie1314/JWWX | 3576681cbda21b666e1107215ce3eff80ce6fa3b | f427e724d6586723b4e7f9cab4b7a73f0370abe9 | refs/heads/master | 2020-03-24T23:11:53.717943 | 2018-06-25T02:08:47 | 2018-06-25T02:08:47 | 143,122,859 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package org.jiaowei.alarmRescue.controller;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class EntityIDFactory {
private static final SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
private static String preId = "";
public static synchronized String createId(){
String id = format.format(Calendar.getInstance().getTime());
while(id.equals(preId)){
id = format.format(Calendar.getInstance().getTime());
}
preId = id;
return id;
}
}
| [
"1071384020@qq.com"
] | 1071384020@qq.com |
3c657464fbfe07ffab49875a459a193d613e8700 | 4bb83687710716d91b5da55054c04f430474ee52 | /dsrc/sku.0/sys.server/compiled/game/script/structure/structure_rollup.java | c218ee1a0d17d8b6b25cee92d6cd9b83779ea354 | [] | no_license | geralex/SWG-NGE | 0846566a44f4460c32d38078e0a1eb115a9b08b0 | fa8ae0017f996e400fccc5ba3763e5bb1c8cdd1c | refs/heads/master | 2020-04-06T11:18:36.110302 | 2018-03-19T15:42:32 | 2018-03-19T15:42:32 | 157,411,938 | 1 | 0 | null | 2018-11-13T16:35:01 | 2018-11-13T16:35:01 | null | UTF-8 | Java | false | false | 6,798 | java | package script.structure;
import script.*;
import script.base_class.*;
import script.combat_engine.*;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Vector;
import script.base_script;
import script.library.utils;
import script.library.player_structure;
import script.library.city;
import script.library.prose;
import script.library.trace;
import script.library.vendor_lib;
public class structure_rollup extends script.base_script
{
public structure_rollup()
{
}
public int OnDoStructureRollup(obj_id self, obj_id player, boolean warnOnly) throws InterruptedException
{
String structName = player_structure.getStructureName(self);
if (structName.length() < 1)
{
structName = "Structure";
}
location where = getLocation(self);
if (warnOnly)
{
string_id subject = new string_id("player_structure", "structure_purge_warning_subject");
string_id body = new string_id("player_structure", "structure_purge_warning_body");
prose_package pp = new prose_package();
prose.setStringId(pp, body);
prose.setTO(pp, getPlayerFullName(player));
String body_oob = chatMakePersistentMessageOutOfBandBody(null, pp);
String subject_str = "@" + subject.toString();
body_oob = chatAppendPersistentMessageWaypointData(body_oob, where.area, where.x, where.z, null, structName);
String[] admins = player_structure.getAdminListNames(self);
for (int i = 0; i < admins.length; ++i)
{
chatSendPersistentMessage("Galactic Housing Authority", admins[i], subject_str, null, body_oob);
}
if (city.isInCity(self))
{
int cityId = city.getStructureCityId(self);
if (cityId != 0)
{
obj_id mayor = cityGetLeader(cityId);
if (mayor != obj_id.NULL_ID)
{
chatSendPersistentMessage("Galactic Housing Authority", mayor, subject_str, null, body_oob);
}
}
}
obj_id nameTarget = self;
if (player_structure.isBuilding(nameTarget))
{
obj_id sign = getObjIdObjVar(nameTarget, player_structure.VAR_SIGN_ID);
if (isIdValid(sign))
{
nameTarget = sign;
}
}
String abandoned = " \\#FF0000\\(Abandoned)";
setName(nameTarget, structName + abandoned);
if (nameTarget != self)
{
setObjVar(self, player_structure.VAR_SIGN_NAME, structName + abandoned);
}
}
else
{
if (player_structure.isBuilding(self))
{
obj_id[] players = player_structure.getPlayersInBuilding(self);
if (players != null)
{
for (int i = 0; i < players.length; i++)
{
expelFromBuilding(players[i]);
}
}
String[] cells = getCellNames(self);
if (cells != null)
{
for (int i = 0; i < cells.length; i++)
{
obj_id cellid = getCellId(self, cells[i]);
obj_id contents[] = getContents(cellid);
if (contents != null)
{
for (int j = 0; j < contents.length; j++)
{
if (hasCondition(contents[j], CONDITION_VENDOR))
{
obj_id owner = getObjIdObjVar(contents[j], "vendor_owner");
if (!isIdValid(owner))
{
owner = getOwner(contents[j]);
}
vendor_lib.finalizePackUp(owner, contents[j], player, player_structure.isAbandoned(self));
}
}
}
}
}
}
obj_id scd = createObject("object/intangible/house/generic_house_control_device.iff", where);
setName(scd, structName);
setOwner(scd, player);
if (!persistObject(scd))
{
LOG("LOG_CHANNEL", "structure_rollup.OnDoStructureRollup persist SCD failed!");
return SCRIPT_CONTINUE;
}
attachScript(scd, "structure.house_control_device");
if (hasObjVar(self, player_structure.VAR_WAYPOINT_STRUCTURE))
{
obj_id waypoint = getObjIdObjVar(self, player_structure.VAR_WAYPOINT_STRUCTURE);
if (isIdValid(waypoint))
{
destroyWaypointInDatapad(waypoint, player);
removeObjVar(self, player_structure.VAR_WAYPOINT_STRUCTURE);
}
}
player_structure.destroyStructureSign(self);
if (player_structure.isResidence(self, player))
{
setHouseId(player, obj_id.NULL_ID);
removeObjVar(self, player_structure.VAR_RESIDENCE_BUILDING);
city.removeCitizen(player, self);
}
city.removeStructureFromCity(self);
String template = getTemplateName(self);
player_structure.setDeedTemplate(scd, template);
if (isIdValid(player) && exists(player))
{
obj_id lotOverlimitStructure = getObjIdObjVar(player, "lotOverlimit.structure_id");
if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == self))
{
setObjVar(player, "lotOverlimit.structure_location", "Datapad");
}
}
putIn(self, scd);
if (hasObjVar(self, "purge_process.rollup_on_load"))
{
removeObjVar(self, "purge_process.rollup_on_load");
}
final int maxDepth = player_structure.isFactory(self) ? 101 : 1;
moveToOfflinePlayerDatapadAndUnload(scd, player, maxDepth + 1);
fixLoadWith(self, player, maxDepth);
trace.log("housepackup", getPlayerFullName(player) + "(" + player + ") had their house rolled up by the purge process (" + self + ", loc " + where.toString() + ") into structure control device " + scd, player, trace.TL_CS_LOG);
}
return SCRIPT_CONTINUE;
}
}
| [
"tmoflash@gmail.com"
] | tmoflash@gmail.com |
a4784bcc686722ecba9347074c0d125df70c3ea3 | 970361e96b0ea48a34557fa928b4df0d03441733 | /app/src/main/java/com/tinytongtong/thinkinjavapractice/chapter21/part03/CriticalSection.java | 089479ea2fce2559284cfbcbcfa1ece92d057fa4 | [
"Apache-2.0"
] | permissive | tinyvampirepudge/ThinkInJavaPractice | a61a20c145e6967fec8615dea154f6d227146a3e | 1b54ee85a22c927ae71773175639316abb5fe457 | refs/heads/master | 2020-04-16T17:56:04.554595 | 2019-01-24T06:31:22 | 2019-01-24T06:31:22 | 165,795,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,220 | java | package com.tinytongtong.thinkinjavapractice.chapter21.part03;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @Description: 同步代码块
* @Author wangjianzhou@qding.me
* @Date 2019/1/23 6:07 PM
* @Version
*/
/**
* 正如注释中注明的,Pair不是线程安全的,因为它的约束条件(虽然是任意的)需要
* 将两个变量维护成相同的值。
* 此外,自增加操作不是线程安全的,并且因为没有任何方法被标记为synchronized,
* 所以不能保证一个Pair对象在多线程程序中不会被破坏。
* 你可以想象一下这种情况:某人交给你一个非线程安全的Pair类,而你需要在一个线程
* 环境中使用它。通过创建PairManager类就可以实现这一点,PairManager类持有一
* 个Pair对象并控制对它的一切访问。注意唯一的public方法就是getPair(),它是
* synchronized的。对于抽象方法increment(),对increment()的同步控制将在
* 实现的时候进行处理。
*
* store()方法将一个Pair对象添加到了synchronized ArrayList中,所以这个操作
* 是线程安全的。因此,该方法不必进行防护,可以防止在PairManager2的synchronized
* 语句块的外部。
*
* PairManipulator被创建用来测试两种不同类型的PairManager,其方法时某个任务
* 中调用increment(),而PairChecker则在另一个任务中执行。为了跟踪可以运行测试
* 的频度,PairChecker在每次成功时都递增checkCounter。
*
* 在main()中创建了两个PairManipulator对象,并允许他们运行一段时间,之后每个
* PairManipulator的结果都会得到展示。
*
* 尽管每次运行的结果可能会非常不同,但一般来说,对于PairChecker的检查频率,
* PairManager1.increment()不允许有PairManager2.increment()那样多。后者
* 采用同步控制块进行同步,所以对象不加锁的时间更长。这也是宁愿使用同步控制块而不是
* 对整个方法进行同步控制的典型原因:使得其他线程能更多地访问(在安全的情况下尽可能多)。
*/
public class CriticalSection {
// Test the two different approaches:
public static void main(String[] args) {
PairManager pman1 = new PairManager1();
PairManager pman2 = new PairManager2();
testApproaches(pman1, pman2);
}
static void testApproaches(PairManager pman1, PairManager pman2) {
ExecutorService exec = Executors.newCachedThreadPool();
PairManipulator pm1 = new PairManipulator(pman1);
PairManipulator pm2 = new PairManipulator(pman2);
PairChecker pcheck1 = new PairChecker(pman1);
PairChecker pcheck2 = new PairChecker(pman2);
exec.execute(pm1);
exec.execute(pm2);
exec.execute(pcheck1);
exec.execute(pcheck2);
try {
TimeUnit.MILLISECONDS.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
System.out.println("Sleep interrupted");
}
System.out.println("pm1: " + pm1 + "\npm2: " + pm2);
System.exit(0);
}
}
class Pair { // Not thread-safe
private int x, y;
public Pair(int x, int y) {
this.x = x;
this.y = y;
}
public Pair() {
this(0, 0);
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public void incrementX() {
x++;
}
public void incrementY() {
y++;
}
@Override
public String toString() {
return "x: " + x + ", y: " + y;
}
public class PairValuesNotEqualException extends RuntimeException {
public PairValuesNotEqualException() {
super("Pair values not equal: " + Pair.this);
}
}
// Arbitrary invariant -- both variables must be equal:
public void checkState() {
if (x != y) {
throw new PairValuesNotEqualException();
}
}
}
// Protect a Pair inside a thread-safe class:
abstract class PairManager {
AtomicInteger checkCounter = new AtomicInteger(0);
protected Pair p = new Pair();
private List<Pair> storage = Collections.synchronizedList(new ArrayList<Pair>());
public synchronized Pair getPair() {
// Make a copy to keep original safe:
return new Pair(p.getX(), p.getY());
}
// Assume this is a time consuming operation
protected void store(Pair p) {
storage.add(p);
try {
TimeUnit.MILLISECONDS.sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public abstract void increment();
}
// Synchronize the entire method:
class PairManager1 extends PairManager {
@Override
public synchronized void increment() {
p.incrementX();
p.incrementY();
store(getPair());
}
}
// Use a critical section:
class PairManager2 extends PairManager {
@Override
public void increment() {
Pair temp;
synchronized (this) {
p.incrementX();
p.incrementY();
temp = getPair();
}
store(temp);// 这个方法是线程安全的,不用放置在同步代码块中。这是因为list是 synchronized ArrayList。
}
}
class PairManipulator implements Runnable {
private PairManager pm;
public PairManipulator(PairManager pm) {
this.pm = pm;
}
@Override
public void run() {
while (true) {
pm.increment();
}
}
@Override
public String toString() {
return "Pair: " + pm.getPair() + " checkCounter= " + pm.checkCounter.get();
}
}
class PairChecker implements Runnable {
private PairManager pm;
public PairChecker(PairManager pm) {
this.pm = pm;
}
@Override
public void run() {
while (true) {
pm.checkCounter.incrementAndGet();
pm.getPair().checkState();
}
}
}
| [
"tinytongtong@163.com"
] | tinytongtong@163.com |
72d6536f185a44966f94d7f3d7051dcf6c444889 | 489dbf038dc81578ee3d1f3465e10d2148a7d3d5 | /web-ide/src/name/martingeisse/webide/nodejs/AbstractNodejsServer.java | 97b7ab981bb755c06b53220cf6096a2a4e8bb908 | [
"MIT"
] | permissive | MartinGeisse/public | 9b3360186be7953d2185608da883916622ec84e3 | 57b905485322222447187ae78a5a56bf3ce67900 | refs/heads/master | 2023-01-21T03:00:43.350628 | 2016-03-20T16:30:09 | 2016-03-20T16:30:09 | 4,472,103 | 1 | 0 | NOASSERTION | 2022-12-27T14:45:54 | 2012-05-28T15:56:16 | Java | UTF-8 | Java | false | false | 3,056 | java | /**
* Copyright (c) 2010 Martin Geisse
*
* This file is distributed under the terms of the MIT license.
*/
package name.martingeisse.webide.nodejs;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import name.martingeisse.webide.application.Configuration;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.ExecuteResultHandler;
import org.apache.commons.exec.ExecuteStreamHandler;
import org.apache.commons.exec.Executor;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.exec.ShutdownHookProcessDestroyer;
/**
* Base class for NodeJS server processes. Each subclass should
* have an associated Javascript file (which is inherited and
* can be overridden) that is passed to the NodeJS command-line
* tool. The server is started by the start() method.
*/
public abstract class AbstractNodejsServer {
/**
* Constructor.
*/
public AbstractNodejsServer() {
}
/**
* Starts this server.
*/
public void start() {
// determine the path of the associated script
URL url = getScriptUrl();
if (!url.getProtocol().equals("file")) {
throw new RuntimeException("unsupported protocol for associated script URL: " + url);
}
File scriptFile = new File(url.getPath());
// build the command line
CommandLine commandLine = new CommandLine(Configuration.getBashPath());
commandLine.addArgument("--login");
commandLine.addArgument("-c");
commandLine.addArgument("node " + scriptFile.getName(), false);
// build I/O streams
ByteArrayInputStream inputStream = null;
OutputStream outputStream = System.err;
OutputStream errorStream = System.err;
ExecuteStreamHandler streamHandler = new PumpStreamHandler(outputStream, errorStream, inputStream);
// build an environment map that contains the path to the node_modules
Map<String, String> environment = new HashMap<String, String>();
environment.put("NODE_PATH", new File("lib/node_modules").getAbsolutePath());
// run Node.js
Executor executor = new DefaultExecutor();
executor.setProcessDestroyer(new ShutdownHookProcessDestroyer());
executor.setStreamHandler(streamHandler);
try {
executor.setWorkingDirectory(scriptFile.getParentFile());
executor.execute(commandLine, environment, new ExecuteResultHandler() {
@Override
public void onProcessFailed(ExecuteException e) {
}
@Override
public void onProcessComplete(int exitValue) {
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
protected URL getScriptUrl() {
for (Class<?> c = getClass(); c != null; c = c.getSuperclass()) {
URL url = c.getResource(c.getSimpleName() + ".js");
if (url != null) {
return url;
}
}
throw new RuntimeException("no associated script for NodeJS server could be found");
}
}
| [
"martingeisse@googlemail.com"
] | martingeisse@googlemail.com |
fe577ca9ceb9b3780eb6df2069287222ee0ea287 | f36cd989c25c4437a5a8ebc00ad2473ee197f3de | /src/main/java/fr/norsys/fondation/services/RendezVousService.java | dd5437f03b60420a103250359bf6a9f73777dd7c | [] | no_license | akouzmohamed999/FONDATION_NORSYS | f0f0857f4f7533e911b800f036afcd79d19afd0f | aced6e59015303e25b68065f35e44e4ac3b792ee | refs/heads/master | 2020-12-24T20:24:43.867094 | 2017-06-22T03:17:34 | 2017-06-22T03:17:34 | 86,247,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 452 | java | package fr.norsys.fondation.services;
import java.util.List;
import org.springframework.stereotype.Service;
import fr.norsys.fondation.entities.RendezVous;
@Service
public interface RendezVousService {
List<RendezVous> findAllRendezVous();
RendezVous addRendezVous(RendezVous rendezVous);
RendezVous updateRendezVous(RendezVous rendezVous);
void deleteRendezVous(RendezVous rendezVous);
RendezVous findRendezVousById(int idRendezVous);
}
| [
"akouz.mohamed999@gmail.com"
] | akouz.mohamed999@gmail.com |
000916e10661ae5b4d209b53c255bf65598e7f96 | 4a805860aad51bd8312c7d2265ccd15a0045e58d | /app/src/main/java/com/example/textrecognition/MainActivity.java | e02505672dfba4b12ac91c64c9e5eb2b9addbd7f | [] | no_license | nishusingh71/TextRecognition | 20941d5d66f5d500f06414172e241bf65190eed5 | 4b81017b13f73c92d7d91f987d86eb717931c784 | refs/heads/master | 2022-11-07T22:27:31.896344 | 2020-06-18T12:15:36 | 2020-06-18T12:15:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,049 | java | package com.example.textrecognition;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.Log;
import android.util.SparseArray;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.TextView;
import com.google.android.gms.vision.CameraSource;
import com.google.android.gms.vision.Detector;
import com.google.android.gms.vision.text.TextBlock;
import com.google.android.gms.vision.text.TextRecognizer;
import com.google.android.gms.vision.text.TextRecognizer.Builder;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
SurfaceView myCameraView;
TextView textView;
CameraSource cameraSource;
final int ReqCameraPermissionID = 1001;
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode){
case ReqCameraPermissionID:
{
if (grantResults[0]==PackageManager.PERMISSION_DENIED)
{
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
return;
}
try {
cameraSource.start(myCameraView.getHolder());
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myCameraView = findViewById(R.id.surface);
textView = findViewById(R.id.text_msg);
TextRecognizer textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build();
if (!textRecognizer.isOperational()) {
Log.w("MainActivity", "Detector dependencies are not yet available");
} else {
Detector detector;
cameraSource = new CameraSource.Builder(getApplicationContext(), textRecognizer).
setFacing(CameraSource.CAMERA_FACING_BACK).
setRequestedPreviewSize(1280, 1024).setRequestedFps(2.0f).setAutoFocusEnabled(true).build();
myCameraView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
try {
if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(MainActivity.this,new String[]{Manifest.permission.CAMERA},ReqCameraPermissionID);
return;
}
cameraSource.start(myCameraView.getHolder());
}
catch (Exception e){
}
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
cameraSource.stop();
}
});
textRecognizer.setProcessor(new Detector.Processor<TextBlock>() {
@Override
public void release() {
}
@Override
public void receiveDetections(Detector.Detections<TextBlock> detections) {
final SparseArray<TextBlock> items=detections.getDetectedItems();
if (items.size()!=0){
textView.post(new Runnable() {
@Override
public void run() {
StringBuilder stringBuilder=new StringBuilder();
for (int i=0;i<items.size();i++){
TextBlock item=items.valueAt(i);
stringBuilder.append(item.getValue());
stringBuilder.append("\n");
}
textView.setText(stringBuilder.toString());
}
});
}
}
});
}
}
} | [
"nishus877@gmail.com"
] | nishus877@gmail.com |
9ba1b8d16f2d0db89615e5114e4d2ed001d52526 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/commons-lang/learning/7940/MutableBoolean.java | 3ab39214c7c643aa6ebcbd5ddcf41abbc7f580b4 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,155 | 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.commons.lang3.mutable;
import java.io.Serializable;
import org.apache.commons.lang3.BooleanUtils;
/**
* A mutable <code>boolean</code> wrapper.
* <p>
* Note that as MutableBoolean does not extend Boolean, it is not treated by String.format as a Boolean parameter.
*
* @see Boolean
* @since 2.2
*/
public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparable<MutableBoolean> {
/**
* Required for serialization support.
*
* @see java.io.Serializable
*/
private static final long serialVersionUID = -4830728138360036487L;
/** The mutable value. */
private boolean value;
/**
* Constructs a new MutableBoolean with the default value of false.
*/
public MutableBoolean() {
super();
}
/**
* Constructs a new MutableBoolean with the specified value.
*
* @param value the initial value to store
*/
public MutableBoolean(final boolean value) {
super();
this.value = value;
}
/**
* Constructs a new MutableBoolean with the specified value.
*
* @param value the initial value to store, not null
* @throws NullPointerException if the object is null
*/
public MutableBoolean(final Boolean value) {
super();
this.value = value.booleanValue();
}
//-----------------------------------------------------------------------
/**
* Gets the value as a Boolean instance.
*
* @return the value as a Boolean, never null
*/
@Override
public Boolean getValue() {
return Boolean.valueOf(this.value);
}
/**
* Sets the value.
*
* @param value the value to set
*/
public void setValue(final boolean value) {
this.value = value;
}
/**
* Sets the value to false.
*
* @since 3.3
*/
public void setFalse() {
this.value = false;
}
/**
* Sets the value to true.
*
* @since 3.3
*/
public void setTrue() {
this.value = true;
}
/**
* Sets the value from any Boolean instance.
*
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(final Boolean value) {
this.value = value.booleanValue();
}
//-----------------------------------------------------------------------
/**
* Checks if the current value is <code>true</code>.
*
* @return <code>true</code> if the current value is <code>true</code>
* @since 2.5
*/
public boolean isTrue() {
return value;
}
/**
* Checks if the current value is <code>false</code>.
*
* @return <code>true</code> if the current value is <code>false</code>
* @since 2.5
*/
public boolean isFalse() {
return !value;
}
//-----------------------------------------------------------------------
/**
* Returns the value of this MutableBoolean as a boolean.
*
* @return the boolean value represented by this object.
*/
public boolean booleanValue() {
return value;
}
//-----------------------------------------------------------------------
/**
* Gets this mutable as an instance of Boolean.
*
* @return a Boolean instance containing the value from this mutable, never null
* @since 2.5
*/
public Boolean toBoolean() {
return Boolean.valueOf(booleanValue());
}
//-----------------------------------------------------------------------
/**
* Compares this object to the specified object. The result is <code>true</code> if and only if the argument is
* not <code>null</code> and is an <code>MutableBoolean</code> object that contains the same
* <code>boolean</code> value as this object.
*
* @param obj the object to compare with, null returns false
* @return <code>true</code> if the objects are the same; <code>false</code> otherwise.
*/
@Override
public boolean equals(final Object obj) {
if (obj instanceof MutableBoolean) {
return value == ((MutableBoolean) obj).booleanValue();
}
return false;
}
/**
* Returns a suitable hash code for this mutable.
*
* @return the hash code returned by <code>Boolean.TRUE</code> or <code>Boolean.FALSE</code>
*/
@Override
public int hashCode() {
return value ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode();
}
//-----------------------------------------------------------------------
/**
* Compares this mutable to another in ascending order.
*
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
* where false is less than true
*/
@Override
public int compareTo(final MutableBoolean other) {
return BooleanUtils.compare(this.value, other.value);
}
//-----------------------------------------------------------------------
/**
* Returns the String value of this mutable.
*
* @return the mutable value as a string
*/
@Override
public String toString() {
return String.valueOf(value);
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
03c9bc9b3b398528ca2011ce1bb304bf63633ceb | a2f8f077036e2f0481337ed883d1e580f0f168ef | /JSP/7-Servlet/src/Servlet2.java | e333c50c63af5d6e32e0fe9113668f94c37c09a1 | [] | no_license | jake-jeon9/study | 39ce0e9e9310b9abf10d625f5aeb9a46ee6a05e8 | 6cff8e8c0f6b739c346f4a352cb3e677068459d5 | refs/heads/master | 2023-07-25T21:25:52.898493 | 2021-09-11T09:28:00 | 2021-09-11T09:28:00 | 369,456,920 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,193 | java |
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class Servlet2
*/
@WebServlet("/Servlet2")
public class Servlet2 extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Servlet2() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"jakejeon1125@gmail.com"
] | jakejeon1125@gmail.com |
50c6bed8e0f04a9039325666047d6afa343caa0b | 7a6d8138f553d6ae6f488d99da332264332a638d | /src/main/java/energyservice/ReservationRepository.java | e2cbb27b7fa9ec3c205844d69ae4f5e4492c566b | [] | no_license | Joon-se/reservation | 23d46e485e400d2978ed64a81775577dae44cdc1 | 795b1ad2910ba4d6bea222a3c222576fb561936a | refs/heads/master | 2022-11-03T02:46:46.923913 | 2020-06-19T00:51:56 | 2020-06-19T00:51:56 | 273,371,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 193 | java | package energyservice;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface ReservationRepository extends PagingAndSortingRepository<Reservation, Long>{
} | [
"lokissmeve@hotmail.com"
] | lokissmeve@hotmail.com |
fc72aadcdecde1e3c49e83f0edb17b22887a3e9c | 82295c2d365176a00ec9dd4a7f67d5844b9a1296 | /magma-datasource-health-canada/src/main/java/org/obiba/magma/datasource/healthcanada/HCDrugsValueTable.java | afeb11acd0cdc579f48206859d4b9d45a68ecfb2 | [] | no_license | nuwimana/public-datasources | 46941bb6f9214ad499deca619b49be3db8490d17 | 219e7700f3ba66ebee43c4f6e26534dd5cec39f6 | refs/heads/master | 2021-01-15T21:49:53.312890 | 2013-06-17T14:43:06 | 2013-06-17T14:43:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,344 | java | package org.obiba.magma.datasource.healthcanada;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import org.obiba.magma.MagmaDate;
import org.obiba.magma.MagmaRuntimeException;
import org.obiba.magma.NoSuchValueSetException;
import org.obiba.magma.Timestamps;
import org.obiba.magma.Value;
import org.obiba.magma.ValueSet;
import org.obiba.magma.ValueTable;
import org.obiba.magma.ValueType;
import org.obiba.magma.Variable;
import org.obiba.magma.VariableEntity;
import org.obiba.magma.support.AbstractValueTable;
import org.obiba.magma.support.VariableEntityBean;
import org.obiba.magma.type.DateTimeType;
import org.obiba.magma.type.DateType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.Maps;
import au.com.bytecode.opencsv.CSVReader;
import de.schlichtherle.io.File;
import de.schlichtherle.io.FileInputStream;
public class HCDrugsValueTable extends AbstractValueTable {
private static final Logger log = LoggerFactory.getLogger(HCDrugsValueTable.class);
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy");
static final String DRUG_ENTITY_TYPE = "Drug";
static final String ALL_FILES_ZIP_URL
= "http://www.hc-sc.gc.ca/dhp-mps/alt_formats/zip/prodpharma/databasdon/allfiles.zip";
private static final Charset WESTERN_EUROPE = Charset.availableCharsets().get("ISO-8859-1");
private File zsource;
// source file name / entity id / value set
private Map<String, Map<String, String[]>> valueSets = Maps.newHashMap();
public HCDrugsValueTable(HCDatasource datasource) {
super(datasource, "Drugs");
setVariableEntityProvider(new HCDrugsVariableEntityProvider(this));
addVariableValueSources(new HCDrugsVariableValueSourceFactory());
}
@Override
public ValueSet getValueSet(VariableEntity entity) throws NoSuchValueSetException {
return new HCDrugsValueSet(entity);
}
@Override
public Timestamps getTimestamps() {
return new Timestamps() {
private File drugEntry;
@Nonnull
@Override
public Value getLastUpdate() {
return DateTimeType.get().valueOf(new Date(getDrugEntry().lastModified()));
}
@Nonnull
@Override
public Value getCreated() {
return DateTimeType.get().nullValue();
}
private File getDrugEntry() {
if(drugEntry == null) {
drugEntry = getFileEntry("drug.txt");
}
return drugEntry;
}
};
}
private void downloadLatestAllFiles() throws IOException {
log.info("Download from: {} ...", ALL_FILES_ZIP_URL);
// Get a connection to the URL and start up a buffered reader.
URL url = new URL(ALL_FILES_ZIP_URL);
url.openConnection();
InputStream reader = url.openStream();
// Setup a buffered file writer to write out what we read from the website.
java.io.File allfiles = java.io.File.createTempFile("healthcanada-drugs-", ".zip");
allfiles.deleteOnExit();
FileOutputStream writer = new FileOutputStream(allfiles);
byte[] buffer = new byte[153600];
int bytesRead = 0;
while((bytesRead = reader.read(buffer)) > 0) {
writer.write(buffer, 0, bytesRead);
buffer = new byte[153600];
}
writer.close();
reader.close();
zsource = new File(allfiles);
}
public File getFileEntry(String name) {
if(zsource == null) {
try {
downloadLatestAllFiles();
} catch(IOException e) {
throw new MagmaRuntimeException("Unable to download Health Canada Drugs from: " + ALL_FILES_ZIP_URL, e);
}
}
return new File(zsource, name);
}
CSVReader getEntryReader(String name) {
try {
return new CSVReader(new InputStreamReader(new FileInputStream(getFileEntry(name)), WESTERN_EUROPE));
} catch(FileNotFoundException e) {
throw new MagmaRuntimeException("Unable to read Health Canada Drug file: " + name, e);
}
}
String[] normalize(String[] line) {
for(int i = 0; i < line.length; i++) {
line[i] = normalize(line[i]);
}
return line;
}
private String normalize(String str) {
return str.trim().replaceAll("\\s{2,}", " ");
}
class HCDrugsValueSet implements ValueSet {
private final VariableEntity entity;
private HCDrugsValueSet(VariableEntity entity) {
this.entity = entity;
}
Value getValue(Variable variable) {
String sourceFile = variable.getAttributeStringValue("file");
int column = Integer.parseInt(variable.getAttributeStringValue("column"));
String[] valueSet = getValueSet(sourceFile);
if(valueSet == null) {
return variable.isRepeatable() ? variable.getValueType().nullSequence() : variable.getValueType().nullValue();
}
return variable.isRepeatable()
? getValueSequence(variable.getValueType(), valueSet[column])
: getValue(variable.getValueType(), valueSet[column]);
}
/**
* Load the data in memory if not already done.
*
* @param sourceFile
* @return
*/
private String[] getValueSet(String sourceFile) {
Map<String, String[]> sourceValueSets = valueSets.get(sourceFile);
try {
if(sourceValueSets == null) {
sourceValueSets = Maps.newHashMap();
valueSets.put(sourceFile, sourceValueSets);
CSVReader reader = getEntryReader(sourceFile);
String[] nextLine;
while((nextLine = reader.readNext()) != null) {
nextLine = normalize(nextLine);
VariableEntity nextEntity = new VariableEntityBean(DRUG_ENTITY_TYPE, nextLine[0]);
if(getVariableEntityProvider().getVariableEntities().contains(nextEntity)) {
if(sourceValueSets.containsKey(nextLine[0])) {
// merge lines
sourceValueSets.put(nextLine[0], merge(sourceValueSets.get(nextLine[0]), nextLine));
} else {
sourceValueSets.put(nextLine[0], nextLine);
}
}
}
reader.close();
}
} catch(IOException e) {
throw new MagmaRuntimeException("Unable to read source file: " + sourceFile, e);
}
return sourceValueSets.get(entity.getIdentifier());
}
/**
* Handle date format and deparse lines that were abusively merged.
*
* @param type
* @param value
* @return
*/
private Value getValue(ValueType type, String value) {
if(value == null || value.isEmpty()) return type.nullValue();
if(type.equals(DateType.get())) {
try {
return DateType.get().valueOf(dateFormat.parse(value));
} catch(ParseException e) {
e.printStackTrace();
return DateType.get().nullValue();
}
} else {
// case of abusive merging of lines
if(value.indexOf('|') != -1) {
String[] values = value.split("\\|");
if(values.length > 0) {
return getValue(type, values[0]);
} else {
return type.nullValue();
}
}
return type.valueOf(value);
}
}
/**
* Deparse multiple values resulting from the merge.
*
* @param type
* @param value
* @return
*/
private Value getValueSequence(ValueType type, String value) {
List<Value> values = new ArrayList<Value>();
for(String val : value.split("\\|")) {
values.add(getValue(type, val));
}
return type.sequenceOf(values);
}
/**
* When there are multiple values, it is on multiple lines (therefore some data are abusively repeated).
*
* @param previousLine
* @param nextLine
* @return
*/
private String[] merge(String[] previousLine, String[] nextLine) {
for(int i = 0; i < nextLine.length; i++) {
previousLine[i] = previousLine[i] + "|" + nextLine[i];
}
return previousLine;
}
@Override
public ValueTable getValueTable() {
return HCDrugsValueTable.this;
}
@Override
public VariableEntity getVariableEntity() {
return entity;
}
@Override
public Timestamps getTimestamps() {
return new Timestamps() {
@Nonnull
@Override
public Value getLastUpdate() {
Value updated = getValue(getVariable("LAST_UPDATE_DATE"));
if (updated.isNull()) return HCDrugsValueTable.this.getTimestamps().getLastUpdate();
return updated;
}
@Nonnull
@Override
public Value getCreated() {
Value created = getLastUpdate();
Value history = getValue(getVariable("HISTORY_DATE"));
if (history.isNull()) return created;
for (Value val : history.asSequence().getValues()) {
if (((MagmaDate)val.getValue()).asDate().before(((MagmaDate)created.getValue()).asDate())) {
created = val;
}
}
return created;
}
};
}
}
}
| [
"yannick.marcon@obiba.org"
] | yannick.marcon@obiba.org |
ddc5f5523dd6bebb8f0543d00b63137fc7175904 | 7c2ae7375b00e66838ea5c5ff1f1569cce47760a | /profiler-test/src/main/java/com/navercorp/pinpoint/test/classloader/TestClassLoader.java | 741e9a96ebdd90f612ac4ea15fb2c9d97dcc4b9f | [
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"DOC",
"CC-BY-3.0",
"GPL-1.0-or-later",
"CC-PDDC",
"MIT",
"CC0-1.0",
"GPL-2.0-only",
"LicenseRef-scancode-public-domain"
] | permissive | tank1314/pinpoint | 1bb74822a144d317ed58c434b222ed67468deaa4 | ad8b4ffeb50e29969f6be806699fcd7e9ef5b07c | refs/heads/master | 2020-03-26T22:54:12.392621 | 2018-08-21T07:40:38 | 2018-08-21T07:40:38 | 118,546,232 | 0 | 0 | Apache-2.0 | 2018-05-12T03:08:35 | 2018-01-23T02:32:45 | Java | UTF-8 | Java | false | false | 6,277 | java | /*
* Copyright 2016 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.navercorp.pinpoint.test.classloader;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.navercorp.pinpoint.bootstrap.instrument.InstrumentContext;
import com.navercorp.pinpoint.profiler.instrument.InstrumentEngine;
import com.navercorp.pinpoint.profiler.instrument.ASMEngine;
import com.navercorp.pinpoint.profiler.instrument.classloading.ClassInjector;
import com.navercorp.pinpoint.profiler.instrument.classloading.DebugTransformerClassInjector;
import com.navercorp.pinpoint.profiler.instrument.JavassistEngine;
import com.navercorp.pinpoint.profiler.plugin.ClassFileTransformerLoader;
import com.navercorp.pinpoint.profiler.plugin.MatchableClassFileTransformerGuardDelegate;
import com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext;
import com.navercorp.pinpoint.test.MockApplicationContext;
import javassist.ClassPool;
import com.navercorp.pinpoint.bootstrap.config.ProfilerConfig;
import com.navercorp.pinpoint.bootstrap.instrument.matcher.Matcher;
import com.navercorp.pinpoint.bootstrap.instrument.matcher.Matchers;
import com.navercorp.pinpoint.bootstrap.instrument.transformer.TransformCallback;
import com.navercorp.pinpoint.common.util.Asserts;
/**
* @author emeroad
* @author hyungil.jeong
*/
public class TestClassLoader extends TransformClassLoader {
private final Logger logger = Logger.getLogger(TestClassLoader.class.getName());
private final MockApplicationContext applicationContext;
private Translator instrumentTranslator;
private final List<String> delegateClass;
private final ClassFileTransformerLoader classFileTransformerLoader;
private final InstrumentContext instrumentContext;
public TestClassLoader(MockApplicationContext applicationContext) {
Asserts.notNull(applicationContext, "applicationContext");
this.applicationContext = applicationContext;
this.classFileTransformerLoader = new ClassFileTransformerLoader(applicationContext.getProfilerConfig(), applicationContext.getDynamicTransformTrigger());
// ClassInjector classInjector = new LegacyProfilerPluginClassInjector(getClass().getClassLoader());
ClassInjector classInjector = new DebugTransformerClassInjector();
this.instrumentContext = new PluginInstrumentContext(applicationContext.getProfilerConfig(), applicationContext.getInstrumentEngine(),
applicationContext.getDynamicTransformTrigger(), classInjector, classFileTransformerLoader);
this.delegateClass = new ArrayList<String>();
}
public void addDelegateClass(String className) {
if (className == null) {
throw new NullPointerException("className must not be null");
}
this.delegateClass.add(className);
}
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (logger.isLoggable(Level.FINE)) {
logger.fine("findClass className:{}" + name);
}
return super.findClass(name);
}
public void initialize() {
addDefaultDelegateLoadingOf();
addCustomDelegateLoadingOf();
addTranslator();
}
private void addCustomDelegateLoadingOf() {
for (String className : delegateClass) {
this.delegateLoadingOf(className);
}
}
public ProfilerConfig getProfilerConfig() {
return applicationContext.getProfilerConfig();
}
public void addTransformer(final String targetClassName, final TransformCallback transformer) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("addTransformer targetClassName:{}" + targetClassName + " callback:{}" + transformer);
}
final Matcher matcher = Matchers.newClassNameMatcher(targetClassName);
final MatchableClassFileTransformerGuardDelegate guard = new MatchableClassFileTransformerGuardDelegate(applicationContext.getProfilerConfig(), instrumentContext, matcher, transformer);
this.instrumentTranslator.addTransformer(guard);
}
private void addDefaultDelegateLoadingOf() {
TestClassList testClassList = new TestClassList();
for (String className : testClassList.getTestClassList()) {
this.delegateLoadingOf(className);
}
}
@Override
protected Class<?> loadClassByDelegation(String name) throws ClassNotFoundException {
if (logger.isLoggable(Level.FINE)) {
logger.fine("loadClassByDelegation className:{}" + name);
}
return super.loadClassByDelegation(name);
}
public void addTranslator() {
final InstrumentEngine instrumentEngine = applicationContext.getInstrumentEngine();
if (instrumentEngine instanceof JavassistEngine) {
logger.info("JAVASSIST BCI engine");
ClassPool classPool = ((JavassistEngine) instrumentEngine).getClassPool(this);
this.instrumentTranslator = new JavassistTranslator(this, classPool, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
} else if (instrumentEngine instanceof ASMEngine) {
logger.info("ASM BCI engine");
this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
} else {
logger.info("Unknown BCI engine");
this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
}
}
}
| [
"kun.tan@baozun.com"
] | kun.tan@baozun.com |
cde8afeba61d8b99031dd8af1052d053106c5de4 | 88a26e9f8195a6f2685843011d708995a431d0e7 | /app/src/test/java/com/example/restapiproject/MainActivityTest.java | a2510e83b7e323d828d960928be6ff8a268f9c8b | [] | no_license | ecluster/RestAPI-Project | b0cf027baa3e873347c1225f7c8e70304b7ca1b4 | 32353a8dea07ed672d58a4f9a40448663e038776 | refs/heads/master | 2023-07-18T06:41:03.206671 | 2021-09-04T04:16:44 | 2021-09-04T04:16:44 | 402,662,473 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,119 | java | package com.example.restapiproject;
import org.junit.Test;
import static org.junit.Assert.*;
import android.content.Context;
import java.util.ArrayList;
import java.util.List;
public class MainActivityTest {
@Test
public void emptyUserField() {
String username = "";
assertEquals(true, MainActivity.isUsernameEmpty(username));
}
@Test
public void filledUserField() {
String username = "edward";
assertEquals(false, MainActivity.isUsernameEmpty(username));
}
@Test
public void emptyPasswordField() {
String password = "";
assertEquals(true, MainActivity.isPasswordEmpty(password));
}
@Test
public void filledPasswordField() {
String password = "password";
assertEquals(false, MainActivity.isPasswordEmpty(password));
}
@Test
public void hasInput() {
String username = "edward";
String password = "password";
assertEquals(true, MainActivity.hasInput(username, password));
}
@Test
public void hasNoInput() {
String username = "";
String password = "";
assertEquals(false, MainActivity.hasInput(username, password));
}
@Test
public void missingUsernameInput() {
String username = "";
String password = "password";
assertEquals(true, MainActivity.hasInput(username, password));
}
@Test
public void missingPasswordInput() {
String username = "username";
String password = "";
assertEquals(true, MainActivity.hasInput(username, password));
}
@Test
public void matchingPassword() {
String password = "password";
List<User> users = new ArrayList<>();
users.add(new User("edward", "password", "1"));
assertEquals(true, MainActivity.matchPassword(password, users));
}
@Test
public void noMatchingPassword() {
String password = "123";
List<User> users = new ArrayList<>();
users.add(new User("edward", "password", "1"));
assertEquals(false, MainActivity.matchPassword(password, users));
}
@Test
public void userExists() {
String user1 = "edward";
List<User> users = new ArrayList<>();
users.add(new User("edward", "password", "1"));
assertEquals(true, MainActivity.userExist(user1, users));
}
@Test
public void userDoesNotExists() {
String user1 = "edward";
List<User> users = new ArrayList<>();
users.add(new User("person", "password", "1"));
assertEquals(false, MainActivity.userExist(user1, users));
}
@Test
public void getUser() {
User u1 = new User("edward", "password", "1");
List<User> users = new ArrayList<>();
users.add(u1);
assertEquals(u1, MainActivity.getUser("edward", users));
}
@Test
public void canGetUser() {
User u1 = new User("person", "password", "1");
List<User> users = new ArrayList<>();
users.add(u1);
assertEquals(null, MainActivity.getUser("edward", users));
}
}
| [
"ecluster@csumb.edu"
] | ecluster@csumb.edu |
7105ee117daf2f60045c06b8dbfa38139e9d681a | eaec4795e768f4631df4fae050fd95276cd3e01b | /src/cmps252/HW4_2/UnitTesting/record_4312.java | 413212301a9e13d3dae8fad778fd9830bd63592b | [
"MIT"
] | permissive | baraabilal/cmps252_hw4.2 | debf5ae34ce6a7ff8d3bce21b0345874223093bc | c436f6ae764de35562cf103b049abd7fe8826b2b | refs/heads/main | 2023-01-04T13:02:13.126271 | 2020-11-03T16:32:35 | 2020-11-03T16:32:35 | 307,839,669 | 1 | 0 | MIT | 2020-10-27T22:07:57 | 2020-10-27T22:07:56 | null | UTF-8 | Java | false | false | 2,442 | java | package cmps252.HW4_2.UnitTesting;
import static org.junit.jupiter.api.Assertions.*;
import java.io.FileNotFoundException;
import java.util.List;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import cmps252.HW4_2.Customer;
import cmps252.HW4_2.FileParser;
@Tag("38")
class Record_4312 {
private static List<Customer> customers;
@BeforeAll
public static void init() throws FileNotFoundException {
customers = FileParser.getCustomers(Configuration.CSV_File);
}
@Test
@DisplayName("Record 4312: FirstName is Jake")
void FirstNameOfRecord4312() {
assertEquals("Jake", customers.get(4311).getFirstName());
}
@Test
@DisplayName("Record 4312: LastName is Fidel")
void LastNameOfRecord4312() {
assertEquals("Fidel", customers.get(4311).getLastName());
}
@Test
@DisplayName("Record 4312: Company is Dazor Manufacturing Corp")
void CompanyOfRecord4312() {
assertEquals("Dazor Manufacturing Corp", customers.get(4311).getCompany());
}
@Test
@DisplayName("Record 4312: Address is 499 Cooper Landing Rd")
void AddressOfRecord4312() {
assertEquals("499 Cooper Landing Rd", customers.get(4311).getAddress());
}
@Test
@DisplayName("Record 4312: City is Cherry Hill")
void CityOfRecord4312() {
assertEquals("Cherry Hill", customers.get(4311).getCity());
}
@Test
@DisplayName("Record 4312: County is Camden")
void CountyOfRecord4312() {
assertEquals("Camden", customers.get(4311).getCounty());
}
@Test
@DisplayName("Record 4312: State is NJ")
void StateOfRecord4312() {
assertEquals("NJ", customers.get(4311).getState());
}
@Test
@DisplayName("Record 4312: ZIP is 8002")
void ZIPOfRecord4312() {
assertEquals("8002", customers.get(4311).getZIP());
}
@Test
@DisplayName("Record 4312: Phone is 856-667-8903")
void PhoneOfRecord4312() {
assertEquals("856-667-8903", customers.get(4311).getPhone());
}
@Test
@DisplayName("Record 4312: Fax is 856-667-6617")
void FaxOfRecord4312() {
assertEquals("856-667-6617", customers.get(4311).getFax());
}
@Test
@DisplayName("Record 4312: Email is jake@fidel.com")
void EmailOfRecord4312() {
assertEquals("jake@fidel.com", customers.get(4311).getEmail());
}
@Test
@DisplayName("Record 4312: Web is http://www.jakefidel.com")
void WebOfRecord4312() {
assertEquals("http://www.jakefidel.com", customers.get(4311).getWeb());
}
}
| [
"mbdeir@aub.edu.lb"
] | mbdeir@aub.edu.lb |
280d6ad4ca525a00af8b364bc47e76fc6da3423c | 2aed8d637adf659ef354ce041437709453a99a84 | /src/com/sme/service/PlgUserService.java | 3f964d5c37dcf1d29e783ffe132259d9bf86af29 | [] | no_license | yaop104/plugins | abd963058334b20d7a261f47e1cb137821eb3134 | 13f4fd3c0e524ec3ee9036c4be9df5300556b2ab | refs/heads/master | 2020-05-21T13:30:45.790004 | 2016-10-10T21:02:06 | 2016-10-10T21:02:06 | 61,511,508 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | package com.sme.service;
import com.sme.core.service.InterfaceBaseService;
import com.sme.entity.PlgUser;
public interface PlgUserService extends InterfaceBaseService<PlgUser> {
//================== begin ======================
//================== end ======================
}
| [
"1178251242@qq.com"
] | 1178251242@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.