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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
959025c215e79571cf9913abf409d02b1a0e804c | cc729146214cf447cbb68373b9d3026a940847bd | /form2/src/main/java/net/skhu/dto/Course.java | 1f8cfd917998cd3f444b557b7557613c2f24463e | [] | no_license | nsap19/spring_practice | f90dd98c657a7e60ba565685101245deaeae65df | c98cd2901e1ee84e321de81048a70efc697ae1a9 | refs/heads/master | 2021-03-10T10:49:04.356356 | 2020-04-10T04:27:15 | 2020-04-10T04:27:15 | 246,446,277 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 191 | java | package net.skhu.dto;
import java.sql.Date;
import lombok.Data;
@Data
public class Course {
int id;
String courseName;
int unit;
Date startDate;
int departmentId;
int professorId;
}
| [
"zzz0484@naver.com"
] | zzz0484@naver.com |
d921f4e083e36ae77a0779599e2018ccfff98baf | 27aabce551531eeec5c75cf8ea86d793f25d56dc | /src/main/java/sv/com/inventario/modelo/entity/Proveedor.java | daf7609b1302ccf65e936e0f4c8cd2ab784f074b | [] | no_license | iorantes/oauth2-jwt | 28f9f382f2a55503f681547230432f2efac6b87c | c6146268db5dacd8284c0bc1f9a007e2a8ea69f5 | refs/heads/master | 2020-03-20T15:20:25.364396 | 2018-06-19T02:09:23 | 2018-06-19T02:09:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,678 | java | package sv.com.inventario.modelo.entity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@SuppressWarnings("serial")
@Entity
@Table(name = "proveedor")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Proveedor extends AbstractBaseEntity {
@Id
@NotNull
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID_Prov")
private Long id;
@Column(name = "Nombre")
private String nombre;
@Column(name = "Direccion")
private String direccion;
@Column(name = "Telefono")
private String telefono;
@Column(name = "Email")
private String email;
public Proveedor() {
}
public Proveedor(@NotNull Long id, String nombre, String direccion, String telefono, String email) {
this.id = id;
this.nombre = nombre;
this.direccion = direccion;
this.telefono = telefono;
this.email = email;
}
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDireccion() {
return direccion;
}
public void setDireccion(String direccion) {
this.direccion = direccion;
}
public String getTelefono() {
return telefono;
}
public void setTelefono(String telefono) {
this.telefono = telefono;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"irvinldt@gmail.com"
] | irvinldt@gmail.com |
d61b68111f66e6f10937f7d2f63c6adc1a7dc929 | 0782e865b9c436cf4b1b075d666bcef577e8feca | /core/src/main/java/org/mariotaku/uniqr/Canvas.java | 4dc644dacda57c76f8908fa9df6af8adbbc06747 | [
"Apache-2.0"
] | permissive | mariotaku/UniqR | 38414066ca232472deeb0de0e705ab1828ca872d | d3ac6209978ae8aad5b5c494bba9a63f11c57c0c | refs/heads/master | 2021-01-19T09:32:52.790103 | 2018-03-15T08:23:20 | 2018-03-15T08:23:20 | 87,766,188 | 27 | 1 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package org.mariotaku.uniqr;
import org.jetbrains.annotations.NotNull;
/**
* Created by mariotaku on 2017/4/10.
*/
public interface Canvas<T> {
int getWidth();
int getHeight();
void drawDot(int l, int t, int size, int color);
@NotNull
T produceResult();
void free();
}
| [
"mariotaku.lee@gmail.com"
] | mariotaku.lee@gmail.com |
5bad16922a6d432463447e8a5c520d41814db4ed | bdad988adbab760c5bd2b5af61f8181406cf8769 | /src/main/java/com/example/gke/GkeApplication.java | bff73acf2077db7f0b9ccc6059bf8490b6320f86 | [] | no_license | vinithanagu/GKE | 89034034d3a5591270154f45a7015e352bf10975 | a4d00489a8bcaca2eb00cd293d8bd67a3576de93 | refs/heads/master | 2023-03-19T12:42:52.505644 | 2021-03-15T22:37:34 | 2021-03-15T22:37:34 | 348,113,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.example.gke;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GkeApplication {
public static void main(String[] args) {
SpringApplication.run(GkeApplication.class, args);
}
}
| [
"ragavravi25@gmail.com"
] | ragavravi25@gmail.com |
eff184fa58be156d54ed45cba48a4b9495f66e77 | fad0336e694648bf28e9874d7bfb5bc88b236903 | /PageRankwithHadoop/source Code/PageRankCombiner.java | 5a235ad4f754219422bc3d9079b39414ab0f2fdf | [] | no_license | chandrimaghosh/parallel-data-processing | 0ec5399d30a96c3ee2221cd12ecac9ecc35f71b7 | e384ffe58ce59c16d35644683605214e819733f9 | refs/heads/master | 2021-07-17T01:26:43.108809 | 2017-10-23T23:16:24 | 2017-10-23T23:16:24 | 108,049,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,652 | java | package pagerank.pagerank;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.Reducer.Context;
import pagerank.pagerank.PageRankDriver.gloabalVariable;
public class PageRankCombiner extends Reducer<Text,Node,Text,Node>{
double deltaTotal=0.0;
private static double a=0.20;
public void reduce(Text key,Iterable<Node> values,Context context)throws IOException, InterruptedException
{
long totalPages = context.getConfiguration().getLong("TotalPages",0);
double PageRankSoFar=0.0;
//Dangling node handle
//Calculate the total delta from all the dangling nodes
if (key.toString().equalsIgnoreCase("~Dnode"))
{
double deltaTotal=0.0;
for (Node n:values)
{
deltaTotal=deltaTotal+n.pageRank;
}
//store delta in Context variable
long longDelta=Double.doubleToLongBits(deltaTotal);
context.getCounter(gloabalVariable.delta).setValue(longDelta);
return;
}
//Calculate the page Rank for all the other nodes
Node n =new Node();
n.isDangling=false;
n.pageLinks=new ArrayList<String>();
n.pageRank=0.0;
for(Node node:values)
{
if (!node.isDangling)
{
n.pageLinks=node.pageLinks;
}
PageRankSoFar=PageRankSoFar+node.pageRank;
}
//reducer all the contributiong pageRanks are added up and the new
//page rank is calculated with the formula
n.pageRank=PageRankSoFar;
//System.out.println("pageRank:"+pageRank+"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"+"Key"+key);
context.write(key, n);
}
}
| [
"ghosh.c@husky.neu.edu"
] | ghosh.c@husky.neu.edu |
27936c100f53233f83c45774865e3ec288602be7 | 45cf3c2a261ebaaea73decf5cc5a4c8f0869d686 | /anhanx-server-oauth/src/main/java/top/dfghhj/anhanx/oauth/config/AccessTokenConfig.java | d743decd08d1e171455dfa1cbc1d5a80055155bb | [] | no_license | Dfghhj/Anhanx | 395ac52c9f85fea434b28c8bcc5bc206389f5404 | 215e2659c82634e10f69afa1c8da7e5300369dea | refs/heads/master | 2022-06-22T04:39:04.271673 | 2020-06-04T03:11:55 | 2020-06-04T03:11:55 | 229,233,707 | 0 | 0 | null | 2022-06-17T02:44:35 | 2019-12-20T09:30:35 | Java | UTF-8 | Java | false | false | 686 | java | package top.dfghhj.anhanx.oauth.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
import javax.annotation.Resource;
@Configuration
public class AccessTokenConfig {
@Resource
RedisConnectionFactory redisConnectionFactory;
@Bean
TokenStore tokenStore() {
// return new InMemoryTokenStore();
return new RedisTokenStore(redisConnectionFactory);
}
}
| [
"dfghhj95@163.com"
] | dfghhj95@163.com |
30a8f0820ece3dfe1d202009a2623ebf6b475a07 | 2d7ea13433243b1804b847793055c8d9b4b840f0 | /src/main/java/com/howie/easyexcelmethodencapsulation/excel/ExcelListener.java | 6fcef0e79c246efc2b0643bf93d5d77ea817727b | [] | no_license | runfengxin/springboot-easyexcel | 0e8a0ba4bfa9a8b73f8e81a1e01450dcf230c4f8 | d1a52030284043ef74b35f42ddd9079d0e809ca6 | refs/heads/master | 2020-05-04T14:22:24.149407 | 2019-04-03T02:24:28 | 2019-04-03T02:24:28 | 179,193,954 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,597 | java | package com.howie.easyexcelmethodencapsulation.excel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import java.util.ArrayList;
import java.util.List;
/**
* Created with IntelliJ IDEA
*
* @Author yuanhaoyue swithaoy@gmail.com
* @Description 监听类,可以自定义
* @Date 2018-06-05
* @Time 16:58
*/
public class ExcelListener extends AnalysisEventListener {
//自定义用于暂时存储data。
//可以通过实例获取该值
private List<Object> datas = new ArrayList<>();
/**
* 通过 AnalysisContext 对象还可以获取当前 sheet,当前行等数据
*/
@Override
public void invoke(Object object, AnalysisContext context) {
//数据存储到list,供批量处理,或后续自己业务逻辑处理。
datas.add(object);
//根据业务自行 do something
doSomething();
/*
如数据过大,可以进行定量分批处理
if(datas.size()<=100){
datas.add(object);
}else {
doSomething();
datas = new ArrayList<Object>();
}
*/
}
/**
* 根据业务自行实现该方法
*/
private void doSomething() {
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
/*
datas.clear();
解析结束销毁不用的资源
*/
}
public List<Object> getDatas() {
return datas;
}
public void setDatas(List<Object> datas) {
this.datas = datas;
}
} | [
"854645907@qq.com"
] | 854645907@qq.com |
f6926d47fe0da42cf241138d05a8d7c5ab47e449 | d74ae31c66c8493260e4dbf8b3cc87581337174c | /src/main/java/hello/service/Customer1730Service.java | 58374e7a2ebaf9d7b3c6d6ba85757bccba6fda9e | [] | no_license | scratches/spring-data-gazillions | 72e36c78a327f263f0de46fcee991473aa9fb92c | 858183c99841c869d688cdbc4f2aa0f431953925 | refs/heads/main | 2021-06-07T13:20:08.279099 | 2018-08-16T12:13:37 | 2018-08-16T12:13:37 | 144,152,360 | 0 | 0 | null | 2021-04-26T17:19:34 | 2018-08-09T12:53:18 | Java | UTF-8 | Java | false | false | 223 | java | package hello.service;
import org.springframework.stereotype.Service;
import hello.repo.Customer1730Repository;
@Service
public class Customer1730Service {
public Customer1730Service(Customer1730Repository repo) {
}
}
| [
"dsyer@pivotal.io"
] | dsyer@pivotal.io |
0760d071090e898d8c356fe7b36f327c06d2ac49 | 46aed1858cf6649681db68d44dc07ec5ced4d5b7 | /src/main/java/cn/edu/sjtu/se/dclab/server/entity/SecondGoods.java | c649caa7998184ad57e926f1ed42026f3543a561 | [] | no_license | sjtudclab/community-server | 6e564ca3803bce009329b39c6b31365eeb26eca7 | a53a667a16b159f73339c38279fa5e85f6947dd0 | refs/heads/master | 2021-01-25T03:48:03.542442 | 2015-11-20T07:10:00 | 2015-11-20T07:10:00 | 31,941,829 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,277 | java | /**
*
*/
package cn.edu.sjtu.se.dclab.server.entity;
/**
* @author chenhui
*
*/
public class SecondGoods {
private Integer id;
private String category;
private String type;
private String title;
private String imagePath;
private String desc;
private String owner;
private String phone;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}
| [
"huiyi.li@outlook.com"
] | huiyi.li@outlook.com |
7ace2502b4a7fe8994e67b51708524b0857764d7 | 6b23d8ae464de075ad006c204bd7e946971b0570 | /WEB-INF/plugin/common/src/jp/groupsession/v2/cmn/cmn170/Cmn170Model.java | 1e2184df6858a08a327b2ca92ffc673c75964803 | [] | 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 | 2,384 | java | package jp.groupsession.v2.cmn.cmn170;
import java.io.Serializable;
import jp.co.sjts.util.NullDefault;
/**
* <br>[機 能] テーマ情報(画面表示用)を格納するModelクラス
* <br>[解 説]
* <br>[備 考]
*
* @author JTS
*/
public class Cmn170Model implements Serializable {
/** CTM_SID mapping */
private int ctmSid__;
/** CTM_PATH_IMG mapping */
private String ctmPathImg__;
/** CTM_NAME mapping */
private String ctmName__;
/** 登録人数 */
private int ctmPerCount__;
/**
* <p>Default Constructor
*/
public Cmn170Model() {
}
/**
* <p>get CTM_SID value
* @return CTM_SID value
*/
public int getCtmSid() {
return ctmSid__;
}
/**
* <p>set CTM_SID value
* @param ctmSid CTM_SID value
*/
public void setCtmSid(int ctmSid) {
ctmSid__ = ctmSid;
}
/**
* <p>get CTM_PATH_IMG value
* @return CTM_PATH_IMG value
*/
public String getCtmPathImg() {
return ctmPathImg__;
}
/**
* <p>set CTM_PATH_IMG value
* @param ctmPathImg CTM_PATH_IMG value
*/
public void setCtmPathImg(String ctmPathImg) {
ctmPathImg__ = ctmPathImg;
}
/**
* <p>get CTM_NAME value
* @return CTM_NAME value
*/
public String getCtmName() {
return ctmName__;
}
/**
* <p>set CTM_NAME value
* @param ctmName CTM_NAME value
*/
public void setCtmName(String ctmName) {
ctmName__ = ctmName;
}
/**
* <p>get ctmPerCount value
* @return ctmPerCount value
*/
public int getCtmPerCount() {
return ctmPerCount__;
}
/**
* <p>set ctmPerCount value
* @param ctmPerCount ctmPerCount value
*/
public void setCtmPerCount(int ctmPerCount) {
ctmPerCount__ = ctmPerCount;
}
/**
* <p>to Csv String
* @return Csv String
*/
public String toCsvString() {
StringBuilder buf = new StringBuilder();
buf.append(ctmSid__);
buf.append(",");
buf.append(NullDefault.getString(ctmPathImg__, ""));
buf.append(",");
buf.append(NullDefault.getString(ctmName__, ""));
return buf.toString();
}
}
| [
"PK140601-29@PK140601-29"
] | PK140601-29@PK140601-29 |
548beef4b65e34369af471bbf13325267ff50e4c | 00e3b812ae1c2c0a49a260d09db74645213e5928 | /app/src/main/java/com/project/cams/fragments/adminfrag/StudentFragment.java | 3d6045b0a5a9a6110fb94fa291b0bae2a2e900ac | [] | no_license | JaspreetKaur768702/Android-Project | 636dcc7319d11b1a7d1a0a9c3536bb40685b0783 | 53dce25dd8bfa8d6fb200df9d6f37a377cf10182 | refs/heads/master | 2023-04-11T01:27:56.507323 | 2021-04-27T20:03:48 | 2021-04-27T20:03:48 | 362,224,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,525 | java | package com.project.cams.fragments.adminfrag;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.project.cams.DBhelperclasses.AllStudents;
import com.project.cams.DBhelperclasses.AllTeacher;
import com.project.cams.DBhelperclasses.DataBaseCAMS;
import com.project.cams.MainActivity;
import com.project.cams.Utility.Global;
import com.project.cams.adapter.adminadapter.StudentAdapter;
import com.project.cams.adapter.adminadapter.TeacherAdapter;
import com.project.cams.databinding.StudentFragmentBinding;
import com.project.cams.fragments.adminfrag.AddStudentFragment;
import java.util.ArrayList;
import java.util.List;
public class StudentFragment extends Fragment {
StudentFragmentBinding binding;
StudentAdapter studentAdapter;
RecyclerView mRecyclerView;
DataBaseCAMS dataBase;
Context mContext;
List< AllStudents > mList;
// required***************//
public StudentFragment() {
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
mContext = context;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
dataBase = DataBaseCAMS.getInstance(mContext);
binding = StudentFragmentBinding.inflate(getLayoutInflater());
initView();
SetStudents();
return binding.getRoot();
}
private void initView() {
mRecyclerView = binding.studentRecycler;
MainActivity.floatingActionButton.bringToFront();
MainActivity.floatingActionButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Global.changeFragment(getActivity(), new AddStudentFragment());
}
});
}
private void SetStudents() {
mList = new ArrayList<>();
mList = dataBase.daoData().getAllStudents();
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
layoutManager.setOrientation(RecyclerView.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
studentAdapter = new StudentAdapter(mList, mContext);
mRecyclerView.setAdapter(studentAdapter);
}
}
| [
"81848208+JaspreetKaur768702@users.noreply.github.com"
] | 81848208+JaspreetKaur768702@users.noreply.github.com |
6cd53a7f4919c2f368e3aa003409528d5d266993 | 55e269125ae4a92691eee419543de6d9a639a900 | /src/com/example/cim/fragment/PCToolFragment.java | dc4f79440c7d1bb3dc846de01daba2dc5f6d45e0 | [] | no_license | calow/MyCIM | 095c9ac638a87b6ee4fcfd2594cdf0f971525098 | 7fa87ce6ee090a96329aeb696c8e0c654cf49684 | refs/heads/master | 2021-01-21T04:42:09.143122 | 2016-06-23T09:59:00 | 2016-06-23T09:59:00 | 51,994,627 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 6,239 | java | package com.example.cim.fragment;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import com.example.cim.R;
import com.example.cim.adapter.ToolsAdapter;
import com.example.cim.asynctask.AsyncTaskBase;
import com.example.cim.model.ToolEntity;
import com.example.cim.network.API;
import com.example.cim.nio.constant.Constant;
import com.example.cim.ui.ToolActivity;
import com.example.cim.view.CustomListView;
import com.example.cim.view.CustomListView.OnRefreshListener;
import com.example.cim.view.LoadingView;
import com.example.testwebview.WebviewActivity;
public class PCToolFragment extends Fragment implements OnItemClickListener {
private static final String TAG = "PCToolFragment";
private Context mContext;
private View mBaseView;
private View mSearchView;
private CustomListView mCustomListView;
private ToolsAdapter adapter;
private LoadingView mLoadingView;
LinkedList<ToolEntity> tes = new LinkedList<ToolEntity>();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mContext = getActivity();
mBaseView = inflater.inflate(R.layout.fragment_pctoollist, null);
mSearchView = inflater.inflate(R.layout.common_search_l, null);
findView();
init();
return mBaseView;
}
public void findView() {
mCustomListView = (CustomListView) mBaseView
.findViewById(R.id.lv_tools);
mLoadingView = (LoadingView) mBaseView.findViewById(R.id.loading);
}
public void init() {
adapter = new ToolsAdapter(mContext, tes, mCustomListView);
mCustomListView.setAdapter(adapter);
mCustomListView.addHeaderView(mSearchView);
mCustomListView.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh() {
new AsyncRefresh().execute(0);
}
});
mCustomListView.setOnItemClickListener(this);
mCustomListView.setCanLoadMore(false);
new ToolsAsyncTask(mLoadingView).execute(0);
}
private class ToolsAsyncTask extends AsyncTaskBase {
List<ToolEntity> recentTes = new ArrayList<ToolEntity>();
public ToolsAsyncTask(LoadingView loadingView) {
super(loadingView);
}
@Override
protected Integer doInBackground(Integer... params) {
int result = -1;
recentTes = new ArrayList<ToolEntity>();
try {
String response = API.httpPost(API.PcToolList_URL, null);
if (response != null && !response.equals("")
&& !response.equals("null")) {
JSONObject object = new JSONObject(response);
JSONArray data = object.getJSONArray("data");
for (int i = 0; i < data.length(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
ToolEntity entity = new ToolEntity();
entity.setToolId(jsonObject.getString("toolId"));
entity.setToolName(jsonObject.getString("toolName"));
entity.setPlateform(jsonObject.getString("platform"));
entity.setDescription(jsonObject
.getString("description"));
entity.setTvId(jsonObject.getString("tvId"));
recentTes.add(entity);
}
}
if (recentTes.size() >= 0) {
result = 1;
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
@Override
protected void onPostExecute(Integer result) {
super.onPostExecute(result);
tes.clear();
tes.addAll(recentTes);
adapter.notifyDataSetChanged();
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
}
private class AsyncRefresh extends
AsyncTask<Integer, Integer, List<ToolEntity>> {
private List<ToolEntity> recentTes = new ArrayList<ToolEntity>();
@Override
protected List<ToolEntity> doInBackground(Integer... params) {
recentTes = new ArrayList<ToolEntity>();
try {
String response = API.httpPost(API.PcToolList_URL, null);
if (response != null && !response.equals("")
&& !response.equals("null")) {
JSONObject object = new JSONObject(response);
JSONArray data = object.getJSONArray("data");
for (int i = 0; i < data.length(); i++) {
JSONObject jsonObject = data.getJSONObject(i);
ToolEntity entity = new ToolEntity();
entity.setToolId(jsonObject.getString("toolId"));
entity.setToolName(jsonObject.getString("toolName"));
entity.setPlateform(jsonObject.getString("platform"));
entity.setDescription(jsonObject
.getString("description"));
entity.setTvId(jsonObject.getString("tvId"));
recentTes.add(entity);
}
}
}catch (Exception e) {
e.printStackTrace();
}
return recentTes;
}
@Override
protected void onPostExecute(List<ToolEntity> result) {
super.onPostExecute(result);
if (result != null) {
updateItemStatu(result);
}
mCustomListView.onRefreshComplete();
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
if (id > -1) {
ToolEntity te = (ToolEntity) adapter.getItem(Integer
.parseInt(String.valueOf(id)));
Intent intent = new Intent(mContext, WebviewActivity.class);
String url = Constant.SERVER_URL + "/tool/tool_run.action?toolId=" + te.getToolId();
intent.putExtra("url", url);
intent.putExtra("title", te.getToolName());
mContext.startActivity(intent);
Activity activity = (Activity)mContext;
activity.overridePendingTransition(R.anim.activity_new, R.anim.activity_out);
} else {
System.out.println("ËÑË÷¿ò±»µã»÷£¡");
}
}
public void updateItemStatu(List<ToolEntity> list) {
tes.clear();
tes.addAll(list);
adapter.notifyDataSetChanged();
}
}
| [
"725517818@qq.com"
] | 725517818@qq.com |
e2575b6931c43269225755cba25a08f6cfc2a320 | 81cbb0310d9df813164081614abfd69485321d91 | /app/src/main/java/com/zzhou/entrance/guard/module/ShowCamera.java | e24ee94481def6e79c0edd24f1c2ababb90b33c1 | [] | no_license | gx625888/Entrance_Guard | f7fbbb7e602f1f6df5e45a2728981d039a193ebe | e7350607abf3ae9f699451af9a8f82605c01d16a | refs/heads/master | 2020-05-02T19:32:03.452183 | 2019-07-03T01:29:27 | 2019-07-03T01:29:27 | 178,161,286 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,562 | java | package com.zzhou.entrance.guard.module;
import java.io.IOException;
import java.lang.reflect.Method;
import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import com.zzhou.entrance.guard.R;
import com.zzhou.entrance.guard.util.LogUtils;
public class ShowCamera extends Activity implements SurfaceHolder.Callback {
private SurfaceView surfaceview;
private SurfaceHolder surfaceholder;
private Camera camera = null;
Camera.Parameters parameters;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera_surface);
LogUtils.d("<<<<<ShowCamera>>>>>");
surfaceview = (SurfaceView) findViewById(R.id.surface_view1);
surfaceholder = surfaceview.getHolder();
surfaceholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
surfaceholder.addCallback(this);
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
// TODO Auto-generated method stub
camera.autoFocus(new AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
if (success) {
initCamera();// 实现相机的参数初始化
camera.cancelAutoFocus();// 只有加上了这一句,才会自动对焦。
}
}
});
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
// TODO Auto-generated method stub
// 获取camera对象
camera = Camera.open();
try {
// 设置预览监听
camera.setPreviewDisplay(holder);
Camera.Parameters parameters = camera.getParameters();
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
parameters.set("orientation", "portrait");
camera.setDisplayOrientation(90);
parameters.setRotation(90);
} else {
parameters.set("orientation", "landscape");
camera.setDisplayOrientation(0);
parameters.setRotation(0);
}
camera.setParameters(parameters);
// 启动摄像头预览
camera.startPreview();
System.out.println("camera.startpreview");
} catch (IOException e) {
e.printStackTrace();
camera.release();
System.out.println("camera.release");
}
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
// TODO Auto-generated method stub
if (camera != null) {
camera.stopPreview();
camera.release();
}
}
// 相机参数的初始化设置
private void initCamera() {
LogUtils.d("<<<<<ShowCamera-initCamera>>>>>");
parameters = camera.getParameters();
parameters.setPictureFormat(PixelFormat.JPEG);
// parameters.setPictureSize(surfaceView.getWidth(),
// surfaceView.getHeight()); // 部分定制手机,无法正常识别该方法。
//parameters.setFlashMode(Parameters.FLASH_MODE_TORCH);
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);// 1连续对焦
setDispaly(parameters, camera);
camera.setParameters(parameters);
camera.startPreview();
camera.cancelAutoFocus();// 2如果要实现连续的自动对焦,这一句必须加上
}
// 控制图像的正确显示方向
private void setDispaly(Camera.Parameters parameters, Camera camera) {
if (Integer.parseInt(Build.VERSION.SDK) >= 8) {
setDisplayOrientation(camera, 180);
} else {
parameters.setRotation(180);
}
}
// 实现的图像的正确显示
private void setDisplayOrientation(Camera camera, int i) {
Method downPolymorphic;
try {
downPolymorphic = camera.getClass().getMethod("setDisplayOrientation", new Class[] { int.class });
if (downPolymorphic != null) {
downPolymorphic.invoke(camera, new Object[] { i });
}
} catch (Exception e) {
Log.e("Came_e", "图像出错");
}
}
} | [
"gx625888@gmail.com"
] | gx625888@gmail.com |
66121d38dba97cef9837ba2d4f326c5768ff5ec1 | 10f1f8965b7baf90a176785f6cfb44149351f484 | /app/src/main/java/com/xyoye/dandanplay/ui/weight/material/MaterialBottomNavigationView.java | cd06121b7cbb4e21e0bcdedd432d027546bcafbf | [
"MIT"
] | permissive | andylao62/DanDanPlayForAndroid | 3c581f52c63b2ec5df1df98c4869717a11e40598 | 3d8176f2289702f12ddddfb0a41e450e0da92a2e | refs/heads/master | 2023-02-18T02:44:23.189746 | 2021-01-18T07:18:24 | 2021-01-18T07:18:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,461 | java | package com.xyoye.dandanplay.ui.weight.material;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Nullable;
import com.xyoye.dandanplay.R;
import skin.support.design.widget.SkinMaterialBottomNavigationView;
import skin.support.widget.SkinCompatBackgroundHelper;
public class MaterialBottomNavigationView extends SkinMaterialBottomNavigationView {
private SkinCompatBackgroundHelper backgroundHelper;
public MaterialBottomNavigationView(Context context) {
this(context,null);
}
public MaterialBottomNavigationView(Context context, @Nullable AttributeSet attrs) {
this(context,attrs, R.attr.bottomNavigationStyle);
}
public MaterialBottomNavigationView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
backgroundHelper = new SkinCompatBackgroundHelper(this);
backgroundHelper.loadFromAttributes(attrs, defStyleAttr);
}
@Override
public void setBackgroundResource(int resid) {
super.setBackgroundResource(resid);
if (backgroundHelper != null) {
backgroundHelper.onSetBackgroundResource(resid);
}
}
private void applyBackground() {
if (backgroundHelper != null) {
backgroundHelper.applySkin();
}
}
@Override
public void applySkin() {
super.applySkin();
applyBackground();
}
}
| [
"fujia625@gmail.com"
] | fujia625@gmail.com |
8597844c7fb493d2403daf2452fb872dcc5e4031 | 22a4d49f9bbfe9cd09f3c8bdcb55e5715a65e3a3 | /chapter_001/src/main/java/ru/job4j/max/Max.java | 7a20da213f8196d1848805a618a298bd2f93d43b | [
"Apache-2.0"
] | permissive | dpopkov/job4j | 47b0511818a0a2539dc9e977036a6cc0bf0ed973 | b96f49f7b9ccd0469bf059663d81b3bde739363c | refs/heads/master | 2022-09-23T06:38:57.900348 | 2021-04-27T20:10:59 | 2021-04-27T20:10:59 | 145,213,360 | 1 | 2 | Apache-2.0 | 2022-09-01T23:13:35 | 2018-08-18T11:08:19 | Java | UTF-8 | Java | false | false | 722 | java | package ru.job4j.max;
/**
* Contains methods for finding the maximum value.
*/
public class Max {
/**
* Finds maximum value of two integer numbers.
* @param first first number
* @param second second number
* @return maximum value
*/
@SuppressWarnings("ManualMinMaxCalculation")
public int max(int first, int second) {
return first > second ? first : second;
}
/**
* Finds maximum value of three integer numbers.
* @param first first number
* @param second second number
* @param third third number
* @return maximum value
*/
public int max(int first, int second, int third) {
return max(max(first, second), third);
}
}
| [
"pkvdenis@gmail.com"
] | pkvdenis@gmail.com |
b58f248d817d9b5b52e6796b925145d0a6db584f | 98c87237cef2f37b8cafbc22d7eeb5a019ef92e1 | /src/main/java/com/imooc/miaosha/vo/GoodsStockVo.java | c7f274479d6626cf49fe357791ef5b2508346724 | [
"Apache-2.0"
] | permissive | yangbao/imooc | eb65f0c2cd9477ab9a940e87853e6170ab849e17 | a74b80b5743fac7273029653adfa82518f9162dc | refs/heads/master | 2021-05-03T06:16:09.908269 | 2018-03-07T09:13:23 | 2018-03-07T09:13:23 | 120,590,755 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package com.imooc.miaosha.vo;
import com.imooc.miaosha.domain.Goods;
public class GoodsStockVo {
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
private int stockCount;
public int getStockCount() {
return stockCount;
}
public void setStockCount(int stockCount) {
this.stockCount = stockCount;
}
}
| [
"paul.yong@thomsonreuters.com"
] | paul.yong@thomsonreuters.com |
29aa95cb37d38b5bb6209c7f4237d65b8c7ee0c1 | 0e75d26812f6e52385e5295e86c123ba6930ece0 | /library1206/src/main/java/com/springboot/library/view/LibRequestBookView.java | 2f397fab10a2e87022c54dcc1f7612d0a40a4d45 | [] | no_license | valdetegjoni/library | 486ce843f5ea497042282a52771380a78424c3d6 | 16514e0aba1cba4d49778a35c8dd4c6b9fa97345 | refs/heads/master | 2023-05-19T20:36:52.359236 | 2021-06-15T09:23:29 | 2021-06-15T09:23:29 | 374,036,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package com.springboot.library.view;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
public class LibRequestBookView implements Serializable {
/**
*
*/
private static final long serialVersionUID = -593941230481240388L;
private Long id;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
private Date requestDate;
private LibBookView libBook;
private LibCustomerView libCustomer;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getRequestDate() {
return requestDate;
}
public void setRequestDate(Date requestDate) {
this.requestDate = requestDate;
}
public LibBookView getLibBook() {
return libBook;
}
public void setLibBook(LibBookView libBook) {
this.libBook = libBook;
}
public LibCustomerView getLibCustomer() {
return libCustomer;
}
public void setLibCustomer(LibCustomerView libCustomer) {
this.libCustomer = libCustomer;
}
}
| [
"gjoni_v@hotmail.com"
] | gjoni_v@hotmail.com |
e29875f0d4cc76f0747a1c8319a4a4586c75db2b | e9d4fc15c616e3861b7df783bdea702f305c13c7 | /otranse-os/samples/pss/src/main/java/com/lanyotech/pps/service/IOrderInfoService.java | 46bea2bd0e9de0d845a53882d8fd2e2df790fdc8 | [] | no_license | lingxfeng/myproject | 00ef0ebae258f1d5d187bf0be23dac653fcead23 | 1b14f47208cc456b68e2cb811a2a71c302be23d9 | refs/heads/master | 2021-01-13T05:02:00.200042 | 2017-02-07T08:01:51 | 2017-02-07T08:01:51 | 81,179,980 | 0 | 4 | null | 2020-03-14T10:57:39 | 2017-02-07T07:33:06 | JavaScript | UTF-8 | Java | false | false | 1,480 | java | package com.lanyotech.pps.service;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import cn.disco.core.support.query.IQueryObject;
import cn.disco.web.tools.IPageList;
import com.lanyotech.pps.domain.OrderInfo;
import com.lanyotech.pps.query.OrderInfoItemQuery;
/**
* OrderInfoService
* @author Disco Framework
*/
public interface IOrderInfoService {
/**
* 保存一个OrderInfo,如果保存成功返回该对象的id,否则返回null
*
* @param instance
* @return 保存成功的对象的Id
*/
Long addOrderInfo(OrderInfo instance);
/**
* 根据一个ID得到OrderInfo
*
* @param id
* @return
*/
OrderInfo getOrderInfo(Long id);
/**
* 删除一个OrderInfo
* @param id
* @return
*/
boolean delOrderInfo(Long id);
/**
* 批量删除OrderInfo
* @param ids
* @return
*/
boolean batchDelOrderInfos(List<Serializable> ids);
/**
* 通过一个查询对象得到OrderInfo
*
* @param properties
* @return
*/
IPageList getOrderInfoBy(IQueryObject queryObject);
/**
* 更新一个OrderInfo
* @param id 需要更新的OrderInfo的id
* @param dir 需要更新的OrderInfo
*/
boolean updateOrderInfo(Long id,OrderInfo instance);
/**
* 删除订单明细条目
* @param id
* @return
*/
boolean delOrderInfoItem(Long id);
/**
* 销售统计
* @param query
* @param groupBy
* @return
*/
List<Map> statistics(OrderInfoItemQuery query,String groupBy);
}
| [
"991736913@qq.com"
] | 991736913@qq.com |
33e9fe0719436a4153c4a3cd109bbd3c030dbdb3 | 6528a167cecb327d8c5d633e189c6fb970b96793 | /src/main/java/hellojpa/JpaMain.java | e73e6a227100010d609e2c108ec420239d87e9da | [] | no_license | JMSSUN/jpa-basic | 23fef336b55faf246f122641c018224fcb70cdec | 5f16fd896ff11a57d49a2a193ee6430403241a9f | refs/heads/master | 2023-04-20T13:59:08.921084 | 2021-05-06T09:38:24 | 2021-05-06T09:38:24 | 363,932,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,752 | java | package hellojpa;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import java.util.List;
public class JpaMain {
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("hello");
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
tx.begin();
try {
/*
****insert
Member member = new Member();
member.setId(2L);
member.setName("HelloB");
m.persist(member);
****삭제
em.remove(findMember);
****찾기
Member findMember = em.find(Member.class, 1L);
System.out.println("findMember.id = "+findMember.getId());
****수정
findMember.setName("HelloJPA");
List<Member> result = em.createQuery("select m from Member as m", Member.class).getResultList();
for (Member member : result) {
System.out.println("member = " + member.getName());
}
*/
// 비영속
// Member member = new Member();
// member.setId(101L);
// member.setName("HelloJPA");
// 영속
// em.persist(member);
Member m = new Member();
m.setId(2L);
m.setUsername("B");
m.setRoleType(RoleType.ADMIN);
em.persist(m);
tx.commit();
} catch(Exception e) {
tx.rollback();
} finally {
em.close();
}
emf.close();
}
}
| [
"j_mssun@naver.com"
] | j_mssun@naver.com |
209aec6a4d1c05af519bb4c40234e8b3cf526c36 | 5e316c355d6838c7828bda1d49c900deb19b127e | /DevWorks/Java/BattleShipBoVersion/src/demo1/message/SystemMessage.java | c07f3b61a76d8ea7bb09d0548d6146c89ec3e7db | [] | no_license | Mtnrunrmidge/Bo_Battleship_Server | b46d40b4a93608c25b7289dc7cb852a4139d28f1 | 6854fe60a428de6a19a3cfdd6990cc4f396c8517 | refs/heads/master | 2020-03-25T22:26:07.173132 | 2018-08-10T01:52:19 | 2018-08-10T01:52:19 | 144,222,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,982 | java | package demo1.message;
import demo1.GridStatus;
import demo1.GridType;
import demo1.Player;
public class SystemMessage extends Message{
public enum SystemResponse {ACK, DENY, READY, START, OVER}
private SystemResponse sr;
private String winner;
private GridType[][] gt;
public SystemMessage(String username, SystemResponse sr) {
super(null);
this.sr = sr;
setWinner(username);
}
public SystemMessage(SystemResponse sr) {
super(null);
this.sr = sr;
setWinner(null);
}
public SystemMessage(SystemResponse sr, GridType[][] gt) {
super(null);
this.sr = sr;
setWinner(null);
this.gt = gt;
}
// start game signal from server to clients
public static SystemMessage getReadyMessage(GridType[][] gt) {
return new SystemMessage(SystemResponse.READY, gt);
}
// start game signal from server to clients
public static SystemMessage getStartMessage() {
return new SystemMessage(SystemResponse.START);
}
public static SystemMessage getAckMessage() {
return new SystemMessage(SystemResponse.ACK);
}
public static SystemMessage getDenyMessage() {
return new SystemMessage(SystemResponse.DENY);
}
public static SystemMessage getGameOverMessage(String username) {
return new SystemMessage(username, SystemResponse.OVER);
}
public SystemResponse getSystemResponse() {
return sr;
}
public String getWinner() {
return winner;
}
public void setWinner(String winner) {
this.winner = winner;
}
public GridType[][] getGt() {
return gt;
}
@Override
public MessageType getMessageType() {
return MessageType.SYSTEM;
}
@Override
public String toString() {
return "SystemMessage{" +
"sr=" + sr +
", winner='" + winner + '\'' +
'}';
}
}
| [
"boyu@mail.weber.edu"
] | boyu@mail.weber.edu |
0b1950a9598c26a9a6855e1d39f3fae3ea2c0492 | d67f6450b24fb08f2f61b74dcdecce3025ee3efc | /gemp-swccg-cards/src/main/java/com/gempukku/swccgo/cards/set9/light/Card9_079.java | 4f3d67a1dfed1ce830d71882da66e2397628bdb2 | [
"MIT"
] | permissive | cburyta/gemp-swccg-public | 00a974d042195e69d3c104e61e9ee5bd48728f9a | 05529086de91ecb03807fda820d98ec8a1465246 | refs/heads/master | 2023-01-09T12:45:33.347296 | 2020-10-26T14:39:28 | 2020-10-26T14:39:28 | 309,400,711 | 0 | 0 | MIT | 2020-11-07T04:57:04 | 2020-11-02T14:47:59 | null | UTF-8 | Java | false | false | 1,979 | java | package com.gempukku.swccgo.cards.set9.light;
import com.gempukku.swccgo.cards.AbstractCapitalStarship;
import com.gempukku.swccgo.cards.AbstractPermanentAboard;
import com.gempukku.swccgo.cards.AbstractPermanentPilot;
import com.gempukku.swccgo.common.Icon;
import com.gempukku.swccgo.common.ModelType;
import com.gempukku.swccgo.common.PlayCardOptionId;
import com.gempukku.swccgo.common.Side;
import com.gempukku.swccgo.filters.Filter;
import com.gempukku.swccgo.filters.Filters;
import com.gempukku.swccgo.game.PhysicalCard;
import com.gempukku.swccgo.game.SwccgGame;
import java.util.Collections;
import java.util.List;
/**
* Set: Death Star II
* Type: Starship
* Subtype: Capital
* Title: Mon Calamari Star Cruiser
*/
public class Card9_079 extends AbstractCapitalStarship {
public Card9_079() {
super(Side.LIGHT, 1, 8, 7, 5, null, 3, 9, "Mon Calamari Star Cruiser");
setLore("Mon Cal MC80 cruiser. Originally a civilian ship. Converted to military use following the liberation of Mon Calamari from the Empire.");
setGameText("Deploys only at Mon Calamari or any Rebel Base. May add 5 pilots, 6 passengers, 1 vehicle and 3 starfighters. Has ship-docking capability. Permanent pilot aboard provides ability of 2.");
addIcons(Icon.DEATH_STAR_II, Icon.PILOT, Icon.NAV_COMPUTER, Icon.SCOMP_LINK);
addModelType(ModelType.MON_CALAMARI_STAR_CRUISER);
setPilotCapacity(5);
setPassengerCapacity(6);
setVehicleCapacity(1);
setStarfighterCapacity(3);
}
@Override
protected Filter getGameTextValidDeployTargetFilter(SwccgGame game, PhysicalCard self, PlayCardOptionId playCardOptionId, boolean asReact) {
return Filters.or(Filters.Deploys_at_Mon_Calamari, Filters.Deploys_at_Rebel_Base);
}
@Override
protected List<? extends AbstractPermanentAboard> getGameTextPermanentsAboard() {
return Collections.singletonList(new AbstractPermanentPilot(2) {});
}
}
| [
"andrew@bender.io"
] | andrew@bender.io |
ff6d08b649f7f2752fd31a73416089d6a41bd8c0 | 6e4594667da81670bcaf8f763ea03ef692728490 | /yourong-core/src/test/java/com/yourong/core/OverdueRepayLogManageTest.java | 0e09e948877d3449a4210c58c53db4d6ca5e8b05 | [] | no_license | cenbow/Daisy | d669db7e80677f9dc6162e78b1b150d31e649d56 | 29a83841acefbe55631b32c51f1f8af723bea20d | refs/heads/master | 2021-01-20T08:31:54.755391 | 2017-04-28T09:40:28 | 2017-04-28T09:40:28 | 90,162,687 | 0 | 1 | null | 2017-05-03T15:11:00 | 2017-05-03T15:11:00 | null | UTF-8 | Java | false | false | 1,398 | java | package com.yourong.core;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import com.yourong.common.exception.ManagerException;
import com.yourong.core.fin.manager.OverdueRepayLogManager;
import com.yourong.core.fin.manager.UnderwriteLogManager;
import com.yourong.core.ic.model.ProjectInterestBiz;
/**
*
* @desc 逾期还款记录测试用例
* @author chaisen
* 2016年3月14日上午11:02:33
*/
public class OverdueRepayLogManageTest extends BaseTest {
@Autowired
private OverdueRepayLogManager overdueRepayLogManager;
@Autowired
private UnderwriteLogManager underwriteLogManager;
/**
*
* @Description:保存逾期还款记录
* @return
* @throws ManagerException
* @author: chaisen
* @time:2016年3月14日 上午11:07:57
*/
//@Test
@Rollback(false)
public int saveOverdueRepayLogTest() throws ManagerException{
ProjectInterestBiz biz=new ProjectInterestBiz();
int i=overdueRepayLogManager.saveOverdueRepayLog(biz);
return i;
}
/**
*
* @return 统计逾期记录数
* @throws ManagerException
*/
@Test
@Rollback(false)
public int countOverdueRepayLogByProjectIdTest() throws ManagerException{
int i=overdueRepayLogManager.countOverdueRepayLogByProjectId(984509394L);
return i;
}
}
| [
"zheng.qiujun@yrw.com"
] | zheng.qiujun@yrw.com |
a33a5acb41d04c02fff061e140cbfa27f177448b | aa024b8784fa58b3cb385d70731285811f295af5 | /app/src/main/java/com/example/map/Pockemon.java | d5a4e4838a818d594e92f03ac84bed261cdbdb1f | [] | no_license | Dimpy1997-cyber/Pokemon-game | 13a2de2bffab63af8b87aa9e029993eeb12b0c0b | 536fcaa489ec684b752bec2d8ffaa4a236a8f81a | refs/heads/master | 2020-08-03T04:57:11.121379 | 2019-09-29T08:39:15 | 2019-09-29T08:39:15 | 211,630,865 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package com.example.map;
import android.location.Location;
public class Pockemon {
public int Image;
public String name;
public String des;
public double power;
public boolean isCatch;
public Location location;
Pockemon(int Image,String name,String des, double power,double lat, double lag){
this.Image=Image;
this.name=name;
this.des=des;
this.power=power;
this.isCatch=false;
location=new Location(name);
location.setLongitude(lag);
location.setLatitude(lat);
}
}
| [
"dimpygoel@rocketmail.com"
] | dimpygoel@rocketmail.com |
21a50162779795404d40e3b74be9b4639653df5b | 6f2ab0b4c0d7da9dab517c2d09bd2cced9ebca3f | /src/main/java/com/example/SampleBackEnd/controller/SampleController.java | 224482c82e65115b5cf4154d76f48b4af7c02d85 | [] | no_license | ArunMuthu-NS/SampleBackEndApp | bc34c454cd17f68b3af6d01d15c571d0b6575387 | bb86d150bdae04494b9b92610d2d3a7c6807143c | refs/heads/master | 2021-01-02T05:07:03.298686 | 2020-02-10T12:17:15 | 2020-02-10T12:17:15 | 239,501,474 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package com.example.SampleBackEnd.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SampleController {
@RequestMapping(method = RequestMethod.GET, path = "")
public String getMethod() {
return "Hi there Arun";
}
}
| [
"arunkumar.muthusamy@metapack.com"
] | arunkumar.muthusamy@metapack.com |
e305412334d7d98ff81fbb4e136e75791c63a09b | c748f85e44e2cef0031c0956c15ef81b7e52f016 | /src/se/sogeti/tdd/chicken/dao/CustomerDAO.java | d5cfb78cc95f794bd82dc9ba388b848a9b8a2eef | [] | no_license | demassinner/tddCrashCourse | bb1af3b0175d44d239390de9a8b900a693535ca9 | 697de7a971039f6ae4275f0de7dcd98ced2414be | refs/heads/master | 2020-06-04T18:17:12.070215 | 2012-11-09T11:24:11 | 2012-11-09T11:24:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 169 | java | package se.sogeti.tdd.chicken.dao;
import java.sql.SQLException;
public interface CustomerDAO {
void save(String name, int customerNumer) throws SQLException;
}
| [
"demas.sinner@sogeti.se"
] | demas.sinner@sogeti.se |
3d7934ae971e2eb0c69802f17e0e74e65085504e | 697a645b01b51e821ff8b048eda54c78e59ad58d | /app/src/main/java/com/byd/vtdr/fragment/FragmentPhotoPreview.java | d6f1337f65801c223ac926db67937b8a2e7b63c3 | [] | no_license | 1214658495/VTDR_backup | 88054aac8808634a64fb7542c55b5f9ab6f0957a | 98d7899eeb29dc879aea62809f04a5f82a5c7377 | refs/heads/master | 2020-03-22T19:09:32.999353 | 2018-07-18T01:46:35 | 2018-07-18T01:46:36 | 140,509,744 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,398 | java | package com.byd.vtdr.fragment;
import android.app.Activity;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.byd.vtdr.ActivityImagesViewPager;
import com.byd.vtdr.MainActivity;
import com.byd.vtdr.Model;
import com.byd.vtdr.R;
import com.byd.vtdr.RemoteCam;
import com.byd.vtdr.ServerConfig;
import com.byd.vtdr.connectivity.IFragmentListener;
import com.byd.vtdr.utils.DownloadUtil;
import com.byd.vtdr.view.CustomDialog;
import com.byd.vtdr.view.MyViewPager;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;
/**
* Created by byd_tw on 2018/3/15.
*/
public class FragmentPhotoPreview 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";
private static CustomDialog customDialog = null;
private ArrayList<Model> mParam1;
private int mParam2;
Unbinder unbinder;
@BindView(R.id.vp_viewPager)
MyViewPager vpViewPager;
@BindView(R.id.tv_vpIndex)
TextView tvVpIndex;
@BindView(R.id.btn_back_to_gridview)
ImageButton btnBackToGridview;
@BindView(R.id.tv_title_photo)
TextView tvTitlePhoto;
@BindView(R.id.rl_bar_showTitle)
RelativeLayout rlBarShowTitle;
@BindView(R.id.btn_share_preview)
ImageButton btnSharePreview;
@BindView(R.id.btn_delete_preview)
ImageButton btnDeletePreview;
@BindView(R.id.btn_zoom)
ImageButton btnZoom;
@BindView(R.id.ll_bar_editPhoto)
LinearLayout llBarEditPhoto;
private static RemoteCam mRemoteCam;
private MyImagesPagerAdapter myImagesPagerAdapter;
private ArrayList<Model> photoLists;
private static int currentItem;
private static final int FADE_OUT = 1;
private IFragmentListener mListener;
public boolean reload = false;
public boolean customDialogOR = false;
public static FragmentPhotoPreview newInstance() {
FragmentPhotoPreview fragmentPhotoPreview = new FragmentPhotoPreview();
return fragmentPhotoPreview;
}
public void setRemoteCam(RemoteCam mRemoteCam) {
this.mRemoteCam = mRemoteCam;
}
public FragmentPhotoPreview() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
Bundle bundle = getArguments();//从activity传过来的Bundle
if (bundle != null) {
photoLists = (ArrayList<Model>) bundle.getSerializable("mPhotoList");
currentItem = (bundle.getInt("position"));
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.frament_photo_preview, container, false);
unbinder = ButterKnife.bind(this, view);
if (savedInstanceState != null) {
ArrayList<String> name = savedInstanceState.getStringArrayList("name");
ArrayList<String> time = savedInstanceState.getStringArrayList("time");
ArrayList<Integer> size = savedInstanceState.getIntegerArrayList("size");
photoLists = new ArrayList<>();
int length = name.size();
for (int i = 0; i < length; i++) {
Model temp = new Model(name.get(i), time.get(i), size.get(i));
photoLists.add(temp);
}
currentItem = (savedInstanceState.getInt("position"));
customDialogOR = savedInstanceState.getBoolean("customDialogOR");
}
if (photoLists.size() != 0) {
initData();
}
reload = true;
return view;
}
// TODO: Rename method, update argument and hook method into UI event
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mListener = (IFragmentListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement IFragmentListener");
}
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
@Override
public void onDestroyView() {
mHandler.removeCallbacksAndMessages(null);
super.onDestroyView();
}
/**
* 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.
*/
public interface OnFragmentInteractionListener {
// TODO: Update argument type and name
void onFragmentInteraction(Uri uri);
}
private void initData() {
myImagesPagerAdapter = new MyImagesPagerAdapter(photoLists, this);
vpViewPager.setAdapter(myImagesPagerAdapter);
vpViewPager.setCurrentItem(currentItem, false);
vpViewPager.setOffscreenPageLimit(0);
// tvVpIndex.setText(currentItem + 1 + "/" + urlList.size());
tvTitlePhoto.setText(photoLists.get(currentItem).getName());
tvVpIndex.setText(currentItem + 1 + "/" + photoLists.size());
vpViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
currentItem = position;
tvVpIndex.setText(currentItem + 1 + "/" + photoLists.size());
tvTitlePhoto.setText(photoLists.get(currentItem).getName());
}
});
if (customDialogOR) {
Dialoagview();
}
Message msg = mHandler.obtainMessage(FADE_OUT);
mHandler.removeMessages(FADE_OUT);
mHandler.sendMessageDelayed(msg, 3000);
}
@OnClick({R.id.btn_back_to_gridview, R.id.btn_share_preview, R.id.btn_export_preview, R.id.btn_delete_preview, R.id
.btn_zoom})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.btn_back_to_gridview:
// TODO: 2017/11/29 删除完成了,需要去更新gridview
reload = false;
((MainActivity) getActivity()).updateCardData();
getActivity().getSupportFragmentManager().popBackStack();
break;
case R.id.btn_share_preview:
sharePhoto();
break;
case R.id.btn_export_preview:
countsDownload();
break;
case R.id.btn_delete_preview:
Dialoagview();
break;
case R.id.btn_zoom:
Intent intent = new Intent(view.getContext(), ActivityImagesViewPager.class);
intent.putExtra("mPhotoList", photoLists);
intent.putExtra("position", currentItem);
startActivity(intent);
break;
default:
break;
}
}
private final MyHandler mHandler = new MyHandler(this);
public static class MyHandler extends Handler {
private WeakReference<FragmentPhotoPreview> mFragmentPhotoPreview;
MyHandler(FragmentPhotoPreview fragmentPhotoPreview) {
mFragmentPhotoPreview = new WeakReference<>(fragmentPhotoPreview);
}
@Override
public void handleMessage(Message msg) {
FragmentPhotoPreview fragmentPhotoPreview = mFragmentPhotoPreview.get();
if (fragmentPhotoPreview != null) {
switch (msg.what) {
case FADE_OUT:
if (fragmentPhotoPreview.rlBarShowTitle.getVisibility() == View.VISIBLE) {
fragmentPhotoPreview.rlBarShowTitle.setVisibility(View.INVISIBLE);
}
if (fragmentPhotoPreview.llBarEditPhoto.getVisibility() == View.VISIBLE) {
fragmentPhotoPreview.llBarEditPhoto.setVisibility(View.INVISIBLE);
}
break;
default:
break;
}
}
}
}
public class MyImagesPagerAdapter extends PagerAdapter {
private ArrayList<Model> mPhotoLists;
private MainActivity activity;
MyImagesPagerAdapter(ArrayList<Model> mPhotoLists, FragmentPhotoPreview activity) {
// this.imageUrls = imageUrls;
this.mPhotoLists = mPhotoLists;
this.activity = (MainActivity) getActivity();
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
// String url = imageUrls.get(position);
// String url = "http://" + ServerConfig.VTDRIP + "/SD0/NORMAL/" +
// model.getName();
String url = "http://" + ServerConfig.VTDRIP + "/SD0/PHOTO/" + mPhotoLists.get
(position).getName();
PhotoView photoView = new PhotoView(activity);
Glide.with(activity).load(url).into(photoView);
container.addView(photoView);
photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float v, float v1) {
showTitleBar();
}
@Override
public void onOutsidePhotoTap() {
showTitleBar();
}
});
return photoView;
}
void showTitleBar() {
// 如下考虑算法优化
if (rlBarShowTitle.getVisibility() == View.VISIBLE) {
rlBarShowTitle.setVisibility(View.INVISIBLE);
} else {
rlBarShowTitle.setVisibility(View.VISIBLE);
}
if (llBarEditPhoto.getVisibility() == View.VISIBLE) {
llBarEditPhoto.setVisibility(View.INVISIBLE);
} else {
llBarEditPhoto.setVisibility(View.VISIBLE);
}
}
@Override
public int getCount() {
// return imageUrls != null ? imageUrls.size() : 0;
return mPhotoLists != null ? mPhotoLists.size() : 0;
}
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
ArrayList<String> name = new ArrayList<>();
ArrayList<String> time = new ArrayList<>();
ArrayList<Integer> size = new ArrayList<>();
int flag = photoLists.size();
for (int i = 0; i < flag; i++) {
name.add(photoLists.get(i).getName());
time.add(photoLists.get(i).getTime());
size.add(photoLists.get(i).getSize());
}
outState.putStringArrayList("name", name);
outState.putStringArrayList("time", time);
outState.putIntegerArrayList("size", size);
outState.putInt("position", currentItem);
outState.putBoolean("customDialogOR", customDialogOR);
super.onSaveInstanceState(outState);
}
public void Dialoagview() {
try {
if ((this.customDialog != null) && this.customDialog.isShowing()) {
this.customDialog.dismiss();
}
} catch (final IllegalArgumentException e) {
} catch (final Exception e) {
} finally {
this.customDialog = null;
}
customDialogOR = true;
CustomDialog.Builder builder = new CustomDialog.Builder(getActivity());
customDialog = builder.cancelTouchOut(false).view(R.layout
.fragment_doublebutton_dialog).style(R.style.CustomDialog).setTitle
(getString(R.string.del_image_sure)).addViewOnclick(R.id.btn_dialogSure, new View.OnClickListener() {
@Override
public void onClick(View view) {
String fileHead;
fileHead = "/tmp/SD0/PHOTO/";
customDialogOR = false;
mRemoteCam.deleteFile((String) (fileHead + photoLists.get(currentItem)
.getName()));
photoLists.remove(currentItem);
if (currentItem == 0 && photoLists.size() == 0) {
customDialog.dismiss();
reload = false;
((MainActivity) getActivity()).updateCardData();
getActivity().getSupportFragmentManager().popBackStack();
} else {
if (currentItem == photoLists.size()) {
currentItem--;
tvVpIndex.setText(currentItem + 1 + "/" + photoLists.size());
tvTitlePhoto.setText(photoLists.get(currentItem).getName());
myImagesPagerAdapter.notifyDataSetChanged();
// ((MainActivity)getActivity()).updateCardData();
customDialog.dismiss();
} else {
tvVpIndex.setText(currentItem + 1 + "/" + photoLists.size());
tvTitlePhoto.setText(photoLists.get(currentItem).getName());
myImagesPagerAdapter.notifyDataSetChanged();
customDialog.dismiss();
}
}
}
}).addViewOnclick(R.id.btn_dialogCancel, new View.OnClickListener() {
@Override
public void onClick(View view) {
customDialogOR = false;
customDialog.dismiss();
}
}).build();
customDialog.show();
}
private void countsDownload() {
String mGetFileName;
mGetFileName = "http://" + ServerConfig.VTDRIP + "/SD0/PHOTO/" + photoLists.get
(currentItem).getName();
String fileName = Environment.getExternalStorageDirectory() + "/行车记录仪" + mGetFileName
.substring(mGetFileName.lastIndexOf('/'));
File file = new File(fileName);
if (!file.exists()) {
DownloadManager downloadManager = (DownloadManager) getActivity().getSystemService
(Context.DOWNLOAD_SERVICE);
//创建下载任务,downloadUrl就是下载链接
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(mGetFileName));
//指定下载路径和下载文件名
request.setDestinationInExternalPublicDir("/行车记录仪/", photoLists.get(currentItem)
.getName());
//不显示下载界面
request.setVisibleInDownloadsUi(true);
downloadManager.enqueue(request);
Toast.makeText(getActivity(), R.string.Download_completed, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getActivity(), R.string.File_downloaded, Toast.LENGTH_SHORT).show();
}
}
private void sharePhoto() {
String mGetFileName;
mGetFileName = "http://" + ServerConfig.VTDRIP + "/SD0/PHOTO/" + photoLists.get
(currentItem).getName();
String fileName = Environment.getExternalStorageDirectory() + "/行车记录仪" + mGetFileName
.substring(mGetFileName.lastIndexOf('/'));
final File file = new File(fileName);
if (!file.exists()) {
final DownloadUtil downloadUtil = DownloadUtil.get();
downloadUtil.download(mGetFileName, "行车记录仪", new DownloadUtil.OnDownloadListener() {
@Override
public void onDownloadSuccess() {
Uri imageUri = Uri.fromFile(file);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, getString(R.string.share_to)));
}
@Override
public void onDownloading(final int progress) {
}
@Override
public void onDownloadFailed() {
}
@Override
public void onDownloadStart() {
}
});
} else {
Uri imageUri = Uri.fromFile(file);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, getString(R.string.share_to)));
}
}
}
| [
"1214658495@qq.com"
] | 1214658495@qq.com |
d9f67e38c614b37e7d3b7ab5c921981aba93ff33 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/31/31_aea40246ebba961979de05aa6048d56ce4c01771/LTLFormulaVisitor/31_aea40246ebba961979de05aa6048d56ce4c01771_LTLFormulaVisitor_t.java | 01f91314d4676e0db4a720ab9e677ab437389ed5 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 9,211 | java | package de.b2tla.ltl;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.List;
import de.b2tla.analysis.MachineContext;
import de.b2tla.exceptions.LTLParseException;
import de.b2tla.exceptions.ScopeException;
import de.b2tla.prettyprint.TLAPrinter;
import de.be4.classicalb.core.parser.BParser;
import de.be4.classicalb.core.parser.exceptions.BException;
import de.be4.classicalb.core.parser.node.AIdentifierExpression;
import de.be4.classicalb.core.parser.node.Node;
import de.be4.classicalb.core.parser.node.TIdentifierLiteral;
import de.be4.ltl.core.parser.analysis.DepthFirstAdapter;
import de.be4.ltl.core.parser.internal.LtlLexer;
import de.be4.ltl.core.parser.lexer.Lexer;
import de.be4.ltl.core.parser.lexer.LexerException;
import de.be4.ltl.core.parser.node.AActionLtl;
import de.be4.ltl.core.parser.node.AEnabledLtl;
import de.be4.ltl.core.parser.node.AExistsLtl;
import de.be4.ltl.core.parser.node.AForallLtl;
import de.be4.ltl.core.parser.node.AHistoricallyLtl;
import de.be4.ltl.core.parser.node.AOnceLtl;
import de.be4.ltl.core.parser.node.AReleaseLtl;
import de.be4.ltl.core.parser.node.ASinceLtl;
import de.be4.ltl.core.parser.node.AStrongFairLtl;
import de.be4.ltl.core.parser.node.ATriggerLtl;
import de.be4.ltl.core.parser.node.AUnparsedLtl;
import de.be4.ltl.core.parser.node.AUntilLtl;
import de.be4.ltl.core.parser.node.AWeakFairLtl;
import de.be4.ltl.core.parser.node.AWeakuntilLtl;
import de.be4.ltl.core.parser.node.AYesterdayLtl;
import de.be4.ltl.core.parser.node.PLtl;
import de.be4.ltl.core.parser.node.Start;
import de.be4.ltl.core.parser.parser.Parser;
import de.be4.ltl.core.parser.parser.ParserException;
public class LTLFormulaVisitor extends DepthFirstAdapter {
private final String name;
private final Start ltlFormulaStart;
private final MachineContext machineContext;
private final LinkedHashMap<de.be4.ltl.core.parser.node.Node, de.be4.classicalb.core.parser.node.Node> ltlNodeToBNodeTable;
private final ArrayList<LTLBPredicate> bPredicates;
private final Hashtable<String, AIdentifierExpression> ltlIdentifierTable;
private ArrayList<Hashtable<String, AIdentifierExpression>> contextTable;
public ArrayList<LTLBPredicate> getBPredicates() {
return bPredicates;
}
public Collection<AIdentifierExpression> getParameter() {
return ltlIdentifierTable.values();
}
public AIdentifierExpression getLTLIdentifier(String identifier) {
return ltlIdentifierTable.get(identifier);
}
public LinkedHashMap<de.be4.ltl.core.parser.node.Node, de.be4.classicalb.core.parser.node.Node> getUnparsedHashTable() {
return ltlNodeToBNodeTable;
}
public de.be4.classicalb.core.parser.node.Node getBAst(
de.be4.ltl.core.parser.node.Node unparsedLtl) {
return ltlNodeToBNodeTable.get(unparsedLtl);
}
public String getName() {
return this.name;
}
public LTLFormulaVisitor(String name, String ltlFormula,
MachineContext machineContext) {
this.name = name;
this.ltlFormulaStart = parse(ltlFormula);
this.machineContext = machineContext;
this.bPredicates = new ArrayList<LTLBPredicate>();
this.ltlNodeToBNodeTable = new LinkedHashMap<de.be4.ltl.core.parser.node.Node, de.be4.classicalb.core.parser.node.Node>();
this.ltlIdentifierTable = new Hashtable<String, AIdentifierExpression>();
this.contextTable = new ArrayList<Hashtable<String, AIdentifierExpression>>();
}
public void start() {
ltlFormulaStart.apply(this);
}
public Start getLTLFormulaStart() {
return ltlFormulaStart;
}
public void printLTLFormula(TLAPrinter tlaPrinter) {
LTLFormulaPrinter ltlFormulaPrinter = new LTLFormulaPrinter(tlaPrinter,
this);
}
public static Start parse(String ltlFormula) {
StringReader reader = new StringReader(ltlFormula);
PushbackReader r = new PushbackReader(reader);
Lexer l = new LtlLexer(r);
Parser p = new Parser(l);
Start ast = null;
try {
ast = p.parse();
} catch (Exception e) {
e.printStackTrace();
throw new LTLParseException(e.getMessage());
}
return ast;
}
@Override
public void caseAUnparsedLtl(AUnparsedLtl node) {
de.be4.classicalb.core.parser.node.Start start = parseBPredicate(node
.getPredicate().getText());
ltlNodeToBNodeTable.put(node, start);
LTLBPredicate ltlBPredicate = new LTLBPredicate(getUnifiedContext(),
start);
this.bPredicates.add(ltlBPredicate);
machineContext.checkLTLBPredicate(ltlBPredicate);
}
private de.be4.classicalb.core.parser.node.Start parseBPredicate(String text) {
String bPredicate = "#PREDICATE " + text;
BParser parser = new BParser("Testing");
de.be4.classicalb.core.parser.node.Start start = null;
try {
start = parser.parse(bPredicate, false);
} catch (BException e) {
e.printStackTrace();
}
return start;
}
@Override
public void caseAExistsLtl(AExistsLtl node) {
handleQuantification(node, node.getExistsIdentifier().getText(), node
.getPredicate().getText(), node.getLtl());
}
@Override
public void caseAForallLtl(AForallLtl node) {
handleQuantification(node, node.getForallIdentifier().getText(), node
.getPredicate().getText(), node.getLtl());
}
private void handleQuantification(de.be4.ltl.core.parser.node.Node node,
String parameterName, String bPredicateString, PLtl ltl) {
// create an identifier (b ast node) for the parameter of the
// quantification
List<TIdentifierLiteral> list = new ArrayList<TIdentifierLiteral>();
list.add(new TIdentifierLiteral(parameterName));
AIdentifierExpression parameterNode = new AIdentifierExpression(list);
// add the created identifier to the current context
Hashtable<String, AIdentifierExpression> currentContext = new Hashtable<String, AIdentifierExpression>();
currentContext.put(parameterName, parameterNode);
this.contextTable.add(currentContext);
// collection the all parameters in
ltlIdentifierTable.put(parameterName, parameterNode);
// parse the b predicate and create a reference to the b ast node
de.be4.classicalb.core.parser.node.Start start = parseBPredicate(bPredicateString);
ltlNodeToBNodeTable.put(node, start);
// collect all identifiers which can be used in the bPredicate and
// verify the bPredicate
LTLBPredicate ltlBPredicate = new LTLBPredicate(getUnifiedContext(),
start);
this.bPredicates.add(ltlBPredicate);
machineContext.checkLTLBPredicate(ltlBPredicate);
// remaining LTL formula
ltl.apply(this);
// remove currentContext from contextTable
contextTable.remove(contextTable.size() - 1);
}
private LinkedHashMap<String, Node> getUnifiedContext() {
LinkedHashMap<String, Node> context = new LinkedHashMap<String, Node>();
for (int i = 0; i < contextTable.size(); i++) {
context.putAll(contextTable.get(i));
}
return context;
}
@Override
public void caseAEnabledLtl(AEnabledLtl node) {
String operationName = node.getOperation().getText();
if (!machineContext.getOperations().containsKey(operationName)) {
throw new ScopeException("Unkown operation " + operationName + ".");
}
}
@Override
public void caseAWeakFairLtl(AWeakFairLtl node) {
String operationName = node.getOperation().getText();
if (!machineContext.getOperations().containsKey(operationName)) {
throw new ScopeException("Unkown operation " + operationName + ".");
}
}
@Override
public void caseAStrongFairLtl(AStrongFairLtl node) {
String operationName = node.getOperation().getText();
if (!machineContext.getOperations().containsKey(operationName)) {
throw new ScopeException("Unkown operation " + operationName + ".");
}
}
public void inAUntilLtl(AUntilLtl node) {
throw new ScopeException(
"The 'until' operator is not supported by TLC.");
}
public void inAWeakuntilLtl(AWeakuntilLtl node) {
throw new ScopeException(
"The 'weak until' operator is not supported by TLC.");
}
public void inAReleaseLtl(AReleaseLtl node) {
throw new ScopeException(
"The 'release' operator is not supported by TLC.");
}
public void inASinceLtl(ASinceLtl node) {
throw new ScopeException(
"The 'since' operator is not supported by TLC.");
}
public void inATriggerLtl(ATriggerLtl node) {
throw new ScopeException(
"The 'trigger' operator is not supported by TLC.");
}
public void inAHistoricallyLtl(AHistoricallyLtl node) {
throw new ScopeException(
"The 'history' operator is not supported by TLC.");
}
public void inAOnceLtl(AOnceLtl node) {
throw new ScopeException("The 'once' operator is not supported by TLC.");
}
public void inAYesterdayLtl(AYesterdayLtl node) {
throw new ScopeException(
"The 'yesterday' operator is not supported by TLC.");
}
@Override
public void caseAActionLtl(AActionLtl node) {
throw new ScopeException(
"The '[...]' operator is not supported by TLC.");
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
aaa94d5dc67b2dd5a330a12dd342800e497f9b8f | 269bce0bf0e23f5e5f7b5d31167c8a804b62ae52 | /comparator-tools/modagame/MODAGAME_hppc_0.6.1/src.main.java/com/carrotsearch/hppc/DoubleShortAssociativeContainer.java | 59bc87d1210542493c8d58ef8c79e69bea133506 | [] | no_license | acapulco-spl/acapulco_replication_package | 5c4378b7662d6aa10f11f52a9fa8793107b34d6d | 7de4d9a96c11977f0cd73d761a4f8af1e0e064e0 | refs/heads/master | 2023-04-15T17:40:14.003166 | 2022-04-13T08:37:11 | 2022-04-13T08:37:11 | 306,005,002 | 3 | 1 | null | 2022-04-11T17:35:06 | 2020-10-21T11:39:59 | Java | UTF-8 | Java | false | false | 4,171 | java | package com.carrotsearch.hppc;
import java.util.Iterator;
import com.carrotsearch.hppc.cursors.*;
import com.carrotsearch.hppc.predicates.*;
import com.carrotsearch.hppc.procedures.*;
/**
* An associative container (alias: map, dictionary) from keys to (one or possibly more) values.
* Object keys must fulfill the contract of {@link Object#hashCode()} and {@link Object#equals(Object)}.
*
* <p>Note that certain associative containers (like multimaps) may return the same key-value pair
* multiple times from iterators.</p>
*
* @see DoubleContainer
*/
@javax.annotation.Generated(date = "2014-09-08T10:42:29+0200", value = "HPPC generated from: DoubleShortAssociativeContainer.java")
public interface DoubleShortAssociativeContainer
extends Iterable<DoubleShortCursor>
{
/**
* Returns a cursor over the entries (key-value pairs) in this map. The iterator is
* implemented as a cursor and it returns <b>the same cursor instance</b> on every
* call to {@link Iterator#next()}. To read the current key and value use the cursor's
* public fields. An example is shown below.
* <pre>
* for (IntShortCursor c : intShortMap)
* {
* System.out.println("index=" + c.index
* + " key=" + c.key
* + " value=" + c.value);
* }
* </pre>
*
* <p>The <code>index</code> field inside the cursor gives the internal index inside
* the container's implementation. The interpretation of this index depends on
* to the container.
*/
@Override
public Iterator<DoubleShortCursor> iterator();
/**
* Returns <code>true</code> if this container has an association to a value for
* the given key.
*/
public boolean containsKey(double key);
/**
* @return Returns the current size (number of assigned keys) in the container.
*/
public int size();
/**
* @return Return <code>true</code> if this hash map contains no assigned keys.
*/
public boolean isEmpty();
/**
* Removes all keys (and associated values) present in a given container. An alias to:
* <pre>
* keys().removeAll(container)
* </pre>
* but with no additional overhead.
*
* @return Returns the number of elements actually removed as a result of this call.
*/
public int removeAll(DoubleContainer container);
/**
* Removes all keys (and associated values) for which the predicate returns <code>true</code>.
* An alias to:
* <pre>
* keys().removeAll(container)
* </pre>
* but with no additional overhead.
*
* @return Returns the number of elements actually removed as a result of this call.
*/
public int removeAll(DoublePredicate predicate);
/**
* Applies a given procedure to all keys-value pairs in this container. Returns the argument (any
* subclass of {@link DoubleShortProcedure}. This lets the caller to call methods of the argument
* by chaining the call (even if the argument is an anonymous type) to retrieve computed values,
* for example.
*/
public <T extends DoubleShortProcedure> T forEach(T procedure);
/**
* Clear all keys and values in the container.
*/
public void clear();
/**
* Returns a collection of keys of this container. The returned collection is a view
* over the key set and any modifications (if allowed) introduced to the collection will
* propagate to the associative container immediately.
*/
public DoubleCollection keys();
/**
* Returns a container view of all values present in this container. The returned collection is a view
* over the key set and any modifications (if allowed) introduced to the collection will
* propagate to the associative container immediately.
*/
public ShortContainer values();
}
| [
"daniel_str@gmx.de"
] | daniel_str@gmx.de |
e36478b0a0a1a7dde9a72672cc467ae643528ed3 | 1ae2b0bb2d314462581120ee33f5f35fe8654cd9 | /src/main/java/com/app/web/rest/UserResource.java | d30b70aec0675ca8f421730fbe30515a4d911a80 | [] | no_license | BulkSecurityGeneratorProject/OfficerManagement | e60f1483a1a90ad908c6bb5829c1c6f6a127606d | 803e996c33bb1cb2aea93c3e5e885022216c9416 | refs/heads/master | 2022-12-26T10:00:39.028089 | 2019-05-31T05:05:44 | 2019-05-31T05:05:44 | 296,590,136 | 0 | 0 | null | 2020-09-18T10:33:08 | 2020-09-18T10:33:07 | null | UTF-8 | Java | false | false | 8,788 | java | package com.app.web.rest;
import com.app.config.Constants;
import com.app.domain.User;
import com.app.repository.UserRepository;
import com.app.security.AuthoritiesConstants;
import com.app.service.MailService;
import com.app.service.UserService;
import com.app.service.dto.UserDTO;
import com.app.web.rest.errors.BadRequestAlertException;
import com.app.web.rest.errors.EmailAlreadyUsedException;
import com.app.web.rest.errors.LoginAlreadyUsedException;
import io.github.jhipster.web.util.HeaderUtil;
import io.github.jhipster.web.util.PaginationUtil;
import io.github.jhipster.web.util.ResponseUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.util.UriComponentsBuilder;
import javax.validation.Valid;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
/**
* REST controller for managing users.
* <p>
* This class accesses the {@link User} entity, and needs to fetch its collection of authorities.
* <p>
* For a normal use-case, it would be better to have an eager relationship between User and Authority,
* and send everything to the client side: there would be no View Model and DTO, a lot less code, and an outer-join
* which would be good for performance.
* <p>
* We use a View Model and a DTO for 3 reasons:
* <ul>
* <li>We want to keep a lazy association between the user and the authorities, because people will
* quite often do relationships with the user, and we don't want them to get the authorities all
* the time for nothing (for performance reasons). This is the #1 goal: we should not impact our users'
* application because of this use-case.</li>
* <li> Not having an outer join causes n+1 requests to the database. This is not a real issue as
* we have by default a second-level cache. This means on the first HTTP call we do the n+1 requests,
* but then all authorities come from the cache, so in fact it's much better than doing an outer join
* (which will get lots of data from the database, for each HTTP call).</li>
* <li> As this manages users, for security reasons, we'd rather have a DTO layer.</li>
* </ul>
* <p>
* Another option would be to have a specific JPA entity graph to handle this case.
*/
@RestController
@RequestMapping("/api")
public class UserResource {
private final Logger log = LoggerFactory.getLogger(UserResource.class);
@Value("${jhipster.clientApp.name}")
private String applicationName;
private final UserService userService;
private final UserRepository userRepository;
private final MailService mailService;
public UserResource(UserService userService, UserRepository userRepository, MailService mailService) {
this.userService = userService;
this.userRepository = userRepository;
this.mailService = mailService;
}
/**
* {@code POST /users} : Creates a new user.
* <p>
* Creates a new user if the login and email are not already used, and sends an
* mail with an activation link.
* The user needs to be activated on creation.
*
* @param userDTO the user to create.
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new user, or with status {@code 400 (Bad Request)} if the login or email is already in use.
* @throws URISyntaxException if the Location URI syntax is incorrect.
* @throws BadRequestAlertException {@code 400 (Bad Request)} if the login or email is already in use.
*/
@PostMapping("/users")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<User> createUser(@Valid @RequestBody UserDTO userDTO) throws URISyntaxException {
log.debug("REST request to save User : {}", userDTO);
if (userDTO.getId() != null) {
throw new BadRequestAlertException("A new user cannot already have an ID", "userManagement", "idexists");
// Lowercase the user login before comparing with database
} else if (userRepository.findOneByLogin(userDTO.getLogin().toLowerCase()).isPresent()) {
throw new LoginAlreadyUsedException();
} else if (userRepository.findOneByEmailIgnoreCase(userDTO.getEmail()).isPresent()) {
throw new EmailAlreadyUsedException();
} else {
User newUser = userService.createUser(userDTO);
mailService.sendCreationEmail(newUser);
return ResponseEntity.created(new URI("/api/users/" + newUser.getLogin()))
.headers(HeaderUtil.createAlert(applicationName, "userManagement.created", newUser.getLogin()))
.body(newUser);
}
}
/**
* {@code PUT /users} : Updates an existing User.
*
* @param userDTO the user to update.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated user.
* @throws EmailAlreadyUsedException {@code 400 (Bad Request)} if the email is already in use.
* @throws LoginAlreadyUsedException {@code 400 (Bad Request)} if the login is already in use.
*/
@PutMapping("/users")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<UserDTO> updateUser(@Valid @RequestBody UserDTO userDTO) {
log.debug("REST request to update User : {}", userDTO);
Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) {
throw new EmailAlreadyUsedException();
}
existingUser = userRepository.findOneByLogin(userDTO.getLogin().toLowerCase());
if (existingUser.isPresent() && (!existingUser.get().getId().equals(userDTO.getId()))) {
throw new LoginAlreadyUsedException();
}
Optional<UserDTO> updatedUser = userService.updateUser(userDTO);
return ResponseUtil.wrapOrNotFound(updatedUser,
HeaderUtil.createAlert(applicationName, "userManagement.updated", userDTO.getLogin()));
}
/**
* {@code GET /users} : get all users.
*
* @param pageable the pagination information.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body all users.
*/
@GetMapping("/users")
public ResponseEntity<List<UserDTO>> getAllUsers(@RequestParam MultiValueMap<String, String> queryParams, UriComponentsBuilder uriBuilder, Pageable pageable) {
final Page<UserDTO> page = userService.getAllManagedUsers(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(uriBuilder.queryParams(queryParams), page);
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
/**
* Gets a list of all roles.
* @return a string list of all roles.
*/
@GetMapping("/users/authorities")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public List<String> getAuthorities() {
return userService.getAuthorities();
}
/**
* {@code GET /users/:login} : get the "login" user.
*
* @param login the login of the user to find.
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the "login" user, or with status {@code 404 (Not Found)}.
*/
@GetMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
public ResponseEntity<UserDTO> getUser(@PathVariable String login) {
log.debug("REST request to get User : {}", login);
return ResponseUtil.wrapOrNotFound(
userService.getUserWithAuthoritiesByLogin(login)
.map(UserDTO::new));
}
/**
* {@code DELETE /users/:login} : delete the "login" User.
*
* @param login the login of the user to delete.
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
*/
@DeleteMapping("/users/{login:" + Constants.LOGIN_REGEX + "}")
@PreAuthorize("hasRole(\"" + AuthoritiesConstants.ADMIN + "\")")
public ResponseEntity<Void> deleteUser(@PathVariable String login) {
log.debug("REST request to delete User: {}", login);
userService.deleteUser(login);
return ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName, "userManagement.deleted", login)).build();
}
}
| [
"ntquang22298@gmail.com"
] | ntquang22298@gmail.com |
fa54dd4f6456fb341fd91eab673f6232708c7825 | 946b89cc2a9954ec81d86ae103720a8c02bc60dd | /DiaMon/src/net/sf/dvstar/android/diamon/charts/BudgetPieChart.java | f68d7cdba4034f97f61e3c8361bbe205f0f24ee0 | [] | no_license | dmvstar/diamon | 10b7858111c00765dd6f1b028c6cba59df2d97e2 | 080ea3568ada4ac0db30d02def1bb913578f3654 | refs/heads/master | 2021-01-10T13:00:28.830799 | 2015-09-28T20:26:41 | 2015-09-28T20:26:41 | 43,241,836 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,947 | java | /**
* Copyright (C) 2009, 2010 SC 4ViewSoft SRL
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.dvstar.android.diamon.charts;
import org.achartengine.ChartFactory;
import org.achartengine.renderer.DefaultRenderer;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
/**
* Budget demo pie chart.
*/
public class BudgetPieChart extends AbstractDemoChart {
/**
* Returns the chart name.
*
* @return the chart name
*/
public String getName() {
return "Budget chart";
}
/**
* Returns the chart description.
*
* @return the chart description
*/
public String getDesc() {
return "The budget per project for this year (pie chart)";
}
/**
* Executes the chart demo.
*
* @param context the context
* @return the built intent
*/
public Intent execute(Context context) {
double[] values = new double[] { 12, 14, 11, 10, 19 };
int[] colors = new int[] { Color.BLUE, Color.GREEN, Color.MAGENTA, Color.YELLOW, Color.CYAN };
DefaultRenderer renderer = buildCategoryRenderer(colors);
renderer.setZoomButtonsVisible(true);
renderer.setZoomEnabled(true);
renderer.setChartTitleTextSize(20);
return ChartFactory.getPieChartIntent(context, buildCategoryDataset("Project budget", values),
renderer, "Budget");
}
}
| [
"dmvstar@gmail.com"
] | dmvstar@gmail.com |
191c0f9ed7eb219327293f39bc96eb4a3e831ad5 | cad0610a31b22e5eb15aed7034dbb3db31052b8b | /reddit/src/main/java/com/ackerman/reddit/aspect/HomeAspect.java | 9becf4e5124e7de056ccfb6e3d09f6e99e009701 | [] | no_license | TTLIUJJ/XMU_REDDIT | 7e446cb21446827c37c4e75a5ddcf5b06a3da3ea | 6707e96c195f4f3440eac9b901a2c3e1678ae9d8 | refs/heads/master | 2021-05-06T14:42:38.332993 | 2017-12-18T06:43:35 | 2017-12-18T06:43:35 | 113,393,053 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,311 | java | package com.ackerman.reddit.aspect;
import com.ackerman.reddit.model.News;
import com.ackerman.reddit.model.User;
import com.ackerman.reddit.utils.Entity;
import com.ackerman.reddit.utils.HostHolder;
import com.ackerman.reddit.utils.JedisUtil;
import com.ackerman.reddit.utils.ViewObject;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.validation.support.BindingAwareModelMap;
import java.util.List;
@Aspect
@Component
public class HomeAspect {
private static Logger logger = LoggerFactory.getLogger(HomeAspect.class);
@Autowired
private HostHolder hostHolder;
@Autowired
private JedisUtil jedisUtil;
@After("execution(* com.ackerman.reddit.controller.HomeController.*(..))")
public void after(JoinPoint joinPoint){
BindingAwareModelMap map = null;
try{
User user = hostHolder.getUser();
if(user == null){
return ;
}
for(Object object: joinPoint.getArgs()){
if(object instanceof BindingAwareModelMap){
map = (BindingAwareModelMap) object;
break;
}
}
if(map == null){
return;
}
List<ViewObject> vos = (List<ViewObject>) map.get("vos");
//收藏的key是一个用户对应多个新闻
String collectionsKey = Entity.getMyCollectKey(user.getId());
for(ViewObject vo : vos){
News news = (News)vo.get("news");
if(jedisUtil.sismember(collectionsKey, String.valueOf(news.getId()))){
vo.set("collected", 1);
}
//然而举报的key是一个新闻对应多个用户
String reportedKey = Entity.getReportNewsKey(news.getId());
if(jedisUtil.sismember(reportedKey, String.valueOf(user.getId()))){
vo.set("reported", 1);
}
}
}catch (Exception e){
e.getStackTrace();
}
}
}
| [
"ttliujj@gmail.com"
] | ttliujj@gmail.com |
cbad3fba91992a112f3a4913a374a2d5d5d49bfb | 82b839181fbddf77af2489541a6600667af44b28 | /app/src/main/java/sudo/nasaspaceapps/cryosphere/restBlogger/model/Blog.java | bc5b1050f759bf179d8c4d0a8488007a34e79cdf | [] | no_license | Kapil706/cryosphere | e971f87990b85f294dc7f82f46c0b16123c12ebe | 4e80ad022a335d1a26d2f98f00302d42f852f603 | refs/heads/master | 2020-04-02T03:39:52.982807 | 2018-10-21T05:46:56 | 2018-10-21T05:46:56 | 153,977,491 | 1 | 0 | null | 2018-10-21T05:46:01 | 2018-10-21T05:46:01 | null | UTF-8 | Java | false | false | 357 | java |
package sudo.nasaspaceapps.cryosphere.restBlogger.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Blog {
@SerializedName("id")
@Expose
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
| [
"sankalpchauhan.me@gmail.com"
] | sankalpchauhan.me@gmail.com |
63b92799baf27dfb05bf94f2797604b3efb271ff | 1bb8c81d9338a2c89c730fc7f156533d0f44f4d4 | /Lista_5/src/ex3/ContaBancaria.java | 7030b9c6d76f08f3e24c50cd71f73f6fa2b813e0 | [
"MIT"
] | permissive | Brunokrk/POO_Java | 8b6580de884c144b58c872948d3cffbaa57ca4ed | 5c2d06fa98dfa01e411cf102d6543bcd23c92ae8 | refs/heads/main | 2023-08-04T10:36:02.830331 | 2021-08-28T06:32:37 | 2021-08-28T06:32:37 | 310,121,294 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | java | package ex3;
import java.util.Date;
public class ContaBancaria {
private Double saldo;
public ContaBancaria(Double valor) {
this.saldo = valor;
}
public void sacar(Double valor) {
try {
if(valor > saldo) {
throw new SaldoInsuficienteException(valor - saldo);
}else {
this.saldo = this.saldo - valor;
System.out.println("Saque efetuado");
}
}catch(SaldoInsuficienteException si) {
System.out.println(si.toString());
}
}
public void pagarBoleto(Boleto boleto) {
Date atual = new Date();
try {
if(boleto.getVencimento().compareTo(atual) == -1) {
throw new BoletoVencidoException(boleto.getVencimento());
}else if(boleto.getValor() > this.saldo) {
throw new SaldoInsuficienteException(boleto.getValor()- saldo);
}else {
this.saldo = this.saldo - boleto.getValor();
}
}catch(BoletoVencidoException | SaldoInsuficienteException ee) {
System.out.println(ee.toString());
}
}
public Double getSaldo() {
return saldo;
}
public void setSaldo(Double saldo) {
this.saldo = saldo;
}
}
| [
"45456467+Brunokrk@users.noreply.github.com"
] | 45456467+Brunokrk@users.noreply.github.com |
a2f2be5eeb12aedca62f472b17a1c57ce4638f8d | 6fb79b4aff47c99e86b1fd2e86a32ba89d121cac | /src/main/java/io/swagger/model/Auth1GetconfigResVcodelonginconfig.java | c64bca7b68c1051c65c8723f4c541dc1179a2140 | [] | no_license | honor-zlc/swagger-spring | 723fdbb8e11590f371b66c165c6b114137d3e7eb | 15939f402102d8434101f7158e88019a33b04c7f | refs/heads/master | 2022-12-11T19:48:24.466061 | 2020-09-10T09:09:22 | 2020-09-10T09:09:22 | 294,359,371 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,969 | java | package io.swagger.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.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* 登录验证码配置信息
*/
@ApiModel(description = "登录验证码配置信息")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-10T06:15:45.348Z[GMT]")
public class Auth1GetconfigResVcodelonginconfig {
@JsonProperty("isenable")
private Boolean isenable = null;
@JsonProperty("passwderrcnt")
private Long passwderrcnt = null;
public Auth1GetconfigResVcodelonginconfig isenable(Boolean isenable) {
this.isenable = isenable;
return this;
}
/**
* 是否启用登录验证码功能
* @return isenable
**/
@ApiModelProperty(required = true, value = "是否启用登录验证码功能")
@NotNull
public Boolean isIsenable() {
return isenable;
}
public void setIsenable(Boolean isenable) {
this.isenable = isenable;
}
public Auth1GetconfigResVcodelonginconfig passwderrcnt(Long passwderrcnt) {
this.passwderrcnt = passwderrcnt;
return this;
}
/**
* 达到开启登录验证码的密码出错次数
* @return passwderrcnt
**/
@ApiModelProperty(required = true, value = "达到开启登录验证码的密码出错次数")
@NotNull
public Long getPasswderrcnt() {
return passwderrcnt;
}
public void setPasswderrcnt(Long passwderrcnt) {
this.passwderrcnt = passwderrcnt;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Auth1GetconfigResVcodelonginconfig auth1GetconfigResVcodelonginconfig = (Auth1GetconfigResVcodelonginconfig) o;
return Objects.equals(this.isenable, auth1GetconfigResVcodelonginconfig.isenable) &&
Objects.equals(this.passwderrcnt, auth1GetconfigResVcodelonginconfig.passwderrcnt);
}
@Override
public int hashCode() {
return Objects.hash(isenable, passwderrcnt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Auth1GetconfigResVcodelonginconfig {\n");
sb.append(" isenable: ").append(toIndentedString(isenable)).append("\n");
sb.append(" passwderrcnt: ").append(toIndentedString(passwderrcnt)).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 ");
}
}
| [
"1525590918@qq.com"
] | 1525590918@qq.com |
557d4a58f494643bb570d87984a038c1d4ddceed | 685dbe1807ced2175ae90e277bb2c77c14b23af4 | /src/main/java/com/hallila/teller/config/ApplicationConfig.java | 8647f461d331e433a3c020c28b63457fc9fcf985 | [] | no_license | Ram2305/bank-application | 4e9ba64fd11f683dad01d047bb90635ce94a5a0f | 5838188bb7aae4019a51e02e23564fa5dedc8b2f | refs/heads/master | 2023-03-16T14:54:33.128644 | 2017-01-29T20:39:03 | 2017-01-29T20:39:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 683 | java | package com.hallila.teller.config;
import com.hallila.teller.App;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
@Configuration
@ComponentScan(basePackageClasses = App.class, excludeFilters = @ComponentScan.Filter({Controller.class, Configuration.class}))
class ApplicationConfig {
/*
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setLocation(new ClassPathResource("/persistence.properties"));
return ppc;
}
*/
} | [
"jussi@hallila.com"
] | jussi@hallila.com |
9bbc988245b812fb36af359d505969f6a07b2416 | 79f8d4dc231f175beb3a67010c9901de971ab55f | /src/main/java/com/product/service/UserDetailsServiceImpl.java | 69bdc9220e0ee1df88c39d71c0d1a9c871b335db | [] | no_license | naveenreddy127y1a0351/Digi-Tech | 6d68db7944f6f326ed4601278a1e7b9a1f7ba10b | 5941c6edc9a2c913e7095ee52afde01992b15e8c | refs/heads/master | 2021-01-12T09:10:18.297492 | 2017-09-01T21:43:16 | 2017-09-01T21:43:16 | 76,780,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,065 | java | package com.product.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.product.dao.UserDetailsDAO;
import com.product.model.UserDetails;
import com.product.model.UserDetails1;
@Service
public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired
private UserDetailsDAO userdetailsdao;
public String addUser(UserDetails ud) {
return userdetailsdao.addUser(ud);
}
public UserDetails1 loginCheck(UserDetails ud) {
return userdetailsdao.loginCheck(ud);
}
public UserDetails1 getUserById(String uid) {
return userdetailsdao.getUserById(uid);
}
public void editUser(UserDetails1 ud) {
userdetailsdao.editUser(ud);
}
public List<UserDetails1> getAllUsers() {
return userdetailsdao.getAllUsers();
}
public void enableUser(String uid) {
userdetailsdao.enableUser(uid);
}
public void disbleUser(String uid) {
userdetailsdao.disableUser(uid);
}
}
| [
"reddynaveen1122@gmail.com"
] | reddynaveen1122@gmail.com |
9a8dec614f1959bbc17fe9371dc3f18737f69baf | a7aea3cce5e5a6584664838f9eabf7b53f1fa2d5 | /src/git_test/HelloWorld.java | 87806e0fdb956ad61a657265573fcb5d3d211345 | [] | no_license | WendyFYR/git_test | d21afaee5bd65d33f2ad6849e355d621871e6802 | e4f9f648cecaee979852965489114eecc7c72555 | refs/heads/master | 2023-01-10T20:38:28.865085 | 2020-11-06T02:22:38 | 2020-11-06T02:22:38 | 304,536,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package git_test;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello world");
}
}
| [
"liangyun_87@163.com"
] | liangyun_87@163.com |
b3f5379b8acc72562b54c50441900765349c47a0 | 620c5286cb25b90508e9f45bc66b253dfa6bcd3b | /src/main/java/com/company/models/interfaces/IBuyDao.java | 2f3595e171acbaf9fba63978b277a260c3906c2f | [] | no_license | kozhamseitova/Market | 37134d93420881559586f7f235c2305593401d4d | 8fb36da826f1cd7608b509ff7c3e0ea2d3195877 | refs/heads/master | 2022-12-29T04:51:31.136677 | 2020-10-18T15:02:37 | 2020-10-18T15:02:37 | 303,419,051 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package com.company.models.interfaces;
import com.company.models.ShoppingCart;
import java.util.List;
public interface IBuyDao {
void addProductsToBuy(ShoppingCart shoppingCart);
List getProductsFromBuyByUserId(long user_id);
}
| [
"kozhamseitova91@gmail.com"
] | kozhamseitova91@gmail.com |
b867a261804f40eca54119ee3dff4cecd1071bf2 | 5fde289dd1a8a50c7721018a3386f2b674caeca1 | /src/Android Frontend/app/src/main/java/com/work/prepmaster/ProfileActivity.java | bebe2a4addd76bc45ff6b5a1a2830cf752c50cc3 | [] | no_license | MKayhan8/PrepMaster | 4efb48f9f0d29030f8e913d1bc926c94f68e7313 | 73beba450075f4b17b84ec92691a057eb647c274 | refs/heads/master | 2020-05-02T23:25:43.492154 | 2019-03-27T20:09:24 | 2019-03-27T20:09:24 | 178,279,733 | 1 | 0 | null | 2019-03-28T20:46:22 | 2019-03-28T20:46:21 | null | UTF-8 | Java | false | false | 1,205 | java | package com.work.prepmaster;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class ProfileActivity extends AppCompatActivity implements View.OnClickListener {
private Button back, options, statistic;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
back = findViewById(R.id.buttonProfileBack);
back.setOnClickListener(this);
options = findViewById(R.id.buttonProfileOptions);
options.setOnClickListener(this);
statistic = findViewById(R.id.buttonStatistic);
statistic.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Intent intentOptions = new Intent(this,ProfileOptionsActivity.class);
Intent intentStatistic = new Intent(this,StatisticActivity.class);
if(view == back)
onBackPressed();
if(view == options)
startActivity(intentOptions);
if(view == statistic)
startActivity(intentStatistic);
}
}
| [
"33962976+mistova@users.noreply.github.com"
] | 33962976+mistova@users.noreply.github.com |
925e310afffbc145c28cf6b2b921eb818b360f05 | 57af218d590618506f8ef2ced921d1744449cfe7 | /src/iae/s20/Order.java | d26f1ffb5e3a93210ceacb0acb4bffecf7a86d90 | [] | no_license | payamdowlatyari/inf124-assignment4 | dfa6e9cae563490c8a0dacd98c5a99e81566ca5c | bc6d607e3de3126d49b97cdf9fca090ff44bcda1 | refs/heads/master | 2022-10-08T11:56:05.400734 | 2020-06-07T19:41:59 | 2020-06-07T19:41:59 | 268,226,870 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,468 | java | package iae.s20;
public class Order {
private int id;
private String email;
private String phone;
private String address;
private String city;
private String state;
private int zip;
private String method;
private String cardname;
private String cardnumber;
private int expmonth;
private int expyear;
private int cvv;
private String name;
private double totalPrice;
public Order() {
this.id = Integer.MIN_VALUE;
this.email = "";
this.phone= "";
this.address = "";
this.city = "";
this.state = "";
this.zip = 0;
this.method = "";
this.cardname = "";
this.cardnumber = "";
this.expyear = 0;
this.expmonth = 0;
this.cvv = Integer.MIN_VALUE;
this.name = "";
this.totalPrice = Double.MIN_NORMAL;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public int getZip() {
return zip;
}
public void setZip(int zip) {
this.zip = zip;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getCardname() {
return cardname;
}
public void setCardname(String cardname) {
this.cardname = cardname;
}
public String getCardnumber() {
return cardnumber;
}
public void setCardnumber(String cardnumber) {
this.cardnumber = cardnumber;
}
public int getExpmonth() {
return expmonth;
}
public void setExpmonth(int expmonth) {
this.expmonth = expmonth;
}
public int getExpyear() {
return expyear;
}
public void setExpyear(int expyear) {
this.expyear = expyear;
}
public int getCvv() {
return cvv;
}
public void setCvv(int cvv) {
this.cvv = cvv;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(double totalPrice) {
this.totalPrice = totalPrice;
}
}
| [
"sanjith@pacbell.net"
] | sanjith@pacbell.net |
9e8338f974beb2b614f27074c040a9d1c3985b3a | 8dd2f72ff99b37b206f9c5f57a9f9c7690a048d7 | /hotelonlinereservation/src/main/java/com/ls/UserRegistration/Controller/RegistrationController.java | b5b09a656c7f28179ad4c8c4f7737fea8a14b6aa | [] | no_license | xiaoqiangouba/biyesheji | 98828fe040422d7ad767c94337d24c074c235de8 | ee68be60e989a9f7ba55685452a2a702915714a5 | refs/heads/master | 2021-01-24T10:53:31.222951 | 2018-04-19T07:46:03 | 2018-04-19T07:46:03 | 118,417,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,482 | java | package com.ls.UserRegistration.Controller;
import com.ls.UserRegistration.Service.UserService;
import com.ls.UserRegistration.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* @author chenqiang
* 用户注册控制器
*/
@Controller
@RequestMapping("/RegistrationController")
public class RegistrationController {
@Autowired
UserService userService;
/**
* @param userName 用户名
* @return
* @verifyUserName 检验用户名
*/
@ResponseBody
@RequestMapping(value = "/verifyUserName",method= RequestMethod.POST)
public boolean verifyUserName(@RequestParam("userName") String userName){
boolean cunt=userService.verifyUserName(userName);
return cunt;
}
/**
*
* @param email 邮箱
* @return 检验邮箱
*/
@ResponseBody
@RequestMapping(value = "/verifyEmail",method= RequestMethod.POST)
public boolean verifyEmail(@RequestParam("email") String email){
boolean cunt=userService.verifyEmail(email);
return cunt;
}
/**
* 用户注册
* @param user 用户实体类
* @return 注册结果
*/
@ResponseBody
@RequestMapping(value = "/registrationUser",method= RequestMethod.POST)
public boolean registrationUser(User user){
//生成id
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
user.setId(uuid);
String salt = ShiroKit.getRandomSalt(5);
String pwdMd5 = ShiroKit.md5(user.getPassword(), salt);
user.setPassword(pwdMd5);
user.setSalt(salt);
int cunt= userService.saveUser(user);
if(cunt==1){
return true;
}else{
return false;
}
}
/**
* 用户登录
* @param user
* @return
*/
@ResponseBody
@RequestMapping(value = "/userLogin",method= RequestMethod.POST)
public Msg userLogin(User user){
boolean cout=userService.userLogin(user);
if(cout==true){
String id=userService.getId(user);
Map<String, Object> loginInfo = new HashMap<String,Object>();
loginInfo.put("userId",id);
String sessionId = JavaWebToken.createJavaWebToken(loginInfo);
return Msg.success().add("id", sessionId);
}
return Msg.fail();
}
/**
* 根据id查询用户姓名
* @param id
* @return
*/
@ResponseBody
@RequestMapping(value ="/getName",method = {RequestMethod.GET,RequestMethod.POST})
public Msg getName(HttpServletRequest request, @RequestParam("id") String id){
//System.out.println(id);
//从session拿到token,再解密得到userid
try {
String userId = AuthUtil.getUserId(id);
User list= userService.getName(userId);
return Msg.success().add("list",list);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 跟据邮箱改密码
* @param user
* @return
*/
@ResponseBody
@RequestMapping(value ="/updataPassword",method = RequestMethod.POST)
public int updataPassword(User user){
int n= userService.updataPassword(user);
return n;
}
}
| [
"554824942@qq.com"
] | 554824942@qq.com |
8f62312e5db56cec737c7eea494636496bdbc377 | eff1a032650191a196b80a738e9e48e878b59671 | /src/main/java/org/jrivets/util/HttpClientBuilder.java | 9daadb70b934d8ef801125225a063bcf27e537d5 | [
"Apache-2.0"
] | permissive | obattalov/jrivets-beans | 38808a6b7e7e081a8cf816d51e80b0ff6544aa38 | 2e7f6ec22f7139dc5e13023d5ab4b9cb84551c91 | refs/heads/master | 2020-12-11T02:02:24.726276 | 2015-10-05T20:15:46 | 2015-10-05T20:15:46 | 36,919,765 | 0 | 0 | null | 2015-06-05T07:51:36 | 2015-06-05T07:51:35 | null | UTF-8 | Java | false | false | 3,664 | java | package org.jrivets.util;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
public final class HttpClientBuilder {
private Integer socketReadTimeout;
private Integer connectionTimeout;
private Integer maxConnections;
private boolean trustAll;
public HttpClientBuilder() {
}
public HttpClientBuilder withSocketReadTimeout(int socketReadTimeout) {
this.socketReadTimeout = socketReadTimeout;
return this;
}
public HttpClientBuilder withConnectionTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
return this;
}
public HttpClientBuilder withMaxConnections(int maxConnections) {
this.maxConnections = maxConnections;
return this;
}
public HttpClientBuilder withTrustAll(boolean trustAll) {
this.trustAll = trustAll;
return this;
}
public HttpClient build() {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("http", 8080, PlainSocketFactory.getSocketFactory()));
schemeRegistry.register(new Scheme("https", 443, trustAll ? buildTrustAllSSLSocketFactory() :
SSLSocketFactory.getSocketFactory()));
PoolingClientConnectionManager connectionManager = new PoolingClientConnectionManager(schemeRegistry);
if (maxConnections != null) {
connectionManager.setDefaultMaxPerRoute(maxConnections);
connectionManager.setMaxTotal(maxConnections);
}
HttpParams httpParams = new BasicHttpParams();
if (socketReadTimeout != null) {
httpParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, socketReadTimeout);
}
if (connectionTimeout != null) {
httpParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
}
HttpProtocolParams.setVersion(httpParams, HttpVersion.HTTP_1_1);
HttpProtocolParams.setContentCharset(httpParams, "UTF-8");
DefaultHttpClient httpClient = new DefaultHttpClient(connectionManager);
httpClient.setParams(httpParams);
return httpClient;
}
private SSLSocketFactory buildTrustAllSSLSocketFactory() {
try {
SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, new TrustManager[]{new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}}, new SecureRandom());
return new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
} catch (Exception e) {
return null;
}
}
}
| [
"dmitry.spasibenko@mulesoft.com"
] | dmitry.spasibenko@mulesoft.com |
76b9739ebe0bc009ac72f8f94549a1f223aaf6a4 | bc3fcd470ce5c2d59fe1d4d70ed84e32a96a53bd | /ds/Problem9.java | ee7133aa348862df1633ea1c73c64e5a251a36d5 | [] | no_license | ShreyasVH/ds-and-algo | 95a626edc92bf57a87bbb6899ecd07415aa96d73 | 41a227a6133ab5a4f94d2e350dea547f0be290d9 | refs/heads/master | 2023-01-24T05:41:45.368977 | 2023-01-18T15:06:30 | 2023-01-18T15:06:30 | 244,600,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,002 | java | /*
Print the sequence similar to the column labels in sheets.
Ex: A, B, .... Z, AA, AB, ...... ZZ, AAA, AAB, ........ ZZZ ...........
*/
public class Problem9
{
public static void main(String[] args)
{
// getSequenceString(675);
getSequence(677);
// getSequence(100);
}
public static void getSequence(int n)
{
for(int i = 1; i <= n; i++)
{
System.out.println(i + " => " + getSequenceString(i));
}
}
public static String getSequenceString(int n)
{
String sequence = "";
int digitCount = (int) Math.ceil(Math.log(n) / Math.log(26));
System.out.println("DigitCount: " + digitCount);
for(int j = digitCount; j > 1; j--)
{
int placeValue = (int) Math.pow(26, j - 1);
int multiplier = (int) (n / Math.pow(26, j - 1));
n = Math.max(n % placeValue, 1);
sequence = sequence + (char) ((int) 'A' + multiplier - 1);
}
sequence = sequence + (char) ((int) 'A' + n - 1);
return sequence;
}
}
/*
Time Complexity: O(logn)
Space Complexity: O(1)
*/ | [
"shreyas.hande@gmail.com"
] | shreyas.hande@gmail.com |
498c12516ce1f18788ae9cf08fda1f8124636ed8 | 20b9b0d883ca35f51a554910288f900a6613d687 | /src/util/InputTest.java | 89ae89ce683cfe59a743c16462efd0fd56298e94 | [] | no_license | bmarchambault/codeup-java-exercises | 8a84e18f7bdf97842e1a2525458a8f9d5c5912c8 | e4c29c6ce4316ff54cec1891307613cca58dad50 | refs/heads/master | 2023-01-06T12:42:29.070662 | 2020-10-16T17:49:17 | 2020-10-16T17:49:17 | 268,579,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | package util;
public class InputTest {
public static void main(String[] args) {
Input user = new Input();
user.getString();
user.yesNo();
user.getInt(3, 15);
user.getInt();
user.getDouble(4.95, 100.50);
user.getDouble();
}
}
| [
"bmarchambault@gmail.com"
] | bmarchambault@gmail.com |
bb832167daee3e95e7973fb18523fd7b928bb874 | 93be3f0d6b828c74f3525f0e3de14901e54ec351 | /src/sample/RemoveHistory.java | b7df127e9f987ce7629b65fea358043b9c26f5ed | [] | no_license | ASherstobitov/TaskManagerFX | d800de53fda3514fdc82eb1d41668d12b5cd6437 | 26d92b5c8880022f1582ac9fffd22a20f4067be3 | refs/heads/master | 2022-04-26T15:29:38.420200 | 2020-04-28T15:52:15 | 2020-04-28T15:52:15 | 259,680,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package sample;
public class RemoveHistory extends History {
private int index;
public RemoveHistory(String nameTask, int index) {
super(nameTask);
this.index = index;
}
public int getIndex() {
return index;
}
}
| [
"aesherstobitov7@gmail.com"
] | aesherstobitov7@gmail.com |
165200c897af4c2318e74738428f04d4802826bc | a4f94f4701a59cafc7407aed2d525b2dff985c95 | /core/typesystemIntegration/source/jetbrains/mps/typesystem/checking/FakeEditorContext.java | 37e526190fe8183ff450ba401293c4b63973aad8 | [] | no_license | jamice/code-orchestra-core | ffda62860f5b117386aa6455f4fdf61661abbe9e | b2bbf8362be2e2173864c294c635badb2e27ecc6 | refs/heads/master | 2021-01-15T13:24:53.517854 | 2013-05-09T21:39:28 | 2013-05-09T21:39:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package jetbrains.mps.typesystem.checking;
import codeOrchestra.actionscript.parsing.FakeEditorComponent;
import jetbrains.mps.nodeEditor.EditorComponent;
import jetbrains.mps.nodeEditor.EditorContext;
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.smodel.SModel;
import jetbrains.mps.smodel.SNode;
/**
* @author Alexander Eliseyev
*/
public class FakeEditorContext extends EditorContext {
private static final SNode FAKE_NODE = new SNode(null, "null", false);
public FakeEditorContext(SModel model, IOperationContext operationContext) {
super(new FakeEditorComponent(operationContext), model, operationContext);
}
@Override
public SNode getSelectedNode() {
return FAKE_NODE;
}
}
| [
"a.a.eliseyev@gmail.com"
] | a.a.eliseyev@gmail.com |
d61a9930bc1fa72d0f85f151f9c93c81e348b302 | c5e7a02631065b9a05dfc2369eb667f48c656dd4 | /src/main/java/com/pifrans/modules/ecommerce/enums/StatusPayment.java | 63ec606b3419f18b869a1d0054868fd3932d14c1 | [] | no_license | pifrans/pifrans-erp | 9b8865fe24cd45cf43c9abbe7c7b29064229cd0d | 5af0da604a7c274f4691188b0cbf2df8bf408d28 | refs/heads/master | 2023-01-28T13:51:13.054126 | 2020-12-08T21:14:24 | 2020-12-08T21:14:24 | 304,478,396 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package com.pifrans.modules.ecommerce.enums;
public enum StatusPayment {
PENDING(1, "Pendente"), PAID(2, "Pago"), CANCELED(3, "Cancelado");
private int id;
private String description;
private StatusPayment(int id, String description) {
this.id = id;
this.description = description;
}
public int getId() {
return id;
}
public String getDescription() {
return description;
}
public static StatusPayment toEnum(Integer id) {
if (id == null) {
return null;
}
for (StatusPayment x : StatusPayment.values()) {
if (id.equals(x.getId())) {
return x;
}
}
throw new IllegalArgumentException("ID inválido: " + id);
}
}
| [
"lucasf.silva@live.com"
] | lucasf.silva@live.com |
6b80a0575f36dd21640d3ba127067cbbf74fe9ab | e63363389e72c0822a171e450a41c094c0c1a49c | /Mate20_9_0_0/src/main/java/com/android/server/hidata/histream/HwHistreamCHRMachineInfo.java | 11e81173349796d8d6dda21d8e15fcbed4429cde | [] | no_license | solartcc/HwFrameWorkSource | fc23ca63bcf17865e99b607cc85d89e16ec1b177 | 5b92ed0f1ccb4bafc0fdb08b6fc4d98447b754ad | refs/heads/master | 2022-12-04T21:14:37.581438 | 2020-08-25T04:30:43 | 2020-08-25T04:30:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,663 | java | package com.android.server.hidata.histream;
import com.android.server.hidata.appqoe.HwAPPQoEUtils;
public class HwHistreamCHRMachineInfo {
public String mApkName = HwAPPQoEUtils.INVALID_STRING_VALUE;
public int mCellQuality = -1;
public int mCellSig = -1;
public int mCellSinr = -1;
public int mChLoad = -1;
public int mNetDlTup = -1;
public int mNetRtt = -1;
public int mRAT = -1;
public int mRxTup1Bef = -1;
public int mRxTup2Bef = -1;
public int mScenario = -1;
public int mStreamQoe = -1;
public int mTxFail1Bef = -1;
public int mTxFail2Bef = -1;
public int mWechatVideoQoe = -1;
public int mWifiRssi = -1;
public int mWifiSnr = -1;
public void printCHRMachineInfo() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("printCHRMachineInfo mApkName = ");
stringBuilder.append(this.mApkName);
stringBuilder.append(" mScenario = ");
stringBuilder.append(this.mScenario);
stringBuilder.append(" mRxTup1Bef = ");
stringBuilder.append(this.mRxTup1Bef);
stringBuilder.append(" mRxTup2Bef = ");
stringBuilder.append(this.mRxTup2Bef);
stringBuilder.append(" mScenario = ");
stringBuilder.append(this.mScenario);
stringBuilder.append(" mChLoad = ");
stringBuilder.append(this.mChLoad);
stringBuilder.append(" mTxFail1Bef = ");
stringBuilder.append(this.mTxFail1Bef);
stringBuilder.append(" mTxFail2Bef = ");
stringBuilder.append(this.mTxFail2Bef);
stringBuilder.append(" mStreamQoe = ");
stringBuilder.append(this.mStreamQoe);
stringBuilder.append(" mWechatVideoQoe = ");
stringBuilder.append(this.mWechatVideoQoe);
stringBuilder.append(" mRAT = ");
stringBuilder.append(this.mRAT);
stringBuilder.append(" mWifiRssi = ");
stringBuilder.append(this.mWifiRssi);
stringBuilder.append(" mWifiSnr = ");
stringBuilder.append(this.mWifiSnr);
stringBuilder.append(" mWifiSnr = ");
stringBuilder.append(this.mWifiSnr);
stringBuilder.append(" mCellSig = ");
stringBuilder.append(this.mCellSig);
stringBuilder.append(" mCellQuality = ");
stringBuilder.append(this.mCellQuality);
stringBuilder.append(" mCellSinr = ");
stringBuilder.append(this.mCellSinr);
stringBuilder.append(" mNetDlTup = ");
stringBuilder.append(this.mNetDlTup);
stringBuilder.append(" mNetRtt = ");
stringBuilder.append(this.mNetRtt);
HwHiStreamUtils.logD(stringBuilder.toString());
}
}
| [
"lygforbs0@mail.com"
] | lygforbs0@mail.com |
eb5ef60ab0cfbffe723800202cc91f79d0e0cff1 | 1e63f0f4aaf00131f62949d1a364dbf635a3569a | /reckoner-content-services/src/main/java/com/reckonlabs/reckoner/contentservices/repo/UserRepoCustom.java | 35e85777829725fe3bff5655160185c713d1fe65 | [] | no_license | dankoch/reckoner-parent | d9f5c7d19bc3b5845243e7a5ad17dd2eec29bec6 | 4b29c1684c7aa4a1a26e6d99ad463c6d0daea17e | refs/heads/master | 2021-01-01T06:33:18.403690 | 2013-06-24T03:57:54 | 2013-06-24T03:57:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.reckonlabs.reckoner.contentservices.repo;
import java.util.List;
import com.reckonlabs.reckoner.domain.user.User;
public interface UserRepoCustom {
public void insertNewUser (User user);
public void updateUser (User user);
public List<User> getUserSummaries(Boolean active,
String sortBy, Boolean ascending,
Integer page, Integer size);
}
| [
"dan@reckonlabs.org"
] | dan@reckonlabs.org |
dd457a9732f7b6f9c549ef6039f5be6699f947c1 | 65f6408508079a69bac592c8b894938ef79719db | /src/main/java/demasse/recipe/demasserecipe/bootstrap/RecipeBootstrap.java | 8954ea446a243bf312c33d738474e3c9bd1eb5d2 | [] | no_license | demasseb/demasserecipe | 32274f45323d73019df27f36b97a542186f96594 | f833a85e6ea0e41587f2413263befcf65ae0a77b | refs/heads/master | 2020-06-13T06:42:59.656636 | 2019-07-01T00:43:39 | 2019-07-01T00:43:39 | 194,574,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,045 | java | package demasse.recipe.demasserecipe.bootstrap;
import demasse.recipe.demasserecipe.domain.*;
import demasse.recipe.demasserecipe.respositories.UnitOfMeasureRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import demasse.recipe.demasserecipe.domain.Recipe;
import demasse.recipe.demasserecipe.respositories.CategoryRepository;
import demasse.recipe.demasserecipe.respositories.RecipeRepository;
import javax.transaction.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Slf4j
@Component
public class RecipeBootstrap implements ApplicationListener<ContextRefreshedEvent> {
private final CategoryRepository categoryRepository;
private final RecipeRepository recipeRepository;
private final UnitOfMeasureRepository unitOfMeasureRepository;
public RecipeBootstrap(CategoryRepository categoryRepository, RecipeRepository recipeRepository, UnitOfMeasureRepository unitOfMeasureRepository) {
this.categoryRepository = categoryRepository;
this.recipeRepository = recipeRepository;
this.unitOfMeasureRepository = unitOfMeasureRepository;
}
private List<Recipe> getRecipe() {
List<Recipe> recipes = new ArrayList<>(2);
Optional<UnitOfMeasure> eachUomOptional = unitOfMeasureRepository.findByUom("Ounce");
if (!eachUomOptional.isPresent()) {
throw new RuntimeException("Expected UOM Not Found");
}
Optional<UnitOfMeasure> tableSpoonUomOptional = unitOfMeasureRepository.findByUom("Tablespoon");
if (!tableSpoonUomOptional.isPresent()) {
throw new RuntimeException("Expected UOM Not Found");
}
Optional<UnitOfMeasure> teaSpoonUomOptional = unitOfMeasureRepository.findByUom("Teaspoon");
if (!teaSpoonUomOptional.isPresent()) {
throw new RuntimeException("Expected UOM Not Found");
}
Optional<UnitOfMeasure> pintUomOptional = unitOfMeasureRepository.findByUom("Pinch");
if (!pintUomOptional.isPresent()) {
throw new RuntimeException("Expected UOM Not Found");
}
Optional<UnitOfMeasure> cupUomOptional = unitOfMeasureRepository.findByUom("Cup");
if (!cupUomOptional.isPresent()) {
throw new RuntimeException("Expected UOM Not Found");
}
UnitOfMeasure eachUom = eachUomOptional.get();
UnitOfMeasure tableSpoonUom = tableSpoonUomOptional.get();
UnitOfMeasure teaSpoonUOM = teaSpoonUomOptional.get();
UnitOfMeasure pintuom = pintUomOptional.get();
UnitOfMeasure cupuom = cupUomOptional.get();
Optional<Category> americanCategoryOptional = categoryRepository.findByDescription("American");
if (!americanCategoryOptional.isPresent()) {
throw new RuntimeException("Expected Category Not Found");
}
Optional<Category> mexicanCategoryOptional = categoryRepository.findByDescription("Mexican");
if (!mexicanCategoryOptional.isPresent()) {
throw new RuntimeException("Expected Category Not Found");
}
Category americanCategory = americanCategoryOptional.get();
Category mexicanCategory = mexicanCategoryOptional.get();
Recipe guacRecipe = new Recipe();
guacRecipe.setDescription("Perfect Guacamole");
guacRecipe.setPrepTime(10);
guacRecipe.setCookTime(10);
guacRecipe.setDifficulty(Difficulty.EASY);
guacRecipe.setDirection("Na so it is done");
Notes guacNotes = new Notes();
guacRecipe.setNotes(guacNotes);
guacRecipe.getIngredients().add(new Ingredient("ripe avocados", new BigDecimal(2), eachUom,guacRecipe));
guacRecipe.getIngredients().add(new Ingredient("Naso", new BigDecimal(2), eachUom,guacRecipe));
guacRecipe.getCategories().add(americanCategory);
guacRecipe.getCategories().add(mexicanCategory);
recipes.add(guacRecipe);
Recipe tacRecipe = new Recipe();
tacRecipe.setDescription("Perfect Tacos");
tacRecipe.setPrepTime(10);
tacRecipe.setCookTime(10);
tacRecipe.setDifficulty(Difficulty.MODERATE);
tacRecipe.setDirection("Nor be so dear");
Notes tacNotes = new Notes();
tacRecipe.setNotes(tacNotes);
tacRecipe.getIngredients().add(new Ingredient("ripe dude", new BigDecimal(2), eachUom,tacRecipe));
tacRecipe.getIngredients().add(new Ingredient("Naso bighead", new BigDecimal(2), eachUom,tacRecipe));
tacRecipe.getCategories().add(americanCategory);
tacRecipe.getCategories().add(mexicanCategory);
recipes.add(tacRecipe);
return recipes;
}
@Override
@Transactional
public void onApplicationEvent(ContextRefreshedEvent event) {
recipeRepository.saveAll(getRecipe());
}
}
| [
"demasseb@gmail.com"
] | demasseb@gmail.com |
7d0f043ae9b781411f52d409b19d4ecc1ecc4900 | 211ec31a7f09435b4c5d491139a2831c98e0f69c | /BestarProject/Widget/src/com/huoqiu/widget/db/DownloadFileDB.java | 0ac36fac6ae54b04cc492bd9929ea42f619beee3 | [
"Apache-2.0"
] | permissive | bestarandyan/ShoppingMall | 6e8ac0ee3a5ae7a91541d04b1fba8d2d1496875c | ee93b393b982bdfe77d26182a2317f2c439c12fc | refs/heads/master | 2021-01-01T05:49:52.010094 | 2015-01-23T10:29:59 | 2015-01-23T10:29:59 | 29,727,539 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,105 | java | package com.huoqiu.widget.db;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
/**
* 数据库中文件下载记录的操作,包括:插入,删除,更�?
*
* @author shenyamin
*
*/
public class DownloadFileDB {
// 数据库字�?path, thid, done
public static final String COL_PATH = "File_Path";
public static final String COL_THID = "File_Thid";
public static final String COL_DONE = "File_Done";
public static final String TABLE_NAME = "DownloadFileRecord";// 数据表名
private static DatabaseUtil helper;
public DownloadFileDB(Context context) {
helper = new DatabaseUtil(context);
}
/**
* 插入数据
*
* @param model
* DownLoadFileModel实体�?
*/
public boolean insert(DownloadFileModel model) {
try {
SQLiteDatabase db = helper.getWritableDatabase();
db.execSQL(
"INSERT INTO " + TABLE_NAME + "(" + COL_PATH + ", "
+ COL_THID + ", " + COL_DONE + ") VALUES(?, ?, ?)",
new Object[] { model.getPath(), model.getThid(),
model.getDone() });
return true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
}
/**
* 删除记录
*
* @param path
* URL路径
* @param thid
* 线程id
*/
// public void delete(String path, int thid) {
// SQLiteDatabase db = helper.getWritableDatabase();
// db.execSQL("DELETE FROM " + TABLE_NAME
// + " WHERE " + COL_PATH + "=? AND " + COL_THID + "=?", new Object[] {
// path, thid });
// }
/**
* 更新记录
*
* @param model
* DownLoadFileModel实体�?
*/
public boolean update(DownloadFileModel model) {
try {
SQLiteDatabase db = helper.getWritableDatabase();
db.execSQL(
"UPDATE " + TABLE_NAME + " SET " + COL_DONE + "=? WHERE "
+ COL_PATH + "=? AND " + COL_THID + "=?",
new Object[] { model.getDone(), model.getPath(),
model.getThid() });
return true;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
}
/**
* 查询表中的某�?��记录
*
* @param path
* URL路径
* @param thid
* 线程Id
* @return
*/
public DownloadFileModel query(String path, int thid) {
DownloadFileModel model = null;
Cursor c = null;
try {
SQLiteDatabase db = helper.getWritableDatabase();
String sql = "SELECT " + COL_PATH + ", " + COL_THID + ", "
+ COL_DONE + " FROM " + TABLE_NAME + " WHERE " + COL_PATH
+ "=? AND " + COL_THID + "=?";
c = db.rawQuery(sql, new String[] { path, String.valueOf(thid) });
if (c.moveToNext()) {
model = new DownloadFileModel(c.getString(0), c.getInt(1),
c.getInt(2));
return model;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
} finally {
if (c != null) {
c.close();
}
}
return null;
}
/**
* 查询APK下载是否完成
*
* @param path
* URL路径
* @param thid
* 线程Id
* @return
*/
// public int queryDownloadOver(String path) {
// Cursor c = null;
// try {
// SQLiteDatabase db = helper.getWritableDatabase();
// String sql = "SELECT " + COL_DONE + " FROM " + TABLE_NAME
// + " WHERE " + COL_PATH + "=? AND " + COL_THID + " = -9999";// -9999已经下载完成的标�?
// c = db.rawQuery(sql, new String[] { path });
// if (c.moveToNext()) {
// return c.getInt(0);
// }
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// return 0;
// } finally {
// if (c != null)
// c.close();
// }
//
// return 0;
// }
/**
* 删除下载记录
*
* @param path
* 文件路径
* @param len
*/
public boolean deleteAll(String path, int len) {
Cursor c = null;
try {
SQLiteDatabase db = helper.getWritableDatabase();
String sel = "SELECT SUM(" + COL_DONE + ") FROM " + TABLE_NAME
+ " WHERE " + COL_PATH + "=?";
c = db.rawQuery(sel, new String[] { path });
if (c.moveToNext()) {
int result = c.getInt(0);
if (result == len) {
db.execSQL("DELETE FROM " + TABLE_NAME + " WHERE "
+ COL_PATH + "=? ", new Object[] { path });
// 删除下载记录后,插入�?��新的记录包含本次下载的url,apk的大小,-9999作为标识以便下次提取这条记录
// insert(new DownloadFileModel(path, -9999, len));
return true;
}
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} finally {
if (c != null) {
c.close();
}
}
return false;
}
/**
* 删除�?��路径为path的下载记�?
*
* @param path
* 文件路径
*/
public boolean deleteDownloadRecord(String path) {
Cursor c = null;
try {
SQLiteDatabase db = helper.getWritableDatabase();
String sel = "SELECT 1 FROM " + TABLE_NAME + " WHERE " + COL_PATH
+ "=? ";// + COL_THID +"= -9999"
c = db.rawQuery(sel, new String[] { path });
if (c.moveToNext()) {
db.execSQL("DELETE FROM " + TABLE_NAME + " WHERE " + COL_PATH
+ "=? ", new Object[] { path });// AND "+ COL_THID +"=
// -9999"
return true;
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
} finally {
if (c != null) {
c.close();
}
}
return false;
}
/**
* 查询是否有未完成的记�?
* �?true;没有:false;
* @param path
* @return
*/
public boolean queryUndone(String path) {
Cursor c = null;
try {
SQLiteDatabase db = helper.getWritableDatabase();
String undo = "SELECT " + COL_PATH + " FROM " + TABLE_NAME + " WHERE "+ COL_PATH +" = '"+ path +"'";//+ COL_THID +"=-9999
c = db.rawQuery(undo, null);
if(c.moveToNext()){
return true;
}
} catch (Exception e) {
e.printStackTrace();
return false;
} finally{
if(c != null){
c.close();
}
}
return false;
}
}
| [
"2238985517@qq.com"
] | 2238985517@qq.com |
da0385f5661bdddff2c9b6ba6aa41a0710b1f8e5 | 1bc928c269707865b316446e9ec8120e74cf6020 | /src/main/java/apple/npc/data/npc/VarsConclusionMap.java | 0d73187773d311b2a987c9262b90376e2e74d805 | [] | no_license | amp7368/MinecraftNPCDialogue | 8e4ed008aac7d661eef34ece3bddd0da77c924c1 | fbfa661ab0d9bf16c73c60f9e428c070a794ddc7 | refs/heads/master | 2021-05-21T22:20:32.461311 | 2020-04-15T05:14:58 | 2020-04-15T05:14:58 | 252,827,308 | 0 | 0 | null | 2020-04-19T18:31:19 | 2020-04-03T19:54:06 | Java | UTF-8 | Java | false | false | 1,153 | java | package apple.npc.data.npc;
import apple.npc.data.booleanAlgebra.BooleanRedirect;
import apple.npc.data.booleanAlgebra.Evaluateable;
import apple.npc.ymlNavigate.YMLBooleanNavigate;
import apple.npc.ymlNavigate.YMLNpcNavigate;
import org.bukkit.configuration.ConfigurationSection;
public class VarsConclusionMap implements Evaluateable {
public int conclusionResult;
private Evaluateable exp;
public VarsConclusionMap(ConfigurationSection config) {
exp = BooleanRedirect.make(config.getConfigurationSection(YMLBooleanNavigate.EXPRESSION));
conclusionResult = config.getInt(YMLNpcNavigate.CONCLUSION_ID);
}
public VarsConclusionMap(int conclusionResult, Evaluateable finished) {
this.conclusionResult = conclusionResult;
this.exp = finished;
}
@Override
public boolean evaluate(String playerUID, int currentConclusion, long timeLastTalked) {
return exp.evaluate(playerUID, currentConclusion, timeLastTalked);
}
public Evaluateable getExpression() {
return exp;
}
public void setExpression(Evaluateable finished) {
this.exp = finished;
}
}
| [
"41219847+amp7368@users.noreply.github.com"
] | 41219847+amp7368@users.noreply.github.com |
08656a9de244a15f0574cb7f59861a4937008c88 | 1f3419109b857b58138be7b90c93532bb3be845d | /app/src/main/java/com/guidovezzoni/bingeworthyshows/common/base/ImdbViewModel.java | b9f327fef9e6732f032301e4d3c283b34c851e16 | [] | no_license | morristech/BingeWorthyShows | fb350a2f2519fc2f0a95f6b87dfbcd98cdf6f4ea | 19f995a70dd6cf9350636bed1b139be2fc7aa246 | refs/heads/master | 2020-05-18T13:13:31.856882 | 2019-01-10T19:32:49 | 2019-01-10T19:32:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.guidovezzoni.bingeworthyshows.common.base;
import com.guidovezzoni.bingeworthyshows.common.baselibrary.BaseViewModel;
import com.guidovezzoni.bingeworthyshows.common.baselibrary.Service;
import com.guidovezzoni.bingeworthyshows.config.ConfigService;
public class ImdbViewModel<M, P> extends BaseViewModel<M, P> {
private final ConfigService configService;
public ImdbViewModel(Service<M, P> service, ConfigService configService) {
super(service);
this.configService = configService;
}
public ConfigService getConfigService() {
return configService;
}
}
| [
"guido.vezzoni.development@gmail.com"
] | guido.vezzoni.development@gmail.com |
31c914a22403fe2f62033835fb495d29499b6b9b | 0c51a150f3b03d4272143b2de4daa1626f1263a1 | /src/main/java/com/bm/index/controller/IndexController.java | 29ad0f1c8bc513a810099d45c0d149f0cadd94c8 | [] | no_license | zhaoyunnian-xb/dcdb | c29016ae18d46d138acc33d32094c643be04176b | 2d7fc4d4f4385386032f550dd0ee27c7d56bc218 | refs/heads/master | 2023-01-14T04:55:02.231896 | 2020-11-27T01:08:14 | 2020-11-27T01:08:14 | 316,149,482 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,938 | java | package com.bm.index.controller;
import com.bm.index.dao.source1.DcdbBmmbnrDao;
import com.bm.index.dao.source1.DcdbDbDao;
import com.bm.index.model.DcdbDb;
import com.bm.index.model.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("index")
public class IndexController {
@Autowired
DcdbDbDao dcdbDbDao;
@Autowired
DcdbBmmbnrDao dcdbBmmbnrDao;
public final static Map<Integer, String> nodeMap = new HashMap<Integer, String>() {
{
put(1,"新建");
put(2, "内勤接收");
put(3, "承办人办理");
put(4, "部门负责人审核");
put(5, "承办人办理");
put(6, "督查室办理");
}
};
@RequestMapping()
public String index(HttpSession session, String id,String username, Model model){
UserEntity loginUser =new UserEntity();
// 用户查询
// List<UserEntity> users = dcdbBmmbnrDao.loginQuery(id);
List<UserEntity> users = dcdbBmmbnrDao.loginQueryByName(username);
// session存放
if (users != null && users.size() > 0) {
loginUser = users.get(0);
model.addAttribute("bmmc", users.get(0).getBmmc());
model.addAttribute("username", users.get(0).getName());
}
session.setAttribute("User",loginUser);
return "index";
}
@RequestMapping("/updateDb.do")
@ResponseBody
public String updateDb(DcdbDb dcdbDb){
String ajzt=dcdbDb.getAjzt();
//判断当前节点是不是整个节点的最后一部,3为整个节点的最后一步
if(ajzt.equals("2")){
Integer nodeid=Integer.valueOf(dcdbDb.getNodeid());
dcdbDb.setNodeid(nodeid+1+"");
dcdbDb.setAjzt("1");
dcdbDb.setNodename(nodeMap.get(Integer.valueOf(dcdbDb.getNodeid())));
//如果是承办人办理之后的节点没有待办事件了,因为只有审批的权限
dcdbDb.setAjzt("2");
}else{
Integer zt=Integer.valueOf(ajzt);
dcdbDb.setAjzt(zt+1+"");
}
//更新操作
int i= dcdbDbDao.updateByExampleSelective(dcdbDb);
return i+"";
}
/**
* 模板下载
* @add
*/
@RequestMapping(value = "/download.do", method = { RequestMethod.GET, RequestMethod.POST })
public void documentDownload(HttpServletRequest request, String fileName,HttpServletResponse response, HttpSession session) {
// 文书获取
String url = session.getServletContext().getRealPath("/") + "download/file/";
String realFile = url + fileName;
try {
fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20").replaceAll("%28", "\\(")
.replaceAll("%29", "\\)").replaceAll("%3B", ";").replaceAll("%40", "@").replaceAll("%23", "\\#")
.replaceAll("%26", "\\&");
response.setHeader("content-disposition", "attachment;filename=" + fileName);
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setCharacterEncoding("UTF-8");
// 输入流
InputStream fis = new BufferedInputStream(new FileInputStream(realFile));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
fis.close();
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
toClient.write(buffer);
toClient.flush();
toClient.close();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"2502517735@qq.com"
] | 2502517735@qq.com |
07605967e15b4fba27b5b3cd8734bf356f61c26d | 090e7d94eb91ac1d981d23ac4ba29d194a5ead97 | /application/src/main/java/com/hugopicado/stocks/controller/api/StockDto.java | 19e31d3c827ff4b04aa31dbc52d57f268ecf0d6e | [] | no_license | KAUSHIKRAO1196/STOCKING | d21e034bde1db72abd308bfb60c9c69f37965dfa | c4cd017076ea576527500ca1a5c773e030e923d6 | refs/heads/master | 2022-12-03T11:55:23.963317 | 2019-06-07T11:12:41 | 2019-06-07T11:12:41 | 190,729,496 | 0 | 0 | null | 2022-11-24T07:02:19 | 2019-06-07T10:59:49 | Java | UTF-8 | Java | false | false | 1,657 | java | package com.hugopicado.stocks.controller.api;
import com.google.common.base.MoreObjects;
public class StockDto {
private String symbol;
private String type;
private double lastDividend;
private double fixedDividend;
private double parValue;
private double tickerPrice;
public String getSymbol() {
return symbol;
}
public String getType() {
return type;
}
public double getLastDividend() {
return lastDividend;
}
public double getFixedDividend() {
return fixedDividend;
}
public double getParValue() {
return parValue;
}
public double getTickerPrice() {
return tickerPrice;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public void setType(String type) {
this.type = type;
}
public void setLastDividend(double lastDividend) {
this.lastDividend = lastDividend;
}
public void setFixedDividend(double fixedDividend) {
this.fixedDividend = fixedDividend;
}
public void setParValue(double parValue) {
this.parValue = parValue;
}
public void setTickerPrice(double tickerPrice) {
this.tickerPrice = tickerPrice;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("symbol", symbol)
.add("type", type)
.add("lastDividend", lastDividend)
.add("fixedDividend", fixedDividend)
.add("parValue", parValue)
.add("tickerPrice", tickerPrice)
.toString();
}
}
| [
"kaushik@kaushikrao896@gmail.com"
] | kaushik@kaushikrao896@gmail.com |
a997d0fb6cfbbdb4acf4cbb4605724e28041b362 | d24e1303894efa688fba2d506ceaa5c7594f9a22 | /src/main/java/com/wufuqiang/leetcode/MS33_VerifyPostorder.java | 3127e925d24728904bec7bc7d23f37ff5ea0b1b9 | [] | no_license | Eureka1996/leetcode | 3663e6a500589a5cd23cd3a0f0dbe61a2fd11764 | 9f56f68208270f3565cf2a0ea6bf1654fdbe4a1a | refs/heads/master | 2022-11-19T11:02:49.801924 | 2022-10-27T01:11:25 | 2022-10-27T01:11:25 | 222,052,314 | 2 | 2 | null | 2020-10-13T19:21:00 | 2019-11-16T05:33:27 | Java | UTF-8 | Java | false | false | 475 | java | package com.wufuqiang.leetcode;
import java.util.Stack;
//验证后序遍历 单调栈
public class MS33_VerifyPostorder {
public boolean verifyPostorder(int[] postorder) {
Stack<Integer> stack = new Stack<>();
int root = Integer.MAX_VALUE;
for(int i = postorder.length - 1; i >= 0; i--) {
if(postorder[i] > root) return false;
while(!stack.isEmpty() && stack.peek() > postorder[i])
root = stack.pop();
stack.add(postorder[i]);
}
return true;
}
}
| [
"1767778344@qq.com"
] | 1767778344@qq.com |
9f2aa89ea2418e7b86a89a3a72fdd48533a251c5 | 6c1c18f95d0bfe3e300c775ecacd296cb0ec176e | /commlib/src/main/java/com/android/banana/commlib/view/MyGridView.java | ab4efba5f3c8fda34bc896aa38658bbf18cc8aac | [] | no_license | winnxiegang/save | a7ea6a3dcee7a9ebda8c6ad89957ae0e4d3c430d | 16ad3a98e8b6ab5d17acacce322dfc5e51ab3330 | refs/heads/master | 2020-03-13T04:27:26.650719 | 2018-04-26T01:18:59 | 2018-04-26T01:18:59 | 130,963,368 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 796 | java | package com.android.banana.commlib.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
*
*
* @author leslie
*
* @version $Id: MyGridView.java, v 0.1 2014年9月11日 下午1:50:21 leslie Exp $
*/
public class MyGridView extends GridView {
public MyGridView(Context context) {
super(context);
}
public MyGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
| [
"1272108979@qq.com"
] | 1272108979@qq.com |
7a6dbab2660f73a25bb12098e2af33fe755e9b5b | 166f845bc08cd71f817542e323a5f95aa758b435 | /CEPE/src/view/aluno/CadastroEspecificoAluno.java | d42eda8d0df446d47c877b6773a60e187d537b9a | [] | no_license | mirielesilverio/projeto-cepe | 16cf690781648a5496f816e9dbeca3516783a59f | 5da61b49f4e44f940e356cb71e897353cc3dd6b9 | refs/heads/master | 2020-09-14T04:37:11.779692 | 2019-11-21T18:49:57 | 2019-11-21T18:49:57 | 157,082,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,565 | 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 view.aluno;
import control.connection.dataAccess.AlunoAccess;
import control.connection.dataAccess.ProfessorAccess;
import control.connection.dataAccess.TurmasAccess;
import javax.swing.JFrame;
import model.Aluno;
import model.Professor;
import model.Usuario;
/**
*
* @author Aluno
*/
public class CadastroEspecificoAluno extends javax.swing.JFrame {
static Aluno aluno;
static Usuario usuario;
static MenuAluno menu;
public CadastroEspecificoAluno(Usuario usuario) {
initComponents();
this.setLocationRelativeTo(null);
this.usuario = usuario;
TurmasAccess turmasAc = new TurmasAccess();
jcbTurmas.removeAllItems();
for(String turma:turmasAc.lista())
{
jcbTurmas.addItem(turma);
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
btnCadastrar = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
btnClose1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jsLinhaNome = new javax.swing.JSeparator();
jcbTurmas = new javax.swing.JComboBox<>();
txtRa = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
setPreferredSize(new java.awt.Dimension(625, 422));
getContentPane().setLayout(null);
jPanel1.setBackground(new java.awt.Color(255, 255, 255));
jPanel1.setLayout(null);
btnCadastrar.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
btnCadastrar.setForeground(new java.awt.Color(0, 77, 133));
btnCadastrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/img/plus.png"))); // NOI18N
btnCadastrar.setText(" FINALIZAR CADASTRO");
btnCadastrar.setActionCommand("btnCadastrar");
btnCadastrar.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 77, 133), 1, true));
btnCadastrar.setContentAreaFilled(false);
btnCadastrar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnCadastrar.setFocusPainted(false);
btnCadastrar.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
btnCadastrarMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
btnCadastrarMouseExited(evt);
}
});
btnCadastrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCadastrarActionPerformed(evt);
}
});
jPanel1.add(btnCadastrar);
btnCadastrar.setBounds(110, 310, 390, 60);
jLabel3.setFont(new java.awt.Font("Century Gothic", 0, 24)); // NOI18N
jLabel3.setForeground(new java.awt.Color(0, 77, 133));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText("INFORMAÇÕES ESPECÍFICAS");
jPanel1.add(jLabel3);
jLabel3.setBounds(40, 100, 540, 30);
btnClose1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/img/cross-square-button.png"))); // NOI18N
btnClose1.setToolTipText("Fechar o programa");
btnClose1.setBorder(null);
btnClose1.setContentAreaFilled(false);
btnClose1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btnClose1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnClose1ActionPerformed(evt);
}
});
jPanel1.add(btnClose1);
btnClose1.setBounds(560, 10, 33, 33);
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/img/minimize.png"))); // NOI18N
jButton2.setToolTipText("Minimizar o programa");
jButton2.setBorder(null);
jButton2.setContentAreaFilled(false);
jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.add(jButton2);
jButton2.setBounds(520, 10, 33, 33);
jLabel5.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
jLabel5.setForeground(new java.awt.Color(0, 77, 133));
jLabel5.setText("Turma");
jPanel1.add(jLabel5);
jLabel5.setBounds(110, 230, 130, 19);
jLabel4.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
jLabel4.setForeground(new java.awt.Color(0, 77, 133));
jLabel4.setText("Registro Escolar");
jPanel1.add(jLabel4);
jLabel4.setBounds(110, 150, 130, 19);
jsLinhaNome.setBackground(new java.awt.Color(102, 102, 102));
jsLinhaNome.setForeground(new java.awt.Color(255, 255, 255));
jPanel1.add(jsLinhaNome);
jsLinhaNome.setBounds(110, 210, 390, 30);
jcbTurmas.setFont(new java.awt.Font("Century Gothic", 0, 11)); // NOI18N
jcbTurmas.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Matéria" }));
jPanel1.add(jcbTurmas);
jcbTurmas.setBounds(110, 260, 390, 30);
txtRa.setFont(new java.awt.Font("Century Gothic", 0, 11)); // NOI18N
txtRa.setForeground(new java.awt.Color(153, 153, 153));
txtRa.setText("Clique para escrever");
txtRa.setBorder(null);
txtRa.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
txtRaMouseClicked(evt);
}
public void mousePressed(java.awt.event.MouseEvent evt) {
txtRaMousePressed(evt);
}
});
txtRa.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtRaActionPerformed(evt);
}
});
jPanel1.add(txtRa);
txtRa.setBounds(110, 180, 390, 30);
getContentPane().add(jPanel1);
jPanel1.setBounds(-5, -4, 630, 430);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btnCadastrarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCadastrarMouseEntered
btnCadastrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/img/plus-blue.png")));
}//GEN-LAST:event_btnCadastrarMouseEntered
private void btnCadastrarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCadastrarMouseExited
btnCadastrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/img/plus.png")));
}//GEN-LAST:event_btnCadastrarMouseExited
private void btnCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarActionPerformed
aluno = new Aluno(usuario);
aluno.setRa(txtRa.getText());
aluno.setClasse(jcbTurmas.getSelectedIndex()+1);
AlunoAccess acesso = new AlunoAccess();
acesso.create(aluno);
this.dispose();
menu = new MenuAluno(aluno);
menu.setVisible(true);
}//GEN-LAST:event_btnCadastrarActionPerformed
private void btnClose1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose1ActionPerformed
System.exit(0);
}//GEN-LAST:event_btnClose1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
this.setExtendedState(JFrame.ICONIFIED);
}//GEN-LAST:event_jButton2ActionPerformed
private void txtRaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtRaMouseClicked
this.txtRa.setText("");
}//GEN-LAST:event_txtRaMouseClicked
private void txtRaMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_txtRaMousePressed
}//GEN-LAST:event_txtRaMousePressed
private void txtRaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtRaActionPerformed
}//GEN-LAST:event_txtRaActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(CadastroEspecificoAluno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(CadastroEspecificoAluno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(CadastroEspecificoAluno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(CadastroEspecificoAluno.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run(Usuario usuario) {
new CadastroEspecificoAluno(usuario).setVisible(true);
}
@Override
public void run() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCadastrar;
private javax.swing.JButton btnClose1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JComboBox<String> jcbTurmas;
private javax.swing.JSeparator jsLinhaNome;
private javax.swing.JTextField txtRa;
// End of variables declaration//GEN-END:variables
}
| [
"mirielesilverio@hotmail.com"
] | mirielesilverio@hotmail.com |
d84c8c655a256a7d922b7ace7e1b108288a2f6cb | 9af1881e304af4a97a17b58bab11f3f6ad23c1c3 | /cloud-nacos/src/main/java/com/example/config/DataSourceConfiguration.java | 8f1a2605aafd5865e88c210a470f3858fb79c45d | [] | no_license | l564203965/SpringCloud | 80dec119c52ca765232d0959c58f031532f949ea | eca5512701d923f76c9e9b0a01bf7036e03a6903 | refs/heads/master | 2023-02-03T07:33:52.524960 | 2020-12-18T14:05:35 | 2020-12-18T14:05:35 | 297,370,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,942 | java | //package com.example.config;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import io.seata.rm.datasource.DataSourceProxy;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.transaction.SpringManagedTransactionFactory;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//
//import javax.sql.DataSource;
//
//
///**
// * @author: ljy Date: 2020/10/2.
// * 配置seata代理数据源
// */
//@Configuration
//public class DataSourceConfiguration {
//
// @Bean
// @ConfigurationProperties(prefix = "spring.datasource")
// public DataSource druidDataSource(){
// DruidDataSource druidDataSource = new DruidDataSource();
// return druidDataSource;
// }
//
// /**
// * 创建DataSourceProxy
// */
// @Primary
// @Bean("dataSource")
// public DataSourceProxy dataSourceProxy(DataSource druidDataSource){
// return new DataSourceProxy(druidDataSource);
// }
//
// /**
// * 将原有的DataSource对象替换为DataSourceProxy
// */
// @Bean
// public SqlSessionFactory sqlSessionFactory(DataSourceProxy dataSourceProxy)throws Exception{
// SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
// sqlSessionFactoryBean.setDataSource(dataSourceProxy);
// sqlSessionFactoryBean.setMapperLocations(new PathMatchingResourcePatternResolver()
// .getResources("classpath*:/mapper/*.xml"));
// sqlSessionFactoryBean.setTransactionFactory(new SpringManagedTransactionFactory());
// return sqlSessionFactoryBean.getObject();
// }
//
//}
| [
"564203965@qq.com"
] | 564203965@qq.com |
c01d55905edfd5431260f87fba886beee47222c8 | 807e4dab8b862e7b03c3ab2b0530e193184b3c97 | /baseio-codec/src/main/java/com/generallycloud/nio/codec/http2/future/HeaderTable.java | c8dbd85e4e0d99d3a62ec167bca87f3ef3455dfc | [
"Apache-2.0"
] | permissive | zc1249274251/baseio | 6ffaff77e23f51d637717ec72edb1ab2b9534f2e | e1a923147894af8b68dc7722cff1be03a99b5a11 | refs/heads/master | 2021-01-20T11:51:20.548255 | 2017-02-21T04:06:46 | 2017-02-21T04:06:46 | 82,634,725 | 1 | 0 | null | 2017-02-21T04:07:56 | 2017-02-21T04:07:55 | null | UTF-8 | Java | false | false | 5,806 | java | /*
* Copyright 2015-2017 GenerallyCloud.com
*
* 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.generallycloud.nio.codec.http2.future;
import java.util.ArrayList;
import java.util.List;
public class HeaderTable {
private List<Http2Header> headers;
public Http2Header getHeader(int index) {
return headers.get(index);
}
public String getHeaderValue(int index) {
return getHeader(index).getValue();
}
public HeaderTable(int size) {
this.headers = new ArrayList<Http2Header>(size);
}
public HeaderTable() {
this.headers = new ArrayList<Http2Header>();
}
public void addHeader(Http2Header header) {
headers.add(header.getIndex(), header);
}
public List<Http2Header> getHeaders() {
return headers;
}
public static HeaderTable STATIC_HEADER_TABLE = new HeaderTable(62);
static {
STATIC_HEADER_TABLE.addHeader(new Http2Header(1, ":authority", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(2, ":method", "GET"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(3, ":method", "POST"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(4, ":path", "/"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(5, ":path", "/index.html"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(6, ":scheme", "http"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(7, ":scheme", "https"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(8, ":status", "200"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(9, ":status", "204"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(10, ":status", "206"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(11, ":status", "304"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(12, ":status", "400"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(13, ":status", "404"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(14, ":status", "500"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(15, "accept-charset", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(16, "accept-encoding", "gzip, deflate"));
STATIC_HEADER_TABLE.addHeader(new Http2Header(17, "accept-language", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(18, "accept-ranges", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(19, "accept", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(20, "access-control-allow-origin", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(21, "age", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(22, "allow", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(23, "authorization", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(24, "cache-control", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(25, "content-disposition", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(26, "content-encoding", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(27, "content-language", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(28, "content-length", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(29, "content-location", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(30, "content-range", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(31, "content-type", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(32, "cookie", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(33, "date", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(34, "etag", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(35, "expect", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(36, "expires", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(37, "from", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(38, "host", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(39, "if-match", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(40, "if-modified-since", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(41, "if-none-match", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(42, "if-range", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(43, "if-unmodified-since", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(44, "last-modified", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(45, "link", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(46, "location", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(47, "max-forwards", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(48, "proxy-authenticate", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(49, "proxy-authorization", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(50, "range", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(51, "referer", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(52, "refresh", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(53, "retry-after", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(54, "server", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(55, "set-cookie", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(56, "strict-transport-security", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(57, "transfer-encoding", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(58, "user-agent", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(59, "vary", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(60, "via", ""));
STATIC_HEADER_TABLE.addHeader(new Http2Header(61, "www-authenticate", ""));
}
}
| [
"8738115@qq.com"
] | 8738115@qq.com |
726eecbc372127b19d28d111be9140605f8c508f | c865fbd5b4dfc2498b7af676669cd58abb1575ef | /info/jonclark/util/FormatUtils.java | f8d0e74424bd65f71a02555c0eba17f90a63fe8f | [] | no_license | sutra/numbertrans | f197f68b14ad225e88a2e59934ba713f0ed09068 | 7f586d9de7ba6384b3cd9d8e1113c91469684584 | refs/heads/master | 2021-01-01T15:05:16.474119 | 2008-03-11T17:53:31 | 2008-03-11T17:53:31 | 239,330,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,659 | java | /*
* Copyright (c) 2006, Jonathan Clark <jon_DOT_h_DOT_clark_AT_gmail_DOT_com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of my affiliates nor the names of thier 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 IMPLIEDWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER 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 info.jonclark.util;
import info.jonclark.lang.PrependStringBuilder;
import java.util.Date;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
/**
* @author Jonathan
*/
public class FormatUtils {
private static final SimpleDateFormat fTime = new SimpleDateFormat("hh:mm:ss aa");
private static final SimpleDateFormat fDateFull =
new SimpleDateFormat("EEEEEEEEE, MMMMMMMM dd, yyyy hh:mm:ss aa");
private static final SimpleDateFormat fDateLong = new SimpleDateFormat("MMMMMMMM dd, yyyy");
public static final DecimalFormat FORMAT_2DECIMALS = new DecimalFormat("#,###.##");
public static final DecimalFormat FORMAT_4DECIMALS = new DecimalFormat("#,###.####");
public static final DecimalFormat FORMAT_EXP = new DecimalFormat("0.0000E0");
public static final DecimalFormat FORMAT_WHOLE = new DecimalFormat("#,###");
public static String formatTime(final Date d) {
return fTime.format(d);
}
/**
* Format date like as in this example: Wednesday, March 31, 2005 5:23:55 pm
*
* @param d
* The date object to be formatted
* @return The specified date formatted in the format shown above
*/
public static String formatFullDate(final Date d) {
return fDateFull.format(d);
}
/**
* Format date like as in this example: March 31, 2005
*
* @param d
* The date object to be formatted
* @return The specified date formatted in the format shown above
*/
public static String formatLongDate(Date d) {
return fDateLong.format(d);
}
/**
* Format a timespan as in this example: 5 days, 2 hours, 9 minutes, 23
* seconds
*
* @param span
* @return
*/
public static String formatTimeSpanFull(final long span) {
final int ALL_UNITS = 6;
return formatTimeSpan(span, ALL_UNITS);
}
/**
* Format a timespan as in this examples: 5 days, 2 hours 9 minutes, 23
* seconds BUT NOT 5 days, 2 hours, 9 minutes, 23 seconds
*
* @param span
* @param nUnits
* The maxiumum number of units that will be shown
* @return
*/
public static String formatTimeSpan(final long span, final int nUnits) {
// modulo the years, months, days, hours, minutes, seconds, etc.
// and create parameters that allow only a certain number
// of those things to be shown
throw new RuntimeException("Unimplemented");
}
/**
* Formats a whole number, adding commas.
*
* @param wholeNumber
* @return
*/
public static String formatLong(long wholeNumber) {
return FORMAT_WHOLE.format(wholeNumber);
}
/**
* Formats a decimal number, adding commas and providing up to 2 places of
* decimal accuracy.
*
* @param decimalNumber
* @return
*/
public static String formatDouble2(double decimalNumber) {
return FORMAT_2DECIMALS.format(decimalNumber);
}
public static String formatDouble4(double decimalNumber) {
return FORMAT_4DECIMALS.format(decimalNumber);
}
public static String formatDoubleExp(double decimalNumber) {
return FORMAT_EXP.format(decimalNumber);
}
public static String formatPhoneNumber(String phoneNumber) {
// make a list of only the digits
StringBuilder digits = new StringBuilder();
for (int i = 0; i < phoneNumber.length(); i++) {
char c = phoneNumber.charAt(i);
if (Character.isDigit(c)) {
digits.append(c);
}
}
// now format like this: (817) 939-1985
int i = 0;
PrependStringBuilder formatted = new PrependStringBuilder();
if (digits.length() >= 4) {
formatted.prepend(digits.substring(0, 4));
i += 4;
if (digits.length() > 4) {
formatted.prepend('-');
}
}
if (digits.length() >= 7) {
formatted.prepend(digits.substring(4, 7));
i += 3;
if (digits.length() > 7) {
formatted.prepend(' ');
}
}
if (digits.length() >= 10) {
formatted.prepend("(" + digits.substring(7, 10) + ")");
i += 3;
if (digits.length() > 10) {
formatted.prepend(' ');
}
}
// just stick whatever is left on the beginning
formatted.prepend(digits.substring(i));
return formatted.toString();
}
}
| [
""
] | |
278267fce0024dca536133db6c20aac29e2692e7 | d1a9d3b5e0fd90c3d4a2539fd3e8fa67df8512a7 | /ExamPortal/ExamPortal/src/main/java/com/exam/config/MySecurityConfig.java | 54e98942716b89d1060b62962c5fbd53aba86560 | [] | no_license | arabindasahoo/springboot | 4f69c00beb7c17a81d0bd13d9d9e61add0758f66 | 84b0a72e91e7908bb9bc3a52fb5e662a747c9072 | refs/heads/master | 2021-11-18T17:10:25.695481 | 2021-08-06T01:47:54 | 2021-08-06T01:47:54 | 239,928,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,661 | java | package com.exam.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import com.exam.service.impl.UserDetailsServiceImpl;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MySecurityConfig extends WebSecurityConfigurerAdapter{
@Autowired
private JwtAuthenticationEntryPoint unauthorizedHander;
@Autowired
private JwtAuthenticationFilter jwtAuthenticationFilter;
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Autowired
private UserDetailsServiceImpl userDetailsServiceImpl;
@Bean
public BCryptPasswordEncoder passwordEncoder()
{
return new BCryptPasswordEncoder();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsServiceImpl).passwordEncoder(passwordEncoder());
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.cors().disable()
.authorizeRequests()
.antMatchers("/generate-token","/user/").permitAll()
.antMatchers(HttpMethod.OPTIONS).permitAll()
.anyRequest().authenticated()
.and()
.exceptionHandling().authenticationEntryPoint(unauthorizedHander)
.and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
}
| [
"ARABINDA@DESKTOP-G3PTM3I"
] | ARABINDA@DESKTOP-G3PTM3I |
f82d6b001d2a20a68df5f560eb52e5fa1a58711a | bb9a610688b6a5fc15d94d3fc18e36a9922c14b7 | /src/main/java/kg/nais/models/ServiceUpdate.java | 4bfef64c93a061209e9ac2883a2845abc6eb09b4 | [] | no_license | aziret26/nais | 2503a1df8de72724aac5aae48a20de7f0dbe4dea | 1815222a2cb821e23e6d322ac6710fea6ef79254 | refs/heads/master | 2021-01-20T07:28:55.537819 | 2018-06-17T18:54:21 | 2018-06-17T18:54:21 | 90,003,389 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,671 | java | package kg.nais.models;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Calendar;
/**
* Created by aziret on 7/12/17.
*/
@Entity
@NamedQueries({
@NamedQuery(name = "ServiceUpdate.findAll",
query = "SELECT su FROM ServiceUpdate su")
})
public class ServiceUpdate implements Serializable{
@Id
@GeneratedValue
private int serviceUpdateId;
@Column
private Calendar ordersLastUpd;
@Column
private Calendar chicksLastUpd;
@Column
private Calendar notificationsLastUpd;
/**
* set time for update in hh:mm format
* system will be updating everyday selected time
*/
@Column
private String updateTime;
public int getServiceUpdateId() {
return serviceUpdateId;
}
public void setServiceUpdateId(int serviceUpdateId) {
this.serviceUpdateId = serviceUpdateId;
}
public Calendar getOrdersLastUpd() {
return ordersLastUpd;
}
public void setOrdersLastUpd(Calendar ordersLastUpd) {
this.ordersLastUpd = ordersLastUpd;
}
public Calendar getChicksLastUpd() {
return chicksLastUpd;
}
public void setChicksLastUpd(Calendar chicksLastUpd) {
this.chicksLastUpd = chicksLastUpd;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public Calendar getNotificationsLastUpd() {
return notificationsLastUpd;
}
public void setNotificationsLastUpd(Calendar notificationsLasUpd) {
this.notificationsLastUpd = notificationsLasUpd;
}
}
| [
"aziret.toktoraliev@iaau.edu.kg"
] | aziret.toktoraliev@iaau.edu.kg |
9773bb7f636892268b9bc1eb305e71154d042753 | 6bdcbbd11e67696c916561a10028d31270f3f3fc | /backend/src/main/java/com/fullstackapp/backend/model/User.java | 371ecb41e59887199fc568a905e2b6eb87d223d5 | [] | no_license | paul-wr/fullstackapp | 4f46eb5c9a3ca7cfc95f6e168f28eba3adbf0e69 | 6b0db651a8c2fb5763073f8ca5388e4e628a8336 | refs/heads/master | 2023-03-05T10:25:09.560601 | 2021-02-15T16:47:44 | 2021-02-15T16:47:44 | 337,462,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | package com.fullstackapp.backend.model;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name = "user_acc")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "user_name")
private String userName;
@Column(name = "email")
private String email;
@Column(name = "user_password")
private String password;
public User(String firstName, String lastName, String userName, String email) {
this.firstName = firstName;
this.lastName = lastName;
this.userName = userName;
this.email = email;
}
}
| [
"saalome@live.ie"
] | saalome@live.ie |
d0c9185edae7b5a7f3f5da843144a28dba03a7ac | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project278/src/main/java/org/gradle/test/performance/largejavamultiproject/project278/p1393/Production27875.java | bd5d949aaea7129f595cbd00cabc02971b7d7381 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,890 | java | package org.gradle.test.performance.largejavamultiproject.project278.p1393;
public class Production27875 {
private String property0;
public String getProperty0() {
return property0;
}
public void setProperty0(String value) {
property0 = value;
}
private String property1;
public String getProperty1() {
return property1;
}
public void setProperty1(String value) {
property1 = value;
}
private String property2;
public String getProperty2() {
return property2;
}
public void setProperty2(String value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
30085f2b7c6629c545910188dc757c080c44c9d3 | bee4da6fab3466d20d852c59cd344553b538d508 | /src/arseny/bochkarev/simpletree/TreeTest.java | d32687a6ee11685820f509887ecea71716ab743e | [] | no_license | rfiit/svp | 714bc34251792076a0b1e3343654f36011ade988 | c49b56a06303ac58c57c209f005b4fff8d85131e | refs/heads/master | 2016-09-06T16:26:06.850520 | 2013-12-23T20:28:23 | 2013-12-23T20:28:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,601 | java | package arseny.bochkarev.simpletree;
import junit.framework.*;
import junit.framework.Assert;
import org.junit.*;
import org.junit.Test;
public class TreeTest extends Assert {
Tree<Integer> tree = new Tree<Integer>();
@Before
public void setUp() throws Exception {
tree.setRoot(1);
Tree.Conductor cnd = tree.getConductor();
cnd.addLeft(2);
cnd.addRight(2);
Tree.Conductor b = cnd.clone();
cnd.goLeft();
cnd.addLeft(3);
cnd.addRight(3);
cnd.goRight();
cnd.addRight(4);
cnd = b;
cnd.goRight();
cnd.addLeft(3);
cnd.goLeft();
cnd.addLeft(4);
}
@Test
public void testGetDeep() throws Exception {
assertEquals(tree.getDeep(), 4);
}
@Test
public void testCountNodeOnLevel() throws Exception {
assertEquals(tree.countNodeOnLevel(0), 0);
assertEquals(tree.countNodeOnLevel(-10), 0);
assertEquals(tree.countNodeOnLevel(1), 1);
assertEquals(tree.countNodeOnLevel(2), 2);
assertEquals(tree.countNodeOnLevel(3), 3);
assertEquals(tree.countNodeOnLevel(4), 2);
}
@Test
public void testLeftToRight() throws Exception {
Counter<Integer> c = new Counter<Integer>();
tree.leftToRight(c);
assertEquals(c.getCount(), 22);
}
@Test
public void testRightToLeft() throws Exception {
Counter<Integer> c = new Counter<Integer>();
tree.rightToLeft(c);
assertEquals(c.getCount(), 22);
}
}
| [
"rfiit@yandex.ru"
] | rfiit@yandex.ru |
f7ac1ee3c028162ad28600480bee799995fa685b | e626553fed6749fa4762ed820c9bf76f739ae5de | /day04-code/src/cn/itcast/day04/demo01/HelloWorld.java | 893d8303065c3d4e458497a2f8ef37db30f8b113 | [] | no_license | gatorpeng/basic-code | 490874392720581e27211d8850876095c2e887bd | 41e361ef67b983795e8eaa25814c4265dd5bfc99 | refs/heads/master | 2020-07-02T02:04:50.652046 | 2019-09-01T22:20:17 | 2019-09-01T22:20:17 | 201,380,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 246 | java | package cn.itcast.day04.demo01;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
System.out.println("Hello world!");
System.out.println("Hello world!");
}
}
| [
"xinlaide1984@gmail.com"
] | xinlaide1984@gmail.com |
42df0a1907f5610f3e6cd6598de53ad0fe987777 | 83d3c511f02ab4d37dba551f76040f4c5031e14b | /HashMap Exercises/src/com/ojas/hashmap/ShallowCopyOfMap.java | 92a6df63b0fc1d28de5b119ca198362283e1d4c5 | [] | no_license | MaheshPikkili/javacode | e079c0388f9ef6a5ca091700e2878733033a6f0b | c3ffaaac093f5f9fd78d1a126aac213315670aeb | refs/heads/master | 2020-03-24T07:04:18.158571 | 2018-07-27T07:12:34 | 2018-07-27T07:12:34 | 142,551,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.ojas.hashmap;
import java.util.HashMap;
import java.util.Map;
public class ShallowCopyOfMap {
public static void main(String[] args) {
HashMap<Integer,String> hash_map= new HashMap<Integer,String>();
hash_map.put(1, "Red");
hash_map.put(2, "Green");
hash_map.put(3, "Black");
hash_map.put(4, "White");
hash_map.put(5, "Blue");
HashMap<Integer,String> hash_map1= new HashMap<Integer,String>(hash_map);
for (Map.Entry<Integer, String> string : hash_map1.entrySet()) {
System.out.println(string.getKey()+" "+string.getValue());
}
}
}
| [
"maheshpikkili437@gmail.com"
] | maheshpikkili437@gmail.com |
de85773e7fe556e95f1d7ac08ca45137879bba2b | a715e8312a90d099b72c24e5b7da1372c9fe67fb | /android/android/src/com/android/tools/idea/editors/navigation/model/Locator.java | 0600a8beea9ab43cc026cc5c125201be250d7a36 | [
"Apache-2.0"
] | permissive | wiltonlazary/bugvm-studio | ff98c1beca1f890013aa05ecd67f137a14a70c32 | 5861389424a51181c58178576c78cf35c0ceb1b5 | refs/heads/master | 2021-01-24T20:58:41.730805 | 2015-12-18T19:34:14 | 2015-12-18T19:34:14 | 56,322,614 | 2 | 1 | null | 2016-04-15T13:34:56 | 2016-04-15T13:34:56 | null | UTF-8 | Java | false | false | 2,659 | java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.tools.idea.editors.navigation.model;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
public class Locator {
@NonNull
private final State state;
@Nullable
private final String fragmentClassName;
@Nullable
private final String viewId;
private Locator(@NonNull State state, @Nullable String fragmentClassName, @Nullable String viewId) {
this.state = state;
this.fragmentClassName = fragmentClassName;
this.viewId = viewId;
}
public static Locator of(@NonNull State state) {
return new Locator(state, null, null);
}
public static Locator of(@NonNull State state, @Nullable String viewName) {
return new Locator(state, null, viewName);
}
public static Locator of(@NonNull State state, @Nullable String fragmentClassName, @Nullable String viewName) {
return new Locator(state, fragmentClassName, viewName);
}
@NonNull
public State getState() {
return state;
}
@Nullable
public String getFragmentClassName() {
return fragmentClassName;
}
@Nullable
public String getViewId() {
return viewId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Locator locator = (Locator)o;
if (fragmentClassName != null ? !fragmentClassName.equals(locator.fragmentClassName) : locator.fragmentClassName != null) return false;
if (!state.equals(locator.state)) return false;
if (viewId != null ? !viewId.equals(locator.viewId) : locator.viewId != null) return false;
return true;
}
@Override
public int hashCode() {
int result = state.hashCode();
result = 31 * result + (fragmentClassName != null ? fragmentClassName.hashCode() : 0);
result = 31 * result + (viewId != null ? viewId.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Locator{" +
"state=" + state +
", viewName='" + viewId + '\'' +
'}';
}
}
| [
"github@ibinti.com"
] | github@ibinti.com |
c648befdc60719edb8a3d2e1c3a71299208b7869 | 076b8e079f885488d74ad9209429c6ed964bd171 | /corejavateacher/src/com/tz/day13/StudentComparator.java | fea621d2df7a4cc4d700324e36b092bbaa261aa7 | [] | no_license | jinrenyu/JavaEE | b987cddb53ee9cf9f58de60aa15c7fa5053579bd | 6d6d4bd62160958d55167e59103e9768cc172396 | refs/heads/master | 2020-03-20T09:12:46.597602 | 2018-06-14T08:56:31 | 2018-06-14T08:56:31 | 137,331,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 422 | java | /**
*
*/
package com.tz.day13;
import java.util.Comparator;
import com.tz.day11.Student;
/**本类用来演示 学生比较器
* @author 吴老师
*
* 2017年3月16日下午4:37:52
*/
public class StudentComparator implements Comparator<Student>
{
@Override
public int compare(Student o1, Student o2) {
System.out.println(">>> invoked...");
//定义比较的逻辑
return o1.getAge() - o2.getAge();
}
}
| [
"1526118253@qq.com"
] | 1526118253@qq.com |
53f9a091300152b15b0a5106f808a14841a2f144 | f5f972cb42fc46cddadc08388bc2678708878685 | /wooplr-bean/src/main/java/com/ubiquity/common/jaxb/themecollection/CollectionSmallJAXB.java | 58c67931eeaada296a8d85dfb21ff06644bf530e | [] | no_license | SantoshChandrakant/wooplr-automation2 | 1441b539ea2578e451a7c6b61f69dd3b7321571a | 24003a438d46b5ac6b64968383a0e36495f40733 | refs/heads/master | 2021-01-12T08:22:23.646508 | 2016-12-15T12:23:27 | 2016-12-15T12:23:27 | 76,557,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,691 | java | package com.ubiquity.common.jaxb.themecollection;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import com.ubiquity.common.jaxb.ecomm.Countable;
/**
* <p>
* Java class for CollectionJAXB complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="CollectionJAXB">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="object_type" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="object_id" type="{http://www.w3.org/2001/XMLSchema}long"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CollectionSmallJAXB", propOrder = { "name", "collectionId", "isPrivate" })
public class CollectionSmallJAXB implements Serializable, Countable {
private final static Long serialVersionUID = 12343L;
protected String name;
protected Long collectionId;
protected Boolean isPrivate;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getCollectionId() {
return collectionId;
}
public Long getId() {
return collectionId;
}
public void setCollectionId(Long collectionId) {
this.collectionId = collectionId;
}
public Boolean getIsPrivate() {
return isPrivate;
}
public void setIsPrivate(Boolean isPrivate) {
this.isPrivate = isPrivate;
}
}
| [
"santosh@wooplr.com"
] | santosh@wooplr.com |
2f8e23a4215b7de6befd6b0c7b3f8d180c33f0a3 | b2acd6c8c84bb610a9e7f6135ea150d43a76af39 | /OCP_JAVA8_PREP/src/org/sbpdiscovery/java/collections/Sorted.java | 30dea796ac0d3a50109dd7c111653106f7f50703 | [] | no_license | kaiwpost/OCP_JAVA8_PREP | 50d35ce6de6d0aefad5e4d5a226d90df40060128 | 0b5fd790c7f0a7b484ec6c7a53f41e79d669e7b9 | refs/heads/master | 2021-01-21T15:27:40.024804 | 2017-06-02T06:34:41 | 2017-06-02T06:34:41 | 91,846,613 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 932 | java | package org.sbpdiscovery.java.collections;
import java.util.*;
/**
* @author Kai W. Post, SBP Medical Discovery Institute, 2017
*/
public class Sorted implements Comparable<Sorted>, Comparator<Sorted> {
private int num;
private String text;
public Sorted(int num, String text) {
super();
this.num = num;
this.text = text;
}
@Override
public int compare(Sorted s1, Sorted s2) {
return s1.num - s2.num;
}
@Override
public int compareTo(Sorted s) {
return text.compareTo(s.text);
}
@Override
public String toString() {
return "" + num;
}
public static void main(String[] args) {
Sorted s1 = new Sorted(88, "a");
Sorted s2 = new Sorted(55, "b");
TreeSet<Sorted> t1 = new TreeSet<>();
t1.add(s1);
t1.add(s2);
System.out.println(t1);
TreeSet<Sorted> t2 = new TreeSet<>(s1);
t2.add(s1);
t2.add(s2);
System.out.println(t2);
System.out.println(t1 + " " + t2);
}
}
| [
"kpost@burnham.org"
] | kpost@burnham.org |
363238fddaedcd4e97347370874c88252b049a0d | e91f2c87a930a33a23c8896e47fa782daba80eed | /src/main/java/com/company/flint/States.java | abd8bf7f5b8259dd82bf64d42c1ebb1bbd220ef1 | [
"MIT"
] | permissive | jakobehmsen/flint | 3f23cb2d09a255264f8a032afcbf666fc305886b | d0e91543c0e43cd3ce354afe1142467fb92a324e | refs/heads/master | 2020-06-13T17:00:26.377248 | 2019-08-30T15:44:10 | 2019-08-30T15:44:10 | 194,723,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,866 | 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 com.company.flint;
/**
*
* @author jakob
*/
public class States {
public static State finish = new State() {
@Override
public State nextState(Evaluator evaluator) {
evaluator.stop();
return this;
}
@Override
public String toString() {
return "finish";
}
};
public static State invoke(State.Callable c, State.Continuation continuation) {
return new State() {
@Override
public State nextState(Evaluator evaluator) {
return c.invoke(evaluator, continuation);
}
@Override
public String toString() {
return "invoke " + c + " for " + continuation;
}
};
}
public static State continueWith(Object result, State.Continuation continuation) {
return new State() {
@Override
public State nextState(Evaluator evaluator) {
return continuation.nextState(evaluator, result);
}
@Override
public String toString() {
return "continue-with " + (result != null ? result + " for " : "") + continuation;
}
};
}
public static State.Continuation always(State state) {
return new State.Continuation() {
@Override
public State nextState(Evaluator evaluator, Object result) {
return state;
}
@Override
public String toString() {
return "" + state;
}
};
}
public static State.Callable respond(State.Callable expr) {
return new State.Callable() {
@Override
public State invoke(Evaluator evaluator, State.Continuation continuation) {
return States.invoke(expr, new State.Continuation() {
@Override
public State nextState(Evaluator evaluator, Object result) {
evaluator.getFrame().push(result);
evaluator.getFrame().respondWith(evaluator);
return continueWith(result, continuation);
}
});
}
};
}
public static State.Callable push(State.Callable expr) {
return new State.Callable() {
@Override
public State invoke(Evaluator evaluator, State.Continuation continuation) {
return States.invoke(expr, new State.Continuation() {
@Override
public State nextState(Evaluator evaluator, Object result) {
evaluator.getFrame().push(result);
return continueWith(null, continuation);
}
@Override
public String toString() {
return "push";
}
});
}
@Override
public String toString() {
return "push " + expr;
}
};
}
public static State.Callable exprs() {
return null;
}
public static State.Callable expr() {
return new State.Callable() {
@Override
public State invoke(Evaluator evaluator, State.Continuation continuation) {
if(evaluator.getFrame().getMessageStream().peek() instanceof Long) {
if(evaluator.getFrame().getMessageStream().peekEquals(1, evaluator.getSymbolTable().getSymbolCodeFromString("<-"))) {
Long name = (Long) evaluator.getFrame().getMessageStream().consume();
evaluator.getFrame().getMessageStream().consume();
return States.invoke(expr(), new State.Continuation() {
@Override
public State nextState(Evaluator evaluator, Object result) {
evaluator.getFrame().push(result);
evaluator.getFrame().store(name);
return continueWith(result, continuation);
}
@Override
public String toString() {
return "expr";
}
});
}
}
return States.invoke(expr1(), continuation);
}
@Override
public String toString() {
return "expr";
}
};
}
public static State.Callable expr1() {
return new State.Callable() {
@Override
public State invoke(Evaluator evaluator, State.Continuation continuation) {
Object obj = evaluator.getFrame().getMessageStream().consume();
return continueWith(obj, continuation);
}
@Override
public String toString() {
return "expr1";
}
};
}
public static State.Callable consume() {
return new State.Callable() {
@Override
public State invoke(Evaluator evaluator, State.Continuation continuation) {
Object obj = evaluator.getFrame().getMessageStream().consume();
return continueWith(obj, continuation);
}
@Override
public String toString() {
return "consume";
}
};
}
}
| [
"jakobehmsen.github@gmail.com"
] | jakobehmsen.github@gmail.com |
4569ef8b7b72750c6d33211169cdb372a85e9c68 | c6eadacfc86f17e5d4d9634470e2c478177d4bcb | /app/src/main/java/com/example/listapp/DetailActivity.java | e8b373ec51e4154a4eecf065cc00cddba443e6ab | [] | no_license | marine03/listApp | 5cc712cc6930838c6ebc1ea664fe69cb237e3a99 | c8efe889089b512b95e94c3735ac4d708e4dd3d1 | refs/heads/master | 2020-07-27T13:15:13.308435 | 2019-09-17T16:19:13 | 2019-09-17T16:19:13 | 209,101,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,798 | java | package com.example.listapp;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.widget.ImageViewCompat;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Display;
import android.widget.ImageView;
public class DetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
Intent in = getIntent();
int index = in.getIntExtra("com.example.listapp.ITEM_INDEX", -1);
if (index > -1){
int pic = getImg(index);
ImageView img = (ImageView) findViewById(R.id.imageView);
scaleImg(img,pic);
}
}
private int getImg(int index){
switch(index){
case 0 : return R.drawable.peach;
case 1 : return R.drawable.tomato;
case 2 : return R.drawable.squash;
default: return -1;
}
}
private void scaleImg(ImageView img, int pic){
Display screen = getWindowManager().getDefaultDisplay();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(getResources(),pic,options);
int imgWidth = options.outWidth;
int screenWidth = screen.getWidth();
if(imgWidth>screenWidth){
int ratio = Math.round((float)imgWidth/(float)screenWidth);
options.inSampleSize = ratio;
}
options.inJustDecodeBounds = false;
Bitmap scaledImg = BitmapFactory.decodeResource(getResources(),pic,options);
img.setImageBitmap(scaledImg);
}
}
| [
"stevenwusmc@gmail.com"
] | stevenwusmc@gmail.com |
802e49a3a86da18090bffd5d6d55d768fba96191 | ec5fe8f20dfe82b479cea3da24c78190f768e086 | /cas-4.1.0/cas-server-extension-clearpass/src/test/java/org/jasig/cas/extension/clearpass/EncryptedMapDecoratorTests.java | f4cb2edb44484a5256021ed45813088124902445 | [
"BSD-3-Clause",
"CDDL-1.1",
"LGPL-2.0-or-later",
"W3C",
"WTFPL",
"SAX-PD",
"CDDL-1.0",
"MIT",
"MPL-1.1",
"LicenseRef-scancode-jsr-107-jcache-spec-2013",
"EPL-1.0",
"Classpath-exception-2.0",
"LGPL-2.1-only",
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseR... | permissive | hsj-xiaokang/springboot-shiro-cas-mybatis | b4cf76dc2994d63f771da0549cf711ea674e53bf | 3673a9a9b279dd1e624c1a7a953182301f707997 | refs/heads/master | 2022-06-26T15:28:49.854390 | 2020-12-06T04:43:13 | 2020-12-06T04:43:13 | 103,009,179 | 42 | 24 | MIT | 2022-06-25T07:27:42 | 2017-09-10T06:35:28 | Java | UTF-8 | Java | false | false | 3,677 | java | /*
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo 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 the following location:
*
* 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.jasig.cas.extension.clearpass;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.util.Map;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* @author Scott Battaglia
* @since 1.0.6
*/
public class EncryptedMapDecoratorTests {
private Map<String, String> map;
private EncryptedMapDecorator decorator;
private CacheManager cacheManager;
@Before
public void setUp() throws Exception {
try {
this.cacheManager = new CacheManager(this.getClass().getClassLoader()
.getResourceAsStream("ehcacheClearPass.xml"));
final Cache cache = this.cacheManager.getCache("clearPassCache");
this.map = new EhcacheBackedMap(cache);
this.decorator = new EncryptedMapDecorator(map);
} catch (final Exception e) {
fail(e.getMessage());
}
}
@After
public void tearDown() throws Exception {
this.cacheManager.removalAll();
this.cacheManager.shutdown();
}
@Test
public void addItem() {
final String key = "MY_KEY";
final String value = "MY_VALUE";
this.decorator.put(key, value);
assertEquals(value, this.decorator.get(key));
assertNull(this.map.get(key));
}
@Test
public void addManyItems() {
final int totalItems = 100;
for (int i = 0; i < totalItems; i++) {
this.decorator.put("key" + i, "value" + i);
}
assertEquals(this.decorator.size(), totalItems);
for (int i = 0; i < totalItems; i++) {
assertNull(this.map.get("key" + i));
assertEquals("value" + i, this.decorator.get("key" + i));
}
}
@Test
public void addAndRemoveItem() {
final String key1 = "MY_REALLY_KEY";
final String value1 = "MY_VALUE";
final String key2 = "MY_KEY2";
final String value2 = "MY_VALUE2";
this.decorator.put(key1, value1);
this.decorator.put(key2, value2);
assertEquals(value1, this.decorator.get(key1));
assertEquals(value2, this.decorator.get(key2));
assertNull(this.map.get(key1));
assertNull(this.map.get(key2));
assertEquals(value1, this.decorator.remove(key1));
assertEquals(value2, this.decorator.remove(key2));
assertNull(this.decorator.get(key1));
assertNull(this.decorator.get(key2));
}
@Test
public void addNullKeyAndValue() {
this.decorator.put(null, null);
assertNull(this.decorator.get(null));
}
@Test
public void addNullValue() {
this.decorator.put("hello", null);
assertNull(this.decorator.get("hello"));
}
}
| [
"2356899074@qq.com"
] | 2356899074@qq.com |
bf48ea70d6d23f1864bc81723eecb2a4d112ac9f | f7160c0f0526cc5afc0fe4e6f06d384394059aa1 | /cellang/cl-webc/src/main/java/org/cellang/webc/main/client/handler/headeritem/CreateTableHeaderItemHandler.java | 93089fbda08b138b25e43e2832acbdb4ea1ee2a4 | [] | no_license | o1711/somecode | e2461c4fb51b3d75421c4827c43be52885df3a56 | a084f71786e886bac8f217255f54f5740fa786de | refs/heads/master | 2021-09-14T14:51:58.704495 | 2018-05-15T07:51:05 | 2018-05-15T07:51:05 | 112,574,683 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 710 | java | package org.cellang.webc.main.client.handler.headeritem;
import org.cellang.clwt.commons.client.frwk.HeaderItemEvent;
import org.cellang.clwt.core.client.Container;
import org.cellang.clwt.core.client.event.Event.EventHandlerI;
import org.cellang.webc.main.client.MainControlI;
import org.cellang.webc.main.client.handler.WebcHandlerSupport;
public class CreateTableHeaderItemHandler extends WebcHandlerSupport implements EventHandlerI<HeaderItemEvent> {
public CreateTableHeaderItemHandler(Container c) {
super(c);
}
@Override
public void handle(HeaderItemEvent t) {
MainControlI mc = this.getControl(MainControlI.class, true);
mc.openCreateTableView(true);//
}
}
| [
"wkz808@163.com"
] | wkz808@163.com |
fa755d12bde2f0060164d52b228da63d30382a7a | ae463c806a0a4bbd4284af66d22921e0992db338 | /assignment-2/Assignment3/Test.java | 23fa7553943964707bc0a9cc11f2962ae9b8fde8 | [] | no_license | heisthere/Blockchain-assignments | 2b6a199118c930ac7386de37849f2ffd795326f7 | cf44f8bdf0b9d54b57d9af5d25ce8931fd33998d | refs/heads/master | 2022-11-26T06:29:41.316826 | 2020-07-31T11:08:42 | 2020-07-31T11:08:42 | 284,001,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,432 | java | import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Signature;
import java.security.SignatureException;
import java.util.ArrayList;
import java.util.Random;
public class Test {
public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException,
SignatureException {
// txHandler holds all randomly generated transactions
TxHandler txHandler;
Transaction tx;
Random random = new Random();
int numBitsKeyPair = 512;
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
keyPairGenerator.initialize(numBitsKeyPair);
KeyPair scroogeKeyPair = keyPairGenerator.genKeyPair();
KeyPair aliceKeyPair = keyPairGenerator.genKeyPair();
KeyPair bobKeyPair = keyPairGenerator.genKeyPair();
// Create initial UTXO-Pool with coins to be spend later
UTXOPool utxoPool = new UTXOPool();
int numInitialUTXOs = 20;
int maxValueOutput = 20;
for (int i = 0; i < numInitialUTXOs; i++){
tx = new Transaction();
int numOutput = random.nextInt(maxValueOutput) + 1;
for (int j = 0; j < numOutput; j++){
double value = random.nextDouble() + 1;
tx.addOutput(value, scroogeKeyPair.getPublic()); // assign all coins to scrooge
}
tx.finalize();
// add all outputs as Unspent Transaction Output
for (int j = 0; j < numOutput; j++){
UTXO utxo = new UTXO(tx.getHash(), j);
utxoPool.addUTXO(utxo, tx.getOutput(j));
}
}
// txHandler is now initialized
txHandler = new TxHandler(new UTXOPool(utxoPool));
// Example Test: test isValidTx() with one valid transaction from scrooge to alice
Transaction validTx = new Transaction();
// choose an unspent transaction as input
UTXO utxo = utxoPool.getAllUTXO().get(0);
validTx.addInput(utxo.getTxHash(), utxo.getIndex());
// assign whole input to alice
double inputValue = utxoPool.getTxOutput(utxo).value;
double outputValue = inputValue;
validTx.addOutput(outputValue, aliceKeyPair.getPublic());
// uncommenting the next line tests for doublespending within one transaction
//validTx.addOutput(outputValue, bobKeyPair.getPublic());
// sign transaction using scrooge's private key
Signature signature = Signature.getInstance("SHA256withRSA");
signature.initSign(scroogeKeyPair.getPrivate());
signature.update(validTx.getRawDataToSign(0));
validTx.addSignature(signature.sign(), 0);
validTx.finalize();
// check for validity
if(txHandler.isValidTx(validTx)){
System.out.println("Transaction is valid.\n");
}else{
System.out.println("Transaction is invalid.\n");
}
Transaction[] acceptedTx = txHandler.handleTxs(new Transaction[]{validTx});
if(acceptedTx.length == 1){
System.out.println("Transaction is accepted.\n");
}else{
System.out.println("Transaction is not accepted.\n");
}
}
}
| [
"zenghuipeng@yeah.net"
] | zenghuipeng@yeah.net |
0fac4837c4d470381f668eac91b366257e4e8d8e | 3006489ea73d75e928fe0a69bc901513f43ed192 | /oasys-auth/src/main/java/cn/linter/oasys/auth/config/WebSecurityConfig.java | 0e8b78883eefacaf742bf1de7d2804d91b0fe99a | [
"Apache-2.0"
] | permissive | missaouib/OASys | 7b97befcec85756512dd641a5b1b621188db1eac | 1f0039ed7a3dcc7b1dcb23a94c6722058296dac4 | refs/heads/master | 2023-02-24T04:55:39.887218 | 2021-02-03T04:43:11 | 2021-02-03T04:43:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,468 | java | package cn.linter.oasys.auth.config;
import cn.linter.oasys.auth.client.UserClient;
import cn.linter.oasys.auth.entity.Role;
import cn.linter.oasys.auth.entity.User;
import cn.linter.oasys.common.entity.ResultStatus;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory;
import java.security.KeyPair;
import java.util.ArrayList;
import java.util.List;
/**
* Security配置
*
* @author wangxiaoyang
* @since 2020/11/03
*/
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private final UserClient userClient;
@Value("#{'${security.oauth2.authorization.jwt.key-store}'.substring(10)}")
private String keyLocation;
@Value("${security.oauth2.authorization.jwt.key-store-password}")
private String keyPassword;
@Value("${security.oauth2.authorization.jwt.key-alias}")
private String keyAlias;
public WebSecurityConfig(UserClient userClient) {
this.userClient = userClient;
}
@Bean
public KeyPair keyPairFactory() {
KeyStoreKeyFactory keyStoreKeyFactory = new KeyStoreKeyFactory(new ClassPathResource(keyLocation), keyPassword.toCharArray());
return keyStoreKeyFactory.getKeyPair(keyAlias, keyPassword.toCharArray());
}
@Bean
public PasswordEncoder passwordEncoderFactory() {
return new BCryptPasswordEncoder();
}
@Bean
public AuthenticationManager authenticationManagerBeanFactory() throws Exception {
return super.authenticationManagerBean();
}
@Bean
public UserDetailsService userDetailsServiceFactory() {
return username -> {
User user = userClient.queryUser(username).getData();
if (user == null) {
throw new UsernameNotFoundException(ResultStatus.USER_NOT_FOUND.getMessage());
}
List<Role> roles = userClient.listRoleOfUser(username).getData();
List<GrantedAuthority> authorities = new ArrayList<>(roles.size());
for (Role role : roles) {
authorities.add(new SimpleGrantedAuthority("ROLE_" + role.getName()));
}
user.setAuthorities(authorities);
return user;
};
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests(authorize -> authorize
.anyRequest().permitAll())
.csrf().disable();
}
} | [
"15847424609@163.com"
] | 15847424609@163.com |
4914735fa7aea207229229a16e6bbcab230ab8d3 | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /external/modules/felix.woodstox-core-asl/4.0.7/src/java/com/ctc/wstx/sr/NonNsInputElementStack.java | 8fe6a0a6d59579222a178a885d8b5a6b7a9412b2 | [] | no_license | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,577 | java | package com.ctc.wstx.sr;
import java.util.*;
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
import org.codehaus.stax2.ri.EmptyIterator;
import org.codehaus.stax2.validation.XMLValidator;
import com.ctc.wstx.api.ReaderConfig;
import com.ctc.wstx.util.BaseNsContext;
import com.ctc.wstx.util.EmptyNamespaceContext;
import com.ctc.wstx.util.StringVector;
import com.ctc.wstx.util.TextBuilder;
/**
* Sub-class of {@link InputElementStack} used when operating in
* non-namespace-aware, non validating mode.
*/
public final class NonNsInputElementStack
extends InputElementStack
{
final static String INT_ERR_UNEXPECTED_CALL = "Internal error: method should never be called for non-namespace element stack.";
/*
//////////////////////////////////////////////////
// Configuration
//////////////////////////////////////////////////
*/
protected final NonNsAttributeCollector mAttrCollector;
/*
//////////////////////////////////////////////////
// Element stack state information
//////////////////////////////////////////////////
*/
/**
* Array that contains path of open elements from root, one String
* for each open start element.
*/
protected String[] mElements;
/**
* Number of Strings in {@link #mElements} that are valid.
*/
protected int mSize;
/*
//////////////////////////////////////////////////
// Simple 1-slot QName cache; used for improving
// efficiency of code that uses QNames extensively
// (like StAX Event API implementation)
//////////////////////////////////////////////////
*/
protected String mLastLocalName = null;
protected QName mLastName = null;
/*
//////////////////////////////////////////////////
// Life-cycle (create, update state)
//////////////////////////////////////////////////
*/
public NonNsInputElementStack(int initialSize, ReaderConfig cfg)
{
super(cfg);
mSize = 0;
if (initialSize < 4) {
initialSize = 4;
}
mElements = new String[initialSize];
mAttrCollector = new NonNsAttributeCollector(cfg);
}
protected void setAutomaticDTDValidator(XMLValidator validator, NsDefaultProvider nsDefs)
{
addValidator(validator);
}
public final void push(String prefix, String localName)
{
throw new IllegalStateException(INT_ERR_UNEXPECTED_CALL);
}
public final void push(String fullName)
{
if (mSize == mElements.length) {
String[] old = mElements;
mElements = new String[old.length + 32];
System.arraycopy(old, 0, mElements, 0, old.length);
}
mElements[mSize] = fullName;
++mSize;
mAttrCollector.reset();
}
/**
* @return True if stack still has elements; false if not (root closed)
*/
public boolean pop()
throws XMLStreamException
{
if (mSize == 0) {
throw new IllegalStateException("Popping from empty stack.");
}
/* Let's allow GCing (not likely to matter, as Strings are very
* likely interned... but it's a good habit
*/
mElements[--mSize] = null;
return (mSize > 0);
}
/**
* Method called to update information about top of the stack, with
* attribute information passed in. Will resolve namespace references,
* and update namespace stack with information.
*
* @return Validation state that should be effective for the fully
* resolved element context
*/
public int resolveAndValidateElement()
throws XMLStreamException
{
NonNsAttributeCollector ac = mAttrCollector;
/* Attribute collector can now build its accessor data structs
* as necessary
*/
int xmlidIx = ac.resolveValues(mReporter);
mIdAttrIndex = xmlidIx;
// Any validator(s)? If not, we are done (except for xml:id check)
if (mValidator == null) {
if (xmlidIx >= 0) { // need to normalize xml:id, still?
normalizeXmlIdAttr(ac, xmlidIx);
}
return XMLValidator.CONTENT_ALLOW_ANY_TEXT;
}
// Otherwise need to call validator's methods:
/* First, a call to check if the element itself may be acceptable
* within structure:
*/
mValidator.validateElementStart(mElements[mSize-1], null,null);
// Then attributes, if any:
int attrLen = ac.getCount();
if (attrLen > 0) {
StringVector attrNames = ac.getNameList();
String[] nameData = attrNames.getInternalArray();
TextBuilder attrBuilder = ac.getAttrBuilder();
char[] attrCB = attrBuilder.getCharBuffer();
for (int i = 0; i < attrLen; ++i) {
String normValue = mValidator.validateAttribute
(nameData[i], null, null, attrCB,
attrBuilder.getOffset(i),
attrBuilder.getOffset(i+1));
if (normValue != null) {
ac.setNormalizedValue(i, normValue);
}
}
}
/* And finally let's wrap things up to see what textual content
* is allowed as child content, if any:
*/
return mValidator.validateElementAndAttributes();
}
public int validateEndElement()
throws XMLStreamException
{
if (mValidator == null) { // should never be null if we get here
return XMLValidator.CONTENT_ALLOW_ANY_TEXT;
}
int index = mSize-1;
int result = mValidator.validateElementEnd(mElements[index], null, null);
if (index == 0) { // root closing
mValidator.validationCompleted(true);
}
return result;
}
/*
///////////////////////////////////////////////////
// Access to helper objects
///////////////////////////////////////////////////
*/
public final AttributeCollector getAttrCollector() {
return mAttrCollector;
}
/**
* Method called to construct a non-transient NamespaceContext instance;
* generally needed when creating events to return from event-based
* iterators.
*/
public final BaseNsContext createNonTransientNsContext(Location loc) {
return EmptyNamespaceContext.getInstance();
}
/*
///////////////////////////////////////////////////
// Implementation of NamespaceContext:
///////////////////////////////////////////////////
*/
public final String getNamespaceURI(String prefix) {
/* No prefixes can be bound in non-namespace mode, however,
* "no prefix" needs to match "no namespace": latter of which
* is signified by the empty String
*/
if (prefix == null || prefix.length() == 0) {
return "";
}
return null;
}
public final String getPrefix(String nsURI) {
return null;
}
public final Iterator getPrefixes(String nsURI) {
return EmptyIterator.getInstance();
}
/*
///////////////////////////////////////////////////
// AttributeInfo methods (StAX2)
///////////////////////////////////////////////////
*/
public final int getAttributeCount()
{
return mAttrCollector.getCount();
}
public final int findAttributeIndex(String nsURI, String localName)
{
// Should never pass a NS URI...
if (nsURI != null && nsURI.length() > 0) {
return -1;
}
return mAttrCollector.findIndex(localName);
}
/*
///////////////////////////////////////////////////
// ValidationContext methods
///////////////////////////////////////////////////
*/
public final QName getCurrentElementName()
{
if (mSize == 0) {
return null;
}
/* 03-Dec-2004, TSa: Maybe we can just reuse the last QName
* object created, if we have same data? (happens if
* state hasn't changed, or we got end element for a leaf
* element, or repeating leaf elements)
*/
String ln = mElements[mSize-1];
/* Since local names are always interned, can just use cheap
* identity comparison here:
*/
if (ln == mLastLocalName) {
return mLastName;
}
QName n = new QName(ln);
mLastLocalName = ln;
mLastName = n;
return n;
}
public int addDefaultAttribute(String localName, String uri, String prefix,
String value)
{
// No real namespace info passed...
return mAttrCollector.addDefaultAttribute(localName, value);
}
/*
///////////////////////////////////////////////////
// Support for NsDefaultProvider
///////////////////////////////////////////////////
*/
public boolean isPrefixLocallyDeclared(String internedPrefix) {
// should never be called... but let's not care if it is
return false;
}
public void addNsBinding(String prefix, String uri) {
// should never be called... but let's just ignore it.
}
/*
///////////////////////////////////////////////////
// Accessors:
///////////////////////////////////////////////////
*/
public final boolean isNamespaceAware() {
return false;
}
// // // Generic stack information:
public final int getDepth() { return mSize; }
public final boolean isEmpty() {
return mSize == 0;
}
// // // Information about element at top of stack:
public final String getDefaultNsURI() {
return null;
}
public final String getNsURI() {
return null;
}
public final String getPrefix() {
return null;
}
public final String getLocalName() {
if (mSize == 0) {
throw new IllegalStateException("Illegal access, empty stack.");
}
return mElements[mSize-1];
}
public final boolean matches(String prefix, String localName)
{
if (mSize == 0) {
throw new IllegalStateException("Illegal access, empty stack.");
}
if (prefix != null && prefix.length() > 0) {
return false;
}
String thisName = mElements[mSize-1];
return (thisName == localName) || thisName.equals(localName);
}
public final String getTopElementDesc() {
if (mSize == 0) {
throw new IllegalStateException("Illegal access, empty stack.");
}
return mElements[mSize-1];
}
// // // Namespace information:
public final int getTotalNsCount() {
return 0;
}
/**
* @return Number of active prefix/namespace mappings for current scope,
* NOT including mappings from enclosing elements.
*/
public final int getCurrentNsCount() {
return 0;
}
public final String getLocalNsPrefix(int index) {
throwIllegalIndex(index);
return null;
}
public final String getLocalNsURI(int index) {
throwIllegalIndex(index);
return null;
}
private static void throwIllegalIndex(int index) {
throw new IllegalArgumentException("Illegal namespace index "+index
+"; current scope has no namespace declarations.");
}
}
| [
"heavy@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | heavy@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
76cce54afe5fd9a41191ed30796440c3a51f8a80 | 1e212405cd1e48667657045ad91fb4dc05596559 | /lib/openflowj-3.3.0-SNAPSHOT-sources (copy)/org/projectfloodlight/openflow/protocol/ver14/OFBsnTlvExternalGatewayIpVer14.java | aa0ff1093e246f31424da4f7ee925da3d1217be5 | [
"Apache-2.0"
] | permissive | aamorim/floodlight | 60d4ef0b6d7fe68b8b4688f0aa610eb23dd790db | 1b7d494117f3b6b9adbdbcf23e6cb3cc3c6187c9 | refs/heads/master | 2022-07-10T21:50:11.130010 | 2019-09-03T19:02:41 | 2019-09-03T19:02:41 | 203,223,614 | 1 | 0 | Apache-2.0 | 2022-07-06T20:07:15 | 2019-08-19T18:00:01 | Java | UTF-8 | Java | false | false | 8,552 | java | // Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
// Copyright (c) 2011, 2012 Open Networking Foundation
// Copyright (c) 2012, 2013 Big Switch Networks, Inc.
// This library was generated by the LoxiGen Compiler.
// See the file LICENSE.txt which should have been included in the source distribution
// Automatically generated by LOXI from template of_class.java
// Do not modify
package org.projectfloodlight.openflow.protocol.ver14;
import org.projectfloodlight.openflow.protocol.*;
import org.projectfloodlight.openflow.protocol.action.*;
import org.projectfloodlight.openflow.protocol.actionid.*;
import org.projectfloodlight.openflow.protocol.bsntlv.*;
import org.projectfloodlight.openflow.protocol.errormsg.*;
import org.projectfloodlight.openflow.protocol.meterband.*;
import org.projectfloodlight.openflow.protocol.instruction.*;
import org.projectfloodlight.openflow.protocol.instructionid.*;
import org.projectfloodlight.openflow.protocol.match.*;
import org.projectfloodlight.openflow.protocol.stat.*;
import org.projectfloodlight.openflow.protocol.oxm.*;
import org.projectfloodlight.openflow.protocol.oxs.*;
import org.projectfloodlight.openflow.protocol.queueprop.*;
import org.projectfloodlight.openflow.types.*;
import org.projectfloodlight.openflow.util.*;
import org.projectfloodlight.openflow.exceptions.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import com.google.common.hash.PrimitiveSink;
import com.google.common.hash.Funnel;
class OFBsnTlvExternalGatewayIpVer14 implements OFBsnTlvExternalGatewayIp {
private static final Logger logger = LoggerFactory.getLogger(OFBsnTlvExternalGatewayIpVer14.class);
// version: 1.4
final static byte WIRE_VERSION = 5;
final static int LENGTH = 8;
private final static IPv4Address DEFAULT_VALUE = IPv4Address.NONE;
// OF message fields
private final IPv4Address value;
//
// Immutable default instance
final static OFBsnTlvExternalGatewayIpVer14 DEFAULT = new OFBsnTlvExternalGatewayIpVer14(
DEFAULT_VALUE
);
// package private constructor - used by readers, builders, and factory
OFBsnTlvExternalGatewayIpVer14(IPv4Address value) {
if(value == null) {
throw new NullPointerException("OFBsnTlvExternalGatewayIpVer14: property value cannot be null");
}
this.value = value;
}
// Accessors for OF message fields
@Override
public int getType() {
return 0x1a;
}
@Override
public IPv4Address getValue() {
return value;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
public OFBsnTlvExternalGatewayIp.Builder createBuilder() {
return new BuilderWithParent(this);
}
static class BuilderWithParent implements OFBsnTlvExternalGatewayIp.Builder {
final OFBsnTlvExternalGatewayIpVer14 parentMessage;
// OF message fields
private boolean valueSet;
private IPv4Address value;
BuilderWithParent(OFBsnTlvExternalGatewayIpVer14 parentMessage) {
this.parentMessage = parentMessage;
}
@Override
public int getType() {
return 0x1a;
}
@Override
public IPv4Address getValue() {
return value;
}
@Override
public OFBsnTlvExternalGatewayIp.Builder setValue(IPv4Address value) {
this.value = value;
this.valueSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
@Override
public OFBsnTlvExternalGatewayIp build() {
IPv4Address value = this.valueSet ? this.value : parentMessage.value;
if(value == null)
throw new NullPointerException("Property value must not be null");
//
return new OFBsnTlvExternalGatewayIpVer14(
value
);
}
}
static class Builder implements OFBsnTlvExternalGatewayIp.Builder {
// OF message fields
private boolean valueSet;
private IPv4Address value;
@Override
public int getType() {
return 0x1a;
}
@Override
public IPv4Address getValue() {
return value;
}
@Override
public OFBsnTlvExternalGatewayIp.Builder setValue(IPv4Address value) {
this.value = value;
this.valueSet = true;
return this;
}
@Override
public OFVersion getVersion() {
return OFVersion.OF_14;
}
//
@Override
public OFBsnTlvExternalGatewayIp build() {
IPv4Address value = this.valueSet ? this.value : DEFAULT_VALUE;
if(value == null)
throw new NullPointerException("Property value must not be null");
return new OFBsnTlvExternalGatewayIpVer14(
value
);
}
}
final static Reader READER = new Reader();
static class Reader implements OFMessageReader<OFBsnTlvExternalGatewayIp> {
@Override
public OFBsnTlvExternalGatewayIp readFrom(ByteBuf bb) throws OFParseError {
int start = bb.readerIndex();
// fixed value property type == 0x1a
short type = bb.readShort();
if(type != (short) 0x1a)
throw new OFParseError("Wrong type: Expected=0x1a(0x1a), got="+type);
int length = U16.f(bb.readShort());
if(length != 8)
throw new OFParseError("Wrong length: Expected=8(8), got="+length);
if(bb.readableBytes() + (bb.readerIndex() - start) < length) {
// Buffer does not have all data yet
bb.readerIndex(start);
return null;
}
if(logger.isTraceEnabled())
logger.trace("readFrom - length={}", length);
IPv4Address value = IPv4Address.read4Bytes(bb);
OFBsnTlvExternalGatewayIpVer14 bsnTlvExternalGatewayIpVer14 = new OFBsnTlvExternalGatewayIpVer14(
value
);
if(logger.isTraceEnabled())
logger.trace("readFrom - read={}", bsnTlvExternalGatewayIpVer14);
return bsnTlvExternalGatewayIpVer14;
}
}
public void putTo(PrimitiveSink sink) {
FUNNEL.funnel(this, sink);
}
final static OFBsnTlvExternalGatewayIpVer14Funnel FUNNEL = new OFBsnTlvExternalGatewayIpVer14Funnel();
static class OFBsnTlvExternalGatewayIpVer14Funnel implements Funnel<OFBsnTlvExternalGatewayIpVer14> {
private static final long serialVersionUID = 1L;
@Override
public void funnel(OFBsnTlvExternalGatewayIpVer14 message, PrimitiveSink sink) {
// fixed value property type = 0x1a
sink.putShort((short) 0x1a);
// fixed value property length = 8
sink.putShort((short) 0x8);
message.value.putTo(sink);
}
}
public void writeTo(ByteBuf bb) {
WRITER.write(bb, this);
}
final static Writer WRITER = new Writer();
static class Writer implements OFMessageWriter<OFBsnTlvExternalGatewayIpVer14> {
@Override
public void write(ByteBuf bb, OFBsnTlvExternalGatewayIpVer14 message) {
// fixed value property type = 0x1a
bb.writeShort((short) 0x1a);
// fixed value property length = 8
bb.writeShort((short) 0x8);
message.value.write4Bytes(bb);
}
}
@Override
public String toString() {
StringBuilder b = new StringBuilder("OFBsnTlvExternalGatewayIpVer14(");
b.append("value=").append(value);
b.append(")");
return b.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OFBsnTlvExternalGatewayIpVer14 other = (OFBsnTlvExternalGatewayIpVer14) obj;
if (value == null) {
if (other.value != null)
return false;
} else if (!value.equals(other.value))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
}
| [
"alex@VM-UFS-001"
] | alex@VM-UFS-001 |
dd20022aea6fea8dcf78314daa757f71a94c92b3 | 42b4b2000bfe0bb0dffa2a8d74f4d47916141dbe | /src/main/java/com/springmvc/mapping/RoleFunctionMapper.java | e0f003deaedbefc751792c7e77056b10a6df147c | [] | no_license | hexingtong/Yuerfei | f84ab45e4b8522e72d5c92ba1d4edac4b2c1769b | 7a0fc24304451ae236f7b9cde24c2e242e0e4550 | refs/heads/master | 2020-04-25T09:00:48.366274 | 2019-05-17T01:25:48 | 2019-05-17T01:25:48 | 172,187,237 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 182 | java | package com.springmvc.mapping;
import com.springmvc.pojo.RoleFunction;
import tk.mybatis.mapper.common.Mapper;
public interface RoleFunctionMapper extends Mapper<RoleFunction> {
} | [
"269860517@qq.com"
] | 269860517@qq.com |
26eeb118585bc0edbb4271f8d9f02cbd0c20ad92 | 9ba95236906aa41c9811b67570df863f5c0ff5c8 | /app/src/test/java/com/example/busra/tabapp/ExampleUnitTest.java | a631d45c6b836b6698d2c49cfeda5bca66c5c595 | [] | no_license | BusraKarnucuKou/AkilliEvApp | 42cbea0f80e6489daad74e02270bd4f0d0693226 | 7900751dbe8ddcf51218d72b34dc216be7144774 | refs/heads/master | 2021-01-22T21:23:21.361203 | 2017-03-21T09:25:25 | 2017-03-21T09:25:25 | 85,425,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.example.busra.tabapp;
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);
}
} | [
"130201076@kocaeli.edu.tr"
] | 130201076@kocaeli.edu.tr |
4be2fe196d271422e309740af13018300dd97714 | a7140b9ef65530b99903ffd9b53e6bd32d41ed10 | /yule-mongo/src/main/java/com/yule/mongo/company/query/BalanceQuery.java | c6948f27e274b522dd7d73ef343f955ee7cfc034 | [] | no_license | FantasybabyChange/yule_workspace | 0c0b2c5cd59f866b70d24ac7c1f9a12df24b9f9d | 5125a39ac04378a4f6c6225dd85fcc46939f4451 | refs/heads/master | 2023-07-21T01:13:22.917184 | 2021-08-17T13:23:06 | 2021-08-17T13:23:06 | 397,264,689 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 880 | java | package com.yule.mongo.company.query;
import java.io.Serializable;
public class BalanceQuery implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3193977797295790434L;
private String month;
private String start_time;
private String end_time;
private String company_id;
public String getStart_time() {
return start_time;
}
public void setStart_time(String start_time) {
this.start_time = start_time;
}
public String getEnd_time() {
return end_time;
}
public void setEnd_time(String end_time) {
this.end_time = end_time;
}
public String getCompany_id() {
return company_id;
}
public void setCompany_id(String company_id) {
this.company_id = company_id;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public BalanceQuery() {
super();
}
}
| [
"625353861@qq.com"
] | 625353861@qq.com |
01669a35d124fbe992d5a95c4b03734a36dd0057 | ca379d35ab208e9f1fae463d55f909dbb85ef161 | /src/org/brutality/model/players/PathFinder.java | 21187edaa6a01096fd30cf4b0a38c205c8080074 | [] | no_license | rampage-osrs/rampage-os-server | a8d1f55073ebfbb14b6b8d97c75575c9b5a80ca6 | 53b9e4124659e35983740b4ef365a2f02d23ea86 | refs/heads/master | 2021-08-19T09:42:18.123993 | 2017-11-25T16:53:13 | 2017-11-25T16:53:13 | 112,019,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,015 | java | package org.brutality.model.players;
import java.util.LinkedList;
import org.brutality.clip.Region;
import org.brutality.model.players.Player;
public class PathFinder {
private static final PathFinder pathFinder = new PathFinder();
public static PathFinder getPathFinder() {
return pathFinder;
}
public PathFinder() {
}
public void findRoute(Player c, int destX, int destY, boolean moveNear,
int xLength, int yLength) {
if (destX == c.getLocalX() && destY == c.getLocalY() && !moveNear) {
c.sendMessage("ERROR!");
return;
}
destX = destX - 8 * c.getMapRegionX();
destY = destY - 8 * c.getMapRegionY();
int[][] via = new int[104][104];
int[][] cost = new int[104][104];
LinkedList<Integer> tileQueueX = new LinkedList<Integer>();
LinkedList<Integer> tileQueueY = new LinkedList<Integer>();
for (int xx = 0; xx < 104; xx++) {
for (int yy = 0; yy < 104; yy++) {
cost[xx][yy] = 99999999;
}
}
int curX = c.getLocalX();
int curY = c.getLocalY();
via[curX][curY] = 99;
cost[curX][curY] = 0;
int tail = 0;
tileQueueX.add(curX);
tileQueueY.add(curY);
boolean foundPath = false;
int pathLength = 4000;
while (tail != tileQueueX.size() && tileQueueX.size() < pathLength) {
curX = tileQueueX.get(tail);
curY = tileQueueY.get(tail);
int curAbsX = c.getMapRegionX() * 8 + curX;
int curAbsY = c.getMapRegionY() * 8 + curY;
if (curX == destX && curY == destY) {
foundPath = true;
break;
}
tail = (tail + 1) % pathLength;
int thisCost = cost[curX][curY] + 1;
if (curY > 0
&& via[curX][curY - 1] == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, c.heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY - 1);
via[curX][curY - 1] = 1;
cost[curX][curY - 1] = thisCost;
}
if (curX > 0
&& via[curX - 1][curY] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, c.heightLevel) & 0x1280108) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY);
via[curX - 1][curY] = 2;
cost[curX - 1][curY] = thisCost;
}
if (curY < 104 - 1
&& via[curX][curY + 1] == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, c.heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY + 1);
via[curX][curY + 1] = 4;
cost[curX][curY + 1] = thisCost;
}
if (curX < 104 - 1
&& via[curX + 1][curY] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, c.heightLevel) & 0x1280180) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY);
via[curX + 1][curY] = 8;
cost[curX + 1][curY] = thisCost;
}
if (curX > 0
&& curY > 0
&& via[curX - 1][curY - 1] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY - 1,
c.heightLevel) & 0x128010e) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, c.heightLevel) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, c.heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY - 1);
via[curX - 1][curY - 1] = 3;
cost[curX - 1][curY - 1] = thisCost;
}
if (curX > 0
&& curY < 104 - 1
&& via[curX - 1][curY + 1] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY + 1,
c.heightLevel) & 0x1280138) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, c.heightLevel) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, c.heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY + 1);
via[curX - 1][curY + 1] = 6;
cost[curX - 1][curY + 1] = thisCost;
}
if (curX < 104 - 1
&& curY > 0
&& via[curX + 1][curY - 1] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY - 1,
c.heightLevel) & 0x1280183) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, c.heightLevel) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, c.heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY - 1);
via[curX + 1][curY - 1] = 9;
cost[curX + 1][curY - 1] = thisCost;
}
if (curX < 104 - 1
&& curY < 104 - 1
&& via[curX + 1][curY + 1] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY + 1,
c.heightLevel) & 0x12801e0) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, c.heightLevel) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, c.heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY + 1);
via[curX + 1][curY + 1] = 12;
cost[curX + 1][curY + 1] = thisCost;
}
}
if (!foundPath) {
if (moveNear) {
int i_223_ = 1000;
int thisCost = 100;
int i_225_ = 10;
for (int x = destX - i_225_; x <= destX + i_225_; x++) {
for (int y = destY - i_225_; y <= destY + i_225_; y++) {
if (x >= 0 && y >= 0 && x < 104 && y < 104
&& cost[x][y] < 100) {
int i_228_ = 0;
if (x < destX) {
i_228_ = destX - x;
} else if (x > destX + xLength - 1) {
i_228_ = x - (destX + xLength - 1);
}
int i_229_ = 0;
if (y < destY) {
i_229_ = destY - y;
} else if (y > destY + yLength - 1) {
i_229_ = y - (destY + yLength - 1);
}
int i_230_ = i_228_ * i_228_ + i_229_ * i_229_;
if (i_230_ < i_223_
|| (i_230_ == i_223_ && (cost[x][y] < thisCost))) {
i_223_ = i_230_;
thisCost = cost[x][y];
curX = x;
curY = y;
}
}
}
}
if (i_223_ == 1000) {
return;
}
} else {
return;
}
}
tail = 0;
tileQueueX.set(tail, curX);
tileQueueY.set(tail++, curY);
int l5;
for (int j5 = l5 = via[curX][curY]; curX != c.getLocalX()
|| curY != c.getLocalY(); j5 = via[curX][curY]) {
if (j5 != l5) {
l5 = j5;
tileQueueX.set(tail, curX);
tileQueueY.set(tail++, curY);
}
if ((j5 & 2) != 0) {
curX++;
} else if ((j5 & 8) != 0) {
curX--;
}
if ((j5 & 1) != 0) {
curY++;
} else if ((j5 & 4) != 0) {
curY--;
}
}
c.resetWalkingQueue();
int size = tail--;
int pathX = c.getMapRegionX() * 8 + tileQueueX.get(tail);
int pathY = c.getMapRegionY() * 8 + tileQueueY.get(tail);
c.addToWalkingQueue(localize(pathX, c.getMapRegionX()),
localize(pathY, c.getMapRegionY()));
for (int i = 1; i < size; i++) {
tail--;
pathX = c.getMapRegionX() * 8 + tileQueueX.get(tail);
pathY = c.getMapRegionY() * 8 + tileQueueY.get(tail);
c.addToWalkingQueue(localize(pathX, c.getMapRegionX()),
localize(pathY, c.getMapRegionY()));
}
}
public boolean accessable(Player c, int destX, int destY) {
destX = destX - 8 * c.getMapRegionX();
destY = destY - 8 * c.getMapRegionY();
int[][] via = new int[104][104];
int[][] cost = new int[104][104];
LinkedList<Integer> tileQueueX = new LinkedList<Integer>();
LinkedList<Integer> tileQueueY = new LinkedList<Integer>();
for (int xx = 0; xx < 104; xx++) {
for (int yy = 0; yy < 104; yy++) {
cost[xx][yy] = 99999999;
}
}
int curX = c.getLocalX();
int curY = c.getLocalY();
via[curX][curY] = 99;
cost[curX][curY] = 0;
int tail = 0;
tileQueueX.add(curX);
tileQueueY.add(curY);
int pathLength = 4000;
int z = c.heightLevel;
while (tail != tileQueueX.size() && tileQueueX.size() < pathLength) {
curX = tileQueueX.get(tail);
curY = tileQueueY.get(tail);
int curAbsX = c.getMapRegionX() * 8 + curX;
int curAbsY = c.getMapRegionY() * 8 + curY;
if (curX == destX && curY == destY) {
return true;
}
tail = (tail + 1) % pathLength;
int thisCost = cost[curX][curY] + 1;
if (curY > 0 && via[curX][curY - 1] == 0 && (Region.getClipping(curAbsX, curAbsY - 1, z) & 0x1280102) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY - 1);
via[curX][curY - 1] = 1;
cost[curX][curY - 1] = thisCost;
}
if (curX > 0 && via[curX - 1][curY] == 0 && (Region.getClipping(curAbsX - 1, curAbsY, z) & 0x1280108) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY);
via[curX - 1][curY] = 2;
cost[curX - 1][curY] = thisCost;
}
if (curY < 104 - 1 && via[curX][curY + 1] == 0 && (Region.getClipping(curAbsX, curAbsY + 1, z) & 0x1280120) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY + 1);
via[curX][curY + 1] = 4;
cost[curX][curY + 1] = thisCost;
}
if (curX < 104 - 1 && via[curX + 1][curY] == 0 && (Region.getClipping(curAbsX + 1, curAbsY, z) & 0x1280180) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY);
via[curX + 1][curY] = 8;
cost[curX + 1][curY] = thisCost;
}
if (curX > 0 && curY > 0 && via[curX - 1][curY - 1] == 0 && (Region.getClipping(curAbsX - 1, curAbsY - 1, z) & 0x128010e) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, z) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, z) & 0x1280102) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY - 1);
via[curX - 1][curY - 1] = 3;
cost[curX - 1][curY - 1] = thisCost;
}
if (curX > 0 && curY < 104 - 1 && via[curX - 1][curY + 1] == 0 && (Region.getClipping(curAbsX - 1, curAbsY + 1, z) & 0x1280138) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, z) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, z) & 0x1280120) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY + 1);
via[curX - 1][curY + 1] = 6;
cost[curX - 1][curY + 1] = thisCost;
}
if (curX < 104 - 1 && curY > 0 && via[curX + 1][curY - 1] == 0 && (Region.getClipping(curAbsX + 1, curAbsY - 1, z) & 0x1280183) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, z) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, z) & 0x1280102) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY - 1);
via[curX + 1][curY - 1] = 9;
cost[curX + 1][curY - 1] = thisCost;
}
if (curX < 104 - 1 && curY < 104 - 1 && via[curX + 1][curY + 1] == 0 && (Region.getClipping(curAbsX + 1, curAbsY + 1, z) & 0x12801e0) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, z) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, z) & 0x1280120) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY + 1);
via[curX + 1][curY + 1] = 12;
cost[curX + 1][curY + 1] = thisCost;
}
}
return false;
}
public int localize(int x, int mapRegion) {
return x - 8 * mapRegion;
}
} | [
"contact.rampageosrs@gmail.com"
] | contact.rampageosrs@gmail.com |
42e7a15d0f25ca90e3fc2cbb148ea1125338bec2 | 621b60e4bf64de79e5cd46fb86eb1de804ba9a49 | /src/main/java/com/heliohdd/springboothdd2_ionic_backend/domain/ItemPedido.java | 16f6f2b53301eb0ea41f1d85020c455c7cc4972e | [] | no_license | heliohdd/springboothdd2_ionic_backend | d1de1f89182f5fbd50111557b325ab3e27b8c25e | 12c253a5800abc4351a623022911da4a6aea68e3 | refs/heads/master | 2021-07-22T22:19:56.889584 | 2020-03-30T13:51:59 | 2020-03-30T13:51:59 | 248,313,473 | 0 | 0 | null | 2021-04-26T20:05:09 | 2020-03-18T18:36:40 | Java | UTF-8 | Java | false | false | 2,647 | java | package com.heliohdd.springboothdd2_ionic_backend.domain;
import java.io.Serializable;
import java.text.NumberFormat;
import java.util.Locale;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class ItemPedido implements Serializable {
private static final long serialVersionUID = 1L;
@JsonIgnore
@EmbeddedId
private ItemPedidoPK id = new ItemPedidoPK();
private Double desconto;
private Integer quantidade;
private Double preco;
public ItemPedido() {
}
public ItemPedido(Pedido pedido, Produto produto, Double desconto, Integer quantidade, Double preco) {
super();
id.setPedido(pedido);
id.setProduto(produto);
this.desconto = desconto;
this.quantidade = quantidade;
this.preco = preco;
}
public double getSubTotal() {
return (preco - desconto) * quantidade;
}
@JsonIgnore
public Pedido getPedido() {
return id.getPedido();
}
public void setPedido(Pedido pedido) {
id.setPedido(pedido);
}
public Produto getProduto() {
return id.getProduto();
}
public void setProduto(Produto produto) {
id.setProduto(produto);
}
public ItemPedidoPK getId() {
return id;
}
public void setId(ItemPedidoPK id) {
this.id = id;
}
public Double getDesconto() {
return desconto;
}
public void setDesconto(Double desconto) {
this.desconto = desconto;
}
public Integer getQuantidade() {
return quantidade;
}
public void setQuantidade(Integer quantidade) {
this.quantidade = quantidade;
}
public Double getPreco() {
return preco;
}
public void setPreco(Double preco) {
this.preco = preco;
}
@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;
ItemPedido other = (ItemPedido) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("pt", "BR"));
StringBuilder builder = new StringBuilder();
builder.append(getProduto().getNome());
builder.append(", Qte: ");
builder.append(getQuantidade());
builder.append(", Preço unitário: ");
builder.append(nf.format(getPreco()));
builder.append(", Subtotal: ");
builder.append(nf.format(getSubTotal()));
builder.append("\n");
return builder.toString();
}
} | [
"heliohdd@yahoo.com.br"
] | heliohdd@yahoo.com.br |
a4b644197a3561637da90516698d23771ab988bb | b0c63ba84a96116b1e3d45348f51a6361fb4691e | /Spring/AOP/spring-aop/src/main/java/org/genesis/javacollector/spring/aop/advice/ForumService.java | e0116c3ad5dbe9620289ae602851a7ac0fbb79d2 | [
"Apache-2.0"
] | permissive | davidgjy/java-collector | 24f76b788db44fc7b1ce0b98c8be12e62d984fc2 | 137d46a72c82c29931e39911f6487f7fdd206d0c | refs/heads/master | 2022-12-24T21:10:56.126983 | 2021-02-26T03:06:16 | 2021-02-26T03:06:16 | 124,169,492 | 0 | 0 | Apache-2.0 | 2022-12-16T04:31:39 | 2018-03-07T02:50:42 | Java | UTF-8 | Java | false | false | 371 | java | package org.genesis.javacollector.spring.aop.advice;
import java.sql.SQLException;
public class ForumService {
public void removeForum(int forumId) {
// do sth...
throw new RuntimeException("运行异常。");
}
public void updateForum(Forum forum) throws Exception{
// do sth...
throw new SQLException("数据更新操作异常。");
}
}
| [
"jgu55@its.jnj.com"
] | jgu55@its.jnj.com |
f74650bc76e3f32ec5f2004e0ed7b02f7f44df40 | 74bbf384414f2bf4be7aefd031aa4eaa856f0d60 | /src/main/java/com/example/ekart/model/Products.java | e3302d9028c4fd7d71b9ddbfbf84239fbbe91223 | [] | no_license | harikumarc/ekart | 76977eefaa00f6a7895646cfda6f10ec866b807e | 96471fb1839ee24692cae9dbbe900a95a631e4c5 | refs/heads/master | 2020-05-02T10:51:57.642900 | 2019-04-03T02:52:04 | 2019-04-03T02:52:04 | 177,909,766 | 0 | 0 | null | 2019-03-27T16:14:53 | 2019-03-27T03:14:21 | Java | UTF-8 | Java | false | false | 1,126 | java | package com.example.ekart.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Products {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private String name;
private String category;
private String subcategory;
private String brand ;
private long price;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getSubcategory() {
return subcategory;
}
public void setSubcategory(String subcategory) {
this.subcategory = subcategory;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public long getPrice() {
return price;
}
public void setPrice(long price) {
this.price = price;
}
}
| [
"harikumarc1987@gmail.com"
] | harikumarc1987@gmail.com |
3b6b889373091c8ffb57a118bc2b01629aa50c01 | abec384825199e4308d739f817c64439d103426d | /app/src/main/java/com/cdhxqh/household_app/ui/widget/Photo/GraphicsBitmapUtils.java | e41c92e769513c737f054dedc242b720569955d3 | [] | no_license | zhongweiyunkeji/Household_app-1 | fd83394a3f5ed401edbac21f421752610d86ee21 | c0f558ce9397a42177fe9609371ff73d934664d8 | refs/heads/master | 2021-01-15T23:41:26.019236 | 2015-09-16T09:13:52 | 2015-09-16T09:13:52 | 40,633,662 | 0 | 0 | null | 2015-08-13T01:57:10 | 2015-08-13T01:57:07 | null | UTF-8 | Java | false | false | 9,837 | java | package com.cdhxqh.household_app.ui.widget.Photo;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class GraphicsBitmapUtils {
// 放大缩小图片
public static Bitmap zoomBitmap(Bitmap bitmap, int w, int h) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix matrix = new Matrix();
float scaleWidht = ((float) w / width);
float scaleHeight = ((float) h / height);
matrix.postScale(scaleWidht, scaleHeight);
Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, width, height,
matrix, true);
return newbmp;
}
// 获得圆角图片的方法
public static Bitmap drawableToBitmap(Drawable drawable) {
int width = drawable.getIntrinsicWidth();
int height = drawable.getIntrinsicHeight();
Bitmap bitmap = Bitmap.createBitmap(width, height, drawable
.getOpacity() != PixelFormat.OPAQUE ? Config.ARGB_8888
: Config.RGB_565);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, width, height);
drawable.draw(canvas);
return bitmap;
}
// 获得带倒影的图片方法
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, float roundPx) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
return output;
}
// 将Drawable转化为Bitmap
public static Bitmap createReflectionImageWithOrigin(Bitmap bitmap) {
final int reflectionGap = 4;
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.preScale(1, -1);
Bitmap reflectionImage = Bitmap.createBitmap(bitmap, 0, height / 2,
width, height / 2, matrix, false);
Bitmap bitmapWithReflection = Bitmap.createBitmap(width,
(height + height / 2), Config.ARGB_8888);
Canvas canvas = new Canvas(bitmapWithReflection);
canvas.drawBitmap(bitmap, 0, 0, null);
Paint deafalutPaint = new Paint();
canvas.drawRect(0, height, width, height + reflectionGap, deafalutPaint);
canvas.drawBitmap(reflectionImage, 0, height + reflectionGap, null);
Paint paint = new Paint();
LinearGradient shader = new LinearGradient(0, bitmap.getHeight(), 0,
bitmapWithReflection.getHeight() + reflectionGap, 0x70ffffff,
0x00ffffff, TileMode.CLAMP);
paint.setShader(shader);
// Set the Transfer mode to be porter duff and destination in
paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
// Draw a rectangle using the paint with our linear gradient
canvas.drawRect(0, height, width, bitmapWithReflection.getHeight()
+ reflectionGap, paint);
return bitmapWithReflection;
}
public static void writerFileForByteArray(byte[] data)
{
Bitmap $bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
if($bitmap==null)
return;
String filename="/sdcard/10.8/"+System.currentTimeMillis()+".png";
File f=new File(filename);
FileOutputStream fos=null;
try {
f.createNewFile();
fos=new FileOutputStream(f);
$bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.flush();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static byte[] Bitmap2Bytes(Bitmap bm){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
return baos.toByteArray();
}
public static byte[] Bitmap2Bytes(Bitmap bm,int cos){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.PNG, cos, baos);
return baos.toByteArray();
}
public static void writerFileForBitmap(Bitmap bitmap)
{
String filename="/sdcard/10.8/"+System.currentTimeMillis()+".png";
File f=new File(filename);
FileOutputStream fos=null;
try {
f.createNewFile();
fos=new FileOutputStream(f);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.flush();
fos.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* 图片合成
* @param bitmap
* @return
*/
private Bitmap createBitmap( Bitmap src, Bitmap watermark ) {
if( src == null ) {
return null;
}
int w = src.getWidth();
int h = src.getHeight();
int ww = watermark.getWidth();
int wh = watermark.getHeight();
//create the new blank bitmap
Bitmap newb = Bitmap.createBitmap( w, h, Config.ARGB_8888 );//创建一个新的和SRC长度宽度一样的位图
Canvas cv = new Canvas( newb );
//draw src into
cv.drawBitmap( src, 0, 0, null );//在 0,0坐标开始画入src
//draw watermark into
cv.drawBitmap( watermark, w - ww + 5, h - wh + 5, null );//在src的右下角画入水印
//save all clip
cv.save( Canvas.ALL_SAVE_FLAG );//保存
//store
cv.restore();//存储
return newb;
}
/**
* 图片圆角
* @param bitmap
* @return
*/
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
final float roundPx = 12;
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
return output;
}
/**
* 缩放、翻转和旋转图片
* @param bmpOrg
* @param rotate
* @return
*/
private Bitmap gerZoomRotateBitmap(
Bitmap bmpOrg, int rotate) {
// 获取图片的原始的大小
int width = bmpOrg.getWidth();
int height = bmpOrg.getHeight();
int newWidth = 300;
int newheight = 300;
// 定义缩放的高和宽的比例
float sw = ((float) newWidth) / width;
float sh = ((float) newheight) / height;
// 创建操作图片的用的Matrix对象
Matrix matrix = new Matrix();
// 缩放翻转图片的动作
// sw sh的绝对值为绽放宽高的比例,sw为负数表示X方向翻转,sh为负数表示Y方向翻转
matrix.postScale(sw, sh);
// 旋转30*
matrix.postRotate(rotate);
//创建一个新的图片
Bitmap resizeBitmap = Bitmap
.createBitmap(bmpOrg, 0, 0, width, height, matrix, true);
return resizeBitmap;
}
/**
* 图片旋转
*
* @param bmp
* 要旋转的图片
* @param degree
* 图片旋转的角度,负值为逆时针旋转,正值为顺时针旋转
* @return
*/
public static Bitmap rotateBitmap(Bitmap bmp, float degree) {
Matrix matrix = new Matrix();
matrix.postRotate(degree);
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
}
/**
* 图片缩放
*
* @param bm
* @param scale
* 值小于则为缩小,否则为放大
* @return
*/
public static Bitmap resizeBitmap(Bitmap bm, float scale) {
Matrix matrix = new Matrix();
matrix.postScale(scale, scale);
return Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
}
/**
* 图片缩放
*
* @param bm
* @param w
* 缩小或放大成的宽
* @param h
* 缩小或放大成的高
* @return
*/
public static Bitmap resizeBitmap(Bitmap bm, int w, int h) {
Bitmap BitmapOrg = bm;
int width = BitmapOrg.getWidth();
int height = BitmapOrg.getHeight();
float scaleWidth = ((float) w) / width;
float scaleHeight = ((float) h) / height;
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
return Bitmap.createBitmap(BitmapOrg, 0, 0, width, height, matrix, true);
}
/**
* 图片反转
*
* @param bm
* @param flag
* 0为水平反转,1为垂直反转
* @return
*/
public static Bitmap reverseBitmap(Bitmap bmp, int flag) {
float[] floats = null;
switch (flag) {
case 0: // 水平反转
floats = new float[] { -1f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 1f };
break;
case 1: // 垂直反转
floats = new float[] { 1f, 0f, 0f, 0f, -1f, 0f, 0f, 0f, 1f };
break;
}
if (floats != null) {
Matrix matrix = new Matrix();
matrix.setValues(floats);
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
}
return null;
}
}
| [
"425767281@qq.com"
] | 425767281@qq.com |
88eebf809c231d680b96340101851c3dc11636f3 | d4c41e8c5188a10d3b7a02984690948371eaa09a | /src/de/hdm/vocke/myContacts/shared/bo/BusinessObject.java | 70c8b0b03084fd5577910f3695716e7e1ad7f03a | [] | no_license | theresa-vocke/myContacts | 444e9e5770fb130f9b70483956c85370d3a67511 | c586a842eb8617644727a6300ef533fcf70b7c33 | refs/heads/master | 2020-03-17T11:23:30.612909 | 2018-06-26T12:55:29 | 2018-06-26T12:55:29 | 133,549,774 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,508 | java | package de.hdm.vocke.myContacts.shared.bo;
import java.io.Serializable;
public abstract class BusinessObject implements Serializable {
private static final long serialVersionUID = 1L;
/**
* eindeutige Identifikationsnummer einer Instanz dieser Klasse
*/
private int id = 0;
/**
* auslesen der id
*/
public int getId() {
return id;
}
/**
* setzen der id
*/
public void setId(int id) {
this.id = id;
}
/**
* erzeugen einer einfachen textuellen Darstellung der jeweiligen Instanz
* Dies kann in den Subklassen überschrieben werden
*/
public String toString(){
/**
* zurückgegeben wird der Klassenname gefolgt von der ID
*/
return this.getClass().getName() + " #" + this.id;
}
/**
* <p>
* Feststellen der <em>inhaltlichen</em> Gleichheit zweier
* <code>BusinessObject</code>-Objekte. Die Gleichheit wird in diesem Beispiel auf eine
* identische ID beschränkt.
* </p>
* <p>
*
* Die Methode <code>equals(...)</code> ist für jeden Referenzdatentyp
* definiert, da sie bereits in der Klasse <code>Object</code> in einfachster
* Form realisiert ist. Dort ist sie allerdings auf die simple Bestimmung der
* Gleicheit der Java-internen Objekt-ID der verglichenen Objekte beschränkt.
* In unseren eigenen Klassen können wir diese Methode überschreiben und ihr
* mehr Intelligenz verleihen.
* </p>
*/
public boolean equals(Object o){
/**
* Abfragen, ob ein Objekt ungleich NULL ist und gecastet werden kann
*/
if (o != null && o instanceof BusinessObject){
BusinessObject bo = (BusinessObject) o;
try {
if (bo.getId() == this.id)
return true;
}
catch (IllegalArgumentException e){
// wenn was schief geht wird zur Sicherheit false zurückgegeben
return false;
}
}
// wenn bislang keine Gleichheit festgestellt wurde wird false zurückgegeben
return false;
}
/**
* erzeugen einer ganzen Zahl, die für das BusinessObjekt charakteristisch ist
* Zusammen mit <code>equals</code> sollte diese Methode immer definiert werden.
* Manche Java-Klassen
* verwendenden <code>hashCode</code>, um initial ein Objekt (z.B. in einer Hashtable)
* zu identifizieren. Erst danach
* würde mit <code>equals</code> festgestellt, ob es sich tatsächlich um das
* gesuchte Objekt handelt.
*/
public int hashCode (){
return this.id;
}
}
| [
"theresa.vocke@outlook.de"
] | theresa.vocke@outlook.de |
3ae2a3a1384b2a87be658052f779bc2b4f47ae92 | 512581608ea438ecd79f06708bf35fc4fe10a481 | /src/main/java/com/example/delivery_fit/Dashboard/track/TrackViewModel.java | 5a9fad9c99c24cc12c79a9d7ed83e04045c6b664 | [] | no_license | harshalshingne/Delivery_Fit | f887d5041bbd407164239bc05d839596b56a7b60 | 2531f197714455e929f1ea5e1e7a93754977baff | refs/heads/master | 2022-12-18T02:51:09.514374 | 2020-09-10T09:00:21 | 2020-09-10T09:00:21 | 294,356,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 804 | java | package com.example.delivery_fit.Dashboard.track;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class TrackViewModel extends ViewModel {
private MutableLiveData<String> mText;
public MutableLiveData<String> resultImageUrl = new MutableLiveData<>();
public TrackViewModel() {
resultImageUrl = new MutableLiveData<>();
resultImageUrl.setValue("https://picsum.photos/seed/picsum/200/300");
}
public MutableLiveData<String> getResultImageUrl() {
return resultImageUrl;
}
public void setResultImageUrl(MutableLiveData<String> resultImageUrl) {
this.resultImageUrl = resultImageUrl;
}
public LiveData<String> getText() {
return resultImageUrl;
}
}
| [
"harshalshingne@gmail.com"
] | harshalshingne@gmail.com |
f2e17ce0feb35e8344ec9006cf36beb4b8416485 | 0bd022e87ce618c41370f951fcfc2c68c714c3b5 | /app/src/main/java/com/example/tecinfo/calculator/Activityd.java | 0db57e65d8eb1c39e154fdf02236a9f3e748993c | [] | no_license | tavaresrafaela/calculator | 913b15f30d38aef3f4a58b85c22c3d8b086711a6 | 80bed33e85f76ea193d7873c3462ca46bfe2cf12 | refs/heads/master | 2020-04-05T10:03:56.957620 | 2018-11-09T00:19:07 | 2018-11-09T00:19:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,286 | java | package com.example.tecinfo.calculator;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Display;
import android.view.View;
import android.widget.EditText;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class Activityd extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_d);
Button bt_inicio = (Button) findViewById(R.id.bt_inicio);
Button bt_calcular = (Button) findViewById(R.id.bt_calcular);
TextView tx_nome = findViewById(R.id.nome);
TextView tx_sobrenome = findViewById(R.id.sobrenome);
TextView tx_formacao = findViewById(R.id.formacao);
TextView tx_idade = findViewById(R.id.idade);
TextView tx_telefone = findViewById(R.id.telefone);
TextView tx_data = findViewById(R.id.data);
Intent intentRecebido = getIntent();
String nome = intentRecebido.getStringExtra("nome");
String sobrenome = intentRecebido.getStringExtra("sobrenome");
String formacao = intentRecebido.getStringExtra("formacao");
String idade = intentRecebido.getStringExtra("idade");
String telefone = intentRecebido.getStringExtra("telefone");
String data = intentRecebido.getStringExtra("data");
tx_nome.setText(nome);
tx_sobrenome.setText(sobrenome);
tx_formacao.setText(formacao);
tx_idade.setText(idade);
tx_telefone.setText(telefone);
tx_data.setText(data);
bt_inicio.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent( Activityd.this, ActivityB.class);
startActivity(intent);
finish();
}
});
bt_calcular.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent( Activityd.this, MainActivity.class);
startActivity(intent);
finish();
}
});
}
}
| [
"tavares.rafaela2013@gmail.com"
] | tavares.rafaela2013@gmail.com |
08bddf8f939dc379bac033874c8c19b499dc8732 | 1252480eee5818dc2e8662591a17ab1c4f28f788 | /cmall-service/src/main/java/com/cmall/dubbo/service/TbUserDubboService.java | 067f19e058d440e69f42090deccc73048c4de0b2 | [] | no_license | yixiaofan/CMall-java | a534e9b009cda4757e3e25726a038340783e2395 | 0fee373dc7ffb5214e5d2b98a038370c72aa5e74 | refs/heads/master | 2022-12-25T18:59:06.698998 | 2019-07-24T11:25:05 | 2019-07-24T11:25:05 | 179,604,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.cmall.dubbo.service;
import com.cmall.pojo.TbUser;
public interface TbUserDubboService {
/*
* 根据用户名和密码查询登录
*/
TbUser selByUser(TbUser user);
/*
* 根据用户id修改用户信息
*/
int updUserInfo(TbUser user);
/*
* 注册
*/
int insUserInfo(TbUser user);
}
| [
"1550685613@qq.com"
] | 1550685613@qq.com |
52fb6e7335b2e8e409a11720d450849ed533cf34 | c7a4d834c0fabf1d8bae5c38294c1ecf5aa8b845 | /RetailerAppMedi/app/src/main/java/com/medicento/retailerappmedi/adapter/ItemCartList.java | a890185828271803fbffd64a4b64d4af2f55341e | [] | no_license | Gitesh-Shastri/retailer-app-tester | f2b84c0772d51c2e489d0ae52059ac2a14ed21a4 | fc0a180cb88c9f0c519e1be88dbefe59d220cfcd | refs/heads/master | 2021-07-06T16:06:56.978777 | 2020-08-29T09:18:20 | 2020-08-29T09:18:20 | 162,337,905 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,433 | java | package com.medicento.retailerappmedi.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.medicento.retailerappmedi.R;
import com.medicento.retailerappmedi.data.EssentialList;
import java.util.ArrayList;
public class ItemCartList extends RecyclerView.Adapter<BaseViewHolder> {
private ArrayList<EssentialList> essentialLists;
private Context context;
public ItemCartList(ArrayList<EssentialList> essentialLists, Context context) {
this.essentialLists = essentialLists;
this.context = context;
}
OverallCostChangeListener mOverallCostChangeListener;
public interface OverallCostChangeListener {
void onCostChanged();
}
public void setmOverallCostChangeListener(OverallCostChangeListener mOverallCostChangeListener) {
this.mOverallCostChangeListener = mOverallCostChangeListener;
}
@NonNull
@Override
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
LayoutInflater inflater = LayoutInflater.from(viewGroup.getContext());
View view = inflater.inflate(R.layout.item_cart_list, viewGroup, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull BaseViewHolder baseViewHolder, int i) {
baseViewHolder.onBind(i);
}
public ArrayList<EssentialList> getEssentialLists() {
return essentialLists;
}
@Override
public int getItemCount() {
return essentialLists != null ? essentialLists.size() : 0;
}
public class ViewHolder extends BaseViewHolder {
EditText qty;
TextView cost, name, discount, gst;
ImageView edit, delete, image;
public ViewHolder(View itemView) {
super(itemView);
gst = itemView.findViewById(R.id.gst);
discount = itemView.findViewById(R.id.discount);
edit = itemView.findViewById(R.id.edit);
qty = itemView.findViewById(R.id.qty);
name = itemView.findViewById(R.id.name);
cost = itemView.findViewById(R.id.cost);
delete = itemView.findViewById(R.id.delete);
image = itemView.findViewById(R.id.image);
}
@Override
protected void clear() {
qty.setText("");
cost.setText("");
name.setText("");
discount.setText("");
gst.setText("");
}
@Override
public void onBind(int position) {
super.onBind(position);
EssentialList essentialList = essentialLists.get(position);
qty.setText(essentialList.getQty()+"");
if (essentialList.getMrp() >= essentialList.getCost()) {
discount.setText((int)((1-(essentialLists.get(position).getCost()/essentialLists.get(position).getMrp()))*100)+"% OFF");
} else {
discount.setText("0% OFF");
}
gst.setText(essentialList.getDiscount() + "% GST applicable");
cost.setText("₹ " + (essentialList.getCost()*essentialList.getQty()));
name.setText(essentialList.getName());
Glide.with(context).load(essentialLists.get(position).getImage_url()).into(image);
edit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
qty.requestFocus();
}
});
delete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
essentialLists.remove(getCurrentPosition());
if (mOverallCostChangeListener != null) {
mOverallCostChangeListener.onCostChanged();
}
notifyDataSetChanged();
}
});
qty.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (!qty.getText().toString().trim().equals("0")) {
try {
essentialLists.get(getCurrentPosition()).setQty(Integer.parseInt(qty.getText().toString()));
if (mOverallCostChangeListener != null) {
mOverallCostChangeListener.onCostChanged();
}
notifyItemChanged(getCurrentPosition());
} catch (Exception e) {
e.printStackTrace();
}
}
qty.setSelection(qty.getText().toString().length());
}
});
}
}
}
| [
"giteshshastri100@gmail.com"
] | giteshshastri100@gmail.com |
9771537b4226081c7e589b35f1a0dede132543a8 | 5298b284019f42dca40e6a60ee63b82631179264 | /src/test/java/com/example/demo/RequestmaptestApplicationTests.java | 55b2b5e6a5a381a6e8db2ada5feb61e7dd08afae | [] | no_license | yinyx/requestmaptest | f07f3987767943510bb05147857de7b296d3ec39 | d6e5f1c942a9e363111cc158dcc2a737791f08bd | refs/heads/master | 2022-12-28T06:17:39.133401 | 2020-10-02T07:33:06 | 2020-10-02T07:33:06 | 259,555,866 | 0 | 0 | null | 2020-07-29T11:09:39 | 2020-04-28T06:51:47 | CSS | UTF-8 | Java | false | false | 699 | java | package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
//import com.example.demo.po.*;
@RunWith(SpringRunner.class)
@TestPropertySource("classpath:wisely.properties")
@SpringBootTest
public class RequestmaptestApplicationTests {
@Value("${person.name}")
private String apiKey;
@Test
public void contextLoads() {
System.out.println(apiKey);
}
}
| [
"302699832@qq.com"
] | 302699832@qq.com |
f807a83bf96e98a2be08501b4a81c6733bb9e433 | 300aefc3ada2c9f2c41e8aa01ba31971c87feb5b | /criacionais/factoryMethod/src/com/factory/method/pattern/Button.java | ae823a4e875b9d94b67b7dc61e76758ca46060ef | [] | no_license | rafaelcaetano/mergulheNosPadroesDeProjeto | 886796546991eb350c939d3fb8c40dd114b0c339 | 5b372eab20bac4f4453b2a21d899e22c3d6bd43e | refs/heads/master | 2023-04-08T19:35:35.092723 | 2021-04-19T01:23:26 | 2021-04-19T01:23:26 | 346,550,008 | 0 | 0 | null | 2021-04-19T01:23:26 | 2021-03-11T02:09:05 | Java | UTF-8 | Java | false | false | 104 | java | package com.factory.method.pattern;
public interface Button {
void render();
void onClick();
}
| [
"engcaetano@outlook.com"
] | engcaetano@outlook.com |
fce92b708fac9e1b4ac61418aa770695d5b9cc91 | 62ae2e59b0c4b737af0c425a6b7c60fbfc0f9d3d | /src/LinearRegression.java | d75368980f63a0861ab02f822dedcc92f38d7c64 | [] | no_license | emanlodovice/LinearRegression | edf1b2ef8124fedd0ea8c2d6b7ed87c324c45c30 | 90b5a1bbf4f7fbb20b68719a1b8472310a1f7bfa | refs/heads/master | 2021-05-28T07:00:34.484135 | 2014-10-18T20:30:17 | 2014-10-18T20:30:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,457 | java | public class LinearRegression {
double[][] features;
double[][] test;
double[] output;
double[] theta;
// private double alpha = 0.0000000001;
double alpha = 0.0002;
int max_steps = 10000;
double minDeltaJ = 0.0003;
int number_test_entry = 1500;
public LinearRegression(String input, String separator,String config) throws Exception {
Object[] obs = FileReader.read(config);
// get value of alpha from config
String temp = obs[0].toString();
temp = temp.substring(0, temp.indexOf('#')).trim();
this.alpha = Double.parseDouble(temp);
// get max steps
temp = obs[1].toString();
temp = temp.substring(0, temp.indexOf('#')).trim();
this.max_steps = Integer.parseInt(temp);
// get min delta J from config
temp = obs[2].toString();
temp = temp.substring(0, temp.indexOf('#')).trim();
this.minDeltaJ = Double.parseDouble(temp);
System.out.println(this.alpha);
// check if feature scaling enabled
temp = obs[3].toString();
temp = temp.substring(0, temp.indexOf('#')).trim();
boolean scaling_enabled = temp.contentEquals("1");
// check selected features
temp = obs[4].toString();
temp = temp.substring(0, temp.indexOf('#')).trim();
String[] indeces = temp.split(" ");
int[] feature_index = new int[indeces.length];
double[] powers = new double[indeces.length];
for(int i=0; i < indeces.length; i++) {
String[] parts = indeces[i].split("\\^");
feature_index[i] = Integer.parseInt(parts[0]);
if (parts.length > 1) {
powers[i] = Double.parseDouble(parts[1]);
} else {
powers[i] = 1.0;
}
}
Object[] values = FileReader.read(input);
features = new double[values.length][];
output = new double[values.length];
// initialize feature values
for (int i=0; i < values.length; i++) {
String v = values[i].toString();
String[] vals = v.split(separator);
features[i] = new double[feature_index.length + 1];
features[i][0] = 1.0;
// initialize theta to 0
if (theta == null) {
theta = new double[feature_index.length + 1];
}
// initialize values of features according to the columns specified in the config
for (int j=0; j < feature_index.length; j++) {
features[i][j + 1] = Math.pow(Double.parseDouble(vals[feature_index[j] - 1]), powers[j]);
}
output[i] = Double.parseDouble(vals[vals.length - 1]);
}
if (scaling_enabled) {
this.features = normalizeAndScale(features);
}
}
public void gradientDescend() {
Graph g = new Graph();
g.graph();
int steps = 0;
double prevJ = j(theta, features, output);
g.add(steps, prevJ);
while (steps < max_steps) {
steps++;
double[] hMinusY = new double[features.length];
for (int i=0; i < features.length; i++) {
hMinusY[i] = hOfx(theta, features[i]) - output[i];
}
double[] newTheta = new double[theta.length];
for (int i=0; i < theta.length; i++) {
newTheta[i] = theta[i] - alpha * gradient(hMinusY, features, i);
}
theta = newTheta;
double newJ = j(theta, features, output);
if (Math.abs(prevJ - newJ) < minDeltaJ) {
System.out.println("prev: " + prevJ);
System.out.println("new: " + newJ);
System.out.println("diff: " + (prevJ - newJ));
System.out.println("End gd a j = " + newJ);
return;
}
prevJ = newJ;
g.add(steps, newJ);
}
System.out.println("End after " + steps + " steps");
System.out.println("with " + prevJ + " error");
}
/* This function will compute for the partial derivative of J with respect of
theta[i], which is the gradient. It accepts the h(x) - y for all data entry,
the matrix feature, and the current index of theta we are updating.
*/
public double gradient(double[] hMinusY, double[][] features, int curJ) {
double res = 0;
for (int i=0; i < hMinusY.length; i++) {
res += hMinusY[i] * features[i][curJ];
}
return res / hMinusY.length;
}
/* This function accepts a matrix of features from x[0] to x[n].
Then it returns the normalized and scaled feature matrix.
*/
public static double[][] normalizeAndScale(double[][] features) {
double[][] res = new double[features.length][features[0].length];
// set x[0]s equal to 1
for (int i=0; i < features.length; i++) {
res[i][0] = 1.0;
}
// do normalization and scaling for x[1] to x[n]
for (int x=1; x < features[0].length; x++) {
double total = 0;
double max = features[0][x];
double min = features[0][x];
// computes the total of a feature and gets the max and min values
for (int j=0; j < features.length; j++) {
total += features[j][x];
if (features[j][x] > max) {
max = features[j][x];
}
if (features[j][x] < min) {
min = features[j][x];
}
}
double ave = total / features.length;
// computes the new value of the feature applying mean normalization and scaling
for (int j=0; j < features.length; j++) {
res[j][x] = (features[j][x] - ave) / (max - min);
}
}
return res;
}
/* This function accepts two vectors (thetas and x's). It will return value
value of h(x) = x[0]*theta[0] + x[1]*theta[1] + ... x[n]*theta[n].
*/
public static double hOfx(double[] theta, double[] xs) {
double total = 0;
for (int i=0; i < theta.length; i++) {
total += theta[i] * xs[i];
}
return total;
}
/* This function computes for a J(theta), which is the error. It accepts a
theta vector and feature matrix.
*/
public static double j(double[] theta, double[][] features, double[] output) {
double res = 0;
for (int i=0; i < features.length; i++) {
double hx = hOfx(theta, features[i]);
res += Math.pow(hx - output[i], 2);
}
return res / (2 * features.length);
}
// delete later
public static void print(double[][] features) {
for (int i=0; i < features.length; i++) {
System.out.print("\n[ ");
for (int j=0; j < features[i].length; j++) {
System.out.print(features[i][j] + " ");
}
System.out.print("]");
}
}
public static void print(double[] output) {
System.out.print("\n[ ");
for (int i=0; i < output.length; i++) {
System.out.print(output[i] + " ");
}
System.out.print("]");
}
}
| [
"name3anad@gmail.com"
] | name3anad@gmail.com |
8381e0633a119e3fea83117c109292643fd0eedd | 3eab5c80d43bd8940f28c538b0e8b855a9f2e3f7 | /app/src/main/java/com/example/nam/travel/views/fragment/ProfileFragment.java | ae315ec1fb0f5ea91634743d9105d852854be3a5 | [] | no_license | Nam2402/Travel | e654d398d8b8bc4461d5f8a1138e018fca442d43 | 55a1991228366020d275ba3616c4d480a5880c8a | refs/heads/master | 2020-04-01T13:15:43.563047 | 2018-10-16T07:56:59 | 2018-10-16T07:56:59 | 153,244,488 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.example.nam.travel.views.fragment;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.nam.travel.R;
public class ProfileFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_profile, container, false);
return view;
}
}
| [
"nguyenngocnam242@gmail.com"
] | nguyenngocnam242@gmail.com |
e82844f64347d1bc42424babb8c1d348badf144c | ca64688c624c624e5c7c2b66c638c929144cf11e | /javabasic/src/chapter08_2/Car2.java | 799435ff1b3677ed6baa88e22208cc29691bebea | [] | no_license | bbbb-6666/java_old | eed83c784437e169a5c1aba88557fca96b1a0f5d | 2be89c42be9bf2984b3bce3741f95c021d26b222 | refs/heads/master | 2020-06-18T15:53:28.600875 | 2019-09-17T07:49:29 | 2019-09-17T07:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package chapter08_2;
public class Car2 {
String color;
int speed;
public void upSpeed (int speed) {
this.speed += speed;
}
public void showInfo() {
System.out.println(this.color+", "+this.speed);
}
}
| [
""
] | |
e7830d9bd40034b65be81baebc60cddc005f6434 | e046a87ae31c5006c37e0010ee5b4c5cbfca28b1 | /springboot-mybatis-common/src/test/java/MybatisApplicationTest.java | 1947e6905c2b2e8fa2b7f3d6ad97feb7906b536e | [] | no_license | Kiritor/Spring-Boot-Study | 46f84324e8b67d5e114b9a5b15db34bd0622a44d | 2a5fef61db0d73742c6df3ec9ad562f09f6abb97 | refs/heads/master | 2021-01-20T12:49:43.166639 | 2019-06-13T08:16:34 | 2019-06-13T08:16:34 | 101,716,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 657 | java | import com.kiritor.mapper.UserMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
public class MybatisApplicationTest {
@SuppressWarnings("all")
@Autowired
UserMapper userMapper;
@Test
public void test_db() {
//开始进行测试
assertThat(userMapper.getUserListByKey("L.Tao").size()).isGreaterThan(1);
}
}
| [
"1406754158@qq.com"
] | 1406754158@qq.com |
cc027899cff3d86fb0ee96fcf54f3591f3ad9654 | fd95009dd904dfdb91fec14bab6c886a1504cda4 | /dosen.java | 3eb3c7b0a3bfa4d668acbc638eba13fcacdf9ad9 | [] | no_license | Dimpecks/Tutorial01 | 3fbb846a915b71981303ecf535950509952cfcd1 | 650cf9a1dd4285f7c9f96e0f65576ff744fd71ed | refs/heads/master | 2020-03-28T05:48:21.052530 | 2018-09-07T08:46:26 | 2018-09-07T08:46:26 | 147,797,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | class dosen{
// Your program begins with a call to main().
// Prints "Hello, World" to the terminal window.
public static void main(String args[])
{
System.out.println("Hello, World");
}
} | [
"cervmkiii@gmail.com"
] | cervmkiii@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.