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
a8460ca447500616af1da844ada3021cb2e0b5bc
9b1d15ddf1fe42ac866c9e5a63b76f6df55bb2be
/09_EL_JSTL/src/cn/bjtu/servlet/Download.java
c157182fc89c947134fbf65618e68d6dcef78886
[]
no_license
ZhaoChancey/JavaWebDemo
a233854968717b4625c6c716a2cbd3cf530575cf
8614e625d38f2d99c36a94eb63f27dc83a6f4dbb
refs/heads/master
2021-05-25T16:54:20.858572
2020-04-07T14:59:13
2020-04-07T14:59:13
253,829,168
0
0
null
null
null
null
UTF-8
Java
false
false
2,776
java
package cn.bjtu.servlet; import org.apache.commons.io.IOUtils; import sun.misc.BASE64Encoder; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URLEncoder; /** * @author shkstart * @create 2020-03-15 22:14 */ public class Download extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // 1、获取要下载的文件名 String downloadFileName = "11.jpg"; // 2、读取要下载的文件内容 (通过ServletContext对象可以读取) ServletContext servletContext = getServletContext(); // 获取要下载的文件类型 String mimeType = servletContext.getMimeType("/file/" + downloadFileName); System.out.println("下载的文件类型:" + mimeType); // 4、在回传前,通过响应头告诉客户端返回的数据类型 resp.setContentType(mimeType); // 5、还要告诉客户端收到的数据是用于下载使用而不是直接显示在页面(还是使用响应头) // Content-Disposition响应头,表示收到的数据怎么处理 // attachment表示附件,表示下载使用 // filename= 表示指定下载的文件名 // 下载下来的文件名由响应头决定 // url编码是把汉字转换成为%xx%xx的格式:谷歌和IE,Base64编码支持火狐 if (req.getHeader("User-Agent").contains("Firefox")){ // 如果是火狐浏览器使用Base64编码 resp.setHeader("Content-Disposition","attachment;filename==?UTF-8?B?" + new BASE64Encoder().encode("中国.jpg".getBytes("UTF-8")) + "?="); } else { // 如果不是火狐,是IE或谷歌,使用URL编码操作 resp.setHeader("Content-Disposition","attachment;filename=" + URLEncoder.encode("中国.jpg","UTF-8")); } /* getResourceAsStream把获取的资源转换成流返回 */ /** * /斜杠被服务器解析表示地址为http://ip:prot/工程名/ 映射 到代码的Web目录 */ InputStream resourceAsStream = servletContext.getResourceAsStream("/file/" + downloadFileName); //获取响应的输出流 OutputStream outputStream = resp.getOutputStream(); // 3、把下载的文件内容回传给客户端 // 读取输入流中全部的数据,复制给输出流,输出给客户端 IOUtils.copy(resourceAsStream,outputStream); } }
[ "756359715@qq.com" ]
756359715@qq.com
ba1c4c16ec1814055f40af044966486411366a46
dd0e7f769b273cc96c2da337a71bd8e0c77b28a3
/src/main/java/com/jakes/movies/repository/MovieRepository.java
3df117b02e1a0b1ca46ea6d18a186f3de309d91a
[]
no_license
JakeDasheck/Spring-movies
ba2feed506ad8c419adb0011b5a6bfa0914da94f
6e427b0dad99ec50aed06d7f3ebbfac4a51cc78f
refs/heads/master
2023-03-24T11:33:04.895042
2021-03-19T11:03:11
2021-03-19T11:03:11
287,374,616
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.jakes.movies.repository; import com.jakes.movies.model.Movie; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface MovieRepository extends JpaRepository<Movie, Integer> { List<Movie> findMoviesByName(String name); }
[ "daszek07@gmail.com" ]
daszek07@gmail.com
0dc3c00945efcc0d096dfe4ae577910109fc465b
7f6667ee00a1e757ccf1a12c0618a82f1e39179f
/src/model/Ticket.java
12bbc662a7583db9e31e4ebe84b694cb35aa48b4
[]
no_license
cjwen15/TicketSelling
6d7c016a4fde67114e29f6c83b2b1fa28c8bbc23
8cfd4d68760e8ef6a560a072cfd6c37d4a134427
refs/heads/master
2021-11-22T00:42:09.896694
2018-09-17T03:15:50
2018-09-17T03:15:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,362
java
package model; import java.util.ArrayList; import javax.swing.JComboBox; import javax.swing.JTextArea; import javax.swing.JTextField; public class Ticket extends Thread { //获得控件 JComboBox pathCom, com1, com2; JTextField jtf1, jtf2; JTextArea showMessage; ArrayList<Path> list = null; public JComboBox getPathCom() { return pathCom; } public void setPathCom(JComboBox pathCom) { this.pathCom = pathCom; } public JComboBox getCom1() { return com1; } public void setCom1(JComboBox com1) { this.com1 = com1; } public JComboBox getCom2() { return com2; } public void setCom2(JComboBox com2) { this.com2 = com2; } public JTextField getJtf1() { return jtf1; } public void setJtf1(JTextField jtf1) { this.jtf1 = jtf1; } public JTextField getJtf2() { return jtf2; } public void setJtf2(JTextField jtf2) { this.jtf2 = jtf2; } public JTextArea getShowMessage() { return showMessage; } public void setShowMessage(JTextArea showMessage) { this.showMessage = showMessage; } public ArrayList<Path> getList() { return list; } public void setList(ArrayList<Path> list) { this.list = list; } public void run() { synchronized (this) { if (Thread.currentThread().getName().equals("1号窗")) { int ticketCount = Integer.parseInt(jtf1.getText()); for (int i = 0; i < 4; i++) { Path pathTemp = list.get(i); if (com1.getSelectedItem().toString() == "2001" && pathTemp.getPathId() == "2001") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2001号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com1.getSelectedItem().toString() == "2002" && pathTemp.getPathId() == "2002") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2002号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com1.getSelectedItem().toString() == "2003" && pathTemp.getPathId() == "2003") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2003号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com1.getSelectedItem().toString() == "2004" && pathTemp.getPathId() == "2004") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2004号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } } } else if (Thread.currentThread().getName().equals("2号窗")) { int ticketCount = Integer.parseInt(jtf2.getText()); for (int i = 0; i < 4; i++) { Path pathTemp = list.get(i); if (com2.getSelectedItem().toString() == "2001" && pathTemp.getPathId() == "2001") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2001号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com2.getSelectedItem().toString() == "2002" && pathTemp.getPathId() == "2002") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2002号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com2.getSelectedItem().toString() == "2003" && pathTemp.getPathId() == "2003") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2003号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } if (com2.getSelectedItem().toString() == "2004" && pathTemp.getPathId() == "2004") { int ticket = pathTemp.getPathTicket(); if (ticket - ticketCount >= 0) { ticket = ticket - ticketCount; pathTemp.setPathTicket(ticket); showMessage.append(Thread.currentThread().getName() + "售票,2004号列车,车票剩余:" + ticket); showMessage.append("\n"); } else { showMessage.append("车票剩余不足,请查询具体班次列车剩余车票"); showMessage.append("\n"); } } } } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "735506355@qq.com" ]
735506355@qq.com
c29c5e7d30f7464db43054d25aacb7349473e629
297b2b4dad220397902bea562655921d2695924a
/src/test/java/WarmUpTask/forMySelfPractice/P4VerifyOrder.java
05880c4aaed53b405293b668f41391099eeb66fb
[]
no_license
RajmiNakarmi/seleniumProjectB20
033d379023b85aeb75f6160a7cea48b13ee86d91
48231532fe9b5f6aa205d8ba90292d10f5fd0565
refs/heads/master
2023-01-11T09:49:50.588040
2020-11-15T15:47:00
2020-11-15T15:47:00
313,065,094
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package WarmUpTask.forMySelfPractice; import com.cybertek.utilities.SmartBearUtilities; import com.cybertek.utilities.WebDriverFactory; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class P4VerifyOrder { WebDriver driver; @BeforeMethod public void setupMethod() { driver = WebDriverFactory.getDriver("Chrome"); driver.get("http://secure.smartbearsoftware.com/samples/testcomplete12/WebOrders/login.aspx"); SmartBearUtilities.loginToSmartBear(driver); } @Test public void verification_Order() { WebElement name = driver.findElement(By.xpath("//td[.='Paul Brown']")); String actualName = name.getText(); String expectedName = "Paul Brown"; Assert.assertEquals(actualName, expectedName, "Result does not match"); } }
[ "68827515+RajmiNakarmi@users.noreply.github.com" ]
68827515+RajmiNakarmi@users.noreply.github.com
66d9e5f3bbbd8cb360a420bb8cf15b927dce05ec
5b7b57c14b91d3d578855abebae59549048b1fd9
/AppCommon/src/main/java/com/trade/eight/moudle/auth/AuthUploadIdCardAct.java
637aecc56305c788aefa7eac75106c09a5fe6607
[]
no_license
xanhf/8yuan
8c4f50fa7c95ae5f0dfb282f67a7b1c39b0b4711
a8b7f351066f479b3bc8a6037036458008e1624c
refs/heads/master
2021-05-14T19:58:44.462393
2017-11-16T10:31:29
2017-11-16T10:31:55
114,601,135
0
0
null
null
null
null
UTF-8
Java
false
false
29,493
java
package com.trade.eight.moudle.auth; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.Html; import android.text.TextUtils; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.easylife.ten.lib.R; import com.netease.nim.uikit.common.media.picker.PickImageHelper; import com.netease.nim.uikit.common.media.picker.model.PhotoInfo; import com.netease.nim.uikit.common.util.storage.StorageType; import com.netease.nim.uikit.common.util.storage.StorageUtil; import com.netease.nim.uikit.common.util.string.StringUtil; import com.netease.nim.uikit.session.constant.Extras; import com.trade.eight.base.BaseActivity; import com.trade.eight.config.AndroidAPIConfig; import com.trade.eight.config.AppSetting; import com.trade.eight.dao.UserInfoDao; import com.trade.eight.entity.TempObject; import com.trade.eight.entity.response.CommonResponse; import com.trade.eight.moudle.auth.data.AuthDataHelp; import com.trade.eight.moudle.auth.entity.CardAuthObj; import com.trade.eight.moudle.auth.entity.IdCardObj; import com.trade.eight.moudle.home.activity.MainActivity; import com.trade.eight.moudle.me.activity.LoginActivity; import com.trade.eight.moudle.outterapp.WebActivity; import com.trade.eight.moudle.trade.activity.FXBTGCashInH5Act; import com.trade.eight.net.okhttp.NetCallback; import com.trade.eight.tools.ConvertUtil; import com.trade.eight.tools.DateUtil; import com.trade.eight.tools.DialogUtil; import com.trade.eight.tools.Log; import com.trade.eight.tools.UploadFileUtil; import com.trade.eight.tools.refresh.RefreshUtil; import com.trade.eight.view.picker.wheelPicker.picker.DatePicker; import java.io.File; import java.io.FileInputStream; import java.util.Calendar; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Created by dufangzhu on 2017/5/19. * 上传身份证 */ public class AuthUploadIdCardAct extends BaseActivity implements View.OnClickListener { public static final String TAG = "AuthUploadIdCardAct"; public AuthUploadIdCardAct context = this; /*时间选择器开始年月日*/ public static final int DATE_START_YEAR = 1900; public static final int DATE_START_MONTH = 1; public static final int DATE_START_DAY = 1; /*时间选择器结束年月日*/ public static final int DATE_END_YEAR = 2047; public static final int DATE_END_MONTH = 1; public static final int DATE_END_DAY = 1; View statusView, contentView; View idCardView01, idCardView02, cardinfo01, cardinfo02, idcard01OK, idcard02OK, idcard_01bg, idcard_02bg, tv_idcard01, tv_idcard02, reload01, reload02, tv_rule; ImageView img_card01, img_card02, img_status; EditText ed_idno, ed_name; TextView tv_sex, tv_status01, tv_status02, tv_reload01, tv_reload02, tv_startdate, tv_enddate; Button btn_status_commit, btn_commit; RefreshUtil refreshUtil; TextView text_card_input_tips_1; TextView text_card_input_tips_2; public static void start(Context context) { context.startActivity(new Intent(context, AuthUploadIdCardAct.class)); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.upload_idcard); setAppCommonTitle(getResources().getString(R.string.me_account_auth)); if (!new UserInfoDao(context).isLogin()) { LoginActivity.start(context); finish(); return; } initViews(); checkStatus(); initRefresh(); } void initRefresh() { refreshUtil = new RefreshUtil(this); refreshUtil.setRefreshTime(AppSetting.getInstance(this).getRefreshTimeWPList()); refreshUtil.setOnRefreshListener(new RefreshUtil.OnRefreshListener() { @Override public Object doInBackground() { return AuthDataHelp.getCheckStatus(AuthUploadIdCardAct.this); } @Override public void onUpdate(Object result) { if (result != null) { cardAuthObj = (CardAuthObj) result; initStatus(cardAuthObj.getStatus()); } } }); } @Override protected void appCommonGoBack() { if (exitRegConfig()) { return; } else { doMyfinish(); } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (exitRegConfig()) { return true; } else { doMyfinish(); } return true; } return super.onKeyDown(keyCode, event); } boolean exitRegConfig() { if (cardAuthObj != null && cardAuthObj.getStatus() == CardAuthObj.STATUS_NOT_SUBMMIT) { String msg = context.getResources().getString(R.string.auth_exit_msg); String negStr = context.getResources().getString(R.string.auth_reg_neg); String postStr = context.getResources().getString(R.string.auth_reg_post); DialogUtil.showConfirmDlg(context, msg, negStr, postStr, true, new Handler.Callback() { @Override public boolean handleMessage(Message message) { doMyfinish(); return false; } }, new Handler.Callback() { @Override public boolean handleMessage(Message message) { return false; } }); return true; } return false; } public void initViews() { statusView = findViewById(R.id.statusView); contentView = findViewById(R.id.contentView); idCardView01 = findViewById(R.id.idCardView01); idCardView02 = findViewById(R.id.idCardView02); img_card01 = (ImageView) findViewById(R.id.img_card01); img_card02 = (ImageView) findViewById(R.id.img_card02); tv_idcard01 = findViewById(R.id.tv_idcard01); tv_idcard02 = findViewById(R.id.tv_idcard02); reload01 = findViewById(R.id.reload01); reload02 = findViewById(R.id.reload02); idcard01OK = findViewById(R.id.idcard01OK); idcard02OK = findViewById(R.id.idcard02OK); idcard_01bg = findViewById(R.id.idcard_01bg); idcard_02bg = findViewById(R.id.idcard_02bg); img_status = (ImageView) findViewById(R.id.img_status); cardinfo01 = findViewById(R.id.cardinfo01); cardinfo02 = findViewById(R.id.cardinfo02); ed_idno = (EditText) findViewById(R.id.ed_idno); ed_name = (EditText) findViewById(R.id.ed_name); tv_sex = (TextView) findViewById(R.id.tv_sex); tv_reload01 = (TextView) findViewById(R.id.tv_reload01); tv_reload02 = (TextView) findViewById(R.id.tv_reload02); tv_reload01.setText(Html.fromHtml(getString(R.string.auth_upload_failed))); tv_reload02.setText(Html.fromHtml(getString(R.string.auth_upload_failed))); tv_startdate = (TextView) findViewById(R.id.tv_startdate); tv_enddate = (TextView) findViewById(R.id.tv_enddate); tv_startdate.setOnClickListener(this); tv_enddate.setOnClickListener(this); tv_status01 = (TextView) findViewById(R.id.tv_status01); tv_status02 = (TextView) findViewById(R.id.tv_status02); text_card_input_tips_1 = (TextView) findViewById(R.id.text_card_input_tips_1); text_card_input_tips_2 = (TextView) findViewById(R.id.text_card_input_tips_2); btn_status_commit = (Button) findViewById(R.id.btn_status_commit); idCardView01.setOnClickListener(this); idCardView02.setOnClickListener(this); btn_commit = (Button) findViewById(R.id.btn_commit); btn_commit.setOnClickListener(this); btn_commit.setEnabled(false); // tv_sex.setOnClickListener(this); tv_rule = findViewById(R.id.tv_rule); tv_rule.setOnClickListener(this); } CardAuthObj cardAuthObj; public void checkStatus() { showNetLoadingProgressDialog(null); AuthDataHelp.checkStatus(context, new NetCallback(context) { @Override public void onFailure(String resultCode, String resultMsg) { showCusToast(ConvertUtil.NVL(resultMsg, context.getResources().getString(R.string.network_problem))); } @Override public void onResponse(String response) { CommonResponse<CardAuthObj> commonResponse = CommonResponse.fromJson(response, CardAuthObj.class); if (commonResponse == null) { showCusToast(context.getResources().getString(R.string.network_problem)); return; } cardAuthObj = commonResponse.getData(); if (!commonResponse.isSuccess() || cardAuthObj == null) { showCusToast(ConvertUtil.NVL(commonResponse.getErrorInfo(), context.getResources().getString(R.string.network_problem))); return; } if (commonResponse != null && commonResponse.isSuccess() && cardAuthObj != null) { initStatus(cardAuthObj.getStatus()); } } }); } private static final int PICK_AVATAR_REQUEST = 0x0E; boolean isFront = true; //正面上传成功 boolean isCard01OK = false; boolean isCard02OK = false; protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK && requestCode == PICK_AVATAR_REQUEST) { String url = data.getStringExtra(com.netease.nim.uikit.session.constant.Extras.EXTRA_FILE_PATH); if (com.trade.eight.tools.StringUtil.isEmpty(url)) { List<PhotoInfo> list = (List<PhotoInfo>) data.getSerializableExtra(Extras.EXTRA_PHOTO_LISTS); if (list != null && list.size() > 0) url = list.get(0).getAbsolutePath(); } //updateAvatar if (url != null) { final String path = url; Log.v(TAG, "path=" + path); String api = AndroidAPIConfig.URL_AUTH_FRONT_CARD; if (!isFront) { api = AndroidAPIConfig.URL_AUTH_BACK_CARD; } showNetLoadingProgressDialog(null); final String reqUrl = api; /* * 注意这在upload里面进行了图片压缩 * */ AuthDataHelp.upload(context, new File(path), reqUrl, new UploadFileUtil.LoadCallBack() { @Override public void hand(CommonResponse<IdCardObj> res, String localPath) { hideNetLoadingProgressDialog(); if (res == null) { showCusToast(getString(R.string.network_problem)); return; } if (res.isSuccess() && res.getData() != null) { //设置信息 Log.v(TAG, "isFront=" + isFront); IdCardObj idCardObj = res.getData(); if (isFront) { //正面信息成功 // PickerlImageLoadTool.disPlay("file://" + path, new RotateImageViewAware(img_card01, path), // com.netease.nim.uikit.R.drawable.nim_image_default); // ImageLoader.getInstance().displayImage("file://" + path, img_card01); setImg(img_card01, localPath); text_card_input_tips_1.setVisibility(View.GONE); btn_commit.setEnabled(false); isCard01OK = true; String idNo = ConvertUtil.NVL(idCardObj.getIdNo(), ""); String name = ConvertUtil.NVL(idCardObj.getName(), ""); String sex = ConvertUtil.NVL(idCardObj.getSex(), ""); //显示证件正面信息 if (idCardObj != null) { ed_idno.setText(idNo); ed_idno.setSelection(ed_idno.getText().length()); ed_name.setText(name); tv_sex.setText(sex); } cardinfo01.setVisibility(View.VISIBLE); idcard01OK.setVisibility(View.VISIBLE); idcard_01bg.setVisibility(View.INVISIBLE); if (TextUtils.isEmpty(idNo) || TextUtils.isEmpty(name) || TextUtils.isEmpty(sex)) { text_card_input_tips_1.setVisibility(View.VISIBLE); text_card_input_tips_1.setText(getResources().getString(R.string.card_input_tips_3)); return; } if ((idNo.length() != 15 && idNo.length() != 18)) { text_card_input_tips_1.setVisibility(View.VISIBLE); text_card_input_tips_1.setText(getResources().getString(R.string.card_input_tips_1)); } } else { text_card_input_tips_2.setVisibility(View.GONE); btn_commit.setEnabled(false); //反面信息成功 isCard02OK = true; // ImageLoader.getInstance().displayImage("file://" + path, img_card02); setImg(img_card02, localPath); String startdate = ConvertUtil.NVL(idCardObj.getExpirationStart(), ""); String enddate = ConvertUtil.NVL(idCardObj.getExpirationEnd(), ""); //显示信息成功 if (idCardObj != null) { tv_startdate.setText(startdate); tv_enddate.setText(enddate); } cardinfo02.setVisibility(View.VISIBLE); idcard02OK.setVisibility(View.VISIBLE); idcard_02bg.setVisibility(View.INVISIBLE); if (TextUtils.isEmpty(startdate) || TextUtils.isEmpty(enddate)) { text_card_input_tips_2.setVisibility(View.VISIBLE); text_card_input_tips_2.setText(getResources().getString(R.string.card_input_tips_3)); return; } if (!TextUtils.isEmpty(enddate) && DateUtil.compareDateWithNow(enddate)) { text_card_input_tips_2.setVisibility(View.VISIBLE); text_card_input_tips_2.setText(getResources().getString(R.string.card_input_tips_2)); } } } else { String msgStr = ConvertUtil.NVL(res.getErrorInfo(), context.getResources().getString(R.string.network_problem)); DialogUtil.showMsgDialog(context, msgStr, null); if (isFront) { tv_idcard01.setVisibility(View.GONE); reload01.setVisibility(View.VISIBLE); } else { tv_idcard02.setVisibility(View.GONE); reload02.setVisibility(View.VISIBLE); } } //都成功了就可以点击 if (isCard01OK && isCard02OK) { // int idNolength = ed_idno.getText().toString().length(); // if ((idNolength == 15 || idNolength == 18)) { // String enDate = tv_enddate.getText().toString(); // if (!TextUtils.isEmpty(enDate) && !DateUtil.compareDateWithNow(enDate)) { // btn_commit.setEnabled(true); // } // } if (text_card_input_tips_1.getVisibility() == View.GONE && text_card_input_tips_2.getVisibility() == View.GONE) { btn_commit.setEnabled(true); } } return; } }); } } } @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.idCardView01 || id == R.id.idCardView02) { // if (!NetworkUtil.checkNetwork(context)) { // showCusToast(getString(R.string.network_problem)); // return; // } if (id == R.id.idCardView01) { isFront = true; //图片的显示方向问题 // /storage/emulated/0/DCIM/Camera/IMG_20170522_184829.jpg // String path = "/storage/emulated/0/DCIM/Camera/IMG_20170522_184829.jpg"; // ImageLoader.getInstance().displayImage("file://" + path, img_card01); // return; } else { isFront = false; } PickImageHelper.PickImageOption option = new PickImageHelper.PickImageOption(); option.titleResId = R.string.app_name; option.crop = false; option.multiSelect = false; //这里cropOutputImageWidth;当设置了crop=false之后就没用到了 option.cropOutputImageWidth = 720; option.cropOutputImageHeight = 720; option.isUseDiyCamera = true; if (isFront) { option.diyCameraTips = getResources().getString(R.string.card_takephoto_tips_1); } else { option.diyCameraTips = getResources().getString(R.string.card_takephoto_tips_2); } option.outputPath = tempFile(); PickImageHelper.pickImage(context, PICK_AVATAR_REQUEST, option); } else if (id == R.id.btn_commit) { DialogUtil.showConfirmDlg(context, context.getResources().getString(R.string.auth_confirm), context.getResources().getString(R.string.auth_confirm_cancle), context.getResources().getString(R.string.auth_confirm_submit), true, null, new Handler.Callback() { @Override public boolean handleMessage(Message message) { submit(); return false; } }); } else if (id == R.id.tv_sex) { final String[] sexChoose = {"男", "女"}; int sel = 0; if (tv_sex.getText().toString().contains("女")) { sel = 1; } AlertDialog.Builder builder = new AlertDialog.Builder(context); if (android.os.Build.VERSION.SDK_INT >= 11) { builder = new AlertDialog.Builder(context, R.style.dialog_holo); } builder.setSingleChoiceItems(sexChoose, sel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); tv_sex.setText(sexChoose[which]); } }).create().show(); } else if (id == R.id.tv_rule) { WebActivity.start(context, getString(R.string.auth_rule_title), AndroidAPIConfig.URL_AGRE_OPEN_ACCOUNT); } else if (id == R.id.tv_enddate) { // showDatePicker(tv_enddate); } else if (id == R.id.tv_startdate) { // showDatePicker(tv_startdate); } } /** * 时间选择器 * * @param tv */ private void showDatePicker(final TextView tv) { DatePicker picker = new DatePicker(this, DatePicker.YEAR_MONTH_DAY); picker.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL); picker.setRangeStart(DATE_START_YEAR, DATE_START_MONTH, DATE_START_DAY); picker.setRangeEnd(DATE_END_YEAR, DATE_END_MONTH, DATE_END_DAY); picker.setSelectedItem(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH) + 1, Calendar.getInstance().get(Calendar.DAY_OF_MONTH)); picker.setOnDatePickListener(new DatePicker.OnYearMonthDayPickListener() { @Override public void onDatePicked(String year, String month, String day) { if (year != null && month != null && day != null) { tv.setText(year + "-" + month + "-" + day); } } }); picker.show(); } void submit() { String idno = ed_idno.getText().toString(); String name = ed_name.getText().toString(); String sex = tv_sex.getText().toString(); String expiresStart = tv_startdate.getText().toString(); String expiresEnd = tv_enddate.getText().toString(); if (StringUtil.isEmpty(idno)) { showCusToast(getString(R.string.card_input_idno)); return; } if (StringUtil.isEmpty(name)) { showCusToast(getString(R.string.card_input_name)); return; } if (StringUtil.isEmpty(sex)) { showCusToast(getString(R.string.card_input_sex)); return; } if (StringUtil.isEmpty(expiresStart)) { showCusToast(getString(R.string.card_input_startdate)); return; } if (StringUtil.isEmpty(expiresEnd)) { showCusToast(getString(R.string.card_input_enddate)); return; } //提交 Map<String, String> map = new LinkedHashMap<>(); map.put("name", name); map.put("idNo", idno); map.put("sex", sex); map.put("expiresStart", expiresStart); map.put("expiresEnd", expiresEnd); AuthDataHelp.submit(context, map, new NetCallback(context) { @Override public void onFailure(String resultCode, String resultMsg) { showCusToast(ConvertUtil.NVL(resultMsg, context.getResources().getString(R.string.network_problem))); } @Override public void onResponse(String response) { CommonResponse<TempObject> commonResponse = CommonResponse.fromJson(response, TempObject.class); if (commonResponse == null) { showCusToast(context.getResources().getString(R.string.network_problem)); return; } if (!commonResponse.isSuccess()) { showCusToast(ConvertUtil.NVL(commonResponse.getErrorInfo(), context.getResources().getString(R.string.network_problem))); return; } //成功之后 显示当前状态 initStatus(CardAuthObj.STATUS_CHECKING); } }); } public static final String JPG = ".jpg"; private String tempFile() { String filename = StringUtil.get32UUID() + JPG; return StorageUtil.getWritePath(filename, StorageType.TYPE_TEMP); } void initStatus(int status) { //审核通过 if (status == CardAuthObj.STATUS_SUCCESS) { contentView.setVisibility(View.GONE); statusView.setVisibility(View.VISIBLE); img_status.setImageResource(R.drawable.ic_card_status_ok); tv_status01.setText(getString(R.string.card_status_success)); tv_status02.setText(""); initStatusBtn(status); } else if (status == CardAuthObj.STATUS_CHECKING) { contentView.setVisibility(View.GONE); statusView.setVisibility(View.VISIBLE); img_status.setImageResource(R.drawable.ic_card_status_checking); tv_status01.setText(getString(R.string.card_status_checking)); tv_status02.setText(getString(R.string.card_status_checking_hint)); initStatusBtn(status); refreshUtil.start(); } else if (status == CardAuthObj.STATUS_FAILED) { contentView.setVisibility(View.GONE); statusView.setVisibility(View.VISIBLE); img_status.setImageResource(R.drawable.ic_card_status_fail); tv_status01.setText(getString(R.string.card_status_failed)); String msg = getString(R.string.card_status_failed_hint); if (cardAuthObj != null) { msg = ConvertUtil.NVL(cardAuthObj.getReturnMsg(), msg); } tv_status02.setText(msg); initStatusBtn(status); } else { //还没提交过资料 contentView.setVisibility(View.VISIBLE); statusView.setVisibility(View.GONE); } } void initStatusBtn(final int status) { if (status == CardAuthObj.STATUS_SUCCESS) { btn_status_commit.setText(getString(R.string.btn_card_status_success)); } else if (status == CardAuthObj.STATUS_CHECKING) { btn_status_commit.setText(getString(R.string.btn_card_status_checking)); } else if (status == CardAuthObj.STATUS_FAILED) { btn_status_commit.setText(getString(R.string.btn_card_status_failed)); } btn_status_commit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (status == CardAuthObj.STATUS_SUCCESS) { //跳转到入金页面 FXBTGCashInH5Act.startCashin(context); finish(); } else if (status == CardAuthObj.STATUS_CHECKING) { Intent intent = new Intent(context, MainActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); } else if (status == CardAuthObj.STATUS_FAILED) { //重新提交 contentView.setVisibility(View.VISIBLE); statusView.setVisibility(View.GONE); } } }); } void setImg(ImageView imgView, String path) { try { FileInputStream fis = new FileInputStream(path); Bitmap bitmap = BitmapFactory.decodeStream(fis); if (bitmap.getWidth() < bitmap.getHeight()) { Matrix matrix = new Matrix(); matrix.postRotate(-90); bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); } imgView.setImageBitmap(bitmap); } catch (Exception e) { e.printStackTrace(); } catch (OutOfMemoryError e) { e.printStackTrace(); } } @Override public void onDestroy() { super.onDestroy(); if (refreshUtil != null) { refreshUtil.stop(); } } }
[ "enricozhang@126.com" ]
enricozhang@126.com
7265d5a718595a7bc2bd12519952f77f20baa3a4
0396d0e7cf12171e9a6f6972e6cc21732a55aa28
/src/main/java/de/vwgis/kafkatitanixexercise/model/PassengersData.java
820baf9691879d62d25d2adec99a6fea48b8e5d5
[]
no_license
Vilkaz/kafka-titanix-exercise
b4727237fe2baa53924ba1b1cc6ab145ce080ce1
5d468c2e083373d89dc8c742189e38d914b78536
refs/heads/master
2022-11-26T04:20:20.520204
2020-07-31T08:07:25
2020-07-31T08:07:25
278,098,956
0
0
null
null
null
null
UTF-8
Java
false
false
1,146
java
package de.vwgis.kafkatitanixexercise.model; import lombok.Data; import org.springframework.stereotype.Component; /** * A Class for to accumulate Data about all Passengers. * * Kinda like replacement for a DB in this exercise. */ @Data public class PassengersData { private int male; private int female; private int maleSurvivors; private int femaleSurvivors; public void consumePassenger(BasicPassenger passenger) { //here we have a potenial exception if a gender is not classified. //Ask PO how he want to handle it SurvivorCounter survivorCounter = SurvivorCounter.valueOf(passenger.getSex()); survivorCounter.count(passenger, this); } void consumeMale(BasicPassenger passenger) { male++; maleSurvivors += passenger.getSurvived() ? 1 : 0; } void consumeFemale(BasicPassenger passenger) { female++; femaleSurvivors += passenger.getSurvived() ? 1 : 0; } public String getStatus() { return String.format("Males: %d (%d survivors) Females %d (%d survivors)", male, maleSurvivors, female, femaleSurvivors); } }
[ "vilius.kukanauskas@vwgis.de" ]
vilius.kukanauskas@vwgis.de
7865e17088fe8d3cae48069499498c2726203c81
fae0a973015ca7ca6f8c415f1257fdf6cff3c559
/zookeeper-3.3.3/src/java/main/org/apache/zookeeper/server/persistence/FileSnap.java
e10c6b5bf112aff8f77ac8e84d4b682c2244af1c
[ "Apache-2.0" ]
permissive
jiaqiang/thirdparty
2c197db2f70f568829ff43ba0f96b9d5fbba96ba
6ee8c1cfa659228770d1598139d47331a5e852a4
refs/heads/master
2021-01-15T12:37:59.453381
2015-09-05T14:46:20
2015-09-05T14:46:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,107
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.zookeeper.server.persistence; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.EOFException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.zip.Adler32; import java.util.zip.CheckedInputStream; import java.util.zip.CheckedOutputStream; import org.apache.jute.BinaryInputArchive; import org.apache.jute.BinaryOutputArchive; import org.apache.jute.InputArchive; import org.apache.jute.OutputArchive; import org.apache.log4j.Logger; import org.apache.zookeeper.server.DataTree; import org.apache.zookeeper.server.SessionInfo; import org.apache.zookeeper.server.util.SerializeUtils; /** * This class implements the snapshot interface. * it is responsible for storing, serializing * and deserializing the right snapshot. * and provides access to the snapshots. */ public class FileSnap implements SnapShot { File snapDir; private volatile boolean close = false; private static final int VERSION=2; private static final long dbId=-1; private static final Logger LOG = Logger.getLogger(FileSnap.class); public final static int SNAP_MAGIC = ByteBuffer.wrap("ZKSN".getBytes()).getInt(); public FileSnap(File snapDir) { this.snapDir = snapDir; } /** * deserialize a data tree from the most recent snapshot * @return the zxid of the snapshot */ public long deserialize(DataTree dt, Map<Long, SessionInfo> sessions) throws IOException { // we run through 100 snapshots (not all of them) // if we cannot get it running within 100 snapshots // we should give up List<File> snapList = findNValidSnapshots(100); if (snapList.size() == 0) { return -1L; } File snap = null; boolean foundValid = false; // in order to be compatible with old version snapshot format. // at beginning, we read snapshot in new way, if read failure(EOFException), // we retry to read the same snapshot in old way. both new way and old way failure, // we retry the next snapshot in snapshot list. boolean retryInOldLogFormat = false; int times = 0; int i = 0; while(i < snapList.size()) { snap = snapList.get(i); InputStream snapIS = null; CheckedInputStream crcIn = null; try { LOG.info("Reading snapshot " + snap); snapIS = new BufferedInputStream(new FileInputStream(snap)); crcIn = new CheckedInputStream(snapIS, new Adler32()); InputArchive ia = BinaryInputArchive.getArchive(crcIn); deserialize(dt,sessions, ia, retryInOldLogFormat); long checkSum = crcIn.getChecksum().getValue(); long val = ia.readLong("val"); if (val != checkSum) { throw new IOException("CRC corruption in snapshot : " + snap); } foundValid = true; break; } catch (IOException eof) { LOG.warn("can not deserialize in new format, try old format."); retryInOldLogFormat = !retryInOldLogFormat; ++times; if (times % 2 == 0) {++i;} } catch(Exception e) { LOG.warn("problem reading snap file " + snap, e); } finally { if (snapIS != null) snapIS.close(); if (crcIn != null) crcIn.close(); } } if (!foundValid) { throw new IOException("Not able to find valid snapshots in " + snapDir); } dt.lastProcessedZxid = Util.getZxidFromName(snap.getName(), "snapshot"); return dt.lastProcessedZxid; } /** * deserialize the datatree from an inputarchive * @param dt the datatree to be serialized into * @param sessions the sessions to be filled up * @param ia the input archive to restore from * @throws IOException */ public void deserialize(DataTree dt, Map<Long, SessionInfo> sessions, InputArchive ia, boolean retryInOldLogFormat) throws IOException { FileHeader header = new FileHeader(); header.deserialize(ia, "fileheader"); if (header.getMagic() != SNAP_MAGIC) { throw new IOException("mismatching magic headers " + header.getMagic() + " != " + FileSnap.SNAP_MAGIC); } SerializeUtils.deserializeSnapshot(dt,ia,sessions, retryInOldLogFormat); } /** * find the most recent snapshot in the database. * @return the file containing the most recent snapshot */ public File findMostRecentSnapshot() throws IOException { List<File> files = findNValidSnapshots(1); if (files.size() == 0) { return null; } return files.get(0); } /** * find the last (maybe) valid n snapshots. this does some * minor checks on the validity of the snapshots. It just * checks for / at the end of the snapshot. This does * not mean that the snapshot is truly valid but is * valid with a high probability. also, the most recent * will be first on the list. * @param n the number of most recent snapshots * @return the last n snapshots (the number might be * less than n in case enough snapshots are not available). * @throws IOException */ private List<File> findNValidSnapshots(int n) throws IOException { List<File> files = Util.sortDataDir(snapDir.listFiles(),"snapshot", false); int count = 0; List<File> list = new ArrayList<File>(); for (File f : files) { // we should catch the exceptions // from the valid snapshot and continue // until we find a valid one try { if (Util.isValidSnapshot(f)) { list.add(f); count++; if (count == n) { break; } } } catch (IOException e) { LOG.info("invalid snapshot " + f, e); } } return list; } /** * find the last n snapshots. this does not have * any checks if the snapshot might be valid or not * @param the number of most recent snapshots * @return the last n snapshots * @throws IOException */ public List<File> findNRecentSnapshots(int n) throws IOException { List<File> files = Util.sortDataDir(snapDir.listFiles(), "snapshot", false); int i = 0; List<File> list = new ArrayList<File>(); for (File f: files) { if (i==n) break; i++; list.add(f); } return list; } /** * serialize the datatree and sessions * @param dt the datatree to be serialized * @param sessions the sessions to be serialized * @param oa the output archive to serialize into * @param header the header of this snapshot * @throws IOException */ protected void serialize(DataTree dt,Map<Long, SessionInfo> sessions, OutputArchive oa, FileHeader header) throws IOException { // this is really a programmatic error and not something that can // happen at runtime if(header==null) throw new IllegalStateException( "Snapshot's not open for writing: uninitialized header"); header.serialize(oa, "fileheader"); SerializeUtils.serializeSnapshot(dt,oa,sessions); } /** * serialize the datatree and session into the file snapshot * @param dt the datatree to be serialized * @param sessions the sessions to be serialized * @param snapShot the file to store snapshot into */ public synchronized void serialize(DataTree dt, Map<Long, SessionInfo> sessions, File snapShot) throws IOException { if (!close) { OutputStream sessOS = new BufferedOutputStream(new FileOutputStream(snapShot)); CheckedOutputStream crcOut = new CheckedOutputStream(sessOS, new Adler32()); //CheckedOutputStream cout = new CheckedOutputStream() OutputArchive oa = BinaryOutputArchive.getArchive(crcOut); FileHeader header = new FileHeader(SNAP_MAGIC, VERSION, dbId); serialize(dt,sessions,oa, header); long val = crcOut.getChecksum().getValue(); oa.writeLong(val, "val"); oa.writeString("/", "path"); sessOS.flush(); crcOut.close(); sessOS.close(); } } /** * synchronized close just so that if serialize is in place * the close operation will block and will wait till serialize * is done and will set the close flag */ @Override public synchronized void close() throws IOException { close = true; } }
[ "user00@VM_64_237_centos.(none)" ]
user00@VM_64_237_centos.(none)
972f42479dda89478c3d281f0be7808342f06053
99de17bc26dfd7c61484ab3c04f7582a2db7a2a0
/HermesEventbus/src/main/java/com/lhfboy/library/hermes/wrapper/MethodWrapper.java
784f0a43676641b31b0d770d28ca71db96c7bb87
[ "Apache-2.0" ]
permissive
kesionli/HermesEventBus-master
56d9ff74f6105b2091301d5737d4649301abd68c
edec6d6b0833c1320c2fe52224b0553d60d016df
refs/heads/master
2022-04-22T10:54:31.212781
2019-05-23T09:11:29
2019-05-23T09:11:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,034
java
/** * * Copyright 2016 Xiaofei * * 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.lhfboy.library.hermes.wrapper; import android.os.Parcel; import android.os.Parcelable; import com.lhfboy.library.hermes.annotation.MethodId; import com.lhfboy.library.hermes.util.TypeUtils; import java.lang.reflect.Method; /** * Created by Xiaofei on 16/4/7. */ public class MethodWrapper extends BaseWrapper implements Parcelable { private TypeWrapper[] mParameterTypes; private TypeWrapper mReturnType; public static final Creator<MethodWrapper> CREATOR = new Creator<MethodWrapper>() { public MethodWrapper createFromParcel(Parcel in) { MethodWrapper methodWrapper = new MethodWrapper(); methodWrapper.readFromParcel(in); return methodWrapper; } public MethodWrapper[] newArray(int size) { return new MethodWrapper[size]; } }; private MethodWrapper() {} public MethodWrapper(Method method) { setName(!method.isAnnotationPresent(MethodId.class), TypeUtils.getMethodId(method)); Class<?>[] classes = method.getParameterTypes(); if (classes == null) { classes = new Class<?>[0]; } int length = classes.length; mParameterTypes = new TypeWrapper[length]; for (int i = 0; i < length; ++i) { mParameterTypes[i] = new TypeWrapper(classes[i]); } mReturnType = new TypeWrapper(method.getReturnType()); } public MethodWrapper(String methodName, Class<?>[] parameterTypes) { setName(true, methodName); if (parameterTypes == null) { parameterTypes = new Class<?>[0]; } int length = parameterTypes.length; mParameterTypes = new TypeWrapper[length]; for (int i = 0; i < length; ++i) { mParameterTypes[i] = new TypeWrapper(parameterTypes[i]); } mReturnType = null; } public MethodWrapper(Class<?>[] parameterTypes) { setName(false, ""); if (parameterTypes == null) { parameterTypes = new Class<?>[0]; } int length = parameterTypes.length; mParameterTypes = new TypeWrapper[length]; for (int i = 0; i < length; ++i) { mParameterTypes[i] = parameterTypes[i] == null ? null : new TypeWrapper(parameterTypes[i]); } mReturnType = null; } public TypeWrapper[] getParameterTypes() { return mParameterTypes; } public TypeWrapper getReturnType() { return mReturnType; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int flags) { super.writeToParcel(parcel, flags); parcel.writeParcelableArray(mParameterTypes, flags); parcel.writeParcelable(mReturnType, flags); } public void readFromParcel(Parcel in) { super.readFromParcel(in); ClassLoader classLoader = MethodWrapper.class.getClassLoader(); Parcelable[] parcelables = in.readParcelableArray(classLoader); if (parcelables == null) { mParameterTypes = null; } else { int length = parcelables.length; mParameterTypes = new TypeWrapper[length]; for (int i = 0; i < length; ++i) { mParameterTypes[i] = (TypeWrapper) parcelables[i]; } } mReturnType = in.readParcelable(classLoader); } }
[ "dong1825650144" ]
dong1825650144
693dac9be92b192d99ec15a3a2ed6516802fa600
3a41bdf604d4eebdb53f24e809872039d1605051
/Array Lab 1/task11.java
fb3b51103ed45cc78cef1cd61a489bdad5d3baaf
[]
no_license
iamraufu/BRACUCSE110
e12a5d5779bb5f09c4674c2fc0410416e40be67e
367255bcf3c375cdff4bd7140238d30dd5048950
refs/heads/main
2023-01-06T11:36:04.384245
2020-11-07T22:14:26
2020-11-07T22:14:26
310,927,841
4
0
null
null
null
null
UTF-8
Java
false
false
587
java
import java.util.Scanner; public class task11{ public static void main(String []args){ Scanner sc= new Scanner(System.in); System.out.println("Enter Ten Numbers"); int a[]=new int[10]; for(int i=0;i<a.length;i++){ a[i]=sc.nextInt(); } for(int i=0;i<a.length;i++){ if(a[i]==i){ a[i]=sc.nextInt(); } if(a.length==i){ System.out.println("Enter A Different Number"); } } for(int i=0;i<a.length;i++){ System.out.println(a[i]); } } }
[ "43452776+RaufuPrezens@users.noreply.github.com" ]
43452776+RaufuPrezens@users.noreply.github.com
3efea899c5388639ecebbea92ceba012740900b2
55b6fb53025fdcf78f266c94556329421c1b7305
/src/main/java/com/nieyue/dao/CollectDao.java
ca413ecc27083a20108179efeec28762f651d623
[]
no_license
lijin148/SevenSeconds
d318c38b1731bbb326afc2de87dc06372752b885
8d22ca6048f98426348bcce04ce1bde5a084fe8b
refs/heads/master
2020-03-07T05:30:40.378493
2017-08-25T09:48:42
2017-08-25T09:48:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.nieyue.dao; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.nieyue.bean.Collect; import com.nieyue.bean.CollectArticleDTO; /** * 收藏数据库接口 * @author yy * */ @Mapper public interface CollectDao { /** 新增收藏*/ public boolean addCollect(Collect collect) ; /** 删除收藏 */ public boolean delCollect(Integer collectId) ; /** 更新收藏*/ public boolean updateCollect(Collect collect); /** 装载收藏 */ public Collect loadCollect( @Param("articleId")Integer articleId, @Param("acountId")Integer acountId, @Param("collectId")Integer collectId); /** 收藏总共数目 */ public int countAll( @Param("articleId")Integer articleId, @Param("acountId")Integer acountId ); /** 分页收藏信息 */ public List<Collect> browsePagingCollect( @Param("articleId")Integer articleId, @Param("acountId")Integer acountId, @Param("pageNum")int pageNum, @Param("pageSize")int pageSize, @Param("orderName")String orderName, @Param("orderWay")String orderWay) ; /** 分页DTO收藏信息 */ public List<CollectArticleDTO> browsePagingCollectArticleDTO( @Param("articleId")Integer articleId, @Param("acountId")Integer acountId, @Param("pageNum")int pageNum, @Param("pageSize")int pageSize, @Param("orderName")String orderName, @Param("orderWay")String orderWay) ; }
[ "278076304@qq.com" ]
278076304@qq.com
90d71d2bef3c4116866ff193448ba9b26f12af18
27c4841c76805bbb3ef9a9d5ae273c41a6d0cfc2
/lib-base/src/main/java/com/android/base/loadsir/ErrorCallback.java
a6a5951c37368a8a95e5e77f8f0e7bc265e34260
[]
no_license
Demo-H/openEye
757b23b7af76bd750994dcf78090716911ebf942
992c446a4107d5c68c9369f6893c40ef14798c4f
refs/heads/master
2022-10-06T21:21:11.022930
2020-06-07T02:33:04
2020-06-07T02:33:04
270,168,541
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package com.android.base.loadsir; import com.android.base.R; import com.android.base.loadsir.callback.Callback; /** * <p> * 类描述: 错误页面 * <p> * Created by Dhunter on 2020/6/2. */ public class ErrorCallback extends Callback { @Override protected int onCreateView() { return R.layout.base_layout_error; } }
[ "wbin18@126.com" ]
wbin18@126.com
686c34fd2690242c5db0ef2f5448f4eaffcc554d
5b65dc08a7caa2709ee2e64c5ced1a0050bf489b
/flink-examples-api/src/main/java/com/buildupchao/flinkexamples/api/JoinExample.java
c9113636f0a4da0bc5eebbfcb6036da87d170118
[]
no_license
suixuan/flink-examples
614a553853ca576fa1630e7e425354684eb0cd96
0e3c3bd54d90614d85f3d9900af0f4de403775bb
refs/heads/master
2022-12-28T14:14:37.054725
2020-05-16T10:21:41
2020-05-16T10:21:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,398
java
package com.buildupchao.flinkexamples.api; import lombok.AllArgsConstructor; import lombok.Data; import lombok.ToString; import org.apache.flink.api.common.functions.JoinFunction; import org.apache.flink.api.java.DataSet; import org.apache.flink.api.java.ExecutionEnvironment; import org.apache.flink.api.java.operators.DataSource; import org.apache.flink.api.java.tuple.Tuple3; import org.apache.flink.shaded.guava18.com.google.common.collect.Lists; import java.util.List; /** * inner join (equals join) * * @author buildupchao * @date 2020/01/01 15:17 * @since JDK 1.8 */ public class JoinExample { public static void main(String[] args) throws Exception { ExecutionEnvironment environment = ExecutionEnvironment.getExecutionEnvironment(); List<Tuple3<Integer, String, Integer>> personList = Lists.newArrayList( Tuple3.of(101, "王朝", 0), Tuple3.of(102, "马汉", 1), Tuple3.of(103, "张龙", 0), Tuple3.of(104, "赵虎", 0) ); List<Tuple3<Integer, String, Integer>> learningCourseList = Lists.newArrayList( Tuple3.of(101, "Flink", 0), Tuple3.of(102, "Spark", 1), Tuple3.of(104, "Data-Warehouse", 0) ); DataSource<Tuple3<Integer, String, Integer>> personDataSource = environment.fromCollection(personList); DataSource<Tuple3<Integer, String, Integer>> learningCourseDataSource = environment.fromCollection(learningCourseList); DataSet<UserInfo> userInfoDataSet = personDataSource.join(learningCourseDataSource) .where(0, 2) .equalTo(0, 2) .with(new UserInfoJonFunction()); userInfoDataSet.print(); } private static class UserInfoJonFunction implements JoinFunction<Tuple3<Integer, String, Integer>, Tuple3<Integer, String, Integer>, UserInfo> { @Override public UserInfo join(Tuple3<Integer, String, Integer> person, Tuple3<Integer, String, Integer> learningCourse) throws Exception { return new UserInfo(person.f0, person.f1, learningCourse.f1); } } @Data @ToString @AllArgsConstructor private static class UserInfo { private Integer userId; private String userName; private String learningCourse; } }
[ "yachaoz@foxmail.com" ]
yachaoz@foxmail.com
a78aeacb4f323e973578c7b9dfad19885c1f6253
0e7529e0b264fdfdc7d86fcb9ee74679bb930458
/src/main/java/com/dnp/bulidingmanage/common/config/MyWebAppConfigurer.java
8af4655d8e9ace9b0567fe954f5116ff0822f01c
[]
no_license
379924269/buliding_manage
e06f9545fa8454ed25c043a9a8e6ae60f14d43a1
117768c6b07cabfdd6f792219dc28174ec4f9bcc
refs/heads/master
2021-05-08T03:07:36.843068
2017-11-14T07:16:33
2017-11-14T07:16:33
108,231,290
1
0
null
null
null
null
UTF-8
Java
false
false
1,396
java
package com.dnp.bulidingmanage.common.config; import com.dnp.bulidingmanage.common.MyInterceptor; import org.springframework.context.annotation.Configuration; import org.springframework.util.ResourceUtils; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * 注册拦截器 * * @Author 华仔 * @Author 2017/10/16 10:02 */ @Configuration public class MyWebAppConfigurer extends WebMvcConfigurerAdapter { //没用shiro的时候注册的拦截器 //@Override //public void addInterceptors(InterceptorRegistry registry) { // //拦截规则:除了login,其他都拦截判断 // String excludePathPatterns[] = {"/manager/login", "/manager/notLogin", "/swagger-resources/**", "/"}; // registry.addInterceptor(new MyInterceptor()).addPathPatterns("/**").excludePathPatterns(excludePathPatterns); //} @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX + "/static/"); registry.addResourceHandler("/swagger-resources/**").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX + "/swagger-resources/"); } }
[ "379924269@qq.com" ]
379924269@qq.com
836cfe27b1e623b1a131b082b9c5147955ad11d8
51c77cd0ce4c0c14d60b341e0be89d0088172320
/imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/tiff/TIFF.java
539a2e128396c12f88ecbe847962fe8ba2b06f15
[ "BSD-3-Clause" ]
permissive
lafaspot/TwelveMonkeys
f633467c7c78a26afe9cf15c37134348a9e2861e
dbf1ea6d1190965026d2e39ae6dac7d31001e78e
refs/heads/master
2021-01-20T04:09:50.542559
2017-07-06T19:44:23
2017-07-06T19:44:23
89,653,173
1
1
null
2017-07-06T19:44:24
2017-04-28T00:57:33
Java
UTF-8
Java
false
false
8,391
java
/* * Copyright (c) 2009, Harald Kuhr * 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 "TwelveMonkeys" nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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 com.twelvemonkeys.imageio.metadata.tiff; /** * TIFF * * @author <a href="mailto:harald.kuhr@gmail.com">Harald Kuhr</a> * @author last modified by $Author: haraldk$ * @version $Id: TIFF.java,v 1.0 Nov 15, 2009 3:02:24 PM haraldk Exp$ */ @SuppressWarnings("UnusedDeclaration") public interface TIFF { short BYTE_ORDER_MARK_BIG_ENDIAN = ('M' << 8) | 'M'; short BYTE_ORDER_MARK_LITTLE_ENDIAN = ('I' << 8) | 'I'; int TIFF_MAGIC = 42; short TYPE_BYTE = 1; short TYPE_ASCII = 2; short TYPE_SHORT = 3; short TYPE_LONG = 4; short TYPE_RATIONAL = 5; short TYPE_SBYTE = 6; short TYPE_UNDEFINED = 7; short TYPE_SSHORT = 8; short TYPE_SLONG = 9; short TYPE_SRATIONAL = 10; short TYPE_FLOAT = 11; short TYPE_DOUBLE = 12; short TYPE_IFD = 13; /* 1 = BYTE 8-bit unsigned integer. 2 = ASCII 8-bit byte that contains a 7-bit ASCII code; the last byte must be NUL (binary zero). 3 = SHORT 16-bit (2-byte) unsigned integer. 4 = LONG 32-bit (4-byte) unsigned integer. 5 = RATIONAL Two LONGs: the first represents the numerator of a fraction; the second, the denominator. TIFF 6.0 and above: 6 = SBYTE An 8-bit signed (twos-complement) integer. 7 = UNDEFINED An 8-bit byte that may contain anything, depending on the definition of the field. 8 = SSHORT A 16-bit (2-byte) signed (twos-complement) integer. 9 = SLONG A 32-bit (4-byte) signed (twos-complement) integer. 10 = SRATIONAL Two SLONGs: the first represents the numerator of a fraction, the second the denominator. 11 = FLOAT Single precision (4-byte) IEEE format. 12 = DOUBLE Double precision (8-byte) IEEE format. See http://www.awaresystems.be/imaging/tiff/tifftags/subifds.html 13 = IFD, same as LONG TODO: BigTiff specifies more types See http://www.awaresystems.be/imaging/tiff/bigtiff.html, http://www.remotesensing.org/libtiff/bigtiffdesign.html (what about 14-15??) 16 = TIFF_LONG8, being unsigned 8byte integer 17 = TIFF_SLONG8, being signed 8byte integer 18 = TIFF_IFD8, being a new unsigned 8byte IFD offset. Should probably all map to Java long (and fail if high bit is set for the unsigned types???) */ String[] TYPE_NAMES = { null, "BYTE", "ASCII", "SHORT", "LONG", "RATIONAL", "SBYTE", "UNDEFINED", "SSHORT", "SLONG", "SRATIONAL", "FLOAT", "DOUBLE", "IFD", null, null, "LONG8", "SLONG8", "IFD8" }; /** Length of the corresponding type, in bytes. */ int[] TYPE_LENGTHS = { -1, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4, -1, -1, 8, 8, 8 }; /// EXIF defined TIFF tags int TAG_EXIF_IFD = 34665; int TAG_GPS_IFD = 34853; int TAG_INTEROP_IFD = 40965; /// A. Tags relating to image data structure: int TAG_IMAGE_WIDTH = 256; int TAG_IMAGE_HEIGHT = 257; int TAG_BITS_PER_SAMPLE = 258; int TAG_COMPRESSION = 259; int TAG_PHOTOMETRIC_INTERPRETATION = 262; int TAG_FILL_ORDER = 266; int TAG_ORIENTATION = 274; int TAG_SAMPLES_PER_PIXEL = 277; int TAG_PLANAR_CONFIGURATION = 284; int TAG_SAMPLE_FORMAT = 339; int TAG_YCBCR_SUB_SAMPLING = 530; int TAG_YCBCR_POSITIONING = 531; int TAG_X_RESOLUTION = 282; int TAG_Y_RESOLUTION = 283; int TAG_X_POSITION = 286; int TAG_Y_POSITION = 287; int TAG_RESOLUTION_UNIT = 296; /// B. Tags relating to recording offset int TAG_STRIP_OFFSETS = 273; int TAG_ROWS_PER_STRIP = 278; int TAG_STRIP_BYTE_COUNTS = 279; int TAG_FREE_OFFSETS = 288; // "Not recommended for general interchange." // "Old-style" JPEG (still used as EXIF thumbnail) int TAG_JPEG_INTERCHANGE_FORMAT = 513; int TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = 514; int TAG_GROUP3OPTIONS = 292; int TAG_GROUP4OPTIONS = 293; /// C. Tags relating to image data characteristics int TAG_TRANSFER_FUNCTION = 301; int TAG_PREDICTOR = 317; int TAG_WHITE_POINT = 318; int TAG_PRIMARY_CHROMATICITIES = 319; int TAG_COLOR_MAP = 320; int TAG_INK_SET = 332; int TAG_INK_NAMES = 333; int TAG_NUMBER_OF_INKS = 334; int TAG_EXTRA_SAMPLES = 338; int TAG_TRANSFER_RANGE = 342; int TAG_YCBCR_COEFFICIENTS = 529; int TAG_REFERENCE_BLACK_WHITE = 532; /// D. Other tags int TAG_DATE_TIME = 306; int TAG_DOCUMENT_NAME = 269; int TAG_IMAGE_DESCRIPTION = 270; int TAG_MAKE = 271; int TAG_MODEL = 272; int TAG_PAGE_NAME = 285; int TAG_PAGE_NUMBER = 297; int TAG_SOFTWARE = 305; int TAG_ARTIST = 315; int TAG_HOST_COMPUTER = 316; int TAG_COPYRIGHT = 33432; int TAG_SUBFILE_TYPE = 254; int TAG_OLD_SUBFILE_TYPE = 255; // Deprecated NO NOT WRITE! int TAG_SUB_IFD = 330; /** * XMP record. * @see com.twelvemonkeys.imageio.metadata.xmp.XMP */ int TAG_XMP = 700; /** * IPTC record. * @see com.twelvemonkeys.imageio.metadata.iptc.IPTC */ int TAG_IPTC = 33723; /** * Photoshop image resources. * @see com.twelvemonkeys.imageio.metadata.psd.PSD */ int TAG_PHOTOSHOP = 34377; /** * Photoshop layer and mask information (byte order follows TIFF container). * Layer and mask information found in a typical layered Photoshop file. * Starts with a character string of "Adobe Photoshop Document Data Block" * (or "Adobe Photoshop Document Data V0002" for PSB) * including the null termination character. * @see com.twelvemonkeys.imageio.metadata.psd.PSD */ int TAG_PHOTOSHOP_IMAGE_SOURCE_DATA = 37724; int TAG_PHOTOSHOP_ANNOTATIONS = 50255; /** * ICC Color Profile. * @see java.awt.color.ICC_Profile */ int TAG_ICC_PROFILE = 34675; // Microsoft Office Document Imaging (MODI) // http://msdn.microsoft.com/en-us/library/aa167596%28office.11%29.aspx int TAG_MODI_BLC = 34718; int TAG_MODI_VECTOR = 34719; int TAG_MODI_PTC = 34720; // http://blogs.msdn.com/b/openspecification/archive/2009/12/08/details-of-three-tiff-tag-extensions-that-microsoft-office-document-imaging-modi-software-may-write-into-the-tiff-files-it-generates.aspx int TAG_MODI_PLAIN_TEXT = 37679; int TAG_MODI_OLE_PROPERTY_SET = 37680; int TAG_MODI_TEXT_POS_INFO = 37681; int TAG_TILE_WIDTH = 322; int TAG_TILE_HEIGTH = 323; int TAG_TILE_OFFSETS = 324; int TAG_TILE_BYTE_COUNTS = 325; // JPEG int TAG_JPEG_TABLES = 347; // "Old-style" JPEG (Obsolete) DO NOT WRITE! int TAG_OLD_JPEG_PROC = 512; int TAG_OLD_JPEG_Q_TABLES = 519; int TAG_OLD_JPEG_DC_TABLES = 520; int TAG_OLD_JPEG_AC_TABLES = 521; }
[ "harald.kuhr@gmail.com" ]
harald.kuhr@gmail.com
c9116a57cb1412f0774752c6b71d0329c000a3a8
446f34f1400a35149758107c284046839d4ae233
/market-product/src/main/java/com/lyc/market/product/web/IndexController.java
471147840ac93bcca31839f0b3159218c28f4a6b
[]
no_license
lycGlish/Market
6f1b20cfa418be4cdd79ad53281720a9fb188575
eddc6509c9d0da0fd0c472a5a992ecf9bf28e7dd
refs/heads/master
2022-12-03T09:39:00.849108
2020-08-20T08:05:39
2020-08-20T08:05:39
287,201,964
0
0
null
null
null
null
UTF-8
Java
false
false
1,191
java
package com.lyc.market.product.web; import com.lyc.market.product.entity.CategoryEntity; import com.lyc.market.product.service.CategoryService; import com.lyc.market.product.vo.Catalog2Vo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; import java.util.Map; /** * @author lyc * @date 2020/8/19 17:19 */ @Controller public class IndexController { @Autowired CategoryService categoryService; @GetMapping("/index/catalog.json") @ResponseBody public Map<String, List<Catalog2Vo>> getCatalogJson() { Map<String, List<Catalog2Vo>> catalogJson = categoryService.getCatalogJson(); return catalogJson; } @GetMapping({"/", "/index.html"}) public String indexPage(Model model) { // 查出所有的一级分类 List<CategoryEntity> categoryEntities = categoryService.getLevel1Categories(); model.addAttribute("categories", categoryEntities); return "index"; } }
[ "708901735@qq.com" ]
708901735@qq.com
baac9926a9cda9df5dbe784f9ddfda88e108ca89
467b202a8aa0a82b373884d4dd106fda8b6c665c
/src/main/java/com/singtel/model/ButterflySolution.java
d5c50453a4f27661736800a553ca86e6a788ec61
[]
no_license
RajarajeswariSG/Assignment
30e348321a0e42f441740abf6dc1c151e362cf39
5bab0d0e69d4337a15dce6294ba9ec8f55b30459
refs/heads/master
2020-12-27T22:35:30.438455
2020-02-06T01:58:20
2020-02-06T01:58:20
237,503,701
0
0
null
null
null
null
UTF-8
Java
false
false
491
java
package com.singtel.model; public class ButterflySolution { public static void main(String[] args) { Butterfly b = new Butterfly(); System.out.println("ButterFly"); b.fly(); CatterPillar c = new CatterPillar(); System.out.println("CatterPillar"); c.walk(); Butterfly butterFlyFromCaterpillar = new Metamorphosis().stage(c); System.out.println("butterFlyFromCaterpillar"); butterFlyFromCaterpillar.fly(); } }
[ "raje2018sg@gmail.com" ]
raje2018sg@gmail.com
0bac3594d653de114500a0989590062e1cd672ca
9df515f1b1498d9923c8fdbd4cc024781fd59024
/app/src/main/java/com/afwsamples/testdpc/common/ColorPicker.java
d93ac3c9dca2e3a1b08b4b78fbfdeea3532a96a3
[ "Apache-2.0" ]
permissive
jindog/android-testdpc
0452866f6a73e3fd46ffff6e9501e81bb5f04d05
14d1aa42539dbe8232d89b9b810afff079d41544
refs/heads/master
2021-06-21T13:58:33.958065
2020-12-10T11:11:00
2020-12-10T11:11:00
140,535,194
0
0
Apache-2.0
2020-12-10T11:11:02
2018-07-11T07:03:16
Java
UTF-8
Java
false
false
8,481
java
/* * Copyright (C) 2016 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.afwsamples.testdpc.common; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.graphics.Color; import android.graphics.PorterDuff; import android.os.Bundle; import android.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; import android.widget.TextView; import android.widget.Toast; import com.afwsamples.testdpc.R; /** * This fragment can be used to get a color input from the user. It contains the seek bars for * RGB and an edit box for entering hexadecimal color value, either of them can be used to provide * input. */ public class ColorPicker extends DialogFragment implements SeekBar.OnSeekBarChangeListener, View.OnClickListener { private static final String ARG_COLOR_VALUE = "init_color"; private static final String ARG_LISTENER_FRAGMENT_TAG = "listener_fragment_tag"; private static final String ARG_ID = "id"; public static final String COLOR_STRING_FORMATTER = "#%08x"; private String mListenerTag; private int mCurrentColor; // Id given as an argument while initiating this class, this will be passed as is to the // listener on callback. Since there could be multiple elements initiating this, caller // can use this to differentiate those. private String mId; private View mTitleHeader; private SeekBar mRedBar; private SeekBar mGreenBar; private SeekBar mBlueBar; private TextView mRedBarValue; private TextView mGreenBarValue; private TextView mBlueBarValue; private EditText mColorValue; private Button mDoneButton; private Button mCancelButton; private Button mPreviewButton; public static ColorPicker newInstance(int initColor, String listenerTag, String id) { ColorPicker fragment = new ColorPicker(); Bundle args = new Bundle(); args.putInt(ARG_COLOR_VALUE, initColor); args.putString(ARG_LISTENER_FRAGMENT_TAG, listenerTag); args.putString(ARG_ID, id); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) { mCurrentColor = savedInstanceState.getInt(ARG_COLOR_VALUE); mListenerTag = savedInstanceState.getString(ARG_LISTENER_FRAGMENT_TAG); mId = savedInstanceState.getString(ARG_ID); } else if (getArguments() != null) { mCurrentColor = getArguments().getInt(ARG_COLOR_VALUE, getResources().getColor(R.color.teal)); mListenerTag = getArguments().getString(ARG_LISTENER_FRAGMENT_TAG); mId = getArguments().getString(ARG_ID); } } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final View rootView = LayoutInflater.from(getActivity()).inflate( R.layout.color_picker, null); AlertDialog dialog = new AlertDialog.Builder(getActivity()) .setView(rootView) .setPositiveButton(R.string.color_picker_done, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { OnColorSelectListener listener = (OnColorSelectListener) getFragmentManager().findFragmentByTag(mListenerTag); if (listener != null) { listener.onColorSelected(mCurrentColor, mId); } } }) .setNegativeButton(android.R.string.cancel, null) .create(); dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { mDoneButton = ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE); mDoneButton.setTextColor(mCurrentColor); mCancelButton = ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_NEGATIVE); mCancelButton.setTextColor(mCurrentColor); updateViewsColor(); } }); initializeViews(rootView); return dialog; } @Override public void onSaveInstanceState(Bundle outState) { outState.putInt(ARG_COLOR_VALUE, mCurrentColor); outState.putString(ARG_LISTENER_FRAGMENT_TAG, mListenerTag); outState.putString(ARG_ID, mId); super.onSaveInstanceState(outState); } private void initializeViews(View rootView) { mTitleHeader = rootView.findViewById(R.id.title_header); mRedBar = (SeekBar) rootView.findViewById(R.id.red_bar); mGreenBar = (SeekBar) rootView.findViewById(R.id.green_bar); mBlueBar = (SeekBar) rootView.findViewById(R.id.blue_bar); mRedBarValue = (TextView) rootView.findViewById(R.id.red_bar_value); mGreenBarValue = (TextView) rootView.findViewById(R.id.green_bar_value); mBlueBarValue = (TextView) rootView.findViewById(R.id.blue_bar_value); mRedBar.setOnSeekBarChangeListener(this); mGreenBar.setOnSeekBarChangeListener(this); mBlueBar.setOnSeekBarChangeListener(this); mColorValue = (EditText) rootView.findViewById(R.id.color_value); mPreviewButton = (Button) rootView.findViewById(R.id.color_preview); mPreviewButton.setOnClickListener(this); } private void updateViewsColor() { mTitleHeader.setBackgroundColor(mCurrentColor); mDoneButton.setTextColor(mCurrentColor); mCancelButton.setTextColor(mCurrentColor); mRedBar.setProgress(Color.red(mCurrentColor)); mGreenBar.setProgress(Color.green(mCurrentColor)); mBlueBar.setProgress(Color.blue(mCurrentColor)); mRedBarValue.setText(Integer.toString(Color.red(mCurrentColor))); mGreenBarValue.setText(Integer.toString(Color.green(mCurrentColor))); mBlueBarValue.setText(Integer.toString(Color.blue(mCurrentColor))); mColorValue.setText(String.format(COLOR_STRING_FORMATTER, mCurrentColor)); mColorValue.setSelection(mColorValue.getText().length()); mColorValue.getBackground().mutate().setColorFilter(mCurrentColor, PorterDuff.Mode.SRC_ATOP); mPreviewButton.setTextColor(mCurrentColor); } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { mCurrentColor = Color.rgb(mRedBar.getProgress(), mGreenBar.getProgress(), mBlueBar.getProgress()); updateViewsColor(); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { // Do nothing } @Override public void onStopTrackingTouch(SeekBar seekBar) { // Do nothing } public interface OnColorSelectListener { void onColorSelected(int selectedColor, String id); } /** * User has tapped the update button, update the color value depending on the value in * the edit box. The current color value will be updated only if the edit box contains a valid * color, otherwise an error toast is shown to the user. */ @Override public void onClick(View view) { try { mCurrentColor = Color.parseColor(mColorValue.getText().toString()); updateViewsColor(); } catch (IllegalArgumentException e) { Toast.makeText(getActivity(), R.string.not_valid_color, Toast.LENGTH_SHORT).show(); } } }
[ "sudheersai@google.com" ]
sudheersai@google.com
f8a92c79459ddd29a5ec4338f135beae2fe352c1
67ec60c810cdd63eab37d54056a56f8094026065
/app/src/com/d2cmall/buyer/activity/RefundReshipActivity.java
9eb8c5cf17371137160a3ed842339f50a6b80d1f
[]
no_license
sinbara0813/fashion
2e2ef73dd99c71f2bebe0fc984d449dc67d5c4c5
4127db4963b0633cc3ea806851441bc0e08e6345
refs/heads/master
2020-08-18T04:43:25.753009
2019-10-25T02:28:47
2019-10-25T02:28:47
215,748,112
1
0
null
null
null
null
UTF-8
Java
false
false
41,038
java
package com.d2cmall.buyer.activity; import android.Manifest; import android.app.Dialog; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.text.Editable; import android.text.InputFilter; import android.text.TextWatcher; import android.util.DisplayMetrics; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.GridView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RelativeLayout; import android.widget.ScrollView; import android.widget.TextView; import com.android.volley.Response; import com.android.volley.VolleyError; import com.bumptech.glide.Glide; import com.d2cmall.buyer.Constants; import com.d2cmall.buyer.D2CApplication; import com.d2cmall.buyer.R; import com.d2cmall.buyer.adapter.ObjectBindAdapter; import com.d2cmall.buyer.api.KaoLaSaleAfterListApi; import com.d2cmall.buyer.api.PostRefundApi; import com.d2cmall.buyer.api.PostReshipApi; import com.d2cmall.buyer.base.BaseActivity; import com.d2cmall.buyer.base.BaseBean; import com.d2cmall.buyer.bean.GlobalTypeBean; import com.d2cmall.buyer.bean.JsonPic; import com.d2cmall.buyer.bean.KaoLaSameWarehouseBean; import com.d2cmall.buyer.bean.OrdersBean; import com.d2cmall.buyer.bean.UserBean; import com.d2cmall.buyer.http.BeanRequest; import com.d2cmall.buyer.util.CashierInputFilter; import com.d2cmall.buyer.util.DialogUtil; import com.d2cmall.buyer.util.ScreenUtil; import com.d2cmall.buyer.util.Session; import com.d2cmall.buyer.util.TitleUtil; import com.d2cmall.buyer.util.UniversalImageLoader; import com.d2cmall.buyer.util.Util; import com.d2cmall.buyer.widget.CheckableLinearLayoutButton; import com.d2cmall.buyer.widget.CheckableLinearLayoutGroup; import com.d2cmall.buyer.widget.ClearEditText; import com.d2cmall.buyer.widget.SelectReasonPop; import com.d2cmall.buyer.widget.SingleSelectPop; import com.d2cmall.buyer.widget.TransparentPop; import com.qiyukf.unicorn.api.ConsultSource; import com.qiyukf.unicorn.api.Unicorn; import com.upyun.library.common.Params; import com.upyun.library.common.UploadManager; import com.upyun.library.listener.SignatureListener; import com.upyun.library.listener.UpCompleteListener; import com.upyun.library.utils.UpYunUtils; import com.zhihu.matisse.Matisse; import com.zhihu.matisse.MimeType; import com.zhihu.matisse.engine.impl.GlideEngine; import com.zhihu.matisse.internal.entity.CaptureStrategy; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; import de.greenrobot.event.EventBus; /** * Created by rookie on 2017/9/9. * 申请退款以及退货退换页面 */ public class RefundReshipActivity extends BaseActivity implements AdapterView.OnItemClickListener, ObjectBindAdapter.ViewBinder<JsonPic>, SingleSelectPop.CallBack { @Bind(R.id.back_iv) ImageView backIv; @Bind(R.id.name_tv) TextView nameTv; @Bind(R.id.title_right) TextView titleRight; @Bind(R.id.tag) View tag; @Bind(R.id.title_layout) RelativeLayout titleLayout; @Bind(R.id.img_product) ImageView imgProduct; @Bind(R.id.tv_product_title) TextView tvProductTitle; @Bind(R.id.tv_product_style) TextView tvProductStyle; @Bind(R.id.tv_product_num) TextView tvProductNum; @Bind(R.id.tv_product_status) TextView tvProductStatus; @Bind(R.id.iv_received) ImageView ivReceived; @Bind(R.id.received_layout) CheckableLinearLayoutButton receivedLayout; @Bind(R.id.iv_unreceived) ImageView ivUnreceived; @Bind(R.id.unreceived_layout) CheckableLinearLayoutButton unreceivedLayout; @Bind(R.id.status_menu) CheckableLinearLayoutGroup statusMenu; @Bind(R.id.status_layout) LinearLayout statusLayout; @Bind(R.id.status_line_view) View statusLineView; @Bind(R.id.tv_reason_label) TextView tvReasonLabel; @Bind(R.id.tv_reason) TextView tvReason; @Bind(R.id.reason_layout) LinearLayout reasonLayout; @Bind(R.id.tv_num_product) TextView tvNumProduct; @Bind(R.id.et_count) ClearEditText etCount; @Bind(R.id.rl_num_product) RelativeLayout rlNumProduct; @Bind(R.id.tv_money_product) TextView tvMoneyProduct; @Bind(R.id.et_money) ClearEditText etMoney; @Bind(R.id.et_remark) ClearEditText etRemark; @Bind(R.id.gridView) GridView gridView; @Bind(R.id.btn_apply) Button btnApply; @Bind(R.id.ll_items_container) LinearLayout llItemsContainer; @Bind(R.id.line_layout) View lineLayout; @Bind(R.id.progressBar) ProgressBar progressBar; @Bind(R.id.rb_all) RadioButton rbAll; @Bind(R.id.rb_freight) RadioButton rbFreight; @Bind(R.id.rb_gap_price) RadioButton rbGapPrice; @Bind(R.id.radio_group) RadioGroup radioGroup; @Bind(R.id.tv_back_desc) TextView tvBackDesc; @Bind(R.id.tv_back_reason) TextView tvBackReason; @Bind(R.id.scroll_view) ScrollView scrollView; private ArrayList<JsonPic> photos; private ArrayList<JsonPic> jsonPics; private ObjectBindAdapter<JsonPic> adapter; private JsonPic emptyPic; private int imageSize; private SingleSelectPop singleSelectPop; private Dialog loadingDialog; private String reason = ""; private int type;//type=0 申请退货退款; type=1 申请退款 private int intentFlag;//intentFlag=0 列表进入的;intentFlag=1 详情进入的 private String orderSn; private long orderId; private long orderItemId; private String skuSn; private long quantity; private String paymentType; private double actualAmount; private int upLoadIndex; private ArrayList<String> imgUpyunPaths; private String alipayAccount; private String alipayName; private String money; private String remark; private String reminded; private boolean isReceived = true; private SelectReasonPop selectPromotionPop; private int maxSelected = 3; private OrdersBean.DataEntity.OrdersEntity.ListEntity.ItemsEntity bean; private String allItemAmount = null;//考拉订单同仓所有商品的金额,逗号分隔 private String allItemId = null;//考拉订单同仓所有商品的id,逗号分隔 private double otherAmount = 0;//考拉订单同仓其它商品的金额 private int statusCode; //订单状态用来退款的(已发货且未完成)radioButton显示的 private ArrayList<RadioButton> rbs; private int allRefund = 1; //1:全额退款,-1:退差价,-2:退运费 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_refund_reship); ButterKnife.bind(this); type = getIntent().getIntExtra("type", 0); intentFlag = getIntent().getIntExtra("intentFlag", 0); orderSn = getIntent().getStringExtra("orderSn"); orderId = getIntent().getLongExtra("orderId", -1); orderItemId = getIntent().getLongExtra("orderItemId", -1); skuSn = getIntent().getStringExtra("skuSn"); quantity = getIntent().getIntExtra("quantity", -1); paymentType = getIntent().getStringExtra("paymentType"); actualAmount = getIntent().getDoubleExtra("actualAmount", 0); reminded = getIntent().getStringExtra("reminded"); statusCode = getIntent().getIntExtra("statusCode", -1); bean = (OrdersBean.DataEntity.OrdersEntity.ListEntity.ItemsEntity) getIntent().getSerializableExtra("bean"); initProductView(); initRefundList(); initReshipList(); initTypeInfo(); photos = new ArrayList<>(); jsonPics = new ArrayList<>(); emptyPic = new JsonPic(); DisplayMetrics dm = getResources().getDisplayMetrics(); imageSize = Math.round(50 * dm.density); int gridViewWidth = Math.round(10 * 2 * dm.density + 50 * 3 * dm.density); gridView.getLayoutParams().width = gridViewWidth; tvReason.addTextChangedListener(textWatcher); etMoney.addTextChangedListener(textWatcher); InputFilter[] filters = {new CashierInputFilter()}; etMoney.setFilters(filters); loadingDialog = DialogUtil.createLoadingDialog(this); photos.add(emptyPic); adapter = new ObjectBindAdapter<>(this, photos, R.layout.list_item_post_image, this); gridView.setAdapter(adapter); gridView.setOnItemClickListener(this); imgUpyunPaths = new ArrayList<>(); titleRight.setBackgroundResource(R.mipmap.tab_all_service); } private void initProductView() { UniversalImageLoader.displayImage(this, Util.getD2cProductPicUrl( bean.getProductImg(), ScreenUtil.dip2px(48), ScreenUtil.dip2px(72)), imgProduct, R.mipmap.ic_logo_empty5, R.mipmap.ic_logo_empty5); tvProductTitle.setText(bean.getProductName()); tvProductStatus.setText(bean.getItemStatus()); tvProductStyle.setText(getString(R.string.label_kongge, bean.getColor(), bean.getSize())); tvProductStatus.setText(getString(R.string.label_final_price, Util.getNumberFormat(actualAmount))); tvProductNum.setText(getString(R.string.label_product_quantity, bean.getQuantity())); if (bean != null && "KAOLA".equals(bean.getProductSource())) { loadKaoLaRelate(); } } //拉取考拉商品的同仓商品 private void loadKaoLaRelate() { progressBar.setVisibility(View.VISIBLE); KaoLaSaleAfterListApi kaoLaSaleAfterListApi = new KaoLaSaleAfterListApi(); kaoLaSaleAfterListApi.setOrderItemId(bean.getId()); D2CApplication.httpClient.loadingRequest(kaoLaSaleAfterListApi, new BeanRequest.SuccessListener<KaoLaSameWarehouseBean>() { @Override public void onResponse(KaoLaSameWarehouseBean kaoLaSameWarehouseBean) { if (isFinishing() || progressBar == null) { return; } progressBar.setVisibility(View.GONE); //考拉商品将相关商品(同仓商品,展示出来) if (kaoLaSameWarehouseBean.getData().getItems().size() > 1) { addRelateProduct(kaoLaSameWarehouseBean); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { progressBar.setVisibility(View.GONE); Util.showToast(RefundReshipActivity.this, Util.checkErrorType(error)); } }); } private void addRelateProduct(KaoLaSameWarehouseBean kaoLaSameWarehouseBean) { llItemsContainer.setVisibility(View.VISIBLE); lineLayout.setVisibility(View.VISIBLE); List<KaoLaSameWarehouseBean.DataBean.ItemsBean> items = kaoLaSameWarehouseBean.getData().getItems(); StringBuilder idBuilder = new StringBuilder(); StringBuilder priceBuilder = new StringBuilder(); for (int i = 0; i < items.size(); i++) { //拼接考拉同仓商品所有id和金额 // if(i==0){ // priceBuilder.append(items.get(i).getActualAmount()); // }else{ // priceBuilder.append(","+items.get(i).getActualAmount()); // } // if(i==0){ // idBuilder.append(items.get(i).getId()); // }else{ // idBuilder.append(","+items.get(i).getId()); // } if (items.get(i).getId() == bean.getId()) { continue; } otherAmount += items.get(i).getActualAmount() * items.get(i).getQuantity(); View itemView = getLayoutInflater().inflate(R.layout.layout_after_sale_list_item, llItemsContainer, false); ImageView itemImgProduct = (ImageView) itemView.findViewById(R.id.img_product); TextView itemTvProductTitle = (TextView) itemView.findViewById(R.id.tv_product_title); TextView itemTvProductStyle = (TextView) itemView.findViewById(R.id.tv_product_style); TextView itemTvProductStatus = (TextView) itemView.findViewById(R.id.tv_product_status); TextView itemTvProductNum = (TextView) itemView.findViewById(R.id.tv_product_num); View line = itemView.findViewById(R.id.line_layout); UniversalImageLoader.displayImage(this, Util.getD2cProductPicUrl( items.get(i).getProductImg(), ScreenUtil.dip2px(48), ScreenUtil.dip2px(72)), itemImgProduct, R.mipmap.ic_logo_empty5, R.mipmap.ic_logo_empty5); itemTvProductTitle.setText(items.get(i).getProductName()); itemTvProductStyle.setText(getString(R.string.label_kongge, items.get(i).getColor(), items.get(i).getSize())); itemTvProductStatus.setText(getString(R.string.label_final_price, Util.getNumberFormat(items.get(i).getActualAmount()))); itemTvProductNum.setText(getString(R.string.label_product_quantity, items.get(i).getQuantity())); line.setVisibility(View.VISIBLE); llItemsContainer.addView(itemView); } allItemAmount = priceBuilder.toString(); allItemId = idBuilder.toString(); etMoney.setHint(getString(R.string.hint_refund_money, Util.getNumberFormat(actualAmount + otherAmount, false))); } public void showPop() { if (photos.contains(emptyPic)) { photos.remove(emptyPic); } PackageManager pkgManager = getPackageManager(); boolean cameraPermission = pkgManager.checkPermission(Manifest.permission.CAMERA, getPackageName()) == PackageManager.PERMISSION_GRANTED; if (Build.VERSION.SDK_INT >= 23 && !cameraPermission) { requestPermission(); } else { choosePic(); } } private void requestPermission() { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, Constants.RequestCode.REQUEST_PERMISSION); } private void choosePic() { Matisse.from(RefundReshipActivity.this) .choose(MimeType.of(MimeType.JPEG, MimeType.PNG)) .theme(R.style.Matisse_Dracula) .countable(true) .capture(true) .captureStrategy( new CaptureStrategy(true, "com.d2cmall.buyer.fileprovider")) .maxSelectable(maxSelected) .gridExpectedSize(ScreenUtil.dip2px(120)) .restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) .thumbnailScale(0.85f) .imageEngine(new GlideEngine()) .forResult(456); } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { if (requestCode == Constants.RequestCode.REQUEST_PERMISSION) { if ((grantResults.length == 2 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED)) { choosePic(); } } else { super.onRequestPermissionsResult(requestCode, permissions, grantResults); } } private void initTypeInfo() { TitleUtil.setBack(this); if (type == 0) {//退货退款 rlNumProduct.setVisibility(View.VISIBLE); TitleUtil.setTitle(this, R.string.label_reship_info); tvReasonLabel.setText(R.string.label_reship_reason); etCount.setHint(String.format(getString(R.string.hint_refund_count), String.valueOf(bean.getQuantity()))); //申请金额根据用户所填退货件数变化 if(bean.getQuantity()==1){ etCount.setText("1"); etCount.setFocusable(false); } if(bean.getQuantity()>1){ TextWatcher textWatcher = 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) { if(!Util.isEmpty(etCount.getText().toString())){ Integer applyCount = Integer.valueOf(etCount.getText().toString()); if(applyCount!=null && bean.getQuantity() > applyCount && applyCount>0){ etMoney.setText(Util.getNumberFormat((bean.getActualAmount()*applyCount)/bean.getQuantity())); }else{ etMoney.setText(Util.getNumberFormat(bean.getActualAmount())); } if(applyCount!=null && (applyCount<=0 || applyCount>bean.getQuantity())){ etCount.setText(bean.getQuantity()+""); etMoney.setText(Util.getNumberFormat(bean.getActualAmount())); } }else{ etMoney.setText(Util.getNumberFormat(bean.getActualAmount())); } } @Override public void afterTextChanged(Editable editable) { } }; etCount.addTextChangedListener(textWatcher); } if (!"COD".equals(paymentType)) { statusLayout.setVisibility(View.VISIBLE); statusLineView.setVisibility(View.VISIBLE); } else { statusLayout.setVisibility(View.GONE); statusLineView.setVisibility(View.GONE); } etMoney.setText(Util.getNumberFormat(bean.getActualAmount())); etMoney.setFocusable(false); // tvMoneyLabel.setText(R.string.label_reship_money); // tvRemarkLabel.setText(R.string.label_reship_remark); singleSelectPop = new SingleSelectPop(this, getResources().getStringArray(R.array.label_exchange_titles)); } else {//退款 if (statusCode >= 2 && statusCode < 8) { radioGroup.setVisibility(View.VISIBLE); rbs = new ArrayList<>(); rbs.add(rbAll); rbs.add(rbFreight); rbs.add(rbGapPrice); radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.rb_all://退全款 changeRbStatus(checkedId); allRefund = 1; break; case R.id.rb_gap_price: //退差价 changeRbStatus(checkedId); allRefund = -1; break; case R.id.rb_freight: //退差价 changeRbStatus(checkedId); allRefund = -2; break; } } }); } TitleUtil.setTitle(this, R.string.label_refund_info); tvReasonLabel.setText(R.string.label_refund_reason); tvMoneyProduct.setText("退款金额"); rlNumProduct.setVisibility(View.GONE); statusLayout.setVisibility(View.GONE); statusLineView.setVisibility(View.GONE); // if (!"COD".equals(paymentType)) { // tvLabel.setText(reminded); // } else { // tvLabel.setText(R.string.label_is_cod); // } // tvMoneyLabel.setText(R.string.label_refund_money); // tvRemarkLabel.setText(R.string.label_refund_remark); singleSelectPop = new SingleSelectPop(this, getResources().getStringArray(R.array.label_refund_titles)); } singleSelectPop.setCallBack(this); etMoney.setHint(getString(R.string.hint_refund_money, Util.getNumberFormat(actualAmount, false))); } //改变rb的显示状态 private void changeRbStatus(int checkedId) { if (rbs == null) { return; } for (int i = 0; i < rbs.size(); i++) { if (checkedId == rbs.get(i).getId()) { rbs.get(i).setBackgroundResource(R.drawable.sp_round4_stroke_red); rbs.get(i).setTextColor(getResources().getColor(R.color.color_red)); } else { rbs.get(i).setBackgroundResource(R.drawable.sp_round4_stroke_black3); rbs.get(i).setTextColor(getResources().getColor(R.color.trans_50_color_black)); } } } @OnClick({R.id.back_iv, R.id.received_layout, R.id.unreceived_layout, R.id.title_right, R.id.tv_back_desc}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.back_iv: finish(); break; case R.id.received_layout: isReceived = true; ivReceived.setImageResource(R.mipmap.icon_shopcart_aselected); ivUnreceived.setImageResource(R.mipmap.icon_shopcart_unaselected); break; case R.id.unreceived_layout: isReceived = false; ivReceived.setImageResource(R.mipmap.icon_shopcart_unaselected); ivUnreceived.setImageResource(R.mipmap.icon_shopcart_aselected); break; case R.id.title_right: toChat(); break; case R.id.tv_back_desc: //退款说明 Util.urlAction(RefundReshipActivity.this, "http://d2cmall.com/page/refunds"); break; } } private class ViewHolder { View addView; View deleteView; ImageView imageView; } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { JsonPic jsonPic = (JsonPic) parent.getAdapter().getItem(position); if (jsonPic != null) { if (Util.isEmpty(jsonPic.getMediaPath())) { showPop(); } } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 456) { if (resultCode == RESULT_OK) { for (String string : Matisse.obtainPathResult(data)) { JsonPic jsonPic = new JsonPic(); jsonPic.setMediaPath(string); photos.add(jsonPic); jsonPics.add(jsonPic); } if (!photos.contains(emptyPic) && jsonPics.size() < 3) { photos.add(emptyPic); } if (jsonPics.size() >= 3 && photos.contains(emptyPic)) { photos.remove(emptyPic); } maxSelected = 3 - jsonPics.size(); adapter.notifyDataSetChanged(); } else { if (!photos.contains(emptyPic) && jsonPics.size() < 3) { photos.add(emptyPic); } } } super.onActivityResult(requestCode, resultCode, data); } @Override public void setViewValue(View view, JsonPic jsonPic, int position) { ViewHolder holder = (ViewHolder) view.getTag(); if (holder == null) { holder = new ViewHolder(); holder.addView = view.findViewById(R.id.add_btn); holder.deleteView = view.findViewById(R.id.delete); holder.imageView = (ImageView) view.findViewById(R.id.image); view.getLayoutParams().width = imageSize; view.getLayoutParams().height = imageSize; view.setTag(holder); } if (Util.isEmpty(jsonPic.getMediaPath())) { holder.imageView.setVisibility(View.GONE); holder.deleteView.setVisibility(View.GONE); holder.addView.setVisibility(View.VISIBLE); } else { holder.addView.setVisibility(View.GONE); holder.imageView.setVisibility(View.VISIBLE); holder.deleteView.setVisibility(View.VISIBLE); holder.deleteView.setOnClickListener(new OnPhotoDeleteClickListener(jsonPic)); Glide.with(this) .load(Uri.fromFile(new File(jsonPic.getMediaPath()))) .error(R.mipmap.ic_default_pic) .into(holder.imageView); } } @OnClick(R.id.reason_layout) void onClick() { showPopupMenu(tvReasonLabel); } private List<String> reshipList = new ArrayList<>(); private void initReshipList() { reshipList.add("商品需要维修"); reshipList.add("收到商品破损"); reshipList.add("商品错发/漏发"); reshipList.add("收到商品描述不符"); reshipList.add("商品质量问题"); reshipList.add("七天无理由退货"); } private void showPopupMenu(View view) { if (type == 0) { selectPromotionPop = new SelectReasonPop(this, reshipList, tvReasonLabel.getText().toString()); selectPromotionPop.setTitle("退货退款原因"); selectPromotionPop.setDissMissListener(new TransparentPop.DismissListener() { @Override public void dismissStart() { } @Override public void dismissEnd() { if (!Util.isEmpty(selectPromotionPop.getPromotion())) { tvReason.setText(selectPromotionPop.getPromotion()); getParams(selectPromotionPop.getPosition()); } } }); selectPromotionPop.show(tvReasonLabel); } else { selectPromotionPop = new SelectReasonPop(this, refundList, tvReasonLabel.getText().toString()); selectPromotionPop.setTitle("退款原因"); selectPromotionPop.setDissMissListener(new TransparentPop.DismissListener() { @Override public void dismissStart() { } @Override public void dismissEnd() { if (!Util.isEmpty(selectPromotionPop.getPromotion())) { tvReason.setText(selectPromotionPop.getPromotion()); getParams(selectPromotionPop.getPosition()); } } }); selectPromotionPop.show(tvReasonLabel); } } private List<String> refundList = new ArrayList<>(); private void initRefundList() { refundList.add("拍错了"); refundList.add("不想要了"); refundList.add("商品缺货"); refundList.add("协商一致退款"); refundList.add("订单信息错误"); } private void getParams(int index) { buttonEnableOrNot(); if (type == 0) {//退货退款 switch (index) { case 0: reason = "repair"; break; case 1: reason = "damaged"; break; case 2: reason = "wrong"; break; case 3: reason = "not"; break; case 4: reason = "quality"; break; case 5: reason = "noReason"; break; } } else {//退款 switch (index) { case 0: reason = "wrong"; break; case 1: reason = "no"; break; case 2: reason = "stock"; break; case 3: reason = "consensus"; break; case 4: reason = "error"; break; } } } @OnClick(R.id.btn_apply) void onApply() { hideKeyboard(null); money = etMoney.getText().toString().trim(); remark = etRemark.getText().toString().trim(); if (Util.isEmpty(money)) { Util.showToast(this, "请输入金额"); return; } if (Util.isEmpty(reason)) { Util.showToast(this, "请选择退货退款原因"); return; } if(money.contains(",")){ money = money.replaceAll(",",""); } double moneyDouble = Double.parseDouble(money); if (moneyDouble > actualAmount + otherAmount) { Util.showToast(this, R.string.msg_apply_money_limit); return; } // if ("COD".equals(paymentType)) { // if (Util.isEmpty(alipayAccount)) { // Util.showToast(this, R.string.msg_alipay_account_empty); // return; // } // if (Util.isEmpty(alipayName)) { // Util.showToast(this, R.string.msg_alipay_name_empty); // return; // } // if (alipayAccount.length() > 20) { // Util.showToast(this, R.string.msg_alipay_account_error); // return; // } // if (alipayName.length() < 2 || alipayName.length() > 10) { // Util.showToast(this, R.string.msg_alipay_name_error); // return; // } // } if (remark.length() > 100) { Util.showToast(this, R.string.msg_mark_error); return; } if ((reason.equals("repair") || reason.equals("damaged") || reason.equals("quality")) && jsonPics.isEmpty()) { Util.showToast(this, "请上传图片凭证"); return; } loadingDialog.show(); if (!jsonPics.isEmpty()) { upLoadIndex = 0; uploadFile(); } else { requestTask(); } } private class OnPhotoDeleteClickListener implements View.OnClickListener { private JsonPic jsonPic; private OnPhotoDeleteClickListener(JsonPic jsonPic) { this.jsonPic = jsonPic; } @Override public void onClick(View v) { photos.remove(jsonPic); jsonPics.remove(jsonPic); maxSelected = 3 - jsonPics.size(); if (!photos.contains(emptyPic)) { photos.add(emptyPic); } adapter.notifyDataSetChanged(); } } private TextWatcher textWatcher = new TextWatcher() { public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { buttonEnableOrNot(); } public void afterTextChanged(Editable s) { } }; private void requestTask() { if (type == 0) { PostReshipApi api = new PostReshipApi(); //api.setQuantity(quantity); if (!Util.isEmpty(etCount.getText().toString())) { api.setReceiveQuantity(Integer.valueOf(etCount.getText().toString())); } else { api.setReceiveQuantity((int) quantity); } api.setOrderItemId(orderItemId); if (Util.isEmpty(reason)) { Util.showToast(RefundReshipActivity.this, "请选择退款原因"); return; } else { api.setReshipReason(reason); } api.setApplyAmount(money); if (!"COD".equals(paymentType)) { if (isReceived) { api.setReceived(1); } else { api.setReceived(0); } } else { api.setBackAccountSn(alipayAccount); api.setBackAccountName(alipayName); } api.setEvidences(Util.join(imgUpyunPaths.toArray(), ",")); api.setMemo(remark); D2CApplication.httpClient.loadingRequest(api, new BeanRequest.SuccessListener<BaseBean>() { @Override public void onResponse(BaseBean baseBean) { loadingDialog.dismiss(); Util.showToast(RefundReshipActivity.this, baseBean.getMsg()); // if (intentFlag == 0) { // Intent intent = new Intent(RefundReshipActivity.this, MyOrderActivity.class); // startActivity(intent); // } else { // Intent intent = new Intent(RefundReshipActivity.this, OrderDetailActivity.class); // intent.putExtram ("orderSn", orderSn); // startActivity(intent); // } Intent intent = new Intent();//跳转到退货 intent.putExtra("position", 0); setResult(RESULT_OK, intent); finish(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { loadingDialog.dismiss(); Util.showToast(RefundReshipActivity.this, Util.checkErrorType(error)); } }); } else { PostRefundApi api = new PostRefundApi(); // if (!Util.isEmpty(etCount.getText().toString())) { // api.setQuantity(Integer.valueOf(etCount.getText().toString())); // } else { // api.setQuantity((int) quantity); // } api.setAllRefund(allRefund); api.setOrderItemId(orderItemId); api.setApplyAmount(money); if (Util.isEmpty(reason)) { Util.showToast(RefundReshipActivity.this, "请选择退款原因"); return; } else { api.setRefundReason(reason); } // if ("COD".equals(paymentType)) { // api.setBackAccountSn(alipayAccount); // api.setBackAccountName(alipayName); // } api.setEvidences(Util.join(imgUpyunPaths.toArray(), ",")); api.setMemo(remark); D2CApplication.httpClient.loadingRequest(api, new BeanRequest.SuccessListener<BaseBean>() { @Override public void onResponse(BaseBean baseBean) { loadingDialog.dismiss(); Util.showToast(RefundReshipActivity.this, baseBean.getMsg()); EventBus.getDefault().post(new GlobalTypeBean(Constants.GlobalType.APPLY_AFTER)); // if (intentFlag == 0) { // Intent intent = new Intent(RefundReshipActivity.this, MyOrderActivity.class); // startActivity(intent); // } else { // Intent intent = new Intent(RefundReshipActivity.this, OrderDetailActivity.class); // intent.putExtra("orderSn",orderSn); // startActivity(intent); // } Intent intent = new Intent(); intent.putExtra("position", 2); setResult(RESULT_OK, intent); finish(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { loadingDialog.dismiss(); Util.showToast(RefundReshipActivity.this, Util.checkErrorType(error)); } }); } } private void buttonEnableOrNot() { boolean reasonTyped = tvReason.getText().length() > 0; boolean isMoney = false; if (!Util.isEmpty(etMoney.getText().toString())) { String amount = etMoney.getText().toString(); if(amount.contains(",")){ amount = amount.replaceAll(",",""); } double moneyDouble = Double.parseDouble(amount); if (moneyDouble > 0) { isMoney = true; } } // if ("COD".equals(paymentType)) { // if (reasonTyped && alipayAccountTyped && alipayNameTyped && isMoney) { // btnApply.setEnabled(true); // } else { // btnApply.setEnabled(false); // } // } else { // if (reasonTyped && isMoney) { // btnApply.setEnabled(true); // } else { // btnApply.setEnabled(false); // } // } } private void uploadFile() { UserBean.DataEntity.MemberEntity user = Session.getInstance().getUserFromFile(this); JsonPic jsonPic = jsonPics.get(upLoadIndex); File file = new File(jsonPic.getMediaPath()); final Map<String, Object> paramsMap = new HashMap<>(); paramsMap.put(Params.BUCKET, Constants.UPYUN_SPACE); paramsMap.put(Params.SAVE_KEY, Util.getUPYunSavePath(user.getId(), Constants.TYPE_CUSTOMER)); paramsMap.put(Params.RETURN_URL, "httpbin.org/post"); UpCompleteListener completeListener = new UpCompleteListener() { @Override public void onComplete(boolean isSuccess, String result) { try { JSONObject jsonObject = new JSONObject(result); imgUpyunPaths.add(jsonObject.optString("url")); } catch (JSONException e) { } upLoadIndex++; if (upLoadIndex < jsonPics.size()) { uploadFile(); } else { requestTask(); } } }; SignatureListener signatureListener = new SignatureListener() { @Override public String getSignature(String raw) { return UpYunUtils.md5(raw + Constants.UPYUN_KEY); } }; UploadManager.getInstance().blockUpload(file, paramsMap, signatureListener, completeListener, null); } @Override public void callback(View trigger, int index, String value) { tvReason.setText(value); buttonEnableOrNot(); if (type == 0) {//退货退款 switch (index) { case 0: reason = "repair"; break; case 1: reason = "damaged"; break; case 2: reason = "wrong"; break; case 3: reason = "not"; break; case 4: reason = "quality"; break; case 5: reason = "noReason"; break; } } else {//退款 switch (index) { case 0: reason = "wrong"; break; case 1: reason = "no"; break; case 2: reason = "stock"; break; case 3: reason = "consensus"; break; case 4: reason = "error"; break; } } } private void toChat() { String title = "线上客服"; String url = "http://www.d2cmall.com"; ConsultSource source = new ConsultSource(url, title, "售后详情"); source.groupId = Constants.QIYU_AF_GROUP_ID; source.robotFirst = true; Unicorn.openServiceActivity(this, "D2C客服", source); //合力亿捷 // Intent intent = new Intent(this,CustomServiceActivity.class); // intent.putExtra("skillGroupId",Constants.HLYJ_BF_AF_GROUP_ID); // startActivity(intent); } }
[ "940258169@qq.com" ]
940258169@qq.com
b3dfdc7b289a4c80e799b139f94b9cf5c822e7ce
6816462670c067a360582c0780429bfbc1b4195b
/service-user/src/main/java/com/luotao/demo/zipkin/service/OrderServiceImpl.java
73609ca5729db7e26d0f08532bc72326d9e8d52e
[]
no_license
abcde10156/dubbo-zipkin-demo
6c3ea242ea00720104b5700fd075a85dfcc654f3
e282e89a8b7e843eeb28468e2b8679e7927e057b
refs/heads/master
2020-03-20T21:05:38.056952
2018-06-18T07:47:04
2018-06-18T07:47:04
137,723,461
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package com.luotao.demo.zipkin.service; import com.luotao.demo.dubbozipkin.request.RequestLong; import com.luotao.demo.dubbozipkin.response.ResponseOrder; import org.springframework.stereotype.Service; import java.util.LinkedHashMap; import java.util.Map; /** * User: luotao-pc * Date: 2018/6/16 * Time: 14:54 */ @Service("orderService") public class OrderServiceImpl implements OrderService { @Override public ResponseOrder findOrder(RequestLong id) { if (id.getId().equals(101L)) { try { Thread.currentThread().sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } } String time = "_" + System.currentTimeMillis(); ResponseOrder responseOrder = new ResponseOrder(); responseOrder.setOrderName("name" + time); responseOrder.setOrderType("type" + time); return responseOrder; } }
[ "luotao@okay.cn" ]
luotao@okay.cn
b956946209770742b9b46d9a7ce9058fba2723e6
46d8584ea10af86dc69f3ec85cc3fcc08f4b4b10
/app/src/main/java/news/syj/com/activity/MainActivity.java
8ddb5d516dd35811ae1ec4e5a2112c8cbd9177e9
[]
no_license
shayajie/MyNewsApplication
7d0bf4d29e8c45d05a5ad7fa62bb6a18d7e5e124
d2e407684674ce95e947770f56429a2bbbf86c8f
refs/heads/master
2021-01-17T20:31:06.425193
2016-07-18T09:05:22
2016-07-18T09:05:22
63,029,046
0
0
null
null
null
null
UTF-8
Java
false
false
1,272
java
package news.syj.com.activity; import android.content.Intent; import android.support.annotation.Nullable; import android.support.design.widget.TabLayout; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import news.syj.com.R; import news.syj.com.utils.UmengManager; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override protected void onResume() { super.onResume(); UmengManager.onResume(this); } @Override protected void onPause() { super.onPause(); UmengManager.onPause(this); } }
[ "1045070573@qq.com" ]
1045070573@qq.com
e90f8b0a3a99ab0c69d4f9c3bebadf7d59ffcdf8
e76195b0b532f39210a09b28e615638b6ef633e3
/src/main/java/cn/com/boe/b5/fwp/poserver/model/TradeUnionFund.java
8c8c2eb9bc1e367778ab5b4360a58e25a6daecc5
[]
no_license
triple-golds/po-server
a0ba5a9816feddae6a8ccf92e58c912430f7a4c5
b217f8b159b703f0a3da7df564733394fb11a97d
refs/heads/master
2022-11-22T22:55:49.899596
2020-07-27T09:37:23
2020-07-27T09:37:23
281,907,136
0
0
null
null
null
null
UTF-8
Java
false
false
3,200
java
package cn.com.boe.b5.fwp.poserver.model; import com.fasterxml.jackson.annotation.JsonFormat; import javax.persistence.*; import java.util.Date; //阳光基金 @Entity public class TradeUnionFund { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; //员工编号 private String code; //姓名 private String name; //性别 private String sex; //年龄 private String age; //个人月收入 private String salary; //家庭人口数 private String people; //入司日期 // @JsonFormat(pattern = "yyyy-MM-dd") private Date entryDate; //科室岗位 private String department; //公司慰问次数 private String sympathyTimes; //联系方式 private String phone; //双职工配偶姓名 private String coupleName; //配偶员工编号 private String coupleCode; //出现困难主要原因 private String reason; //所属工会小组 @ManyToOne private TradeUnionTeam team; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; } public String getAge() { return age; } public void setAge(String age) { this.age = age; } public String getSalary() { return salary; } public void setSalary(String salary) { this.salary = salary; } public String getPeople() { return people; } public void setPeople(String people) { this.people = people; } public Date getEntryDate() { return entryDate; } public void setEntryDate(Date entryDate) { this.entryDate = entryDate; } public String getDepartment() { return department; } public void setDepartment(String department) { this.department = department; } public String getSympathyTimes() { return sympathyTimes; } public void setSympathyTimes(String sympathyTimes) { this.sympathyTimes = sympathyTimes; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getCoupleName() { return coupleName; } public void setCoupleName(String coupleName) { this.coupleName = coupleName; } public String getCoupleCode() { return coupleCode; } public void setCoupleCode(String coupleCode) { this.coupleCode = coupleCode; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public TradeUnionTeam getTeam() { return team; } public void setTeam(TradeUnionTeam team) { this.team = team; } }
[ "yangxinyx@boe.com.cn" ]
yangxinyx@boe.com.cn
0f19cd84dc0996f37329b3be49c59474ede2e676
7abf3e0d525c8b3700f3f05751eedef953a9eef7
/src/ReverseWords.java
7651d7be3984c455fb6c63c214cc8526dd0e3819
[]
no_license
panbowen/LeetCodeOnlineJudge
40cb07bfbf132896a8dfe88986692c04040f222b
39d9406f76121af373e335f7dec281d9b6d72b0f
refs/heads/master
2016-09-06T00:07:02.672823
2015-08-02T14:12:35
2015-08-02T14:12:35
17,144,477
0
0
null
null
null
null
UTF-8
Java
false
false
556
java
public class ReverseWords { public static String reverseWords(String s) { int len = s.length(); if (len == 0 || len == 1) return s; String[] temp = s.split(" "); StringBuilder sb = new StringBuilder(); for (int i = temp.length -1; i>=0 ; i--){ if(!temp[i].equals("")) sb.append(temp[i]).append(" "); } return sb.length() == 0? "":sb.substring(0, sb.length()-1); } public static void main(String[] args){ String s = "the sky is blue"; System.out.println(reverseWords(s)); } }
[ "pbwpbw2008@yahoo.com" ]
pbwpbw2008@yahoo.com
942ae8af2811aafdd7bbdc0d636b8e92717c5862
e6004aeba5c82481407b3f487dfb45095453cad2
/app/src/main/java/org/d3ifcool/finpro/core/mediators/interfaces/prodi/ProdiDetailActivityMediator.java
776d66f3c32a62b51f79743218d07851f6dda159
[]
no_license
haryandrafatwa/TA
869f997e9e8d32114e868110335a271e5e3c550e
da2c3646211a5e6d987c4ce2520c8d7a6975fd63
refs/heads/master
2023-07-11T09:45:00.992567
2021-08-10T08:12:39
2021-08-10T08:12:39
357,818,086
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package org.d3ifcool.finpro.core.mediators.interfaces.prodi; import android.app.ProgressDialog; import androidx.annotation.IdRes; import org.d3ifcool.finpro.core.models.Mahasiswa; import org.d3ifcool.finpro.core.models.Plotting; public interface ProdiDetailActivityMediator { void Notify(@IdRes int id); void message(String event); ProgressDialog getProgressDialog(); Mahasiswa getMahasiswa(); void setPlotting(Plotting plotting); }
[ "haryandrafatwa010@gmail.com" ]
haryandrafatwa010@gmail.com
b3947ed15280fa21605919863ff837f92d6f1699
88cbed379abcf6e415a37131b4ed61a911896235
/src/main/java/problem/solution/model/BNode.java
3370aea803beef786751144a659cf0a15b79cb39
[]
no_license
ADiligentMan/Practice
bc4a494cd359785fd5874cb053d83321d2bf3a15
7d6da50bcc0d5ec3b8e2e8398fc061c23baf4512
refs/heads/master
2021-08-03T22:04:44.904911
2021-07-22T14:38:05
2021-07-22T14:38:05
157,845,821
0
0
null
2020-10-13T21:50:24
2018-11-16T09:41:04
Java
UTF-8
Java
false
false
173
java
package problem.solution.model; /** * @author wangpeng * @since 2021-01-26 */ public class BNode { public int value; public BNode left; public BNode right; }
[ "1003638818@qq.com" ]
1003638818@qq.com
23f7b799e923e68c080b16f23c0e1fbf579ed5e1
c4b5e9c9de96168b23c3709ecc79ff3dcbd5f56e
/src/main/java/com/subhamsql/mysqljpa/dao/UserRepository.java
ee6ac8c7c16e565851c0574ee499ffe031f50d4e
[]
no_license
subhambhardwaj/jpa-mysql-database
3a535c8dc995b09cb73b698b8f469b42036d1681
b09ef001bdad8e063f0977593c60238ce63a36a2
refs/heads/master
2022-12-05T13:39:40.511225
2020-08-31T15:37:18
2020-08-31T15:37:18
291,044,021
0
0
null
null
null
null
UTF-8
Java
false
false
363
java
package com.subhamsql.mysqljpa.dao; import com.subhamsql.mysqljpa.model.User; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; import java.util.Set; public interface UserRepository extends JpaRepository<User, String> { Set<User> findByEmailContaining (String email); List<User> findByNameContaining(String name); }
[ "you@example.com" ]
you@example.com
6ea210d4571d8e5d205cf88d65175f2705b11c8d
512ff7e33759e38f7d395218857e5549c107cc6c
/app/src/main/java/com/github/codetanzania/feature/logincitizen/OTPVerificationActivity.java
fd0c32c409f40acbd9c342be2f68db02642de678
[]
no_license
krtonga/mwauwasa
26d011a6de9870444dc419bd3f40306092a79b15
c2703bf3e013f07585d46de0c3312be407ce9496
refs/heads/master
2020-03-20T21:26:28.588088
2018-06-21T08:13:14
2018-06-21T08:13:14
137,740,858
1
0
null
null
null
null
UTF-8
Java
false
false
10,477
java
package com.github.codetanzania.feature.logincitizen; import android.Manifest; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.graphics.Color; import android.os.Bundle; import android.os.CountDownTimer; import android.support.annotation.NonNull; import android.support.design.widget.TextInputEditText; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.github.codetanzania.core.api.Open311Api; import com.github.codetanzania.feature.home.MainActivity; import com.github.codetanzania.open311.android.library.models.Reporter; import com.github.codetanzania.util.LocalTimeUtils; import com.github.codetanzania.util.SmsUtils; import com.github.codetanzania.util.Util; import java.util.HashMap; import java.util.Map; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import tz.co.codetanzania.BuildConfig; import tz.co.codetanzania.R; public class OTPVerificationActivity extends AppCompatActivity implements Callback<ResponseBody>, DialogInterface.OnCancelListener, DialogInterface.OnClickListener, SmsVerificationBroadcastReceiver.OnVerificationResult, View.OnClickListener, TextWatcher { private static final String TAG = "OTPVerification"; private static final int SMS_PERMISSION_CODE = 0; // reference to the views private TextView tvCountDown; private TextView tvOtpTitle; private TextInputEditText tilVerificationCode; private Button btnRetry; private Button btnCancel; // Constants used by the timer private static long VERIFICATION_TIMEOUT = 60000; private static final int UPDATE_INTERVAL = 1000; private long mCurrentTick = VERIFICATION_TIMEOUT; /* broadcast receiver for the SMSs */ private SmsVerificationBroadcastReceiver mSmsReceiver; private String mVerificationCode; private CountDownTimer mCountDownTimer; /* CountDown timer to keep track of the number of second remains until the request is cancelled */ private CountDownTimer getCountDownTimer() { return new CountDownTimer(mCurrentTick, UPDATE_INTERVAL) { @Override public void onTick(long l) { tvCountDown.setText(LocalTimeUtils .formatCountDown(l, LocalTimeUtils.FMT_MM_SS)); mCurrentTick = l; } @Override public void onFinish() { if (!PhoneVerificationUtils.isVerified( OTPVerificationActivity.this)) { showOptions(); } } }; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_otp_verification); initViews(); Log.d(TAG, "VISITED"); if (mSmsReceiver == null) { mSmsReceiver = new SmsVerificationBroadcastReceiver(); registerReceiver(mSmsReceiver, new IntentFilter("android.provider.Telephony.SMS_RECEIVED")); } mSmsReceiver.setOnVerificationResult(this); bootstrapVerification(); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "onResume: " + mCurrentTick); // Log.d(TAG, "onResume: "); mCountDownTimer = getCountDownTimer(); mCountDownTimer.start(); } @Override public void onPause() { if (mCountDownTimer != null) { mCountDownTimer.cancel(); } super.onPause(); } @Override public void onDestroy() { if (mSmsReceiver != null) { unregisterReceiver(mSmsReceiver); mSmsReceiver = null; } super.onDestroy(); } private void initViews() { tvOtpTitle = (TextView) findViewById(R.id.tv_OtpTitle); tvCountDown = (TextView) findViewById(R.id.tv_OtpCountDown); tilVerificationCode = (TextInputEditText) findViewById(R.id.til_VerificationCode); btnRetry = (Button) findViewById(R.id.btn_OtpRetry); btnCancel = (Button) findViewById(R.id.btn_ChangeNumber); btnRetry.setOnClickListener(this); btnCancel.setOnClickListener(this); tilVerificationCode.addTextChangedListener(this); } private void showOptions() { btnRetry.setVisibility(View.VISIBLE); btnCancel.setVisibility(View.VISIBLE); } private void bootstrapVerification() { // generate and store random code mVerificationCode = PhoneVerificationUtils.getRandomVerificationCode(); PhoneVerificationUtils.storeVerificationCode(this, mVerificationCode); // initialize broadcast receiver if (hasReadSmsPermission()) { // send verification code using SMS transporter [presumably, EGA] SmsUtils.sendVerificationCode(getApplicationContext(), mVerificationCode, this); } else { showPermitClarificationDialog(); } } private boolean hasReadSmsPermission() { return ContextCompat.checkSelfPermission( this, Manifest.permission.READ_SMS) == PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission( this, Manifest.permission.RECEIVE_SMS) == PackageManager.PERMISSION_GRANTED; } private void requestReadSmsPermission() { ActivityCompat.requestPermissions(this, new String[]{ Manifest.permission.READ_SMS, Manifest.permission.RECEIVE_SMS }, SMS_PERMISSION_CODE); } private void showMessage(String msg) { tilVerificationCode.setText(msg); tilVerificationCode.setTextColor(Color.parseColor("#262626")); } private void showPermitClarificationDialog() { int msgId = R.string.msg_reason_to_read_sms; int txtGrant = R.string.text_grant_read_sms_permission; int txtDeny = R.string.text_deny_read_sms_permission; AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setMessage(msgId) .setPositiveButton(txtGrant, this) .setNegativeButton(txtDeny, this) .create().show(); tvOtpTitle.setText(R.string.title_otp_requesting_permission); tilVerificationCode.setVisibility(View.INVISIBLE); } private void exitApplication() { android.os.Process.killProcess(android.os.Process.myPid()); } @Override public void onRequestPermissionsResult( int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case SMS_PERMISSION_CODE: { // If request is cancelled, the result arrays are empty. if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // send verification code using SMS transporter [presumably, EGA] SmsUtils.sendVerificationCode(getApplicationContext(), mVerificationCode, this); } else { // show dialog message before quiting exitApplication(); } } } } @Override public void onResponse( @NonNull Call<ResponseBody> call, @NonNull Response<ResponseBody> response) { // if (response.isSuccessful()) { // mCountDownTimer.start(); // } } @Override public void onFailure( Call<ResponseBody> call, Throwable t) { Toast.makeText(this, R.string.error_delivering_sms, Toast.LENGTH_SHORT).show(); showOptions(); } @Override public void onCancel(DialogInterface dialog) { // there's no need now! exitApplication(); } @Override public void onClick(DialogInterface dialog, int which) { if (which == DialogInterface.BUTTON_POSITIVE) { requestReadSmsPermission(); dialog.dismiss(); } else if (which == DialogInterface.BUTTON_NEGATIVE) { exitApplication(); } } @Override public void onVerificationSuccessful(String message, boolean userAction) { PhoneVerificationUtils.setVerified(this, true); if (!userAction) { showMessage(message); } // start another activity and finish this. // As a result, this will call our onPause, causing the activity // to tear down, which includes stopping the timer and // un-registering the broadcast receiver. startActivity(new Intent(this, MainActivity.class)); } @Override public void onVerificationFailed() { // Show option buttons [retry|quit] showOptions(); } @Override public void onClick(View v) { switch(v.getId()) { case R.id.btn_OtpRetry: recreate(); break; case R.id.btn_ChangeNumber: startActivity(new Intent(this, UserDetailsActivity.class)); finish(); break; } } @Override public void beforeTextChanged( CharSequence s, int start, int count, int after) { } @Override public void onTextChanged( CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { // manual verification if (!TextUtils.isEmpty(s)) { if (s.toString().equals(mVerificationCode)) { tilVerificationCode.setError(null); onVerificationSuccessful(mVerificationCode, true); } else { if (s.length() >= 4) { tilVerificationCode.setError(getString(R.string.text_invalid_verification_code)); } else { tilVerificationCode.setError(null); } } } } }
[ "kristen.tonga@gmail.com" ]
kristen.tonga@gmail.com
d9f3cbe2b652d28f23dd9307475f775104126424
cc483e31e0049ac9652dfe9c543164e5fed02c7e
/ultravioletZx/src/main/java/org/ultraviolet/spectrum/z80/Z80.java
a2603377024821dca359d80c8451aa1bfcf779e0
[]
no_license
ultravioletemulator/ultravioletZx
549475b2ab2afd5fb424658eded92216d56e1966
82a0774fa27c4937711f2bdbc10f75dcec70a28d
refs/heads/master
2021-07-02T20:35:17.968160
2017-09-22T12:09:29
2017-09-22T12:09:29
104,324,110
0
0
null
null
null
null
UTF-8
Java
false
false
7,746
java
package org.ultraviolet.spectrum.z80; import org.apache.commons.lang3.builder.ToStringBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.ultraviolet.spectrum.core.Masks; import org.ultraviolet.spectrum.machines.Machine; /** * Created by developer on 21/09/2017. */ public class Z80 { //Registers // A,B,C,D,E 8-bit registers // AF 16-bit register containing A and flags // BC 16-bit register containing B and C // DE 16-bit register containing D and E // HL 16-bit register used for addressing // F 8-bit Flag register // I 8-bit Interrupt Page address register // IX,IY 16-bit index registers // PC 16-bit Program Counter register // R 8-bit Memory Refresh register // SP 16-bit Stack Pointer register // 8-bit registers A,B,C,D,E private byte regA; private byte regB; private byte regC; private byte regD; private byte regE; // 16Bits // private short regAF; // private short regBC; // private short regDE; private short regHL; // // 8-bit Flag register F //Bit 7 6 5 4 3 2 1 0 //Pos S Z X H X P/V N C // C carry Flag // N ann/subtract // P/V Parity/Overflow flag // H Half carry flag // Z Zero flag // S Sign flag // X Not used // private byte regF; // 8-bit Interrupt Page address register I // IFFs private byte regI; // 16-bit index registers IX,IY private short regIX; private short regIY; // PC 16-bit Program Counter register private short pc = 0; // 8-bit Memory Refresh register R private byte regR; // SP 16-bit Stack Pointer register private short sp; static final Logger logger = LoggerFactory.getLogger(Z80.class); public Z80() { } public Z80(byte regA, byte regB, byte regC, byte regD, byte regE, short regHL, byte regF, byte regI, short regIX, short regIY, short pc, byte regR, short sp) { this.regA = regA; this.regB = regB; this.regC = regC; this.regD = regD; this.regE = regE; this.regHL = regHL; this.regF = regF; this.regI = regI; this.regIX = regIX; this.regIY = regIY; this.pc = pc; this.regR = regR; this.sp = sp; } public byte getRegA() { return regA; } public void setRegA(byte regA) { this.regA = regA; } public byte getRegB() { return regB; } public void setRegB(byte regB) { this.regB = regB; } public byte getRegC() { return regC; } public void setRegC(byte regC) { this.regC = regC; } public byte getRegD() { return regD; } public void setRegD(byte regD) { this.regD = regD; } public byte getRegE() { return regE; } public void setRegE(byte regE) { this.regE = regE; } public short getRegAF() { return Z80.bytesToShort(regA, regF); } public void setRegAF(short regAF) { byte lo = (byte) (regAF & 0xff); byte hi = (byte) ((regAF >> 8) & 0xff); regA = hi; regF = lo; } public short getRegBC() { return Z80.bytesToShort(regB, regC); } public void setRegBC(short regBC) { byte lo = (byte) (regBC & 0xff); byte hi = (byte) ((regBC >> 8) & 0xff); regB = hi; regC = lo; } public short getRegDE() { return Z80.bytesToShort(regD, regE); } public void setRegDE(short regDE) { byte lo = (byte) (regDE & 0xff); byte hi = (byte) ((regDE >> 8) & 0xff); regD = hi; regE = lo; } public short getRegHL() { return regHL; } public void setRegHL(short regHL) { this.regHL = regHL; } public byte getRegF() { return regF; } public void setRegF(byte regF) { this.regF = regF; } public byte getRegI() { return regI; } public void setRegI(byte regI) { this.regI = regI; } public short getRegIX() { return regIX; } public void setRegIX(short regIX) { this.regIX = regIX; } public short getRegIY() { return regIY; } public void setRegIY(short regIY) { this.regIY = regIY; } public short getPc() { return pc; } public void setPc(short pc) { this.pc = pc; } public byte getRegR() { return regR; } public void setRegR(byte regR) { this.regR = regR; } public short getSp() { return sp; } public void setSp(short sp) { this.sp = sp; } public byte getCFlag() { return (byte) (this.regF & Masks.MASK_FLAG_C); } public byte getNFlag() { return (byte) (this.regF & Masks.MASK_FLAG_N); } public byte getPVFlag() { return (byte) (this.regF & Masks.MASK_FLAG_PV); } public byte gsetZFlag() { return (byte) (this.regF & Masks.MASK_FLAG_Z); } public byte getHFlag() { return (byte) (this.regF & Masks.MASK_FLAG_H); } public byte getSFlag() { return (byte) (this.regF & Masks.MASK_FLAG_S); } public void setCFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_C); } public void setNFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_N); } public void setPVFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_PV); } public void setZFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_Z); } public void setSFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_S); } public void setHFlag() { this.regF = (byte) (Masks.MASK_FLAG_H); } public void resetCFlag() { this.regF = (byte) (Masks.MASK_FLAG_C); } public void resetNFlag() { this.regF = (byte) (Masks.MASK_FLAG_N); } public void resetPVFlag() { this.regF = (byte) (Masks.MASK_FLAG_PV); } public void resetZFlag() { this.regF = (byte) (this.regF & Masks.MASK_FLAG_Z); } public void resetSFlag() { this.regF = (byte) (Masks.MASK_FLAG_S); } public void resetHFlag() { this.regF = (byte) (Masks.MASK_FLAG_H); } // C carry Flag // N ann/subtract // P/V Parity/Overflow flag // H Half carry flag // Z Zero flag // S Sign flag // X Not used @Override public String toString() { return ToStringBuilder.reflectionToString(this); } public static byte[] intToBytes(int x) { byte[] bytes = new byte[4]; for (int i = 0; x != 0; i++, x >>>= 8) { bytes[i] = (byte) (x & 0xFF); } return bytes; } public static byte setFlag(Machine machine, byte flags) { byte flagsPrev = machine.getZ80().getRegF(); byte flagsRes = (byte) (flagsPrev & flags); machine.getZ80().setRegF(flagsRes); return flagsRes; } public static int bytesToInt(byte[] arr, int off) { return arr[off] << 8 & 0xFF00 | arr[off + 1] & 0xFF; } // end of getInt public static short bytesToShort(byte hi, byte lo) { short val = (short) (((hi & 0xFF) << 8) | (lo & 0xFF)); return val; } public static byte[] shortToBytes(short x) { byte[] res = new byte[2]; res[0] = (byte) (x & 0xff); res[1] = (byte) ((x >> 8) & 0xff); return res; } private final static char[] hexArray = "0123456789ABCDEF".toCharArray(); public static String bytesToHex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.length; j++) { int v = bytes[j] & 0xFF; hexChars[j * 2] = hexArray[v >>> 4]; hexChars[j * 2 + 1] = hexArray[v & 0x0F]; } return new String(hexChars); } public static String byteToHex(byte bytes) { int v = bytes & 0xFF; int ind = v >>> 4; return "" + hexArray[ind]; } public static final byte[] hexFromString(final String s) { String[] v = s.split(" "); byte[] arr = new byte[v.length]; int i = 0; for (String val : v) { arr[i++] = Integer.decode("0x" + val).byteValue(); } return arr; } public void printStatus() { logger.debug("Pc: " + bytesToHex(shortToBytes(pc))); logger.debug("A: " + byteToHex(regA)); logger.debug("B: " + byteToHex(regB)); logger.debug("C: " + byteToHex(regC)); logger.debug("D: " + byteToHex(regD)); logger.debug("E: " + byteToHex(regE)); } }
[ "aalkorta.caf@gmail.com" ]
aalkorta.caf@gmail.com
be89415165bb38badbfd0d464b677cf474634951
912bc4335ce933982177ec34717efdc289827348
/src/main/java/com/example/docureader/model/I9/SubSection1AliensAuthorizedToWorkHelpPassportNum.java
1d06be09e1e69453d152bd1498677acff5365d5c
[]
no_license
Srujith/docureader
6bb426365a9d393d2335d370c74cba20d77e5a1c
3f141b9e401a40391eb66a5e923b9a91c1c177f4
refs/heads/master
2022-04-17T02:36:02.940567
2020-04-13T19:29:27
2020-04-13T19:29:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,217
java
package com.example.docureader.model.I9; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "dataNode" }) public class SubSection1AliensAuthorizedToWorkHelpPassportNum { @JsonProperty("dataNode") private String dataNode; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<String, Object>(); @JsonProperty("dataNode") public String getDataNode() { return dataNode; } @JsonProperty("dataNode") public void setDataNode(String dataNode) { this.dataNode = dataNode; } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } @JsonAnySetter public void setAdditionalProperty(String name, Object value) { this.additionalProperties.put(name, value); } }
[ "iamcloudkraken@gmail.com" ]
iamcloudkraken@gmail.com
30680d6f0b4dd7de6cb05e215746b0a5972cf3b9
1718d541e81f1c61ad76ecef47eb0fbc06eb25a3
/src/cit/workflow/engine/manager/action/OpenWorkflowInstancesViewAction.java
78dca93e6131f916adf7ac04d2d22e92a78c0e98
[]
no_license
Syncret/cit.workflow.engine.manager
434f207627c24c57afd51a6b3209e5159d5f4e00
23b61125e25c9884d4a75aa483b33d55d42b4432
refs/heads/master
2021-01-19T08:14:25.571997
2020-05-26T03:03:51
2020-05-26T03:03:51
15,020,780
0
0
null
null
null
null
UTF-8
Java
false
false
1,198
java
package cit.workflow.engine.manager.action; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; import cit.workflow.engine.manager.util.ImageFactory; public class OpenWorkflowInstancesViewAction extends Action implements IWorkbenchAction{ private final IWorkbenchWindow window; public static final String ID="cit.workflow.engine.manager.action.openworkflowinstancesviewaction"; private final String viewID=cit.workflow.engine.manager.views.WorkflowInstancesView.ID; public OpenWorkflowInstancesViewAction(IWorkbenchWindow window){ this.window=window; this.setText("&Workflow Instances"); setToolTipText("Open Workflow Instances View"); this.setImageDescriptor(ImageFactory.getImageDescriptor(ImageFactory.WORKFLOWSVIEW)); } public void run(){ if(window!=null){ try{ window.getActivePage().showView(viewID); }catch(PartInitException e){ MessageDialog.openError(window.getShell(), "Error", "Error opening view:"+e.getMessage()); } } } @Override public void dispose() { } }
[ "837022929@qq.com" ]
837022929@qq.com
38d5f71d590dd841c336735320a7f6d05ad4e144
de52068e2541de1b58b236f42092270c00bbd681
/src/main/java/com/jeeplus/modules/cv/web/statis/CoverSummaryController.java
e69f5fafcceaab4d7042b50a0e3a51d77a981097
[]
no_license
dtatgit/cover-admin-1
57b1a442b8b20b1c4a46305f0669366da69442af
3b606119e167755bf5899b22135369033f7662d2
refs/heads/master
2023-06-28T10:41:21.781016
2021-02-25T08:29:32
2021-02-25T08:29:32
391,333,650
0
0
null
null
null
null
UTF-8
Java
false
false
1,685
java
package com.jeeplus.modules.cv.web.statis; import com.jeeplus.core.persistence.Page; import com.jeeplus.core.web.BaseController; import com.jeeplus.modules.cv.entity.statis.CoverCollectStatis; import com.jeeplus.modules.cv.service.statis.CoverCollectStatisService; import org.apache.shiro.authz.annotation.RequiresPermissions; 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.ResponseBody; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; @Controller @RequestMapping(value = "${adminPath}/cv/statis/coverSummary") public class CoverSummaryController extends BaseController { @Autowired private CoverCollectStatisService coverCollectStatisService; /** * 窨井盖汇总列表页面 */ @RequiresPermissions("cv:statis:coverSummary:list") @RequestMapping(value = {"list", ""}) public String list() { return "modules/cv/statis/coverSummaryList"; } /** * 窨井盖采集统计列表数据 */ @ResponseBody @RequiresPermissions("cv:statis:coverSummary:list") @RequestMapping(value = "data") public Map<String, Object> data(CoverCollectStatis coverCollectStatis, HttpServletRequest request, HttpServletResponse response, Model model) { Page<CoverCollectStatis> page = coverCollectStatisService.findSummaryPage(new Page<CoverCollectStatis>(request, response), coverCollectStatis); return getBootstrapData(page); } }
[ "295868658@qq.com" ]
295868658@qq.com
cc9b952ff57b71ffe240751b288291b7851e1038
c927e81cf94c84e2ef8ecd265d15363aa05ff420
/app/src/main/java/gcg/testproject/activity/selectdate/SelectDateActivity.java
3cfde39dcd3a4d510ea6bcbb08a646886940a802
[]
no_license
chenxiaoliMira/AndroidExample
277b28dc5f6a67c6b4d14cbd5cdcf3e3868e5946
cbe250c9eefc23edcf3fd5fb94497ced0e126ee5
refs/heads/master
2020-03-28T10:39:37.095830
2018-09-11T01:05:36
2018-09-11T01:05:36
148,131,192
0
0
null
null
null
null
UTF-8
Java
false
false
2,599
java
package gcg.testproject.activity.selectdate; import android.icu.util.Calendar; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.util.Log; import android.view.View; import android.widget.DatePicker; import android.widget.TextView; import butterknife.Bind; import butterknife.ButterKnife; import gcg.testproject.R; import gcg.testproject.base.BaseActivity; /** * 日期选择器 * * @ClassName:SelectDateActivity * @PackageName:gcg.testproject.activity.selectdate * @Create On 2018/1/15 14:48 * @Site:http://www.handongkeji.com * @author:gongchenghao * @Copyrights 2018/1/15 handongkeji All rights reserved. */ public class SelectDateActivity extends BaseActivity implements View.OnClickListener{ @Bind(R.id.tv_start_time) TextView tvStartTime; @Bind(R.id.tv_end_time) TextView tvEndTime; private Calendar c; @RequiresApi(api = Build.VERSION_CODES.N) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_date); ButterKnife.bind(this); initClickEvent(); //初始化控件的点击事件 c = Calendar.getInstance(); } private void initClickEvent() { tvStartTime.setOnClickListener(this); tvEndTime.setOnClickListener(this); } @RequiresApi(api = Build.VERSION_CODES.N) @Override public void onClick(View view) { switch (view.getId()) { case R.id.tv_start_time: showDateDialog(); break; case R.id.tv_end_time: showDateDialog(); break; } } @RequiresApi(api = Build.VERSION_CODES.N) private void showDateDialog() { new DoubleDatePickerDialog(SelectDateActivity.this, 0, new DoubleDatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker startDatePicker, int startYear, int startMonthOfYear, int startDayOfMonth, DatePicker endDatePicker, int endYear, int endMonthOfYear, int endDayOfMonth) { tvStartTime.setText(startYear+"-"+(startMonthOfYear + 1)+"-"+startDayOfMonth); tvEndTime.setText(endYear+"-"+(endMonthOfYear + 1)+"-"+endDayOfMonth); } }, c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DATE), true).show(); //最后一个参数传true,表示可以显示日 } }
[ "42768492+chenxiaoliMira@users.noreply.github.com" ]
42768492+chenxiaoliMira@users.noreply.github.com
e6f30d17df8cae4496a7350a15072b12ba709e30
64a2beabdc4edaf7f3b22a5430a710b63e4ff2bc
/src/main/java/com/meenu/codingskills/algorithms/SelectionSort.java
f5133fc25b80aa2a1f1ab458f71b0f49cf701330
[]
no_license
MeenuVNair/CodingSkills
338cea55e52fc1db7927463f5cdbf25374c2eab5
28da48e9841e61f2c7eb5f51fb39c6e7fdf7aaf3
refs/heads/master
2022-12-24T11:35:45.806566
2020-08-06T12:30:15
2020-08-06T12:30:15
254,673,841
0
0
null
2020-10-13T21:05:03
2020-04-10T15:48:08
Java
UTF-8
Java
false
false
708
java
package com.meenu.codingskills.algorithms; /** * @author Meenu V Nair * * Creation time: Apr 24, 2020 9:38:03 PM * */ public class SelectionSort { private void selectionSort(int[] arr) { int n = arr.length; for(int i = 0; i < n - 1; i++) { int minIndex = i; for(int j = i + 1; j < n; j++) { if(arr[j] < arr[minIndex]) { minIndex = j; } } int temp = arr[i]; arr[i] = arr[minIndex]; arr[minIndex] = temp; } } public void findSolution() { int arr[] = {12, 11, 13, 5, 6, 7}; printArray(arr); selectionSort(arr); printArray(arr); } private void printArray(int[] arr) { for(int i : arr) { System.out.print(i + " "); } System.out.println(); } }
[ "meenu.nair@sap.com" ]
meenu.nair@sap.com
584322143980838e677488b1ff1d7fc8916a52c9
94138ba86d0dbf80b387064064d1d86269e927a1
/group06/1378560653/src/com/coding/basic/array/ArrayUtil.java
3e3b51e735c7f20f602f363880ede713a0e260c5
[]
no_license
DonaldY/coding2017
2aa69b8a2c2990b0c0e02c04f50eef6cbeb60d42
0e0c386007ef710cfc90340cbbc4e901e660f01c
refs/heads/master
2021-01-17T20:14:47.101234
2017-06-01T00:19:19
2017-06-01T00:19:19
84,141,024
2
28
null
2017-06-01T00:19:20
2017-03-07T01:45:12
Java
UTF-8
Java
false
false
6,020
java
package com.coding.basic.array; import java.util.Arrays; public class ArrayUtil { /** * 给定一个整形数组a , 对该数组的值进行置换 例如: a = [7, 9 , 30, 3] , 置换后为 [3, 30, 9,7] 如果 a = [7, 9, 30, 3, 4] , 置换后为 [4,3, 30 , 9,7] * @param origin * @return */ public void reverseArray(int[] origin){ //注意边界条件 if(origin == null || origin.length == 0){ return; } for(int i=0, j = origin.length-1; i<j; i++, j--){ int t = origin[i]; origin[i] = origin[j]; origin[j] = t; } /*for(int i = 0; i < origin.length; i++){ * int t = origin[i]; * origin[i] = origin[origin.length - 1 - i]; * origin[origin.length - 1 - i] = t; }*/ } /** * 现在有如下的一个数组: int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5} * 要求将以上数组中值为0的项去掉,将不为0的值存入一个新的数组,生成的新数组为: * {1,3,4,5,6,6,5,4,7,6,7,5} * @param oldArray * @return */ public int[] removeZero(int[] oldArray){ if(oldArray == null){ return null; } int count = 0; //统计非零元素个数 int b[] = new int[oldArray.length]; //先统计非零元素个数,并将非零元素存入一个和原数组同样大小的新数组 for(int i=0; i < oldArray.length; i++) { if(oldArray[i] != 0) { b[count++] = oldArray[i]; } } return Arrays.copyOf(b, count); } /** * 给定两个已经排序好的整形数组, a1和a2 , 创建一个新的数组a3, 使得a3 包含a1和a2 的所有元素, 并且仍然是有序的 * 例如 a1 = [3, 5, 7,8] a2 = [4, 5, 6,7] 则 a3 为[3,4,5,6,7,8] , 注意: 已经消除了重复 * @param array1 * @param array2 * @return */ public int[] merge(int[] array1, int[] array2){ //当array1和array2都为空时,返回空 if(array1 == null && array2 == null){ return null; } if(array1 == null && array2 != null){ return array2; } if(array1 != null && array2 == null){ return array1; } int[] newArray = new int[array1.length + array2.length]; //应该让a1,a2两个数组先进行比较 比较后插入元素 int i = 0; //array1下标 int j = 0; //array2下标 int count = 0; //array3下标 while(i < array1.length && j < array2.length){ if(array1[i] < array2[j]){ newArray[count++] = array1[i++]; }else if(array1[i] > array2[j]){ newArray[count++] = array2[j++]; }else if(array1[i] == array2[j]){ newArray[count++] = array2[j++]; i++; } } while(i==array1.length && j<array2.length){ newArray[count++] = array2[j++]; } while(j==array2.length && i<array1.length){ newArray[count++] = array1[i++]; } return Arrays.copyOf(newArray, count); } /** * 把一个已经存满数据的数组 oldArray的容量进行扩展, 扩展后的新数据大小为oldArray.length + size * 注意,老数组的元素在新数组中需要保持 * 例如 oldArray = [2,3,6] , size = 3,则返回的新数组为 * [2,3,6,0,0,0] * @param oldArray * @param size * @return * @throws Exception */ public int[] grow(int [] oldArray, int size){ if(oldArray == null) return null; if(size < 0) throw new IndexOutOfBoundsException("size小于0"); int[] newArray = new int[oldArray.length + size]; System.arraycopy(oldArray, 0, newArray, 0, oldArray.length); return newArray; } /** * 斐波那契数列为:1,1,2,3,5,8,13,21...... ,给定一个最大值, 返回小于该值的数列 * 例如, max = 15 , 则返回的数组应该为 [1,1,2,3,5,8,13] * max = 1, 则返回空数组 [] * @param max * @return */ public int[] fibonacci(int max){ //先将2个边界条件处理 if(max == 1){ return new int[0]; } if(max == 2){ return new int[]{1,1};//注意 } int[] a = new int[max]; a[0] = 1; a[1] = 1; int count = 2; for(int i=2; i<max; i++){ a[i] = a[i-1] + a[i-2]; if(a[i] >= max){ break; }else{ count++; } } return Arrays.copyOf(a,count); } /** * 返回小于给定最大值max的所有素数数组 * 例如max = 23, 返回的数组为[2,3,5,7,11,13,17,19] * @param max * @return */ public int[] getPrimes(int max){ if(max < 3){ return new int[0]; } boolean[] isPrime = isPrime(max); int[] array = new int[max]; int count = 1; array[0] = 2; for(int i = 3; i < max; i++){ if(isPrime[i]){ array[count++] = i; } } return Arrays.copyOf(array, count); } private boolean[] isPrime(int max) { boolean[] isPrime = new boolean[max]; for(int i = 3; i < max; i++){ if(i % 2 != 0 ){ isPrime[i] = true; }else{ isPrime[i] = false; } } for(int i = 3; i < Math.sqrt(max); i++){ if(isPrime[i]){ for(int j = 2*i ; j < max; j += i){ isPrime[j] = false; } } } return isPrime; } /** * 所谓“完数”, 是指这个数恰好等于它的因子之和,例如6=1+2+3 * 给定一个最大值max, 返回一个数组, 数组中是小于max 的所有完数 * @param max * @return */ public int[] getPerfectNumbers(int max){ if(max < 0){ return new int[0]; } int[] Array = new int[max]; int count = 0; for(int n = 1; n < max; n++) { int sum = 0; for(int i=1; i< n; i++) { if(n%i == 0) sum += i; } if(sum == n) Array[count++] = n; } return Arrays.copyOf(Array, count); } /** * 用seperator 把数组 array给连接起来 * 例如array= [3,8,9], seperator = "-" * 则返回值为"3-8-9" * @param array * @param s * @return */ public String join(int[] array, String seperator) { if(array == null || array.length == 0){ return ""; } StringBuilder buffer = new StringBuilder(); for(int i = 0; i < array.length; i++){ buffer.append(array[i]); if(i < array.length - 1){ buffer.append(seperator); } } return buffer.toString(); } }
[ "kaideguo@gmail.com" ]
kaideguo@gmail.com
1e8130be79a36b560e2fdb4fa3650ae31353ba89
baf03272774e32a60a3b21817400d57d1347068d
/src/_26Inheritance/B.java
0858fc3d75cf02ca787f1f34c7650485782ac67f
[]
no_license
Arasefe/OCAPREP
8e22c1df09efcdad1d8ab6a09c63d4a5058cf81e
f0a411d508b8ad93a9b8ac2b414f99c79ce8005d
refs/heads/master
2022-10-21T14:51:16.594373
2020-06-08T21:56:24
2020-06-08T21:56:24
270,837,935
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
package _26Inheritance; public class B extends A { public void print() { A obj = new A(); System.out.println(obj.i1); //Line 8 System.out.println(i2); //Line 9 System.out.println(obj.i2); causes compilation error System.out.println(this.i2); //Line 10 System.out.println(super.i2); //Line 11 } public static void main(String [] args) { new B().print(); } }
[ "arasefe@users.noreply.github.com" ]
arasefe@users.noreply.github.com
b7fc73d31d5b193d87b971e09316f38dfce79c56
8b719ffda2d80fc1b717935ac09fba3e316b24ae
/src/User.java
5d4cafea982731285440ed7670031b4d58ee33a5
[]
no_license
abhinavb05/parking-lot
9e51868acd42a448b63576f007ec0652a3474abc
4c4b91c5adb565e32abc66419805e8721b022586
refs/heads/main
2023-05-30T20:01:49.439801
2021-06-20T08:49:34
2021-06-20T08:49:34
378,599,389
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
import java.util.*; public class User { private Vehicle vehicle; private Ticket ticket; private ParkingLot parkingLot; User(Vehicle vehicle){ this.vehicle = vehicle; } void setTicket(ParkingLot parkingLot) { Manager manager = new Manager(parkingLot); this.ticket = manager.findVacantSlot(vehicle); this.parkingLot = parkingLot; } Ticket getTicket() { return ticket; } void parkVehicle() { Floor allocatedFloor = parkingLot.getFloors().get(ticket.getFloorNumber()); Slot allocatedSlot = allocatedFloor.getSlots().get(ticket.getSlotNumber()); if(!allocatedSlot.getVacancy()) { allocatedSlot.reverseVacancy(); }else { //slot not vaccant } } void unparkVehicle() { Floor allocatedFloor = parkingLot.getFloors().get(ticket.getFloorNumber()); Slot allocatedSlot = allocatedFloor.getSlots().get(ticket.getSlotNumber()); if(allocatedSlot.getVacancy()) { allocatedSlot.reverseVacancy(); }else { //slot already vaccant } } }
[ "abhinavbansal05.12.98@gmail.com" ]
abhinavbansal05.12.98@gmail.com
e79624d0cb75ff2b3e4b0e2c8c717eb33990c88b
9254e7279570ac8ef687c416a79bb472146e9b35
/gpdb-20160503/src/main/java/com/aliyun/gpdb20160503/models/ModifyDBInstanceNetworkTypeResponse.java
8c2fb4d0ca29f4f8911fb2df57917b06c300f1d3
[ "Apache-2.0" ]
permissive
lquterqtd/alibabacloud-java-sdk
3eaa17276dd28004dae6f87e763e13eb90c30032
3e5dca8c36398469e10cdaaa34c314ae0bb640b4
refs/heads/master
2023-08-12T13:56:26.379027
2021-10-19T07:22:15
2021-10-19T07:22:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,170
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.gpdb20160503.models; import com.aliyun.tea.*; public class ModifyDBInstanceNetworkTypeResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public ModifyDBInstanceNetworkTypeResponseBody body; public static ModifyDBInstanceNetworkTypeResponse build(java.util.Map<String, ?> map) throws Exception { ModifyDBInstanceNetworkTypeResponse self = new ModifyDBInstanceNetworkTypeResponse(); return TeaModel.build(map, self); } public ModifyDBInstanceNetworkTypeResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public ModifyDBInstanceNetworkTypeResponse setBody(ModifyDBInstanceNetworkTypeResponseBody body) { this.body = body; return this; } public ModifyDBInstanceNetworkTypeResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
41d6b57065d287abd46ddb767267b219b58aa984
dd648e67a9f0dfecb5424db391e3642703d92639
/src/entregaFinal/PaymentButton.java
08dfbc2635c0a7ab3e434717e815158701ed72d0
[]
no_license
RicardoPoleo/FinalProject
cebc3377d0b378fc22017814f70b356378142972
9de5b764eba19e4d03fda16b712b55a736ab9004
refs/heads/master
2020-07-09T04:27:16.196477
2019-08-22T21:33:34
2019-08-22T21:33:34
203,876,521
0
0
null
2019-08-22T21:32:18
2019-08-22T21:32:18
null
UTF-8
Java
false
false
702
java
package entregaFinal; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; public class PaymentButton extends PageObject { private WebElement paymentbutton = driver.findElement(By.xpath("(/html[1]/body[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/form[1]/div[5]/div[1]/input[1])")); public PaymentButton(WebDriver driver) { super(driver); } public boolean isInitialized() { wait.until(ExpectedConditions.visibilityOf(paymentbutton)); return this.paymentbutton.isDisplayed(); } public void PaymentButtonClick(){ this.paymentbutton.click(); } }
[ "german.salinas@cl.abstracta.us" ]
german.salinas@cl.abstracta.us
1c2ad507d243f8a2d504f452de7eec26c0bf4012
bdc77caea64e0851a08bde5cb3e44e72e82a12a7
/lab2/src/Account.java
a4e5b2e3a76e4af3c59ef9b1eab2ca2a70dd5557
[]
no_license
Abenezer2008/CS-525
8b311872fa34d85dd922dece0a5af6ea897703ee
90c38d057779c055fa7247ea1e55bbb693a8fc22
refs/heads/main
2023-05-30T08:24:24.490600
2021-06-25T19:16:27
2021-06-25T19:16:27
380,331,803
0
0
null
null
null
null
UTF-8
Java
false
false
1,606
java
import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Account { private Customer customer; private String accountNumber; private List<AccountEntry> entryList = new ArrayList<AccountEntry>(); public Account(String accountNumber) { this.accountNumber = accountNumber; } public String getAccountNumber() { return accountNumber; } public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; } public double getBalance() { double balance = 0; for (AccountEntry entry : entryList) { balance += entry.getAmount(); } return balance; } public void deposit(double amount) { AccountEntry entry = new AccountEntry(amount, "deposit", "", ""); entryList.add(entry); } public void withdraw(double amount) { AccountEntry entry = new AccountEntry(-amount, "withdraw", "", ""); entryList.add(entry); } private void addEntry(AccountEntry entry) { entryList.add(entry); } public void transferFunds(Account toAccount, double amount, String description) { AccountEntry fromEntry = new AccountEntry(-amount, description, toAccount.getAccountNumber(), toAccount.getCustomer().getName()); AccountEntry toEntry = new AccountEntry(amount, description, toAccount.getAccountNumber(), toAccount.getCustomer().getName()); entryList.add(fromEntry); toAccount.addEntry(toEntry); } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } public Collection<AccountEntry> getEntryList() { return entryList; } }
[ "abenezersintayehu22@gmail.com" ]
abenezersintayehu22@gmail.com
01d598e38b5fb5ceb438eee7ad6eb0209f6a8921
2db3391efdeaeb8756540277ae5a039ad6915311
/src/com/klasser/person.java
9586720a758a2acb496ab900ef428707530b7453
[]
no_license
heimgun/ContactList
77d5f8d4ddacec977fb6213fb65d695a8da88bf0
48e3b3dde130e262c452d6f5cf8e845741937639
refs/heads/master
2020-07-27T09:21:31.666169
2019-09-18T08:26:10
2019-09-18T08:26:10
209,044,133
0
1
null
2019-09-18T08:22:05
2019-09-17T12:11:00
Java
UTF-8
Java
false
false
318
java
package com.klasser; public class person { public String navn; public String alder; public String tele; public String epost; public String personInfo(){ String text = "Navn: "+navn+"\n" + "Alder: "+alder+"\n"+ "Telefonnr.: "+tele+"\n"+"E-post: "+epost+"\n"; return text; } }
[ "heidi.guneriussen@live.no" ]
heidi.guneriussen@live.no
23b2660084dde82fb695df27e5c8b0f248f09ea8
1e903af4698e642c7f75e97eeec8f219cca928c3
/src/Demo_1/Str_2.java
3b652c513a99e02a71826ac1c7f08bda1f10c658
[]
no_license
skirandr/Lambo
59028bac43838965b1d487b2bdc480854e4d520a
a6e9d4bfba5dcf46047370c51b61eb702018566a
refs/heads/master
2022-11-16T22:35:39.700078
2020-07-14T16:45:21
2020-07-14T16:45:21
279,638,302
0
0
null
null
null
null
UTF-8
Java
false
false
127
java
package Demo_1; public class Str_2 { public static void main(String[] args) { System.out.println("hi_!"); } }
[ "shashi@HP-PC" ]
shashi@HP-PC
6a26e191c01369faf015d13e2cf53180cccd379e
2bd7a5899912b6215ba6c813e59abe4e08126336
/Es2_1_JDBC/src.main.java/it/polito/ai/es2/ReadJson.java
24aeba9c4af9108cb5c8eb6d60a24629d2fad052
[]
no_license
jaime9510/Es2_MappaTrasportoTorino
7ccfdb67886b8ed53a4b0c5035a0aa2da102b9f7
755bf843e5ec74f0f14e4d4204ac1a773074f37c
refs/heads/master
2021-03-27T11:46:16.737709
2017-04-12T21:57:05
2017-04-12T21:57:05
87,852,227
0
0
null
null
null
null
UTF-8
Java
false
false
1,384
java
package it.polito.ai.es2; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import it.polito.ai.es2.model.Linea; import it.polito.ai.es2.model.LineeFermate; import it.polito.ai.es2.model.Stop; public class ReadJson { public LineeFermate read() { ObjectMapper mapper = new ObjectMapper(); LineeFermate lineeFermate = new LineeFermate(); List<Linea> listLine = new ArrayList<Linea>(); List<Stop> listStop = new ArrayList<Stop>(); try { JsonNode root = mapper.readTree(new File("./src/main/resources/linee.json")); JsonNode lines = root.get("lines"); JsonNode stops = root.get("stops"); for (JsonNode line : lines) { Linea linea = mapper.treeToValue(line, Linea.class); listLine.add(linea); } lineeFermate.setLinee(listLine); for (JsonNode s : stops) { Stop stop = mapper.treeToValue(s, Stop.class); listStop.add(stop); } lineeFermate.setStops(listStop); } catch (JsonGenerationException e) { e.printStackTrace(); } catch (JsonMappingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return lineeFermate; } }
[ "jaime951@gmail.com" ]
jaime951@gmail.com
14d72e4d61baa806abcd288b48d92006158644d7
d97ed22f159b4577eff940068fdb0d63b08f1149
/app/src/main/java/com/saechaol/learningapp/sinch/AudioPlayer.java
4183f98f0aae89f49114f185b33627e5ae040b90
[]
no_license
saechaol/learning-app
79ed81445a0d348b3b53d7ecea7fd1d58f2f64b6
22f0730c9882d1159f203a72c3d9a0524786d072
refs/heads/main
2023-02-22T03:38:30.258474
2021-01-28T06:58:17
2021-01-28T06:58:17
308,889,032
0
0
null
null
null
null
UTF-8
Java
false
false
3,270
java
package com.saechaol.learningapp.sinch; import android.content.Context; import android.content.res.AssetFileDescriptor; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioTrack; import android.media.MediaPlayer; import android.net.Uri; import android.util.Log; import com.saechaol.learningapp.R; import java.io.FileInputStream; import java.io.IOException; /** * Implements an audio stream player for the application */ public class AudioPlayer { static final String LOG_TAG = AudioPlayer.class.getSimpleName(); private Context context; private MediaPlayer mediaPlayer; private AudioTrack dialTone; private final static int SAMPLE_RATE = 16000; public AudioPlayer(Context context) { this.context = context.getApplicationContext(); } public void playRingtone() { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // check silent mode if (audioManager.getRingerMode() == AudioManager.RINGER_MODE_NORMAL) { mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); try { mediaPlayer.setDataSource(context, Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.ringtone)); } catch (IOException e) { Log.e(LOG_TAG, "Could not set up media player object for ringtone"); mediaPlayer = null; return; } } } public void stopRingtone() { if (mediaPlayer != null) { mediaPlayer.stop(); mediaPlayer.release(); mediaPlayer = null; } } public void playDialTone() { stopDialTone(); try { dialTone = createDialTone(context); dialTone.play(); } catch (Exception e) { Log.e(LOG_TAG, "Could not play dialtone", e); } } public void stopDialTone() { if (dialTone != null) { dialTone.stop(); dialTone.release(); dialTone = null; } } private static AudioTrack createDialTone(Context context) throws IOException { AssetFileDescriptor fileDescriptor = context.getResources().openRawResourceFd(R.raw.dialtone); int length = (int) fileDescriptor.getLength(); AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_VOICE_CALL, SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, length, AudioTrack.MODE_STATIC); byte[] data = new byte[length]; readFileToBytes(fileDescriptor, data); audioTrack.write(data, 0, data.length); audioTrack.setLoopPoints(0, data.length / 2, 30); return audioTrack; } private static void readFileToBytes(AssetFileDescriptor fileDescriptor, byte[] data) throws IOException { FileInputStream inputStream = fileDescriptor.createInputStream(); int bytesRead = 0; while (bytesRead < data.length) { int res = inputStream.read(data, bytesRead, (data.length - bytesRead)); if (res == -1) break; bytesRead += res; } } }
[ "33850575+saechaol@users.noreply.github.com" ]
33850575+saechaol@users.noreply.github.com
ff381482593f00d2362863cb3739e8ab70e211a3
e23b2224eff572098c3c319681b8caabed5b5335
/app/src/main/java/com/spencerstudios/admincenter/Models/Member.java
c1bccb17f4685dd3a23d5a7aeda070b32110c0e5
[]
no_license
Binary-Finery/AdminCenter
47487902e4b34105f2dedae1e46f4a4920bed9b7
344880b935e592e1acff8c46162e65c8b8caa089
refs/heads/master
2020-03-12T02:40:01.241688
2018-04-26T19:27:20
2018-04-26T19:27:20
130,408,247
4
1
null
null
null
null
UTF-8
Java
false
false
1,090
java
package com.spencerstudios.admincenter.Models; public class Member { public String name; private String reason; private String author; private long timeStamp; private boolean isBanned; private String id; public Member() { /*empty constructor*/ } public Member(String name, String reason, String author, long timeStamp, boolean isBanned, String id) { this.name = name; this.reason = reason; this.author = author; this.timeStamp = timeStamp; this.isBanned = isBanned; this.id = id; } public String getName() { return name; } public String getReason() { return reason; } public String getAuthor() { return author; } public long getTimeStamp() { return timeStamp; } public boolean isBanned() { return isBanned; } public void setBanned(boolean banned) { isBanned = banned; } public String getId(){ return id; } public void setId(String id){ this.id = id; } }
[ "deanspencer007@gmail.com" ]
deanspencer007@gmail.com
0ab832f7c28e8fd2f99c123e28ee8d975f6da3be
03096b3e84aed5101432546fca1efa4462602cfb
/Application/HelloWorld/app/src/main/java/com/mousebird/maply/CoordSystem.java
ac4419c5ef55d8e939983a7ddc1c027d7540bb59
[]
no_license
enoxaiming/HelloWorld
020ee5f31d54f24ad7dcdc5802500f371ed1527d
fd4594c7b579c273597dd1840264e70560168027
refs/heads/master
2020-07-25T12:50:01.941283
2016-09-04T14:43:50
2016-09-04T14:43:50
67,212,736
0
0
null
null
null
null
UTF-8
Java
false
false
3,055
java
/* * CoordSystem.java * WhirlyGlobeLib * * Created by Steve Gifford on 6/2/14. * Copyright 2011-2014 mousebird consulting * * 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.mousebird.maply; /** * The coord system is a very simple representation of the coordinate * systems supported by WhirlyGlobe-Maply. Very few moving parts are * accessible at this level. In general, you'll want to instantiate * one of the subclasses and pass it around to Mapy objects as needed. * */ public class CoordSystem { /** * Only ever called by the subclass. Don't use this directly please. */ CoordSystem() { } public void finalize() { dispose(); } /** * Lower left corner of the bounding box in local coordinates. */ Point3d ll = null; /** * Upper right corner of the bounding box in local coordinates. */ Point3d ur = null; /** * Return the valid bounding box for the coordinate system. * null means everywhere is valid. */ public Mbr getBounds() { if (ll == null || ur == null) return null; Mbr mbr = new Mbr(); mbr.addPoint(new Point2d(ll.getX(),ll.getY())); mbr.addPoint(new Point2d(ur.getX(),ur.getY())); return mbr; } /** * Set the bounding box for the coordinate system. * @param mbr */ public void setBounds(Mbr mbr) { ll = new Point3d(mbr.ll.getX(),mbr.ll.getY(),0.0); ur = new Point3d(mbr.ur.getX(),mbr.ur.getY(),0.0); } /** * Convert from WGS84 longitude/latitude coordinates to the local coordinate system. * * @param pt The input coordinate in longitude/latitude WGS84 radians. Yes, radians. * @return A point in the local coordinate system. */ public native Point3d geographicToLocal(Point3d pt); /** * Convert from the local coordinate system to WGS84 longitude/latitude in radians. * * @param pt A point in the local coordinate system. * @return A coordinate in longitude/latitude WGS84 radians. Yes, radians. */ public native Point3d localToGeographic(Point3d pt); /** * Convert the coordinate between systems. * @param inSystem The system the coordinate is in. * @param outSystem The system the coordinate you want it in. * @param inCoord The coordinate. * @return Returns the coordinate in the outSystem. */ public static native Point3d CoordSystemConvert3d (CoordSystem inSystem, CoordSystem outSystem, Point3d inCoord); static { nativeInit(); } private static native void nativeInit(); native void initialise(); native void dispose(); private long nativeHandle; }
[ "leeshoon1344@gmail.com" ]
leeshoon1344@gmail.com
24c5cb188e41bb448b2187681f93245dc76876ff
0e2f7a18e7f4bc4cd0e031c8dc9dd782929a5cae
/app/src/main/java/com/xbx/client/ui/activity/LoginActivity.java
c1ea6239f780aff99da7f2122e3a2d807b187873
[]
no_license
baletree/XbxClient
597be14023fe08bfc1c1fde94f2e684def5b9338
a1865ca84b8d16818696d332b88dd3eadc9236a3
refs/heads/master
2021-06-01T19:30:41.947431
2016-05-23T10:07:52
2016-05-23T10:07:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,033
java
package com.xbx.client.ui.activity; import android.content.Intent; import android.graphics.Paint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.content.LocalBroadcastManager; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.xbx.client.R; import com.xbx.client.beans.UserInfo; import com.xbx.client.http.IRequest; import com.xbx.client.http.RequestParams; import com.xbx.client.jsonparse.UtilParse; import com.xbx.client.jsonparse.UserInfoParse; import com.xbx.client.linsener.RequestBackLisener; import com.xbx.client.utils.Constant; import com.xbx.client.utils.SharePrefer; import com.xbx.client.utils.Util; import cn.jpush.android.api.JPushInterface; /** * Created by EricYuan on 2016/3/29. */ public class LoginActivity extends BaseActivity { private TextView title_txt_tv; private TextView login_agreepact_tv; private EditText login_phone_et; private EditText login_code_et; private Button login_btn; private Button login_code_btn; private LocalBroadcastManager lBManager = null; private int countDown = 60; private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case 1: if (countDown > 0) { countDown--; login_code_btn.setText(countDown + getString(R.string.login_code_minute)); handler.sendEmptyMessageDelayed(1, 1000); } else { login_code_btn.setText(getString(R.string.login_code_get)); login_code_btn.setClickable(true); login_code_btn.setBackgroundResource(R.drawable.button_bg); } break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); Util.pLog("JPushId:" + JPushInterface.getRegistrationID(this)); } @Override protected void initDatas() { super.initDatas(); lBManager = LocalBroadcastManager.getInstance(this); } @Override protected void initViews() { super.initViews(); title_txt_tv = (TextView) findViewById(R.id.title_txt_tv); login_agreepact_tv = (TextView) findViewById(R.id.login_agreepact_tv); login_btn = (Button) findViewById(R.id.login_btn); login_code_btn = (Button) findViewById(R.id.login_code_btn); login_phone_et = (EditText) findViewById(R.id.login_phone_et); login_code_et = (EditText) findViewById(R.id.login_code_et); findViewById(R.id.title_left_img).setOnClickListener(this); title_txt_tv.setText(R.string.login_title); login_agreepact_tv.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线 login_btn.setOnClickListener(this); login_code_btn.setOnClickListener(this); String userPhone = SharePrefer.getUserPhone(LoginActivity.this); if (!Util.isNull(userPhone)) { Util.pLog("LoginInput:" + userPhone); login_phone_et.setText(userPhone); login_phone_et.setSelection(userPhone.length()); } } @Override public void onClick(View v) { super.onClick(v); /* login_phone_et.setText("18602854129"); login_code_et.setText("147248");*/ String phone = login_phone_et.getText().toString(); String code = login_code_et.getText().toString(); switch (v.getId()) { case R.id.login_btn: if (Util.isNull(phone)) { Util.showToast(LoginActivity.this, getString(R.string.phone_tips)); return; } if (Util.isNull(code)) { Util.showToast(LoginActivity.this, getString(R.string.code_tips)); return; } // startActivity(new Intent(LoginActivity.this, MainActivity.class)); toLogin(phone, code); break; case R.id.login_code_btn: if (Util.isNull(phone)) { Util.showToast(LoginActivity.this, getString(R.string.phone_tips)); return; } if (!Util.checkTel(phone)) { Util.showToast(LoginActivity.this, getString(R.string.phone_check)); return; } getCode(phone); break; case R.id.title_left_img: finish(); break; } } private void getCode(final String phone) { String postUrl = getString(R.string.url_conIp).concat(getString(R.string.url_getCode)); RequestParams params = new RequestParams(); params.put("mobile", phone); SharePrefer.savePhone(LoginActivity.this, phone); IRequest.post(this, postUrl, params, "", new RequestBackLisener(LoginActivity.this) { @Override public void requestSuccess(String json) { Util.pLog("getCode Result=" + json); if (UtilParse.getRequestCode(json) == 1) { countDown = 60; login_code_btn.setBackgroundResource(R.drawable.button_code_bg); login_code_btn.setClickable(false); handler.sendEmptyMessage(1); } Util.showToast(LoginActivity.this, UtilParse.getRequestMsg(json)); } }); } private void toLogin(String phone, String code) { String postUrl = getString(R.string.url_conIp).concat(getString(R.string.url_Login)); final String pushId = JPushInterface.getRegistrationID(this); RequestParams params = new RequestParams(); params.put("mobile", phone); params.put("password", code); params.put("push_id", pushId);//代表用户端 params.inputParams(); IRequest.post(this, postUrl, params, "", new RequestBackLisener(LoginActivity.this) { @Override public void requestSuccess(String json) { Util.pLog("Login Result=" + json + "\npushId:" + pushId); if (UtilParse.getRequestCode(json) == 1) { UserInfo userInfo = UserInfoParse.getUserInfo(UtilParse.getRequestData(json)); if (userInfo != null) { SharePrefer.saveUserInfo(LoginActivity.this, userInfo); lBManager.sendBroadcast(new Intent(Constant.ACTION_LOGINSUC)); finish(); } } else { Util.showToast(LoginActivity.this, UtilParse.getRequestMsg(json)); } } }); } }
[ "1209085180@qq.com" ]
1209085180@qq.com
3ed9f9bbc2f69bea44ba2da3b43d4352f0583058
51bbc6cd93a8a9db49b55f1af74ba794fafa0a56
/excel-plugin/src/test/java/tests/diagnosis/MockNodeData.java
ad3aacb47aacf117e46d1dd8d1eef44a5b4a6141
[ "Apache-2.0" ]
permissive
manleviet/Master-project
0131d38f55663a52071d889de90298395d76bafa
387cff0fd4fd1dab3914f7a181dac68a3b2fe60e
refs/heads/master
2021-09-21T00:43:23.546164
2018-08-17T19:49:43
2018-08-17T19:49:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,950
java
package tests.diagnosis; import choco.Choco; import choco.kernel.model.constraints.Constraint; import choco.kernel.model.variables.integer.IntegerVariable; import org.exquisite.core.engines.tree.Node; import org.exquisite.diagnosis.engines.common.ConstraintComparator; import java.util.*; /** * Reflects the unpruned DAG structure from the Greiner paper - used for testing revised pruning and node reuse methods. * @author David * */ public class MockNodeData { public Hashtable<String, Constraint> constraints = new Hashtable<String, Constraint>(); public List<Node<Constraint>> graph = new ArrayList<>(); public List<List<Constraint>> knownConflicts = new ArrayList<List<Constraint>>(); public Hashtable<List<Constraint>, List<Node<Constraint>>> conflictNodeLookup = new Hashtable<>(); public Node<Constraint> rootNode; /** * @return a graph the same as used in Greiner's paper. */ public static MockNodeData greinerExample(){ MockNodeData instance = new MockNodeData(); instance.makeGreinerExample(); return instance; } /** * @return a small graph with a pair of nodes whose paths contain identical labels. */ public static MockNodeData duplicatePathsExample(){ MockNodeData instance = new MockNodeData(); instance.makeDuplicatePathExample(); return instance; } public static MockNodeData nodeReuseExample(){ MockNodeData instance = new MockNodeData(); instance.makeReuseExample(); return instance; } private void makeReuseExample(){ IntegerVariable testVar = Choco.makeIntVar("testVar"); Constraint a = Choco.eq(testVar, 1); Constraint b = Choco.eq(testVar, 2); Constraint c = Choco.eq(testVar, 3); Constraint d = Choco.eq(testVar, 4); constraints.put("a", a); constraints.put("b", b); constraints.put("c", c); constraints.put("d", d); Constraint[] rootArray = {a,b}; Node<Constraint> root = makeRoot(rootArray); Constraint[] n1Conflicts = {b, c}; Node<Constraint> n1 = makeNode("n1", n1Conflicts, root, a); Constraint[] n2Conflicts = {a, c}; Node<Constraint> n2 = makeNode("n2", n2Conflicts, root, b); Constraint[] n3Conflicts = {}; Node<Constraint> n3 = makeNode("n3", n3Conflicts, n1, b); Constraint[] n4Conflicts = {b, d}; Node<Constraint> n4 = makeNode("n4", n4Conflicts, n1, c); } /** * Emulates unpruned graph example from pg.85 of * http://cs.ru.nl/~peterl/teaching/KeR/Theorist/greibers-correctiontoreiter.pdf */ private void makeGreinerExample(){ IntegerVariable testVar = Choco.makeIntVar("testVar"); Constraint a = Choco.eq(testVar, 1); Constraint b = Choco.eq(testVar, 2); Constraint c = Choco.eq(testVar, 3); Constraint d = Choco.eq(testVar, 4); constraints.put("a", a); constraints.put("b", b); constraints.put("c", c); constraints.put("d", d); Constraint[] rootArray = {a,b}; Node<Constraint> root = makeRoot(rootArray); Constraint[] n1Conflicts = {b, c}; Node<Constraint> n1 = makeNode("n1", n1Conflicts, root, a); Constraint[] n2Conflicts = {a, c}; Node<Constraint> n2 = makeNode("n2", n2Conflicts, root, b); Constraint[] n3Conflicts = {}; Node<Constraint> n3 = makeNode("n3", n3Conflicts, n1, b); n2.addChild(n3, a); Constraint[] n4Conflicts = {b, d}; Node<Constraint> n4 = makeNode("n4", n4Conflicts, n1, c); Constraint[] n5Conflicts = {}; Node<Constraint> n5 = makeNode("n5", n5Conflicts, n2, c); Constraint[] n6Conflicts = {}; Node<Constraint> n6 = makeNode("n6", n6Conflicts, n4, b); Constraint[] n7Conflicts = {b}; Node<Constraint> n7 = makeNode("n7", n7Conflicts, n4, d); } /** * For testing parallel tree pre-check for duplicate node paths. */ private void makeDuplicatePathExample(){ IntegerVariable testVar = Choco.makeIntVar("testVar"); Constraint a = Choco.eq(testVar, 1); Constraint b = Choco.eq(testVar, 2); Constraint c = Choco.eq(testVar, 3); Constraint d = Choco.eq(testVar, 4); Constraint e = Choco.eq(testVar, 4); Constraint f = Choco.eq(testVar, 4); constraints.put("a", a); constraints.put("b", b); constraints.put("c", c); constraints.put("d", d); constraints.put("e", e); constraints.put("f", f); //level 0 Constraint[] rootArray = {a,b,c}; Node<Constraint> root = makeRoot(rootArray); //level 1 Constraint[] n1Conflicts = {b, e}; Node<Constraint> n1 = makeNode("n1", n1Conflicts, root, a); Constraint[] n2Conflicts = {a, f}; Node<Constraint> n2 = makeNode("n2", n2Conflicts, root, b); Constraint[] n3Conflicts = {d, e}; Node<Constraint> n3 = makeNode("n3", n3Conflicts, root, c); } /** * Makes a Node and configures that node as a root node. * @param conflict the nodeLabel set for this root node * @return Node set as root. */ private Node<Constraint> makeRoot(Constraint[] conflict) { Node<Constraint> root = new Node<Constraint>(new ArrayList<Constraint>(Arrays.asList(conflict))); root.nodeName = "root"; graph.add(root); knownConflicts.add(root.nodeLabel); List<Node<Constraint>> nodes = new ArrayList<Node<Constraint>>(); nodes.add(root); conflictNodeLookup.put(root.nodeLabel, nodes); rootNode = root; return root; } /** * Makes a (non-root) Node * @param name A name for the node (can be useful for printing, debugging). * @param conflict The nodeLabel set for this particular node. * @param parent The parent of this node. * @param edge The path label from the parent that points to this node. * @return A Node that is the child of another node. */ private Node<Constraint> makeNode(String name, Constraint[] conflict, Node<Constraint> parent, Constraint edge) { Node<Constraint> node = new Node<Constraint>(parent, edge); node.nodeLabel = new ArrayList<Constraint>(Arrays.asList(conflict)); //System.out.println("Making node " + name + " with nodeLabel size of: " + node.nodeLabel.size()); node.nodeName = name; Set<Constraint> set = new TreeSet<Constraint>(new ConstraintComparator()); set.addAll(parent.pathLabels); node.pathLabels.addAll(set); node.pathLabels.add(edge); graph.add(node); if (!node.nodeLabel.isEmpty()){ knownConflicts.add(node.nodeLabel); List<Node<Constraint>> nodes = conflictNodeLookup.get(node.nodeLabel); if (nodes == null) { nodes = new ArrayList<Node<Constraint>>(); } nodes.add(node); conflictNodeLookup.put(node.nodeLabel, nodes); } return node; } }
[ "Konstantin.Schekotihin@aau.at" ]
Konstantin.Schekotihin@aau.at
1fdc4b4268f37b5035849f02af09ed8f16395223
59e4596f07b00a69feabb1fb119619aa58964dd4
/StsTool.v.1.3.3/eu.aniketos.wp1.ststool.commitments/src/eu/aniketos/wp1/ststool/commitments/model/DelegationCommitment/TrustworthinessCommitment.java
2c9b96134ec59c3320eef027381e79af2fc6ac94
[]
no_license
AniketosEU/Socio-technical-Security-Requirements
895bac6785af1a40cb55afa9cb3dd73f83f8011f
7ce04c023af6c3e77fa4741734da7edac103c875
refs/heads/master
2018-12-31T17:08:39.594985
2014-02-21T14:36:14
2014-02-21T14:36:14
15,801,803
1
1
null
null
null
null
UTF-8
Java
false
false
3,358
java
/* * TrustworthinessCommitment.java * * This file is part of the STS-Tool project. * Copyright (c) 2011-2012 "University of Trento - DISI" All rights reserved. * * Is strictly forbidden to remove this copyright notice from this source code. * * Disclaimer of Warranty: * STS-Tool (this software) is provided "as-is" and without warranty of any kind, * express, implied or otherwise, including without limitation, any warranty of * merchantability or fitness for a particular purpose. * In no event shall the copyright holder or contributors be liable for any direct, * indirect, incidental, special, exemplary, or consequential damages * including, but not limited to, procurement of substitute goods or services; * loss of use, data, or profits; or business interruption) however caused and on * any theory of liability, whether in contract, strict liability, or tort (including * negligence or otherwise) arising in any way out of the use of this software, even * if advised of the possibility of such damage. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License version 3 * as published by the Free Software Foundation with the addition of the * following permission added to Section 15 as permitted in Section 7(a): * FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY * "University of Trento - DISI","University of Trento - DISI" DISCLAIMS THE * WARRANTY OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program; if not, see http://www.gnu.org/licenses or write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA, 02110-1301 USA, or download the license from the following URL: * http://www.sts-tool.eu/License.php * * For more information, please contact STS-Tool group at this * address: ststool@disi.unitn.it * */ package eu.aniketos.wp1.ststool.commitments.model.DelegationCommitment; import eu.aniketos.wp1.ststool.Delegation; public class TrustworthinessCommitment extends AbstractDelegationCommitment { public TrustworthinessCommitment(Delegation delegation, int index) { super(delegation, index); } @Override public String getRequester(){ if (delegation.getSource() == null || delegation.getSource().getName() == null) return "Unknwon"; else return delegation.getSource().getName(); } @Override public String getResponsible(){ if (delegation.getSource() == null || delegation.getSource().getName() == null) return "Unknwon"; else return delegation.getSource().getName(); } @Override public String getReqisite(){ return "delegatedTo(" + getDelegation().getTarget().getName() + ",trustworthiness level " + getDelegation().getTrustworthinessValue() + ")"; } @Override public String getDescritption(){ return getResponsible() + " will delegate goal "+getDelegation().getSourceGoal().getName()+", only to " + getDelegation().getTarget().getName() + " that have trustwhorthiness level grater than " + getDelegation().getTrustworthinessValue(); } @Override public String securityNeedName(){ return "trustworthiness"; } }
[ "mattia@MacBookPro.local" ]
mattia@MacBookPro.local
6b6772200b99ded27e04940f044efc8fc37386d0
da8886e63c3da46694b97aaa5cf888553f81b242
/src/main/java/team/union/sys_sp/twotabrel/vo/TwoTabRelWeb.java
6486e7cbc680f342e2f99f9103d4e50494778ef6
[]
no_license
dcxsIntegartion/integration
474bb06eeffc70e0e40b65518beb906f0a8491d5
69bd1b627afff3c6ed5745cbdca314782926f804
refs/heads/master
2021-01-19T21:01:37.126874
2018-06-13T07:47:37
2018-06-13T07:47:37
88,593,384
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package team.union.sys_sp.twotabrel.vo; public class TwoTabRelWeb { /** 当前业务已经使用颜色 **/ private String[] colers; /** 当前业务已经使用颜色对应的业务id **/ private String[] mainIds; public String[] getColers() { return colers; } public void setColers(String[] colers) { this.colers = colers; } public String[] getMainIds() { return mainIds; } public void setMainIds(String[] mainIds) { this.mainIds = mainIds; } }
[ "626134765@qq.com" ]
626134765@qq.com
5fb7cd1151f106ba09e9a3f204d5cef0e3fffd60
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Math-10/org.apache.commons.math3.analysis.differentiation.DSCompiler/BBC-F0-opt-70/25/org/apache/commons/math3/analysis/differentiation/DSCompiler_ESTest_scaffolding.java
998e47e53d1804f0fd589061f59ca910434409d8
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
5,809
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 23 19:06:14 GMT 2021 */ package org.apache.commons.math3.analysis.differentiation; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DSCompiler_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.analysis.differentiation.DSCompiler"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DSCompiler_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.exception.MathInternalError", "org.apache.commons.math3.exception.MathIllegalStateException", "org.apache.commons.math3.analysis.differentiation.DSCompiler", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.exception.NonMonotonicSequenceException", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.exception.DimensionMismatchException", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.exception.NumberIsTooLargeException", "org.apache.commons.math3.exception.NotStrictlyPositiveException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.util.ArithmeticUtils", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.util.FastMathLiteralArrays" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DSCompiler_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.math3.analysis.differentiation.DSCompiler", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.util.Precision", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.util.ArithmeticUtils", "org.apache.commons.math3.util.FastMath$CodyWaite", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.DimensionMismatchException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.util.MathArrays", "org.apache.commons.math3.exception.NumberIsTooLargeException" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
27a242b618966b74a0da62eb39fefc11a471a8e5
81adb6bb0148ae5d8e1668fc5267431dc89c88a6
/src/jp/co/jjs/java_seminar/exercise_20140514_2/Exercise1.java
9d39227bcd4370b4b98370b750675ee2ea111e6d
[]
no_license
jjs-0006/Exercise
9510915eebe2f91431f5ee7d6aa62861a9fc0588
2abb9eea9961254d867dd5672e639b0f4e208d97
refs/heads/master
2020-05-19T19:05:27.826897
2014-05-23T08:29:30
2014-05-23T08:29:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package jp.co.jjs.java_seminar.exercise_20140514_2; public class Exercise1 { public static void main(String[] args) { Student s1 = new Student("山田一",20,0); Student s2 = new Student("田中太郎",21,1); System.out.println(s1.s + " " + s1.c + " " + s1.classNumber + " " + s1.d + " " + s1.b); s1.showName(); s2.showName(); s1.answer(); System.out.println(s1.report()); s1.answer(); System.out.println(s1.report()); } }
[ "jjs-0006@outlook.jp" ]
jjs-0006@outlook.jp
1f17c3c6bc656439af1c23625c15e2b56218fd7a
bde682a9933140140f1712e066c23160b23ada5b
/hibernate-examples/src/test/java/org/hibernate/examples/mapping/inheritance/joinedsubclass/Person.java
c3d22e94be5d258d19c2853f9423ed4267b51a45
[ "Apache-2.0" ]
permissive
egorpe/hibernate-redis
8f378df180b61176b137b48b9e1d06ec057e0ac3
40c4b23f7b1911508420e29682277ebecd8387bf
refs/heads/master
2020-04-06T03:52:57.794524
2014-01-01T06:21:30
2014-01-01T06:21:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,657
java
package org.hibernate.examples.mapping.inheritance.joinedsubclass; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import org.hibernate.examples.model.AbstractHibernateEntity; import org.hibernate.examples.utils.HashTool; import org.hibernate.examples.utils.ToStringHelper; import javax.persistence.*; /** * org.hibernate.examples.mapping.inheritance.joinedsubclass.Person * * @author 배성혁 sunghyouk.bae@gmail.com * @since 2013. 11. 30. 오후 12:54 */ @Entity @Table(name = "JoinedSubclass_Person") @org.hibernate.annotations.Cache(region = "examples", usage = CacheConcurrencyStrategy.READ_WRITE) @Inheritance(strategy = InheritanceType.JOINED) @DynamicInsert @DynamicUpdate @Getter @Setter public abstract class Person extends AbstractHibernateEntity<Long> { @Id @GeneratedValue @Column(name = "personId") @Setter(AccessLevel.PROTECTED) private Long id; @Column(name = "personName", nullable = false, length = 128) private String name; @Column(name = "regidentNo", nullable = false, length = 128) private String regidentNo; private Integer age; @Override public int hashCode() { return HashTool.compute(name, regidentNo); } @Override public ToStringHelper buildStringHelper() { return super.buildStringHelper() .add("name", name) .add("regidentNo", regidentNo); } private static final long serialVersionUID = 823321933233116966L; }
[ "sunghyouk.bae@gmail.com" ]
sunghyouk.bae@gmail.com
ee41114a5cd290db6ae7eaff063002954f6bad11
c9edd21bdf3e643fe182c5b0f480d7deb218737c
/dy-agent-log4j/dy-agent-log4j-core/src/main/java/com/hust/foolwc/dy/agent/log4j/core/config/PropertiesPlugin.java
ae2789f53f21a02dd7504dad6816523eeeb447e5
[]
no_license
foolwc/dy-agent
f302d2966cf3ab9fe8ce6872963828a66ca8a34e
d7eca9df2fd8c4c4595a7cdc770d6330e7ab241c
refs/heads/master
2022-11-22T00:13:52.434723
2022-02-18T09:39:15
2022-02-18T09:39:15
201,186,332
10
4
null
2022-11-16T02:45:38
2019-08-08T05:44:02
Java
UTF-8
Java
false
false
2,915
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache license, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the license for the specific language governing permissions and * limitations under the license. */ package com.hust.foolwc.dy.agent.log4j.core.config; import java.util.HashMap; import java.util.Map; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.Plugin; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginConfiguration; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginElement; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginFactory; import com.hust.foolwc.dy.agent.log4j.core.lookup.Interpolator; import com.hust.foolwc.dy.agent.log4j.core.lookup.MapLookup; import com.hust.foolwc.dy.agent.log4j.core.lookup.StrLookup; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.Plugin; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginConfiguration; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginElement; import com.hust.foolwc.dy.agent.log4j.core.config.plugins.PluginFactory; import com.hust.foolwc.dy.agent.log4j.core.lookup.Interpolator; import com.hust.foolwc.dy.agent.log4j.core.lookup.MapLookup; import com.hust.foolwc.dy.agent.log4j.core.lookup.StrLookup; /** * Handles properties defined in the configuration. */ @Plugin(name = "properties", category = Node.CATEGORY, printObject = true) public final class PropertiesPlugin { private PropertiesPlugin() { } /** * Creates the Properties component. * @param properties An array of Property elements. * @param config The Configuration. * @return An Interpolator that includes the configuration properties. */ @PluginFactory public static StrLookup configureSubstitutor(@PluginElement("Properties") final Property[] properties, @PluginConfiguration final Configuration config) { if (properties == null) { return new Interpolator(config.getProperties()); } final Map<String, String> map = new HashMap<>(config.getProperties()); for (final Property prop : properties) { map.put(prop.getName(), prop.getValue()); } return new Interpolator(new MapLookup(map), config.getPluginPackages()); } }
[ "liwencheng@douyu.tv" ]
liwencheng@douyu.tv
c910a472cd139422fce8349830ae9074ce8d9277
9f7c6324f63b1f19f93bb9aea42c8391c9171486
/src/main/java/com/itlize/ResourceManagement/Service/Impl/ResourceServiceImpl.java
75fd1aafffbc55ff90d8e193925ff35a7985b312
[]
no_license
jaspervhr-dev/ResourceManagement
894f4c9777f3518f742be88d7f7805a7fa8e1296
af26682ceb1cbc9c1f6ae583d4d7f0a4b8778a2a
refs/heads/master
2023-08-15T12:44:18.826472
2021-10-11T04:02:01
2021-10-11T04:02:01
411,016,012
0
0
null
2021-10-05T15:58:47
2021-09-27T19:25:30
Java
UTF-8
Java
false
false
901
java
package com.itlize.ResourceManagement.Service.Impl; import com.itlize.ResourceManagement.Entity.Resource; import com.itlize.ResourceManagement.Repository.ResourceRepository; import com.itlize.ResourceManagement.Service.ResourceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * @author Siteng Fan * @date 9/29/21 11:45 AM */ @Service public class ResourceServiceImpl implements ResourceService { @Autowired ResourceRepository resourceRepository; @Override public Resource findOneById(Integer id) { return resourceRepository.findById(id).orElse(null); } @Override public List<Resource> findALl() { return resourceRepository.findAll(); } @Override public void addOne(Resource resource) { resourceRepository.save(resource); } }
[ "stuartsf1996@gmail.com" ]
stuartsf1996@gmail.com
0eb08fc14a84405bf11c6daef469923a5fbbbbba
04ed4181ce0c61295f8fc3af99905aa3cba7c5f5
/app/src/main/java/ps/gov/mtit/govqr/LoginActivity.java
5d6894f448db594581bedc716798931646f43193
[]
no_license
cryptobuks1/GovQR
1cef6c872125ff14dac1c3d96d4d4d6456cf64d1
f620a389f05dab96de395b6dad15b755a003c511
refs/heads/master
2021-01-08T07:57:01.138792
2019-12-24T10:05:24
2019-12-24T10:05:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,501
java
package ps.gov.mtit.govqr; import android.app.ProgressDialog; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.Toast; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonObjectRequest; import com.android.volley.toolbox.StringRequest; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; import ps.gov.mtit.govqr.utils.PrefsUtils; public class LoginActivity extends AppCompatActivity { public static String TAG = "SSOLOGIN"; EditText txtUser, txtPw; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); txtUser = findViewById(R.id.userEditText); txtPw = findViewById(R.id.pwEditText); } private void ssoLogin(final String user, final String pw) { final ProgressDialog pd = ProgressDialog.show(this, getString(R.string.app_name), "جاري تسجيل الدخول"); StringRequest request = new StringRequest(Request.Method.POST, AppZone.TOKEN_URL, new Response.Listener<String>() { @Override public void onResponse(String response) { pd.dismiss(); Log.d(TAG, "response : " + response); try { JSONObject obj = new JSONObject(response.substring(response.indexOf("{"))); if (obj.getString("status").equalsIgnoreCase("success")) { PrefsUtils.saveToken(LoginActivity.this, obj.getString("access_token")); PrefsUtils.saveRefreshToken(LoginActivity.this, obj.getString("refresh_token")); Intent i = new Intent(getApplicationContext(), MainActivity.class); startActivity(i); finish(); //checkPermissionRequest(obj.getString("access_token"), obj.getString("refresh_token")); } else { Toast.makeText(LoginActivity.this, obj.getString("message"), Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { pd.dismiss(); Log.d(TAG, "error : " + error.toString()); } }) { @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> params = new HashMap<String, String>(); params.put("client_id", AppZone.SSO_CLIENTID); params.put("client_secret", AppZone.SSO_SECRET); params.put("username", user); params.put("password", pw); Log.d(TAG, "params : " + params.toString()); return params; } @Override public Map<String, String> getHeaders() throws AuthFailureError { HashMap<String, String> headers = new HashMap<String, String>(); //headers.put("Authorization", reqHeader); // headers.put("Content-Type","application/x-www-form-urlencoded"); Log.d(TAG, "headers : " + headers.toString()); return headers; } }; // add the request object to the queue to be executed MyRequestQueue.getInstance(this).getRequestQueue().add(request); } private void checkPermissionRequest(final String token, final String refresh_token) { final ProgressDialog pd = ProgressDialog.show(this, getString(R.string.app_name), ""); String url = AppZone.BASE_URL + "/GET_SUPERMARKET_USER_PR"; Log.d(TAG, "Url : " + url); JsonObjectRequest request = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { pd.dismiss(); Log.d(TAG, "Response : " + response.toString()); try { if (response.getString("status").equalsIgnoreCase("success")) { PrefsUtils.saveToken(LoginActivity.this, token); PrefsUtils.saveRefreshToken(LoginActivity.this, refresh_token); Intent i = new Intent(getApplicationContext(), MainActivity.class); startActivity(i); finish(); } else { Toast.makeText(LoginActivity.this, response.getString("message"), Toast.LENGTH_SHORT).show(); } } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { pd.dismiss(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { HashMap<String, String> headers = new HashMap<String, String>(); headers.put("x-sso-authorization", token); Log.d(TAG, "headers : " + headers.toString()); return headers; } }; MyRequestQueue.getInstance(this).getRequestQueue().add(request); } public void login(View view) { if (!txtUser.getText().toString().isEmpty() && !txtPw.getText().toString().isEmpty()) { //ssoLogin(txtUser.getText().toString(), AppZone.passMd5Encryption(txtPw.getText().toString())); ssoLogin(txtUser.getText().toString(), AppZone.passMd5Encryption(txtPw.getText().toString())); } else { Toast.makeText(this, "أدخل اسم المستخدم وكلمة المرور", Toast.LENGTH_SHORT).show(); } } public void forgetPassword(View view) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://elogin.gov.ps/new/forgotPasswordNew"))); } }
[ "mohseneyas@gmail.com" ]
mohseneyas@gmail.com
e5fea9ca59ab9a3ae8ea67a376ef0fd3c8d7d7c0
60231321ae07d564d4245ba7182b5ffd455da7a5
/JavaIoProgramming/src/ch18/exam09/CopyExample.java
196ca3c8d67e0a8e42a17e35b79f0fcdf89537b0
[]
no_license
JeongSemi/TestRepository
1fc7b1b86e75adcf72f5584389bde2311b5c647f
3e16625c5802302f505a507f89bf187265269061
refs/heads/master
2021-01-20T00:45:51.856815
2017-08-29T05:26:45
2017-08-29T05:26:45
89,182,167
0
0
null
null
null
null
UTF-8
Java
false
false
755
java
package ch18.exam09; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.Reader; import java.io.Writer; public class CopyExample { public static void main(String[] args) throws FileNotFoundException, IOException { Reader reader = new FileReader("src/ch18/exam09/test.txt"); Writer writer = new FileWriter("src/ch18/exam09/test2.txt"); char[] data = new char[3]; int readChars = -1; while (true) { readChars = reader.read(data); if (readChars == -1) { break; } writer.write(data, 0, readChars); } writer.flush(); writer.close(); } }
[ "wjdtpa2@gmail.com" ]
wjdtpa2@gmail.com
745a295624dc4f3fa6c3d77a3a9549f1b7688ef3
4d97a8ec832633b154a03049d17f8b58233cbc5d
/Math/96/Math/evosuite-branch/0/org/apache/commons/math/complex/ComplexEvoSuite_branch_Test_scaffolding.java
a0a71dc83fed7af8dfcd6f061d82865f5eaf89dd
[]
no_license
4open-science/evosuite-defects4j
be2d172a5ce11e0de5f1272a8d00d2e1a2e5f756
ca7d316883a38177c9066e0290e6dcaa8b5ebd77
refs/heads/master
2021-06-16T18:43:29.227993
2017-06-07T10:37:26
2017-06-07T10:37:26
93,623,570
2
1
null
null
null
null
UTF-8
Java
false
false
5,869
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Dec 11 19:10:17 GMT 2014 */ package org.apache.commons.math.complex; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; public class ComplexEvoSuite_branch_Test_scaffolding { @org.junit.Rule public org.junit.rules.Timeout globalTimeout = new org.junit.rules.Timeout(6000); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 5000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); resetClasses(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("java.vm.vendor", "Oracle Corporation"); java.lang.System.setProperty("java.specification.version", "1.7"); java.lang.System.setProperty("java.home", "/usr/local/packages6/java/jdk1.7.0_55/jre"); java.lang.System.setProperty("user.dir", "/scratch/ac1gf/Math/96/0/run_evosuite.pl_7163_1418324400"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); java.lang.System.setProperty("awt.toolkit", "sun.awt.X11.XToolkit"); java.lang.System.setProperty("file.encoding", "UTF-8"); java.lang.System.setProperty("file.separator", "/"); java.lang.System.setProperty("java.awt.graphicsenv", "sun.awt.X11GraphicsEnvironment"); java.lang.System.setProperty("java.awt.headless", "true"); java.lang.System.setProperty("java.awt.printerjob", "sun.print.PSPrinterJob"); java.lang.System.setProperty("java.class.path", "/data/ac1gf/defects4j/framework/projects/lib/evosuite.jar:/scratch/ac1gf/Math/96/0/run_evosuite.pl_7163_1418324400/target/classes"); java.lang.System.setProperty("java.class.version", "51.0"); java.lang.System.setProperty("java.endorsed.dirs", "/usr/local/packages6/java/jdk1.7.0_55/jre/lib/endorsed"); java.lang.System.setProperty("java.ext.dirs", "/usr/local/packages6/java/jdk1.7.0_55/jre/lib/ext:/usr/java/packages/lib/ext"); java.lang.System.setProperty("java.library.path", "lib"); java.lang.System.setProperty("java.runtime.name", "Java(TM) SE Runtime Environment"); java.lang.System.setProperty("java.runtime.version", "1.7.0_55-b13"); java.lang.System.setProperty("java.specification.name", "Java Platform API Specification"); java.lang.System.setProperty("java.specification.vendor", "Oracle Corporation"); java.lang.System.setProperty("java.vendor", "Oracle Corporation"); java.lang.System.setProperty("java.vendor.url", "http://java.oracle.com/"); java.lang.System.setProperty("java.version", "1.7.0_55"); java.lang.System.setProperty("java.vm.info", "mixed mode"); java.lang.System.setProperty("java.vm.name", "Java HotSpot(TM) 64-Bit Server VM"); java.lang.System.setProperty("java.vm.specification.name", "Java Virtual Machine Specification"); java.lang.System.setProperty("java.vm.specification.vendor", "Oracle Corporation"); java.lang.System.setProperty("java.vm.specification.version", "1.7"); java.lang.System.setProperty("java.vm.version", "24.55-b03"); java.lang.System.setProperty("line.separator", "\n"); java.lang.System.setProperty("os.arch", "amd64"); java.lang.System.setProperty("os.name", "Linux"); java.lang.System.setProperty("os.version", "2.6.32-431.23.3.el6.x86_64"); java.lang.System.setProperty("path.separator", ":"); java.lang.System.setProperty("user.country", "GB"); java.lang.System.setProperty("user.home", "/home/ac1gf"); java.lang.System.setProperty("user.language", "en"); java.lang.System.setProperty("user.name", "ac1gf"); java.lang.System.setProperty("user.timezone", "Europe/Belfast"); } private static void initializeClasses() { org.evosuite.runtime.ClassStateSupport.initializeClasses(ComplexEvoSuite_branch_Test_scaffolding.class.getClassLoader() , "org.apache.commons.math.complex.Complex", "org.apache.commons.math.util.MathUtils" ); } private static void resetClasses() { org.evosuite.runtime.reset.ClassResetter.getInstance().setClassLoader(ComplexEvoSuite_branch_Test_scaffolding.class.getClassLoader()); org.evosuite.runtime.ClassStateSupport.resetClasses( "org.apache.commons.math.complex.Complex", "org.apache.commons.math.util.MathUtils" ); } }
[ "martin.monperrus@gnieh.org" ]
martin.monperrus@gnieh.org
b58c61aada5e5d1549604289a73085dc925a25a7
1b0ec3416150da9654bc3651be0386eec81d6bdd
/app/src/main/java/com/example/project/easyshopping/AddGoods.java
315126ea01b5ef06de4cbb910fcd8276ded1a1f5
[]
no_license
xkyyxj/summer_yunshangdian
85606c15b799de06022d77a1675961ee36789587
8cf975c96270e8f3d8bd07777b8f1f93cf78d97a
refs/heads/master
2020-05-17T00:09:00.349333
2015-08-04T02:39:46
2015-08-04T02:39:46
40,158,928
0
0
null
null
null
null
UTF-8
Java
false
false
17,035
java
package com.example.project.easyshopping; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import com.bmob.BTPFileResponse; import com.bmob.BmobProFile; import com.bmob.btp.callback.DownloadListener; import com.bmob.btp.callback.UploadListener; import com.example.project.easyshopping.data.ShopG; import com.test.albert.myapplication.R; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; import cn.bmob.v3.listener.SaveListener; /** * Created by acer on 2015/7/13. */ public class AddGoods extends Activity { //图片处理的类变量 private String file_path = null, pro_file_path = null, pic_name; private FileOutputStream out = null; private Bitmap pic_bt = null; //两个类对象 private ShopG mShopG = null; private ShopG new_mShopG = null; private static final int IMAGE_REQUEST_CODE = 0; private static final int CAMERA_REQUEST_CODE = 1; private static final int RESULT_REQUEST_CODE = 2; public static final String IMAGE_FILE_NAME = "temp_file"; private static final String PROPERTY_FILE_NAME = "user_info.xml"; private LinearLayout ll1; private ImageButton back; private TextView textView0; private RelativeLayout rl1; private LinearLayout ll2; private EditText etBarcode; private ImageButton ibScan; private ImageButton ibPic; private ImageButton ibUpload; private LinearLayout ll3; private LinearLayout ll4; private TextView tvName; private EditText dtName; private LinearLayout ll5; private TextView tvDescribe; private EditText dtDescribe; private LinearLayout ll6; private TextView tvPrice; private EditText dtPrice; private LinearLayout ll7; private TextView tvCat; private Spinner spinner; private Button submit; private static String ShopName; private void assignViews() { ll1 = (LinearLayout) findViewById(R.id.ll1); back = (ImageButton) findViewById(R.id.back); textView0 = (TextView) findViewById(R.id.textView0); rl1 = (RelativeLayout) findViewById(R.id.rl1); ll2 = (LinearLayout) findViewById(R.id.ll2); etBarcode = (EditText) findViewById(R.id.et_barcode); ibScan = (ImageButton) findViewById(R.id.ib_scan); ibPic = (ImageButton) findViewById(R.id.ib_pic); ibUpload = (ImageButton) findViewById(R.id.ib_upload); ll3 = (LinearLayout) findViewById(R.id.ll3); ll4 = (LinearLayout) findViewById(R.id.ll4); tvName = (TextView) findViewById(R.id.tv_name); dtName = (EditText) findViewById(R.id.dt_name); ll5 = (LinearLayout) findViewById(R.id.ll5); tvDescribe = (TextView) findViewById(R.id.tv_describe); dtDescribe = (EditText) findViewById(R.id.dt_describe); ll6 = (LinearLayout) findViewById(R.id.ll6); tvPrice = (TextView) findViewById(R.id.tv_price); dtPrice = (EditText) findViewById(R.id.dt_price); ll7 = (LinearLayout) findViewById(R.id.ll7); tvCat = (TextView) findViewById(R.id.tv_cat); spinner = (Spinner) findViewById(R.id.spinner); submit = (Button) findViewById(R.id.submit); } private ArrayAdapter<String> mAdapter; private static String[] cat; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.addgoods); assignViews(); Intent intent = getIntent(); ShopName = intent.getStringExtra("shopname"); Log.e("AddGoods里的onCreat()方法", "里得到的ShopName是" + ShopName); file_path = getFilesDir().getPath() + ShopName + ".png"; pro_file_path = getFilesDir().getPath() + "/" + PROPERTY_FILE_NAME; mShopG=new ShopG(); new_mShopG=new ShopG(); loadpic(); initSpinner(); initButton(); } private void initSpinner() { cat = new String[]{"请选择类别", "日用品", "水果", "零食"}; mAdapter = new ArrayAdapter<String>(this, R.layout.drop_down_item, cat); spinner.setAdapter(mAdapter); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Log.v("AddGoods", "spinner选择了第" + position + "个item"); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); } private void initButton() { ibPic.setOnClickListener(new EditGoodsPicClickListener()); back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { update(); } }); } class EditGoodsPicClickListener implements View.OnClickListener { @Override public void onClick(View v) { // TODO Auto-generated method stub showDialog(); } } /** * 弹出选择图片进行上传的dialog */ private void showDialog() { new AlertDialog.Builder(this) .setTitle(R.string.activity_edit_user_info_pic_source_cho) .setItems(R.array.face_image_choice_item, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: Intent intentFromGallery = new Intent(); intentFromGallery.setType("image/*"); intentFromGallery .setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(intentFromGallery, IMAGE_REQUEST_CODE); break; case 1: Intent intentFromCapture = new Intent( MediaStore.ACTION_IMAGE_CAPTURE); if (hasSdcard()) { intentFromCapture.putExtra( MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File( Environment.getExternalStorageDirectory(), IMAGE_FILE_NAME))); } startActivityForResult(intentFromCapture, CAMERA_REQUEST_CODE); break; } } }) .setNegativeButton(R.string.activity_edit_user_info_cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }).show(); } private static boolean hasSdcard() { String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { return true; } else { return false; } } private void loadpic() { File file = new File(file_path); if (!file.exists()) try { ibPic.setImageDrawable(getResources().getDrawable(R.drawable.nopic)); file.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block Log.e("on creating file!", "error!!!!!!!"); e.printStackTrace(); } else { pic_bt = BitmapFactory.decodeFile(file_path); ibPic.setImageBitmap(pic_bt); } try { out = new FileOutputStream(file); } catch (FileNotFoundException e) { // TODO Auto-generated catch block Log.e("on creating :", "error!!!"); e.printStackTrace(); } String file_na = mShopG.getPicture(); if (file_na != null && pic_bt == null) { downloadFile(file_na); } } private void downloadFile(String file_name) { BmobProFile.getInstance(this).download(file_name, new DownloadListener() { @Override public void onError(int arg0, String arg1) { // TODO Auto-generated method stub } @Override public void onProgress(String arg0, int arg1) { // TODO Auto-generated method stub } @Override public void onSuccess(String full_path) { // TODO Auto-generated method stub pic_bt = BitmapFactory.decodeFile(full_path); ibPic.setImageBitmap(pic_bt); saveShopBitmap(pic_bt); } }); } private void update() { BTPFileResponse response = BmobProFile.getInstance(AddGoods.this).upload(file_path, new UploadListener() { @Override public void onError(int arg0, String arg1) { // TODO Auto-generated method stub } @Override public void onProgress(int arg0) { // TODO Auto-generated method stub } @Override public void onSuccess(String file_name, String url) { // TODO Auto-generated method stub pic_name = file_name; try { writeProperty("user_pic", file_name); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (pic_name != null) { new_mShopG.setPicture(pic_name); } String p = dtPrice.getText().toString(); String goodsname = dtName.getText().toString(); String describe = dtDescribe.getText().toString(); String cat = spinner.getSelectedItem().toString(); if (p.equals("") || goodsname.equals("") || describe.equals("") || cat.equals("")) { toast("信息不完整,请检查。"); } else { Log.e("AddGoods里的update()方法", "种类cat为" + cat); new_mShopG.setShopname(ShopName); new_mShopG.setGoodsname(goodsname); new_mShopG.setDescription(describe); new_mShopG.setPrice(p); new_mShopG.setGcat(cat); //上传数据 new_mShopG.save(AddGoods.this, new SaveListener() { @Override public void onSuccess() { toast("商品已添加!快去管理你的小店吧~"); finish(); } @Override public void onFailure(int i, String s) { toast("添加商品失败"+s); } }); } } }); /* ShopG mShopG = new ShopG(); mShopG.setShopname(ShopName); mShopG.setGoodsname(goodsname); mShopG.setDescription(describe); mShopG.setPrice(price); mShopG.setGcat(cat); //上传数据 mShopG.save(AddGoods.this, new SaveListener() { @Override public void onSuccess() { toast("商品已添加!快去管理你的小店吧~"); } @Override public void onFailure(int i, String s) { toast("添加商品失败!请重新尝试"); } });*/ } private void writeProperty(String pro_name, String pro_value) throws IOException { File file = new File(pro_file_path); if (!file.exists()) { file.createNewFile(); } FileOutputStream output = new FileOutputStream(file); Properties pro = new Properties(); pro.put(pro_name, pro_value); pro.store(output, null); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != RESULT_CANCELED) { Log.i("onActivityResult :", "is running ???"); switch (requestCode) { case IMAGE_REQUEST_CODE: startPhotoZoom(data.getData()); break; case CAMERA_REQUEST_CODE: if (hasSdcard()) { File tempFile = new File( Environment.getExternalStorageDirectory() + "/" + IMAGE_FILE_NAME); // Log.e("is the file",""); Log.i("onActivityResult:", "is running ???2"); startPhotoZoom(Uri.fromFile(tempFile)); } else { //Toast.makeText(UserInfoActivity.this, // "", Toast.LENGTH_LONG).show(); } break; case RESULT_REQUEST_CODE: if (data != null) { getImageToView(data); } break; } } super.onActivityResult(requestCode, resultCode, data); } public void startPhotoZoom(Uri uri) { Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(uri, "image/*"); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExtra("outputX", 320); intent.putExtra("outputY", 320); intent.putExtra("return-data", true); startActivityForResult(intent, 2); } private void getImageToView(Intent data) { Bundle extras = data.getExtras(); if (extras != null) { Bitmap photo = extras.getParcelable("data"); saveShopBitmap(photo); // Drawable drawable = new BitmapDrawable(photo); // face_image.setImageDrawable(drawable); ibPic.setImageBitmap(photo); //photo. } } private void saveShopBitmap(Bitmap photo) { BufferedOutputStream buffer_out = new BufferedOutputStream(out); photo.compress(Bitmap.CompressFormat.PNG, 100, buffer_out); try { buffer_out.flush(); buffer_out.close(); } catch (IOException e) { // TODO Auto-generated catch block Log.e("write bitmap:", "error!!!!!!!!!!!!!!!!!!"); e.printStackTrace(); } } private void toast(String text) { Toast.makeText(AddGoods.this, text, Toast.LENGTH_SHORT).show(); ; } }
[ "qingchun_w@sina.com" ]
qingchun_w@sina.com
bba86f7c3cf458fc2861ae5dbd2e811f6078319e
14f2e4bb1add511b63bb4886b15c5040a5dada77
/src/utils/sort/BubbleSorter.java
005b1a618f437135ad61c353596108437445815e
[]
no_license
lizhaowei/lzw
e2150baf4508cf3bb975477c6d4db1b360f00485
4651a1e20d7d88e371504f7ee387d4f0af90f38b
refs/heads/master
2016-09-05T12:49:15.719190
2014-01-15T16:54:54
2014-01-15T16:54:54
null
0
0
null
null
null
null
GB18030
Java
false
false
1,232
java
package utils.sort; /** * 冒泡排序<br> * * <pre> * 这可能是最简单的排序算法了,算法思想是每次从数组末端开始比较相邻两元素,把第i小的冒泡到 * 数组的第i个位置。i从0一直到N-1从而完成排序。(当然也可以从数组开始端开始比较相邻两元素, * 把第i大的冒泡到数组的第N-i个位置。i从0一直到N-1从而完成排序。) * </pre> * * @author 李赵伟 * @param <E> */ public class BubbleSorter<E extends Comparable<E>> extends Sorter<E> { private static boolean DWON = true; private final void bubble_down(E[] array, int from, int len) { for (int i = from; i < from + len; i++) { for (int j = from + len - 1; j > i; j--) { if (array[j].compareTo(array[j - 1]) < 0) { swap(array, j - 1, j); } } } } private final void bubble_up(E[] array, int from, int len) { for (int i = from + len - 1; i >= from; i--) { for (int j = from; j < i; j++) { if (array[j].compareTo(array[j + 1]) > 0) { swap(array, j, j + 1); } } } } @Override public void sort(E[] array, int from, int len) { if (DWON) { bubble_down(array, from, len); } else { bubble_up(array, from, len); } } }
[ "weizhaoli@gmail.com" ]
weizhaoli@gmail.com
ffdc8a5149836c7d8768f10ff3780f2de0e71820
71aabef4b162ee6b7ad8248fe578a4ec78a1d761
/src/main/java/com/programapprentice/app/FlattenBinaryTreeToLinkedList_114.java
33e5854350d2fa703e8d680896a069469a681b03
[]
no_license
program-apprentice/leetcode
9eb67066a45f67c459e6a59268669ed58c82520b
38dab4d4faa04d48d2052ad31322eff34cb0dae3
refs/heads/master
2021-01-16T17:45:45.644339
2015-11-11T05:16:22
2015-11-11T05:16:22
40,210,317
0
0
null
null
null
null
UTF-8
Java
false
false
1,398
java
package com.programapprentice.app; import com.programapprentice.util.TreeNode; /** * User: program-apprentice * Date: 9/7/15 * Time: 8:33 PM */ public class FlattenBinaryTreeToLinkedList_114 { // Recursive is too slow public void flatten_v1(TreeNode root) { if(root == null) { return; } flatten_v1(root.left); TreeNode p = root.left; if(p != null) { while (p.right != null) { p = p.right; } flatten_v1(root.right); p.right = root.right; root.right = root.left; } } public void flatten(TreeNode root) { flatten2(root); } // return last node in flatten public TreeNode flatten2(TreeNode root) { if(root == null) { return root; // wrong: return null } if(root.left == null && root.right == null) { return root; } TreeNode left = root.left; TreeNode right = root.right; TreeNode leftLast = flatten2(left); if(leftLast != null) { root.left = null; // missing this one. root.right = left; // wrong: root.left = left leftLast.right = right; } TreeNode rightLast = flatten2(right); if(rightLast != null) { return rightLast; } return leftLast; } }
[ "rui.jiang.tech@gmail.com" ]
rui.jiang.tech@gmail.com
525d26787a78ddd0c7a0b69d1ae4d4a3a216ab74
8c88ef471a572d4eb47c283b46f3cd7e3b8d93b9
/src/main/java/com/great/childschool/tools/ZipUtil.java
bec0c0be383b6e6fafd0ab73977a59407eca490e
[]
no_license
JeoYan/ChildSchool
af208dbd3a7b83b00e1b655632ceec5bfd9af090
667a2c87ee8882629851a24d1811efe8f8df1763
refs/heads/master
2022-07-06T09:31:24.657594
2020-01-10T02:20:05
2020-01-10T02:20:05
228,354,191
0
0
null
2022-05-20T21:19:49
2019-12-16T09:50:15
JavaScript
UTF-8
Java
false
false
3,567
java
package com.great.childschool.tools; import org.apache.commons.io.FileUtils; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class ZipUtil { public static ResponseEntity<byte[]> downLoadFiles(List<File> files,String bookName, HttpServletResponse response) throws Exception { ResponseEntity<byte[]> responseEntity=null; try { // List<File> 作为参数传进来,就是把多个文件的路径放到一个list里面 // 创建一个临时压缩文件 // 临时文件可以放在CDEF盘中,但不建议这么做,因为需要先设置磁盘的访问权限,最好是放在服务器上,方法最后有删除临时文件的步骤 String zipFilename = "F:/"+bookName+".rar"; File file = new File(zipFilename); file.createNewFile(); if (!file.exists()) { file.createNewFile(); } response.reset(); // response.getWriter() // 创建文件输出流 FileOutputStream fous = new FileOutputStream(file); ZipOutputStream zipOut = new ZipOutputStream(fous); zipFile(files, zipOut); zipOut.close(); fous.close(); responseEntity=export(file); } catch (Exception e) { e.printStackTrace(); } return responseEntity; } /** * 把接受的全部文件打成压缩包 * * */ public static void zipFile(List files, ZipOutputStream outputStream) { int size = files.size(); for (int i = 0; i < size; i++) { File file = (File) files.get(i); zipFile(file, outputStream); } } /** * 根据输入的文件与输出流对文件进行打包 * * */ public static void zipFile(File inputFile, ZipOutputStream ouputStream) { try { if (inputFile.exists()) { if (inputFile.isFile()) { FileInputStream IN = new FileInputStream(inputFile); BufferedInputStream bins = new BufferedInputStream(IN, 512); ZipEntry entry = new ZipEntry(inputFile.getName()); ouputStream.putNextEntry(entry); // 向压缩文件中输出数据 int nNumber; byte[] buffer = new byte[512]; while ((nNumber = bins.read(buffer)) != -1) { ouputStream.write(buffer, 0, nNumber); } // 关闭创建的流对象 bins.close(); IN.close(); } else { try { File[] files = inputFile.listFiles(); for (int i = 0; i < files.length; i++) { zipFile(files[i], ouputStream); } } catch (Exception e) { e.printStackTrace(); } } } } catch (Exception e) { e.printStackTrace(); } } public static ResponseEntity<byte[]> export(File file) { HttpHeaders headers = new HttpHeaders(); // MediaType:互联网媒介类型 contentType:具体请求中的媒体类型信息 headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", file.getName()); System.out.println("-----file-------"+file); System.out.println("-----file.getName()-------"+file.getName()); ResponseEntity<byte[]> responseEntity= null; try { responseEntity = new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file), headers, HttpStatus.CREATED); } catch (IOException e) { e.printStackTrace(); }finally { file.delete(); } return responseEntity; } }
[ "215476838@qq.com" ]
215476838@qq.com
e0c3648c25df6f2deff43e7e530ddc9beb89bfbe
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/android/support/v4/app/FragmentManager.java
aaab41cb29b801ef5ef1ad65289af4f5f7b296fd
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,412
java
package android.support.v4.app; import android.os.Bundle; import android.support.annotation.IdRes; import android.support.annotation.StringRes; import android.support.v4.app.Fragment.SavedState; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.List; public abstract class FragmentManager { public static final int POP_BACK_STACK_INCLUSIVE = 1; public interface BackStackEntry { CharSequence getBreadCrumbShortTitle(); @StringRes int getBreadCrumbShortTitleRes(); CharSequence getBreadCrumbTitle(); @StringRes int getBreadCrumbTitleRes(); int getId(); String getName(); } public interface OnBackStackChangedListener { void onBackStackChanged(); } public abstract void addOnBackStackChangedListener(OnBackStackChangedListener onBackStackChangedListener); public abstract FragmentTransaction beginTransaction(); public abstract void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr); public abstract boolean executePendingTransactions(); public abstract Fragment findFragmentById(@IdRes int i); public abstract Fragment findFragmentByTag(String str); public abstract BackStackEntry getBackStackEntryAt(int i); public abstract int getBackStackEntryCount(); public abstract Fragment getFragment(Bundle bundle, String str); public abstract List<Fragment> getFragments(); public abstract boolean isDestroyed(); public abstract boolean isExecutingActions(); public abstract void popBackStack(); public abstract void popBackStack(int i, int i2); public abstract void popBackStack(String str, int i); public abstract boolean popBackStackImmediate(); public abstract boolean popBackStackImmediate(int i, int i2); public abstract boolean popBackStackImmediate(String str, int i); public abstract void putFragment(Bundle bundle, String str, Fragment fragment); public abstract void removeOnBackStackChangedListener(OnBackStackChangedListener onBackStackChangedListener); public abstract SavedState saveFragmentInstanceState(Fragment fragment); @Deprecated public FragmentTransaction openTransaction() { return beginTransaction(); } public static void enableDebugLogging(boolean z) { FragmentManagerImpl.a = z; } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
23d685674e7bd700d78b6e72d3afdfd49a3dd78f
f69921ab69c305d90a5dd5f6c3b93f3ffb7e6f6e
/jars/gwt-g3d/gwt-g3d-base/src/gwt/g3d/client/gl2/enums/TextureWrapMode.java
49c7559b07fe1c6d1ce04bddcfabc8fc6e5ba5cb
[]
no_license
thallium205/bitcoin-visualizer
6ed1f4795e21e8c7677ead58b7dd4f3b5183c738
aaf29c2ccfabd6ed0b82701d82cfe0368f2512d1
refs/heads/master
2021-01-10T21:45:22.092511
2011-12-07T07:16:03
2011-12-07T07:16:03
2,044,919
1
1
null
null
null
null
UTF-8
Java
false
false
1,621
java
/* * Copyright 2009 Hao Nguyen * * 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 gwt.g3d.client.gl2.enums; import java.util.HashMap; import java.util.Map; /** * TextureWrapMode flags. * * @author hao1300@gmail.com */ public enum TextureWrapMode { REPEAT(GLEnum.REPEAT), CLAMP_TO_EDGE(GLEnum.CLAMP_TO_EDGE), MIRRORED_REPEAT(GLEnum.MIRRORED_REPEAT); private static Map<Integer, TextureWrapMode> textureWrapModeMap; private final int value; private TextureWrapMode(GLEnum glEnum) { this.value = glEnum.getValue(); } /** * Gets the enum's numerical value. */ public int getValue() { return value; } /** * Parses an integer value to its corresponding TextureWrapMode enum. * * @param textureWrapMode */ public static TextureWrapMode parseTextureWrapMode(int textureWrapMode) { if (textureWrapModeMap == null) { textureWrapModeMap = new HashMap<Integer, TextureWrapMode>(); for (TextureWrapMode v : values()) { textureWrapModeMap.put(v.getValue(), v); } } return textureWrapModeMap.get(textureWrapMode); } }
[ "johnrussells@gmail.com" ]
johnrussells@gmail.com
96b34f39589622f26eca9991d04b2e5515445517
f2be6aa0d9a6e2d455c04cf063cf0dfd3246aa5a
/jixiao/.svn/pristine/11/118fe961ec8fa6291db141a8c1562d8bb999e3ff.svn-base
5c02a062e1b630316b404d4e6aea73ba93b7157e
[]
no_license
platinumhamburg/jixiao
33b7a6228f8b0e41714fbbdc1812db45a38d067a
874a4d618c9fbb01851cd2fd2a8b344474b3e89c
refs/heads/master
2021-01-10T21:49:00.690878
2015-05-25T17:41:05
2015-05-25T17:41:05
36,075,373
0
3
null
null
null
null
UTF-8
Java
false
false
5,922
package com.hoyotech.prison.action; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.ServletActionContext; import com.hoyotech.prison.bean.ContrabandGoods; import com.hoyotech.prison.bean.Police; import com.hoyotech.prison.bean.PrisonerContrabandGoods; import com.hoyotech.prison.log.LogFactory; import com.hoyotech.prison.service.impl.DictionaryService; import com.hoyotech.prison.service.impl.PrisonerContrabandGoodsService; import com.hoyotech.prison.util.ConfigHelper; import com.hoyotech.prison.util.ObjectUpdateUtil; import com.hoyotech.prison.util.PrisonUtil; public class ContrabandGoodsAction { private PrisonerContrabandGoodsService prisonerContrabandGoodsService; private DictionaryService dictionaryService; private List<PrisonerContrabandGoods> list; private PrisonerContrabandGoods prisonerContrabandGoods; private ContrabandGoods contrabandGoods; private String id; private String prisonerId; private String type; private List<Police> policelist; private LogFactory log; public String detail(){ prisonerContrabandGoods = prisonerContrabandGoodsService.detailByPrisoner(id); return "detail"; } public String detailByPrisoner(){ prisonerContrabandGoods = prisonerContrabandGoodsService.detailByPrisoner(id); return "detail"; } public String addUI(){ selectPolice(); prisonerId = id; type = "contrabandGoods"; return "addUI"; } public void selectPolice(){ HttpServletRequest request = ServletActionContext.getRequest(); String prisonCode=PrisonUtil.getPrisonCode(request); policelist=dictionaryService.selectPolice(prisonCode); } public String addGoodsUI(){ selectPolice(); prisonerContrabandGoods = prisonerContrabandGoodsService.detail(id); prisonerId = prisonerContrabandGoods.getPrisoner().getId(); return "addGoodsUI"; } /** * 添加涉案装备 * @return */ public String addContrabandGoods(){ HttpServletRequest request=ServletActionContext.getRequest(); String prisonCode=PrisonUtil.getPrisonCode(request); contrabandGoods.setPrisonCode(prisonCode); prisonerContrabandGoodsService.addContrabandGoods(contrabandGoods); // 添加日志 ConfigHelper config = ConfigHelper.getConfig(); String operate = "添加成功。"; log.getInsertLogMessage(contrabandGoods, config.getInsert(), operate, config.getContrabandGood(), config.getSucceed(), request); return "seccess"; } /** * 添加 * @return */ public String add(){ addContrabandGoods(); prisonerContrabandGoods.setNoYear(PrisonUtil.getYear());//添加流水号 prisonerContrabandGoods.setNoNumber(dictionaryService.getNo("PrisonerContrabandGoods")); HttpServletRequest request=ServletActionContext.getRequest(); String prisonCode=PrisonUtil.getPrisonCode(request); prisonerContrabandGoods.setPrisonCode(prisonCode); prisonerContrabandGoodsService.add(prisonerContrabandGoods); id = prisonerContrabandGoods.getPrisoner().getId(); type = "contrabandGoods"; // 添加日志 ConfigHelper config = ConfigHelper.getConfig(); String operate = "添加成功。"; log.getInsertLogMessage(prisonerContrabandGoods, config.getInsert(), operate, config.getContrabandGood(), config.getSucceed(), request); return "main"; } /** * 添加涉案物品 * @return */ public String add1(){ addContrabandGoods(); id = prisonerContrabandGoods.getId(); PrisonerContrabandGoods object = prisonerContrabandGoodsService.detail(id); ObjectUpdateUtil.compareProperty(prisonerContrabandGoods, object); prisonerContrabandGoodsService.update(object); id = prisonerContrabandGoods.getPrisoner().getId(); // 添加日志 PrisonerContrabandGoods old_obj = prisonerContrabandGoodsService.detail(id); HttpServletRequest request = ServletActionContext.getRequest(); ConfigHelper config = ConfigHelper.getConfig(); String operate = "修改成功。"; log.getModifyLogMessage(object, old_obj, config.getUpdate(), operate, config.getContrabandGood(), config.getSucceed(), request); return "Detail"; } public String doc(){ prisonerContrabandGoods = prisonerContrabandGoodsService.detailByPrisoner(prisonerId); return "doc"; } public PrisonerContrabandGoodsService getPrisonerContrabandGoodsService() { return prisonerContrabandGoodsService; } public void setPrisonerContrabandGoodsService( PrisonerContrabandGoodsService prisonerContrabandGoodsService) { this.prisonerContrabandGoodsService = prisonerContrabandGoodsService; } public DictionaryService getDictionaryService() { return dictionaryService; } public void setDictionaryService(DictionaryService dictionaryService) { this.dictionaryService = dictionaryService; } public List<Police> getPolicelist() { return policelist; } public void setPolicelist(List<Police> policelist) { this.policelist = policelist; } public String getType() { return type; } public void setType(String type) { this.type = type; } public List<PrisonerContrabandGoods> getList() { return list; } public void setList(List<PrisonerContrabandGoods> list) { this.list = list; } public PrisonerContrabandGoods getPrisonerContrabandGoods() { return prisonerContrabandGoods; } public void setPrisonerContrabandGoods( PrisonerContrabandGoods prisonerContrabandGoods) { this.prisonerContrabandGoods = prisonerContrabandGoods; } public ContrabandGoods getContrabandGoods() { return contrabandGoods; } public void setContrabandGoods(ContrabandGoods contrabandGoods) { this.contrabandGoods = contrabandGoods; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPrisonerId() { return prisonerId; } public void setPrisonerId(String prisonerId) { this.prisonerId = prisonerId; } public LogFactory getLog() { return log; } public void setLog(LogFactory log) { this.log = log; } }
[ "platinumhamburg@gmail.com" ]
platinumhamburg@gmail.com
8862036c37fa3addf5931052c49b912b9e92bf4a
8820fc33ecd70d398573e205e359e9d0d3447f24
/src/main/java/com/wiselink/exception/ServiceException.java
d3e78372160762fd537c93f2fc79526a91babc86
[]
no_license
leoyonn/erp
06bc95a9328628ec7d1397143b6a888eacbe500c
34a9671e59fa3dfcb15a43a7b990e5daa25110ef
refs/heads/master
2021-01-10T20:36:53.926279
2013-09-14T06:24:12
2013-09-14T06:24:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
615
java
/** * ServiceException.java * [CopyRight] * @author leo [leoyonn@gmail.com] * @date 2013-6-14 下午6:15:25 */ package com.wiselink.exception; /** * 服务层出现的异常 * @author leo */ public class ServiceException extends Exception { private static final long serialVersionUID = 1L; public ServiceException() { super(); } public ServiceException(String message) { super(message); } public ServiceException(String message, Throwable cause) { super(message, cause); } public ServiceException(Throwable cause) { super(cause); } }
[ "leoyonn@gmail.com" ]
leoyonn@gmail.com
8d2d2a8a335568d4b66bd54323faf460e2273a2a
1e225a48a7cbd7e7bb6f8a2d3922cb5b69767b55
/mybatisPlus/src/main/java/com/example/demo/person/controller/PersonController.java
e89b6139a0452ebfbf928014269b127788a300c3
[]
no_license
zpTree/USDemo
5dfe9ee12bd6d864707d3d7e2dafb8cfe612d04c
5fc9253eee6b44bd5bdad705b421492a90149f60
refs/heads/master
2020-04-02T03:45:04.290698
2019-06-14T16:59:39
2019-06-14T16:59:39
153,982,255
0
0
null
2019-10-31T12:17:28
2018-10-21T07:05:25
Java
UTF-8
Java
false
false
803
java
package com.example.demo.person.controller; import com.example.demo.person.entity.Person; import com.example.demo.person.service.IPersonService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ResponseBody; /** * <p> * 前端控制器 * </p> * * @author ZP * @since 2019-06-14 */ @Controller @RequestMapping("/person") public class PersonController { @Autowired private IPersonService personService; @RequestMapping("getPerson") @ResponseBody public String getPerson(){ Person p = personService.getById("1"); System.out.print("getPerson"); return p.toString(); } }
[ "1075019367@qq.com" ]
1075019367@qq.com
87bac4666e7060dd3ba53d28207ebb5dd3066664
414fdd8d8805138259872b50d4370038c0a025fb
/priyatham workspace/TODO APP/tasks/src/com/example/tasks/categories/YearlyCls.java
2e5619e30d03b92c6b2793e4562272161e131806
[]
no_license
suryaharshan1/android-windroilla
d16295a23d5d597ed7cb45e22153b9ff28c10abd
fc50ff05689a68ba0696d306d1081525777a8012
refs/heads/master
2020-04-05T23:19:58.776502
2014-08-02T20:21:47
2014-08-02T20:21:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,610
java
package com.example.tasks.categories; import java.util.ArrayList; import java.util.List; import com.example.tasks.CustomAdapter; import com.example.tasks.R; import com.example.tasks.RowItem; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; 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.ListView; public class YearlyCls extends Fragment { List<RowItem> rowItems; RowItem itemData; CustomAdapter adapter; SQLiteDatabase db; Cursor cu; View rootView; ListView l1; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub rootView =inflater.inflate(R.layout.yearly, container,false); rowItems = new ArrayList<RowItem>(); l1=(ListView)rootView.findViewById(R.id.listyearly); adapter = new CustomAdapter(getActivity(), rowItems); l1.setAdapter(adapter); //======================================== db = getActivity().openOrCreateDatabase("tasks", getActivity().MODE_WORLD_WRITEABLE,null); db.execSQL("create table if not exists tasksdetails(name VARCHAR,time VARCHAR,priority VARCHAR,category VARCHAR)"); //db.execSQL("drop table tasksdetails"); cu= db.rawQuery("select * from tasksdetails where category ='YEARLY' and priority ='HIGH'", null); // null is for mode. while(cu.moveToNext()){ RowItem item = new RowItem(R.drawable.high,""+cu.getString(0),""+cu.getString(1),cu.getString(2),"("+cu.getString(3)+")"); rowItems.add(item); adapter.notifyDataSetChanged(); } cu= db.rawQuery("select * from tasksdetails where category ='YEARLY' and priority ='NORMAL'", null); // null is for mode. while(cu.moveToNext()){ RowItem item = new RowItem(R.drawable.normal,""+cu.getString(0),""+cu.getString(1),cu.getString(2),"("+cu.getString(3)+")"); rowItems.add(item); adapter.notifyDataSetChanged(); } cu= db.rawQuery("select * from tasksdetails where category ='YEARLY' and priority ='LOW'", null); // null is for mode. while(cu.moveToNext()){ RowItem item = new RowItem(R.drawable.low,""+cu.getString(0),""+cu.getString(1),cu.getString(2),"("+cu.getString(3)+")"); rowItems.add(item); adapter.notifyDataSetChanged(); } return rootView; } }
[ "priyathamkumaravvaru95@gmail.com" ]
priyathamkumaravvaru95@gmail.com
2acff1316d708a3c4b5c9600f4f088f0616b5db7
9f04e9f9a22ecddfce6260e552878c359ea9273a
/FMP/api/src/main/java/ua/softserve/rv036/findmeplace/config/WebMvcConfig.java
41c1f55283266ba624cd8abc32eee45144219027
[]
no_license
alexleokyky/study-devops
83354267cce59eb7b88a1bd455daf42c9e22bf2d
181041d814e361a3f6763d4db11c5b0a28814205
refs/heads/master
2020-04-30T04:37:13.090976
2019-04-01T13:22:58
2019-04-01T13:22:58
176,614,489
0
0
null
null
null
null
UTF-8
Java
false
false
654
java
package ua.softserve.rv036.findmeplace.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class WebMvcConfig implements WebMvcConfigurer { private final long MAX_AGE_SECS = 3600; @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("*") .allowedMethods("HEAD", "OPTIONS", "GET", "POST", "PUT", "PATCH", "DELETE") .maxAge(MAX_AGE_SECS); } }
[ "alex.leo.kyky@gmail.com" ]
alex.leo.kyky@gmail.com
6699f4994ce313c48f268499e2d5c9ef1abdbcd5
e434c81fb59ecaeacbc3da9dd4a24c3bac8c99e3
/TuanNgoaiLe_Exception/FileNotFoundException.java
52c7e553073ba2f151c5986232c5e51da8680f4e
[]
no_license
HuyNguyen1302/OOP2020
b12a5fd9cebe05c061acf0b10e43c1e9e14ff522
b307b4a3ad45174fa0f343695457ef6b56a8d4e0
refs/heads/master
2022-12-01T00:53:48.583277
2020-08-21T07:23:20
2020-08-21T07:23:20
284,185,277
0
0
null
2020-08-07T18:09:59
2020-08-01T04:23:12
Java
UTF-8
Java
false
false
750
java
package Task2; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class FileNotFoundException { static String filename = "f_out.txt"; public static void readFile(String filename) throws java.io.FileNotFoundException, IOException { BufferedReader br; FileReader f = new FileReader("f_out.txt"); br = new BufferedReader(f); System.out.println(br.lines()); } public static void main(String[] args) { try { readFile(filename); } catch ( java.io.FileNotFoundException e) { System.out.println("Không tìm thấy file"); } catch (IOException e) { System.out.println(e.getMessage()); } } }
[ "sonogami.rin@gmail.com" ]
sonogami.rin@gmail.com
8a70276bab3969ea6d91b26150a79aa88d724c9f
1620dff752885cbdc96c667752affea6b9dfe8f0
/eTAAP-Dashboard-Rectifier/src/com/etaap/beans/CommitedCompletedUserStoryCategory.java
bd7b617703fd4be092bf32d1c0c46d2dc2a081b6
[]
no_license
hmarimuthu/Dashboard
e30ffcc2f491c1afa28ecf3ca94a6d1af7c09266
3a84785bca75c74fdcdca81eceeb30fa462cd02b
refs/heads/master
2021-01-20T18:52:13.238828
2016-07-13T22:09:20
2016-07-13T22:09:20
63,282,609
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package com.etaap.beans; import java.util.ArrayList; import java.util.List; public class CommitedCompletedUserStoryCategory { String name; List<String> categories = new ArrayList<String>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public List<String> getCategories() { return categories; } public void setCategories(List<String> categories) { this.categories = categories; } }
[ "senthilss@gmail.com" ]
senthilss@gmail.com
0a1f47e56ddf9bb54795de75f9fd901fdbe4ed91
f021a194631fd6f8549686a651c0e22d5f24802c
/src/test/java/org/apache/lucene/tr/TestZemberek3StemFilter.java
30add8cb8d52027f8342ecd1c7af70fa08eb8397
[ "Apache-2.0" ]
permissive
iorixxx/lucene-solr-analysis-turkish
929d556baeac77e2ae03e52a84f2d62b604da9f4
4d4ff9cef2a17616726c07503909e9e66783f759
refs/heads/master
2022-12-15T23:51:43.255830
2022-10-15T06:57:58
2022-10-15T06:57:58
18,417,264
77
24
Apache-2.0
2022-12-04T17:54:42
2014-04-03T20:31:55
Java
UTF-8
Java
false
false
3,712
java
package org.apache.lucene.tr; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.tests.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.custom.CustomAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tr.MyTurkishMorphology; import org.apache.lucene.analysis.tr.TurkishLowerCaseFilter; import org.apache.lucene.analysis.tr.Zemberek3StemFilter; import org.apache.lucene.analysis.tr.Zemberek3StemFilterFactory; import org.junit.Test; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; public class TestZemberek3StemFilter extends BaseTokenStreamTestCase { private static final MyTurkishMorphology morphology = MyTurkishMorphology.createWithDefaults(); @Test public void testSomeWords() throws Exception { TokenStream stream = whitespaceMockTokenizer("kuş gribi aşısı ortaklar çekişme masalı TİCARETİN DE ARTMASI BEKLENİYOR"); stream = new Zemberek3StemFilter(stream, morphology, "maxLength"); assertTokenStreamContents(stream, new String[]{"kuş", "grip", "aşı", "ortak", "çekişme", "masal", "ticaret", "de", "artma", "beklen"}); } @Test public void testUnrecognizedWords() throws Exception { TokenStream stream = whitespaceMockTokenizer("kuku euro"); stream = new Zemberek3StemFilter(stream, morphology, "maxLength"); assertTokenStreamContents(stream, new String[]{"kuku", "euro"}); } @Test public void test4SP() throws Exception { Analyzer analyzer = CustomAnalyzer.builder() .withTokenizer("standard") .addTokenFilter("turkishlowercase") .addTokenFilter(Zemberek3StemFilterFactory.class) .build(); System.out.println(getAnalyzedTokens("4g.x", analyzer)); System.out.println(getAnalyzedTokens("0.25", analyzer)); System.out.println(getAnalyzedTokens(".", analyzer)); System.out.println(getAnalyzedTokens("bulun.duğunu", analyzer)); assertTrue(getAnalyzedTokens(".", analyzer).isEmpty()); identity("4g.x"); identity("0.25"); identity("."); TokenStream stream = whitespaceMockTokenizer("4S.P"); stream = new TurkishLowerCaseFilter(stream); stream = new Zemberek3StemFilter(stream, morphology, "maxLength"); assertTokenStreamContents(stream, new String[]{"4s.p"}); } private void identity(String word) throws Exception { TokenStream stream = whitespaceMockTokenizer(word); stream = new TurkishLowerCaseFilter(stream); stream = new Zemberek3StemFilter(stream, morphology, "maxLength"); assertTokenStreamContents(stream, new String[]{word}); } /** * Modified from : http://lucene.apache.org/core/4_10_2/core/org/apache/lucene/analysis/package-summary.html */ public static List<String> getAnalyzedTokens(String text, Analyzer analyzer) { final List<String> list = new ArrayList<>(); try (TokenStream ts = analyzer.tokenStream("FIELD", new StringReader(text))) { final CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class); ts.reset(); // Resets this stream to the beginning. (Required) while (ts.incrementToken()) list.add(termAtt.toString()); ts.end(); // Perform end-of-stream operations, e.g. set the final offset. } catch (IOException ioe) { throw new RuntimeException("happened during string analysis", ioe); } return list; } }
[ "iorixxx@yahoo.com" ]
iorixxx@yahoo.com
8c780129311f172e4c3845a6df87cd2afb6a2571
495a9c0ed3b604693c115ede93a35d61e4e606e0
/src/LamportProtocol.java
8b980c3a602834da50a45bddb617c0cd61448a59
[]
no_license
GauravNaresh/Lamport_MutualExclusion
f68a242d72f57e4362b4c7bc585c1e1274126563
89f4e03ba69a82eed8db2655deec81753c8b2fab
refs/heads/master
2022-12-08T20:20:35.232202
2020-09-02T00:51:29
2020-09-02T00:51:29
292,126,612
1
0
null
null
null
null
UTF-8
Java
false
false
4,118
java
import java.util.HashMap; import java.util.PriorityQueue; import java.util.ArrayList; import java.util.Random; public class LamportProtocol implements MESProvider { Messenger messenger; ProjectMain use; HashMap<Integer, Long> lastMessageTimes = new HashMap<Integer, Long>(); PriorityQueue<CSRequest> pq = new PriorityQueue<CSRequest>(); int N; int nodeId; long temp_clk; Object lock = new Object(); boolean inCriticalSection = false; CSRequest currentRequest = null; ArrayList<Integer> requestsWhenInCS = new ArrayList<Integer>(); public LamportProtocol(Messenger messenger, int nodeId, int N){ this.use = (ProjectMain)messenger; this.messenger = messenger; this.nodeId = nodeId; this.N = N; } public void initialize(){ currentRequest = null; inCriticalSection = false; lastMessageTimes.clear(); requestsWhenInCS.clear(); } public void process(Object message, int senderId, long sendTime, long receiveTime){ synchronized(this){ if(inCriticalSection){ if(message instanceof LamportRequestMessage){ System.out.println("received a request message in cs"); pq.add(new CSRequest(senderId, sendTime)); requestsWhenInCS.add(senderId); } else if (message instanceof LamportReplyMessage){ } else if (message instanceof LamportReleaseMessage){ ; } else { ; } } else { if(message instanceof LamportRequestMessage){ CSRequest nextRequest = new CSRequest(senderId, sendTime); if(currentRequest != null && (currentRequest.compareTo(nextRequest) < 0)){ pq.add(nextRequest); } else { pq.add(nextRequest); messenger.send(new LamportReplyMessage(), senderId); } } else if (message instanceof LamportReplyMessage){ ; } else if (message instanceof LamportReleaseMessage){ pq.poll(); } else { ; } if(currentRequest != null){ lastMessageTimes.put(senderId, sendTime); if(l1() && l2()){ inCriticalSection = true; notify(); } } } } } public void csEnter() { synchronized(this){ initialize(); currentRequest = new CSRequest(nodeId, -1); currentRequest.clock = messenger.broadcast(new LamportRequestMessage(), false); temp_clk = currentRequest.clock; String nodex = "Node " + Integer.toString(nodeId) + " Entered CS: " + Long.toString(currentRequest.clock); System.out.println(nodex); this.use.output.add(nodex); this.use.cat.add(nodex); pq.add(currentRequest); while(!inCriticalSection){ try{ wait(this.use.getCSdelay()); System.out.println("done waiting!!" + inCriticalSection); } catch (InterruptedException iex){ ; } } return; } } public void csExit() { long temp; synchronized(this){ System.out.println("got the lock!"); messenger.broadcast(new LamportReleaseMessage(), false); pq.poll(); for(int i:requestsWhenInCS){ messenger.send(new LamportReplyMessage(), i); } initialize(); requestsWhenInCS.clear(); inCriticalSection = false; temp= temp_clk+ this.use.getCSdelay(); String nodey = "Node " + Integer.toString(nodeId) + " exits CS: " + Long.toString(temp); System.out.println(nodey); this.use.output.add(nodey); this.use.cat.add(nodey); } } public boolean l1(){ if(currentRequest!=null && lastMessageTimes.size() >= (N - 1)){ for(Integer i: lastMessageTimes.keySet()){ if(i!=nodeId){ if(lastMessageTimes.get(i) <= currentRequest.clock){ return false; } } } return true; } return false; } public boolean l2(){ if(!pq.isEmpty()){ CSRequest next = pq.peek(); if(next.nodeId == this.nodeId){ return true; } else { return false; } } return false; } } class CSRequest implements Comparable<CSRequest>{ int nodeId; long clock; CSRequest(int nodeId, long clock){ this.nodeId = nodeId; this.clock = clock; } public int compareTo(CSRequest o) { if(this.clock == o.clock){ return this.nodeId - o.nodeId; } else if(this.clock > o.clock){ return 1; } else { return -1; } } }
[ "gauravnaresh97@gmail.com" ]
gauravnaresh97@gmail.com
38748a77818e136c2e262507b2789c1df0c51e23
677e3f9b2be1b6066bc1a5dc59b1bf29d4395882
/SCT2/tags/ci-build/jenkins-YAKINDU_SCT2_CI-799/test-plugins/org.yakindu.sct.generator.java.runtime.test/src-gen/org/yakindu/sct/runtime/java/test_hierarchy/Test_HierarchyCycleBasedStatemachine.java
386e1b52f1d2bc68b9439b74e8f23b3114217d16
[]
no_license
peterharaszin/yakindu
5647464966b6fb953272603441fd08d412c27a18
6990984f2c67a853f02cfc7a58e1741f136032f0
refs/heads/master
2021-01-10T21:33:19.748169
2015-04-22T12:52:50
2015-04-22T12:52:50
34,406,387
0
0
null
null
null
null
UTF-8
Java
false
false
20,322
java
/** Copyright (c) 2011 committers of YAKINDU and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: committers of YAKINDU - initial API and implementation */ package org.yakindu.sct.runtime.java.test_hierarchy; import java.util.Collection; import java.util.HashSet; import org.yakindu.sct.runtime.java.Event; import org.yakindu.sct.runtime.java.EventVector; import org.yakindu.sct.runtime.java.IStatemachine; public class Test_HierarchyCycleBasedStatemachine implements IStatemachine { public enum State { State1, State9, State10, State2, State3, State4, State5, State6, State7, State8, $NullState$ }; private DefaultInterfaceImpl defaultInterface; private final State[] stateVector = new State[1]; private int nextStateIndex; private final EventVector<Event<? extends Enum<?>>> occuredEvents; private final Collection<Event<? extends Enum<?>>> outEvents; public Test_HierarchyCycleBasedStatemachine() { occuredEvents = new EventVector<Event<? extends Enum<?>>>(16); outEvents = new HashSet<Event<? extends Enum<?>>>(); defaultInterface = new DefaultInterfaceImpl(this); } protected Collection<Event<? extends Enum<?>>> getOccuredEvents() { return occuredEvents; } protected Collection<Event<? extends Enum<?>>> getOutEvents() { return outEvents; } protected boolean eventOccured() { return !occuredEvents.isEmpty(); } public void init() { for (int i = 0; i < stateVector.length; i++) { stateVector[i] = State.$NullState$; } occuredEvents.clear(); } public boolean isStateActive(State state) { for (int i = 0; i < stateVector.length; i++) { if (stateVector[i] == state) { return true; } } return false; } public DefaultInterface getDefaultInterface() { return defaultInterface; } public void enter() { defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } private void reactState1() { } private void reactState9() { if (occuredEvents.contains(defaultInterface.getEventEvent1())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State9 : stateVector[0] = State.$NullState$; defaultInterface .setVarS1(defaultInterface.getVarS1() - (1)); break; case State10 : stateVector[0] = State.$NullState$; defaultInterface .setVarS1(defaultInterface.getVarS1() - (1)); break; default : break; } defaultInterface.setVarS1(defaultInterface.getVarS1() - (1)); defaultInterface.setVarS2(1); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State3; } else { if (occuredEvents.contains(defaultInterface.getEventEvent9())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS1(defaultInterface.getVarS1() - (1)); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State10; } } } private void reactState10() { if (occuredEvents.contains(defaultInterface.getEventEvent1())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State9 : stateVector[0] = State.$NullState$; defaultInterface .setVarS1(defaultInterface.getVarS1() - (1)); break; case State10 : stateVector[0] = State.$NullState$; defaultInterface .setVarS1(defaultInterface.getVarS1() - (1)); break; default : break; } defaultInterface.setVarS1(defaultInterface.getVarS1() - (1)); defaultInterface.setVarS2(1); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State3; } else { if (occuredEvents.contains(defaultInterface.getEventEvent10())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS1(defaultInterface.getVarS1() - (1)); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } } } private void reactState2() { } private void reactState3() { if (occuredEvents.contains(defaultInterface.getEventEvent6())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State3 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface.getEventEvent2())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State5; } else { if (occuredEvents.contains(defaultInterface.getEventEvent11())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface .setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface .getEventEvent14())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface .setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } } } } } private void reactState4() { } private void reactState5() { if (occuredEvents.contains(defaultInterface.getEventEvent6())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State3 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface.getEventEvent7())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State3; } else { if (occuredEvents.contains(defaultInterface.getEventEvent3())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State7; } else { if (occuredEvents.contains(defaultInterface .getEventEvent12())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface .setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface .getEventEvent15())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface .getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State10; } } } } } } private void reactState6() { } private void reactState7() { if (occuredEvents.contains(defaultInterface.getEventEvent6())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State3 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface.getEventEvent7())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State3; } else { if (occuredEvents.contains(defaultInterface.getEventEvent8())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State7 : stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); break; default : break; } defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State5; } else { if (occuredEvents.contains(defaultInterface .getEventEvent4())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State8; } } } } } private void reactState8() { if (occuredEvents.contains(defaultInterface.getEventEvent6())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State3 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface.getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface.getEventEvent7())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State5 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State7 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); break; default : break; } defaultInterface.setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State3; } else { if (occuredEvents.contains(defaultInterface.getEventEvent8())) { //Handle exit of all possible states on position 0... switch (stateVector[0]) { case State7 : stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); break; case State8 : stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); break; default : break; } defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State5; } else { if (occuredEvents.contains(defaultInterface .getEventEvent5())) { stateVector[0] = State.$NullState$; defaultInterface .setVarS2(defaultInterface.getVarS2() - (1)); defaultInterface .setVarS2(defaultInterface.getVarS2() + (1)); nextStateIndex = 0; stateVector[0] = State.State7; } else { if (occuredEvents.contains(defaultInterface .getEventEvent13())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface .getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State9; } else { if (occuredEvents.contains(defaultInterface .getEventEvent16())) { stateVector[0] = State.$NullState$; defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS2(defaultInterface .getVarS2() - (1)); defaultInterface.setVarS1(1); defaultInterface.setVarS1(defaultInterface .getVarS1() + (1)); nextStateIndex = 0; stateVector[0] = State.State10; } } } } } } } public void runCycle() { outEvents.clear(); for (nextStateIndex = 0; nextStateIndex < stateVector.length; nextStateIndex++) { switch (stateVector[nextStateIndex]) { case State1 : reactState1(); break; case State9 : reactState9(); break; case State10 : reactState10(); break; case State2 : reactState2(); break; case State3 : reactState3(); break; case State4 : reactState4(); break; case State5 : reactState5(); break; case State6 : reactState6(); break; case State7 : reactState7(); break; case State8 : reactState8(); break; default : // $NullState$ } } occuredEvents.clear(); } }
[ "yakindu@itemis.de@6a4fa09a-a2c1-c95f-7b62-f4ef5be68d87" ]
yakindu@itemis.de@6a4fa09a-a2c1-c95f-7b62-f4ef5be68d87
d71ad8f9685221efded6c035045e202dfb3d3c31
61f67f88ad20a7b78d869b648a80fa5946c57fec
/src/main/java/test/hqltest.java
7eabbda14285d73f1d492308bcf3483a79bdaf34
[]
no_license
Fullcreammilk/RJJH
23d604ab293c81d5677a48289f506604a667e0e4
18bf603c7a30c73f39ca7a866dc1cfa0c0b2eaf7
refs/heads/master
2020-03-18T21:31:14.830764
2018-07-02T14:04:31
2018-07-02T14:04:31
135,285,006
0
0
null
null
null
null
UTF-8
Java
false
false
7,128
java
package test; import com.edu.nju.wel.dao.*; import com.edu.nju.wel.model.*; import com.edu.nju.wel.service.CompanyDetailService; import com.edu.nju.wel.service.MakerDetailService; import com.edu.nju.wel.service.UserService; import com.edu.nju.wel.service.impl.CompanyDetailImpl; import com.edu.nju.wel.service.impl.MakerDetailImpl; import com.edu.nju.wel.util.Persistence; import com.edu.nju.wel.util.ToBigImage; import org.junit.Test; import org.springframework.stereotype.Controller; import javax.annotation.Resource; import java.util.Iterator; import java.util.List; import java.util.Map; /** * Created by ${WX} on 2017/4/15. */ @Controller public class hqltest { @Resource(name = "UserService") UserService userService; CompanyDetailService companyDetailService = new CompanyDetailImpl(); @Test public void test1() { UserDao userDao = DAOManager.userDao; // userDao.find("hyx"); // MovieReviewDao movieReviewDao=DAOManager.movieReviewDao; // movieReviewDao.find(); User u = new User(); u.setName("gmd"); // u.setAge(2); userDao.add(u); } // @Test // public void test2(){ // // userService= (UserServiceImpl) ApplicationContextHelper.getApplicationContext().getBean("UserService"); // List<User> list = userService.find(); // for (User u: // list) { // System.out.println(u.getId()); // // } // } @Test public void test3() { MovieReviewDao dao = DAOManager.movieReviewDao; dao.find("b"); } @Test public void test4() { MovieDetailDao dao = DAOManager.movieDetailDao; List<MovieDetailPO> list = dao.getAll(); for (MovieDetailPO po : list ) { System.out.println(po.getName()); } MovieDetailPO po = dao.getByName("The Shawshank Redemption"); System.out.println(po.getName()); Iterator<String> iterator = dao.getCreators("The Shawshank Redemption"); while (iterator.hasNext()) { System.out.println(iterator.next()); } iterator = dao.getStars("The Shawshank Redemption"); while (iterator.hasNext()) { System.out.println(iterator.next()); } } @Test public void test5() { MakerDetailDao dao = DAOManager.makerDetailDao; List<MakerDetailPO> list = dao.getAll("star"); for (MakerDetailPO po : list ) { System.out.println(po.getName()); } MakerDetailPO po = dao.getByName("Arshad Warsi"); System.out.println(po.getName()); Iterator<String> iterator = dao.getMovies("Arshad Warsi"); while (iterator.hasNext()) { System.out.println(iterator.next()); } } @Test public void test6() { System.out.println(ToBigImage.toBigImage("https://images-na.ssl-images-amazon.com/images/M/MV5BYzVlMWViZGEtYjEyYy00YWZmLThmZGEtYmM4MDZlN2Q5MmRmXkEyXkFqcGdeQXVyMTQxNzMzNDI@._V1_UX182_CR0,0,182,268_AL_.jpg")); } @Test public void test7() { List<MakerDetailPO> list = DAOManager.makerDetailDao.getAllByFirstLetter("star", "A"); // for (MakerDetailPO po:list // ) { // System.out.println(po.getName()); // } } @Test public void test8() { MovieReviewPO po = new MovieReviewPO(); po.setAll(1); po.setUseful(2); DAOManager.movieReviewDao.find(""); } @Test public void test9() { List<MovieReviewPO> list = DAOManager.movieReviewDao.find("Dangal"); for (MovieReviewPO po : list) { System.out.println(po.getAuthor()); } System.out.println(DAOManager.movieReviewDao.getPersonalReviewNum("12 Angry Men")); } @Test public void test10() { List<RewardPO> list = DAOManager.rewardDao.getByMovieName("Ben-Hur"); for (RewardPO po : list ) { System.out.println(po.getMovieName()); System.out.println(po.getPeopleName()); System.out.println(po.getRewardYear()); System.out.println(po.getRewardName()); System.out.println(po.getRewardType()); } } @Test public void test11() { DAOManager.makerDetailDao.getAll("star"); } @Test public void test12() { List<MovieDetailPO> list = DAOManager.movieDetailDao.getAll(); int count = 0; for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i).getReleDate()); count++; } System.out.println(count); } @Test public void test13() { Map<Integer, Integer> map = companyDetailService.getCompanyAwards("Twentieth Century Fox", "nomiees", "oscar"); Iterator<Integer> integerIterator = map.keySet().iterator(); while (integerIterator.hasNext()) { Integer i = integerIterator.next(); System.out.println(i + ":" + map.get(i)); } } @Test public void test14() { Map<String, Double> map = companyDetailService.getTopSix("Twentieth Century Fox"); for (String s : map.keySet()) { System.out.println(s); } } @Test public void test15() { List<LittleAwardsPO> littleAwardsPOS = DAOManager.littleAwardsDao.getByName("Woody Allen", "star"); Iterator<LittleAwardsPO> iterator = littleAwardsPOS.iterator(); LittleAwardsPO littleAwardsPO; int temp = 0; while (iterator.hasNext()) { littleAwardsPO = iterator.next(); temp += (littleAwardsPO.getWon() + littleAwardsPO.getNominated() * 0.5); System.out.println(littleAwardsPO.getWon() + " " + littleAwardsPO.getNominated()); } System.out.println(temp); } @Test public void test16() { List<MakerDetailPO> list = Persistence.getAllMaker("star"); for (MakerDetailPO po : list) { DAOManager.makerDetailDao.getByName(po.getName()); } } @Test public void test17() { List<MakerDetailPO> list = DAOManager.makerDetailDao.modify("Woody Allen", "star"); System.out.println(list.size()); for (int i = 1; i < list.size(); i++) { DAOManager.makerDetailDao.delete(list.get(i)); } DAOManager.makerDetailDao.getByName("Woody Allen"); } @Test public void test18() { MakerDetailService service = new MakerDetailImpl(); Map<String, Double> map = service.getMakerRadarMap("Woody Allen", "star"); Iterator<String> iterator = map.keySet().iterator(); while (iterator.hasNext()) { String s = iterator.next(); System.out.println(s + ":" + map.get(s)); } } @Test public void test19() { System.out.println(DAOManager.favoriteDao.getMakerByUserName("gmd","creator").get(0).getName()); } @Test public void test20(){ DAOManager.favoriteDao.getMakerByUserName("wx","creator"); } }
[ "151250136@smail.nju.edu.cn" ]
151250136@smail.nju.edu.cn
4f663c25fa1272e32bec9a613804876d23f3e618
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Closure-114/com.google.javascript.jscomp.NameAnalyzer/default/20/com/google/javascript/jscomp/NameAnalyzer_ESTest.java
1c0dfc72a0f7f0e25483bd07b18800560efb8b75
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
8,257
java
/* * This file was automatically generated by EvoSuite * Thu Jul 29 20:09:21 GMT 2021 */ package com.google.javascript.jscomp; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.google.javascript.jscomp.AbstractCompiler; import com.google.javascript.jscomp.Compiler; import com.google.javascript.jscomp.NameAnalyzer; import com.google.javascript.jscomp.Normalize; import com.google.javascript.jscomp.PeepholeSubstituteAlternateSyntax; import com.google.javascript.jscomp.StatementFusion; import com.google.javascript.rhino.Node; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.mock.java.io.MockPrintStream; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class NameAnalyzer_ESTest extends NameAnalyzer_ESTest_scaffolding { @Test(timeout = 4000) public void test00() throws Throwable { NameAnalyzer nameAnalyzer0 = new NameAnalyzer((AbstractCompiler) null, true); nameAnalyzer0.removeUnreferenced(); } @Test(timeout = 4000) public void test01() throws Throwable { NameAnalyzer nameAnalyzer0 = new NameAnalyzer((AbstractCompiler) null, true); // Undeclared exception! // try { nameAnalyzer0.process((Node) null, (Node) null); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.NodeTraversal", e); // } } @Test(timeout = 4000) public void test02() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "groupVariableDeclarations"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test03() throws Throwable { MockPrintStream mockPrintStream0 = new MockPrintStream("=T,ZYuZiWDR,H(Q"); Compiler compiler0 = new Compiler(mockPrintStream0); NameAnalyzer nameAnalyzer0 = new NameAnalyzer(compiler0, false); StatementFusion statementFusion0 = new StatementFusion(false); PeepholeSubstituteAlternateSyntax peepholeSubstituteAlternateSyntax0 = new PeepholeSubstituteAlternateSyntax(false); Node node0 = Normalize.parseAndNormalizeTestCode(compiler0, "com.google.javascript.rhino.head.ScriptableObject$GetterSlot"); nameAnalyzer0.process(node0, node0); nameAnalyzer0.process(node0, node0); assertEquals(2, Node.FLAG_THIS_UNMODIFIED); } @Test(timeout = 4000) public void test04() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "comgo^gle.javasWript.jscomp.NameAnalyzer$JsNameRefNode"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test05() throws Throwable { Compiler compiler0 = new Compiler(); NameAnalyzer nameAnalyzer0 = new NameAnalyzer(compiler0, false); Node node0 = Node.newNumber((double) 119); Node node1 = new Node(119, node0, node0, node0, node0, 8, 57); nameAnalyzer0.process(node0, node1); assertEquals(2, Node.POST_FLAG); } @Test(timeout = 4000) public void test06() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "comgo^gle.javasWript.jcomp.NameAnalyze]$Js%ameRefNode"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test07() throws Throwable { MockPrintStream mockPrintStream0 = new MockPrintStream("=T,ZYuZiWDR,H(Q"); Compiler compiler0 = new Compiler(mockPrintStream0); NameAnalyzer nameAnalyzer0 = new NameAnalyzer(compiler0, true); StatementFusion statementFusion0 = new StatementFusion(true); PeepholeSubstituteAlternateSyntax peepholeSubstituteAlternateSyntax0 = new PeepholeSubstituteAlternateSyntax(false); Node node0 = Normalize.parseAndNormalizeTestCode(compiler0, "window"); Node node1 = new Node(49, node0); nameAnalyzer0.process(node0, node1); assertFalse(node1.isNull()); } @Test(timeout = 4000) public void test08() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { compiler0.parseTestCode("wino2.K"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test09() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "com.google.javasWript.jscomp.NameAnalyzer$JsNameRefNode"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test10() throws Throwable { Compiler compiler0 = new Compiler(); NameAnalyzer nameAnalyzer0 = new NameAnalyzer(compiler0, false); Node node0 = Node.newNumber((double) 154); Node node1 = new Node(154, node0, node0, node0, node0, 8, 57); // Undeclared exception! // try { nameAnalyzer0.process(node1, node1); // fail("Expecting exception: RuntimeException"); // } catch(RuntimeException e) { // } } @Test(timeout = 4000) public void test11() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "fBhknVGzwNgz=UHF"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } @Test(timeout = 4000) public void test12() throws Throwable { Compiler compiler0 = new Compiler(); // Undeclared exception! // try { Normalize.parseAndNormalizeTestCode(compiler0, "com.googl.javascript.jscomp.NameAnalyzer$AliasSet"); // // fail("Expecting exception: IllegalArgumentException"); // Unstable assertion // } catch(IllegalArgumentException e) { // // // // Multiple entries with same key: author=NOT_IMPLEMENTED and author=AUTHOR // // // verifyException("com.google.common.collect.ImmutableMap", e); // } } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d0750548ae0c8f04ce0fcf5db316e8e2d7d3b21b
447520f40e82a060368a0802a391697bc00be96f
/apks/comparison_androart/ro.btrl.pay/source/o/Bj.java
c1f3fc28a003245084d209dceab9b15e482b4e9a
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
33,255
java
package o; import java.io.BufferedReader; import java.io.DataInput; import java.io.DataOutput; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Serializable; import java.text.ParseException; import java.util.HashMap; import java.util.StringTokenizer; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public final class Bj extends AZ<Bj> implements Serializable { private static final int[] ʻ; private static final Integer[] ʻॱ; private static final int[] ʼ; private static final Integer[] ʼॱ; private static final int[] ʽ; private static final Integer[] ʾ; private static final Integer[] ʿ; private static final int[] ˊ; private static final HashMap<Integer, Integer[]> ˊॱ; private static final int[] ˋ; private static final HashMap<Integer, Integer[]> ˋॱ; private static final int[] ˎ; private static final int[] ˏ = { 0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325 }; private static final String ˏॱ; private static final Long[] ͺ; private static final int[] ॱ; private static final HashMap<Integer, Integer[]> ॱˊ; private static final Integer[] ॱˋ; private static final Integer[] ॱˎ; private static final String ॱॱ; private static final Integer[] ॱᐝ; private static final char ᐝ; private static final Integer[] ᐝॱ; private final transient int ʽॱ; private final transient Bl ˈ; private final transient int ˉ; private final transient int ˊˊ; private final transient AL ˊˋ; private final transient int ˊᐝ; private final long ˋˊ; private final transient boolean ˋᐝ; static { ˎ = new int[] { 0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325 }; ˋ = new int[] { 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 29 }; ॱ = new int[] { 30, 29, 30, 29, 30, 29, 30, 29, 30, 29, 30, 30 }; ˊ = new int[] { 0, 1, 0, 1, 0, 1, 1 }; ʻ = new int[] { 1, 9999, 11, 51, 5, 29, 354 }; ʼ = new int[] { 1, 9999, 11, 52, 6, 30, 355 }; ʽ = new int[] { 0, 354, 709, 1063, 1417, 1772, 2126, 2481, 2835, 3189, 3544, 3898, 4252, 4607, 4961, 5315, 5670, 6024, 6379, 6733, 7087, 7442, 7796, 8150, 8505, 8859, 9214, 9568, 9922, 10277 }; ᐝ = File.separatorChar; ॱॱ = File.pathSeparator; ˏॱ = "org" + ᐝ + "threeten" + ᐝ + "bp" + ᐝ + "chrono"; ॱˊ = new HashMap(); ˋॱ = new HashMap(); ˊॱ = new HashMap(); ॱˎ = new Integer[ˏ.length]; int i = 0; while (i < ˏ.length) { ॱˎ[i] = new Integer(ˏ[i]); i += 1; } ॱᐝ = new Integer[ˎ.length]; i = 0; while (i < ˎ.length) { ॱᐝ[i] = new Integer(ˎ[i]); i += 1; } ʼॱ = new Integer[ˋ.length]; i = 0; while (i < ˋ.length) { ʼॱ[i] = new Integer(ˋ[i]); i += 1; } ʾ = new Integer[ॱ.length]; i = 0; while (i < ॱ.length) { ʾ[i] = new Integer(ॱ[i]); i += 1; } ʿ = new Integer[ʽ.length]; i = 0; while (i < ʽ.length) { ʿ[i] = new Integer(ʽ[i]); i += 1; } ͺ = new Long['Ŏ']; i = 0; while (i < ͺ.length) { ͺ[i] = new Long(i * 10631); i += 1; } ॱˋ = new Integer[ˊ.length]; i = 0; while (i < ˊ.length) { ॱˋ[i] = new Integer(ˊ[i]); i += 1; } ᐝॱ = new Integer[ʻ.length]; i = 0; while (i < ʻ.length) { ᐝॱ[i] = new Integer(ʻ[i]); i += 1; } ʻॱ = new Integer[ʼ.length]; i = 0; while (i < ʼ.length) { ʻॱ[i] = new Integer(ʼ[i]); i += 1; } try { ᐝ(); return; } catch (IOException localIOException) {}catch (ParseException localParseException) {} } private Bj(long paramLong) { int[] arrayOfInt = ʼ(paramLong); ॱ(arrayOfInt[1]); ˋ(arrayOfInt[2]); ˎ(arrayOfInt[3]); ˏ(arrayOfInt[4]); this.ˈ = Bl.ˎ(arrayOfInt[0]); this.ʽॱ = arrayOfInt[1]; this.ˊᐝ = arrayOfInt[2]; this.ˊˊ = arrayOfInt[3]; this.ˉ = arrayOfInt[4]; this.ˊˋ = AL.ˋ(arrayOfInt[5]); this.ˋˊ = paramLong; this.ˋᐝ = ʻ(this.ʽॱ); } private Object readResolve() { return new Bj(this.ˋˊ); } private Object writeReplace() { return new Bs((byte)3, this); } private static long ʻ(int paramInt) { int j = (paramInt - 1) / 30; int k = (paramInt - 1) % 30; int i = ʽ(j)[Math.abs(k)].intValue(); paramInt = i; if (k < 0) { paramInt = -i; } Object localObject1; try { Long localLong = ͺ[j]; } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject1 = null; } Object localObject2 = localObject1; if (localObject1 == null) { localObject2 = new Long(j * 10631); } return ((Long)localObject2).longValue() + paramInt - 492148L - 1L; } private static InputStream ʻ() { Object localObject1 = System.getProperty("org.threeten.bp.i18n.HijrahDate.deviationConfigFile"); Object localObject4 = localObject1; if (localObject1 == null) { localObject4 = "hijrah_deviation.cfg"; } Object localObject5 = System.getProperty("org.threeten.bp.i18n.HijrahDate.deviationConfigDir"); if (localObject5 != null) { if (((String)localObject5).length() == 0) { localObject1 = localObject5; if (((String)localObject5).endsWith(System.getProperty("file.separator"))) {} } else { localObject1 = (String)localObject5 + System.getProperty("file.separator"); } localObject1 = new File((String)localObject1 + ᐝ + (String)localObject4); if (((File)localObject1).exists()) { try { localObject1 = new FileInputStream((File)localObject1); return localObject1; } catch (IOException localIOException1) { throw localIOException1; } } return null; } StringTokenizer localStringTokenizer = new StringTokenizer(System.getProperty("java.class.path"), ॱॱ); while (localStringTokenizer.hasMoreTokens()) { Object localObject2 = localStringTokenizer.nextToken(); localObject5 = new File((String)localObject2); if (((File)localObject5).exists()) { if (((File)localObject5).isDirectory()) { if (new File((String)localObject2 + ᐝ + ˏॱ, (String)localObject4).exists()) { try { localObject2 = new FileInputStream((String)localObject2 + ᐝ + ˏॱ + ᐝ + (String)localObject4); return localObject2; } catch (IOException localIOException2) { throw localIOException2; } } } else { try { localObject5 = new ZipFile((File)localObject5); } catch (IOException localIOException3) { localObject5 = null; } if (localObject5 != null) { String str = ˏॱ + ᐝ + (String)localObject4; ZipEntry localZipEntry = ((ZipFile)localObject5).getEntry(str); Object localObject3 = localZipEntry; if (localZipEntry == null) { if (ᐝ == '/') { localObject3 = str.replace('/', '\\'); } else { localObject3 = str; if (ᐝ == '\\') { localObject3 = str.replace('\\', '/'); } } localObject3 = ((ZipFile)localObject5).getEntry((String)localObject3); } if (localObject3 != null) { try { localObject3 = ((ZipFile)localObject5).getInputStream((ZipEntry)localObject3); return localObject3; } catch (IOException localIOException4) { throw localIOException4; } } } } } } return null; } static boolean ʻ(long paramLong) { if (paramLong <= 0L) { paramLong = -paramLong; } return (paramLong * 11L + 14L) % 30L < 11L; } static int ʼ() { return ʻॱ[6].intValue(); } private static int[] ʼ(long paramLong) { paramLong += 492148L; int i; int k; int j; int n; int m; int i1; if (paramLong >= 0L) { i = ʽ(paramLong); k = ˋ(paramLong, i); j = ˊ(i, k); n = ˎ(i, k, j); j = i * 30 + j + 1; k = ॱ(n, j); m = ˏ(n, k, j) + 1; i = Bl.ˊ.ॱ(); } else { k = (int)paramLong / 10631; m = (int)paramLong % 10631; i = k; j = m; if (m == 0) { j = 54905; i = k + 1; } k = ˊ(i, j); m = ˎ(i, j, k); j = 1 - (i * 30 - k); if (ʻ(j)) { i = m + 355; } else { i = m + 354; } k = ॱ(i, j); m = ˏ(i, k, j) + 1; i1 = Bl.ˎ.ॱ(); n = i; i = i1; } int i2 = (int)((5L + paramLong) % 7L); if (i2 <= 0) { i1 = 7; } else { i1 = 0; } return new int[] { i, j, k + 1, m, n + 1, i2 + i1 }; } private static int ʽ(long paramLong) { Long[] arrayOfLong = ͺ; int i = 0; try { while (i < arrayOfLong.length) { long l = arrayOfLong[i].longValue(); if (paramLong < l) { return i - 1; } i += 1; } i = (int)paramLong; i /= 10631; return i; } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {} return (int)paramLong / 10631; } private static Integer[] ʽ(int paramInt) { Object localObject1; try { Integer[] arrayOfInteger = (Integer[])ˊॱ.get(new Integer(paramInt)); } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject1 = null; } Object localObject2 = localObject1; if (localObject1 == null) { localObject2 = ʿ; } return localObject2; } static int ˊ(int paramInt) { int i = (paramInt - 1) / 30; Object localObject; try { Integer[] arrayOfInteger = (Integer[])ˊॱ.get(Integer.valueOf(i)); } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject = null; } if (localObject != null) { paramInt = (paramInt - 1) % 30; if (paramInt == 29) { return ͺ[(i + 1)].intValue() - ͺ[i].intValue() - localObject[paramInt].intValue(); } return localObject[(paramInt + 1)].intValue() - localObject[paramInt].intValue(); } if (ʻ(paramInt)) { return 355; } return 354; } private static int ˊ(int paramInt, long paramLong) { Integer[] arrayOfInteger = ʽ(paramInt); if (paramLong == 0L) { return 0; } if (paramLong > 0L) { paramInt = 0; while (paramInt < arrayOfInteger.length) { if (paramLong < arrayOfInteger[paramInt].intValue()) { return paramInt - 1; } paramInt += 1; } return 29; } paramLong = -paramLong; paramInt = 0; while (paramInt < arrayOfInteger.length) { if (paramLong <= arrayOfInteger[paramInt].intValue()) { return paramInt - 1; } paramInt += 1; } return 29; } public static Bj ˊ(int paramInt1, int paramInt2, int paramInt3) { if (paramInt1 >= 1) { return ˎ(Bl.ˊ, paramInt1, paramInt2, paramInt3); } return ˎ(Bl.ˎ, 1 - paramInt1, paramInt2, paramInt3); } private static int ˋ(long paramLong, int paramInt) { Object localObject1; try { Long localLong = ͺ[paramInt]; } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject1 = null; } Object localObject2 = localObject1; if (localObject1 == null) { localObject2 = new Long(paramInt * 10631); } return (int)(paramLong - ((Long)localObject2).longValue()); } private static long ˋ(int paramInt1, int paramInt2, int paramInt3) { return ʻ(paramInt1) + ˎ(paramInt2 - 1, paramInt1) + paramInt3; } private static void ˋ(int paramInt) { if ((paramInt < 1) || (paramInt > 12)) { throw new AG("Invalid month of Hijrah date"); } } private static void ˋ(String paramString, int paramInt) { paramString = new StringTokenizer(paramString, ";"); while (paramString.hasMoreTokens()) { String str1 = paramString.nextToken(); int j = str1.indexOf(':'); if (j != -1) { String str2 = str1.substring(j + 1, str1.length()); int i; try { i = Integer.parseInt(str2); } catch (NumberFormatException paramString) { throw new ParseException("Offset is not properly set at line " + paramInt + ".", paramInt); } int k = str1.indexOf('-'); if (k != -1) { str2 = str1.substring(0, k); str1 = str1.substring(k + 1, j); j = str2.indexOf('/'); int m = str1.indexOf('/'); if (j != -1) { String str3 = str2.substring(0, j); str2 = str2.substring(j + 1, str2.length()); try { j = Integer.parseInt(str3); } catch (NumberFormatException paramString) { throw new ParseException("Start year is not properly set at line " + paramInt + ".", paramInt); } try { k = Integer.parseInt(str2); } catch (NumberFormatException paramString) { throw new ParseException("Start month is not properly set at line " + paramInt + ".", paramInt); } } else { throw new ParseException("Start year/month has incorrect format at line " + paramInt + ".", paramInt); } int n; if (m != -1) { str2 = str1.substring(0, m); str1 = str1.substring(m + 1, str1.length()); try { m = Integer.parseInt(str2); } catch (NumberFormatException paramString) { throw new ParseException("End year is not properly set at line " + paramInt + ".", paramInt); } try { n = Integer.parseInt(str1); } catch (NumberFormatException paramString) { throw new ParseException("End month is not properly set at line " + paramInt + ".", paramInt); } } else { throw new ParseException("End year/month has incorrect format at line " + paramInt + ".", paramInt); } if ((j != -1) && (k != -1) && (m != -1) && (n != -1)) { ˎ(j, k, m, n, i); } else { throw new ParseException("Unknown error at line " + paramInt + ".", paramInt); } } else { throw new ParseException("Start and end year/month has incorrect format at line " + paramInt + ".", paramInt); } } else { throw new ParseException("Offset has incorrect format at line " + paramInt + ".", paramInt); } } } private static int ˎ(int paramInt1, int paramInt2) { return ॱॱ(paramInt2)[paramInt1].intValue(); } private static int ˎ(int paramInt1, int paramInt2, int paramInt3) { Integer[] arrayOfInteger = ʽ(paramInt1); if (paramInt2 > 0) { return paramInt2 - arrayOfInteger[paramInt3].intValue(); } return arrayOfInteger[paramInt3].intValue() + paramInt2; } static Bj ˎ(long paramLong) { return new Bj(paramLong); } static Bj ˎ(Bl paramBl, int paramInt1, int paramInt2, int paramInt3) { BM.ˎ(paramBl, "era"); ॱ(paramInt1); ˋ(paramInt2); ˎ(paramInt3); return new Bj(ˋ(paramBl.ˏ(paramInt1), paramInt2, paramInt3)); } private static void ˎ(int paramInt) { if ((paramInt < 1) || (paramInt > ˏ())) { throw new AG("Invalid day of month of Hijrah date, day " + paramInt + " greater than " + ˏ() + " or less than 1"); } } private static void ˎ(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) { if (paramInt1 < 1) { throw new IllegalArgumentException("startYear < 1"); } if (paramInt3 < 1) { throw new IllegalArgumentException("endYear < 1"); } if ((paramInt2 < 0) || (paramInt2 > 11)) { throw new IllegalArgumentException("startMonth < 0 || startMonth > 11"); } if ((paramInt4 < 0) || (paramInt4 > 11)) { throw new IllegalArgumentException("endMonth < 0 || endMonth > 11"); } if (paramInt3 > 9999) { throw new IllegalArgumentException("endYear > 9999"); } if (paramInt3 < paramInt1) { throw new IllegalArgumentException("startYear > endYear"); } if ((paramInt3 == paramInt1) && (paramInt4 < paramInt2)) { throw new IllegalArgumentException("startYear == endYear && endMonth < startMonth"); } boolean bool = ʻ(paramInt1); Integer[] arrayOfInteger2 = (Integer[])ॱˊ.get(new Integer(paramInt1)); Integer[] arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { if (bool) { arrayOfInteger1 = new Integer[ˎ.length]; i = 0; while (i < ˎ.length) { arrayOfInteger1[i] = new Integer(ˎ[i]); i += 1; } } else { arrayOfInteger2 = new Integer[ˏ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= ˏ.length) { break; } arrayOfInteger2[i] = new Integer(ˏ[i]); i += 1; } } } arrayOfInteger2 = new Integer[arrayOfInteger1.length]; int i = 0; while (i < 12) { if (i > paramInt2) { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue() - paramInt5); } else { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue()); } i += 1; } ॱˊ.put(new Integer(paramInt1), arrayOfInteger2); arrayOfInteger2 = (Integer[])ˋॱ.get(new Integer(paramInt1)); arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { if (bool) { arrayOfInteger1 = new Integer[ॱ.length]; i = 0; while (i < ॱ.length) { arrayOfInteger1[i] = new Integer(ॱ[i]); i += 1; } } else { arrayOfInteger2 = new Integer[ˋ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= ˋ.length) { break; } arrayOfInteger2[i] = new Integer(ˋ[i]); i += 1; } } } arrayOfInteger2 = new Integer[arrayOfInteger1.length]; i = 0; while (i < 12) { if (i == paramInt2) { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue() - paramInt5); } else { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue()); } i += 1; } ˋॱ.put(new Integer(paramInt1), arrayOfInteger2); if (paramInt1 != paramInt3) { j = (paramInt1 - 1) / 30; arrayOfInteger2 = (Integer[])ˊॱ.get(new Integer(j)); arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { arrayOfInteger2 = new Integer[ʽ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= arrayOfInteger2.length) { break; } arrayOfInteger2[i] = new Integer(ʽ[i]); i += 1; } } i = (paramInt1 - 1) % 30 + 1; while (i < ʽ.length) { arrayOfInteger1[i] = new Integer(arrayOfInteger1[i].intValue() - paramInt5); i += 1; } ˊॱ.put(new Integer(j), arrayOfInteger1); i = (paramInt1 - 1) / 30; j = (paramInt3 - 1) / 30; if (i != j) { i += 1; while (i < ͺ.length) { ͺ[i] = new Long(ͺ[i].longValue() - paramInt5); i += 1; } i = j + 1; while (i < ͺ.length) { ͺ[i] = new Long(ͺ[i].longValue() + paramInt5); i += 1; } } j = (paramInt3 - 1) / 30; arrayOfInteger2 = (Integer[])ˊॱ.get(new Integer(j)); arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { arrayOfInteger2 = new Integer[ʽ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= arrayOfInteger2.length) { break; } arrayOfInteger2[i] = new Integer(ʽ[i]); i += 1; } } i = (paramInt3 - 1) % 30 + 1; while (i < ʽ.length) { arrayOfInteger1[i] = new Integer(arrayOfInteger1[i].intValue() + paramInt5); i += 1; } ˊॱ.put(new Integer(j), arrayOfInteger1); } bool = ʻ(paramInt3); arrayOfInteger2 = (Integer[])ॱˊ.get(new Integer(paramInt3)); arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { if (bool) { arrayOfInteger1 = new Integer[ˎ.length]; i = 0; while (i < ˎ.length) { arrayOfInteger1[i] = new Integer(ˎ[i]); i += 1; } } else { arrayOfInteger2 = new Integer[ˏ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= ˏ.length) { break; } arrayOfInteger2[i] = new Integer(ˏ[i]); i += 1; } } } arrayOfInteger2 = new Integer[arrayOfInteger1.length]; i = 0; while (i < 12) { if (i > paramInt4) { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue() + paramInt5); } else { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue()); } i += 1; } ॱˊ.put(new Integer(paramInt3), arrayOfInteger2); arrayOfInteger2 = (Integer[])ˋॱ.get(new Integer(paramInt3)); arrayOfInteger1 = arrayOfInteger2; if (arrayOfInteger2 == null) { if (bool) { arrayOfInteger1 = new Integer[ॱ.length]; i = 0; while (i < ॱ.length) { arrayOfInteger1[i] = new Integer(ॱ[i]); i += 1; } } else { arrayOfInteger2 = new Integer[ˋ.length]; i = 0; for (;;) { arrayOfInteger1 = arrayOfInteger2; if (i >= ˋ.length) { break; } arrayOfInteger2[i] = new Integer(ˋ[i]); i += 1; } } } arrayOfInteger2 = new Integer[arrayOfInteger1.length]; i = 0; while (i < 12) { if (i == paramInt4) { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue() + paramInt5); } else { arrayOfInteger2[i] = new Integer(arrayOfInteger1[i].intValue()); } i += 1; } ˋॱ.put(new Integer(paramInt3), arrayOfInteger2); arrayOfInteger1 = (Integer[])ˋॱ.get(new Integer(paramInt1)); arrayOfInteger2 = (Integer[])ˋॱ.get(new Integer(paramInt3)); Integer[] arrayOfInteger3 = (Integer[])ॱˊ.get(new Integer(paramInt1)); Integer[] arrayOfInteger4 = (Integer[])ॱˊ.get(new Integer(paramInt3)); paramInt5 = arrayOfInteger1[paramInt2].intValue(); paramInt4 = arrayOfInteger2[paramInt4].intValue(); paramInt3 = arrayOfInteger3[11].intValue() + arrayOfInteger1[11].intValue(); paramInt2 = arrayOfInteger4[11].intValue() + arrayOfInteger2[11].intValue(); i = ʻॱ[5].intValue(); int j = ᐝॱ[5].intValue(); paramInt1 = i; if (i < paramInt5) { paramInt1 = paramInt5; } i = paramInt1; if (paramInt1 < paramInt4) { i = paramInt4; } ʻॱ[5] = new Integer(i); paramInt1 = j; if (j > paramInt5) { paramInt1 = paramInt5; } paramInt5 = paramInt1; if (paramInt1 > paramInt4) { paramInt5 = paramInt4; } ᐝॱ[5] = new Integer(paramInt5); paramInt4 = ʻॱ[6].intValue(); paramInt5 = ᐝॱ[6].intValue(); paramInt1 = paramInt4; if (paramInt4 < paramInt3) { paramInt1 = paramInt3; } paramInt4 = paramInt1; if (paramInt1 < paramInt2) { paramInt4 = paramInt2; } ʻॱ[6] = new Integer(paramInt4); paramInt1 = paramInt5; if (paramInt5 > paramInt3) { paramInt1 = paramInt3; } paramInt3 = paramInt1; if (paramInt1 > paramInt2) { paramInt3 = paramInt2; } ᐝॱ[6] = new Integer(paramInt3); } static int ˏ() { return ʻॱ[5].intValue(); } static int ˏ(int paramInt1, int paramInt2) { return ᐝ(paramInt2)[paramInt1].intValue(); } private static int ˏ(int paramInt1, int paramInt2, int paramInt3) { Integer[] arrayOfInteger = ॱॱ(paramInt3); if (paramInt1 >= 0) { if (paramInt2 > 0) { return paramInt1 - arrayOfInteger[paramInt2].intValue(); } return paramInt1; } if (ʻ(paramInt3)) { paramInt1 += 355; } else { paramInt1 += 354; } if (paramInt2 > 0) { return paramInt1 - arrayOfInteger[paramInt2].intValue(); } return paramInt1; } static Bc ˏ(DataInput paramDataInput) { int i = paramDataInput.readInt(); int j = paramDataInput.readByte(); int k = paramDataInput.readByte(); return Bm.ˏ.ˋ(i, j, k); } private static void ˏ(int paramInt) { if ((paramInt < 1) || (paramInt > ʼ())) { throw new AG("Invalid day of year of Hijrah date"); } } private static int ॱ(int paramInt1, int paramInt2) { Integer[] arrayOfInteger = ॱॱ(paramInt2); if (paramInt1 >= 0) { paramInt2 = 0; while (paramInt2 < arrayOfInteger.length) { if (paramInt1 < arrayOfInteger[paramInt2].intValue()) { return paramInt2 - 1; } paramInt2 += 1; } return 11; } if (ʻ(paramInt2)) { paramInt1 += 355; } else { paramInt1 += 354; } paramInt2 = 0; while (paramInt2 < arrayOfInteger.length) { if (paramInt1 < arrayOfInteger[paramInt2].intValue()) { return paramInt2 - 1; } paramInt2 += 1; } return 11; } private static Bj ॱ(int paramInt1, int paramInt2, int paramInt3) { int j = ˎ(paramInt2 - 1, paramInt1); int i = paramInt3; if (paramInt3 > j) { i = j; } return ˊ(paramInt1, paramInt2, i); } private static void ॱ(int paramInt) { if ((paramInt < 1) || (paramInt > 9999)) { throw new AG("Invalid year of Hijrah Era"); } } private static Integer[] ॱॱ(int paramInt) { Object localObject1; try { Integer[] arrayOfInteger = (Integer[])ॱˊ.get(new Integer(paramInt)); } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject1 = null; } Object localObject2 = localObject1; if (localObject1 == null) { if (ʻ(paramInt)) { return ॱᐝ; } localObject2 = ॱˎ; } return localObject2; } private static void ᐝ() { Object localObject2 = ʻ(); if (localObject2 != null) { Object localObject1 = null; try { localObject2 = new BufferedReader(new InputStreamReader((InputStream)localObject2)); int i = 0; for (;;) { localObject1 = localObject2; String str = ((BufferedReader)localObject2).readLine(); if (str == null) { break; } i += 1; localObject1 = localObject2; ˋ(str.trim(), i); } if (localObject2 != null) { ((BufferedReader)localObject2).close(); return; } } finally { if (localObject1 != null) { localObject1.close(); } } } } private static Integer[] ᐝ(int paramInt) { Object localObject1; try { Integer[] arrayOfInteger = (Integer[])ˋॱ.get(new Integer(paramInt)); } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) { localObject1 = null; } Object localObject2 = localObject1; if (localObject1 == null) { if (ʻ(paramInt)) { return ʾ; } localObject2 = ʼॱ; } return localObject2; } public int ˊ() { return ˏ(this.ˊᐝ - 1, this.ʽॱ); } void ˊ(DataOutput paramDataOutput) { paramDataOutput.writeInt(ˏ(BN.ˋˊ)); paramDataOutput.writeByte(ˏ(BN.ʿ)); paramDataOutput.writeByte(ˏ(BN.ॱᐝ)); } public long ˋ(BT paramBT) { if ((paramBT instanceof BN)) { switch (3.ˏ[((BN)paramBT).ordinal()]) { default: break; case 5: return this.ˊˋ.ˋ(); case 6: return (this.ˊˊ - 1) % 7 + 1; case 7: return (this.ˉ - 1) % 7 + 1; case 1: return this.ˊˊ; case 2: return this.ˉ; case 8: return ॱˊ(); case 3: return (this.ˊˊ - 1) / 7 + 1; case 9: return (this.ˉ - 1) / 7 + 1; case 10: return this.ˊᐝ; case 4: return this.ʽॱ; case 11: return this.ʽॱ; case 12: return this.ˈ.ॱ(); } throw new BX("Unsupported field: " + paramBT); } return paramBT.ˎ(this); } public final Bg<Bj> ˋ(AQ paramAQ) { return super.ˋ(paramAQ); } public Bl ˋ() { return this.ˈ; } public int ˋॱ() { return ˊ(this.ʽॱ); } public Bj ˎ(BT paramBT, long paramLong) { if ((paramBT instanceof BN)) { BN localBN = (BN)paramBT; localBN.ˊ(paramLong); int i = (int)paramLong; switch (3.ˏ[localBN.ordinal()]) { default: break; case 5: return ᐝ(paramLong - this.ˊˋ.ˋ()); case 6: return ᐝ(paramLong - ˋ(BN.ᐝॱ)); case 7: return ᐝ(paramLong - ˋ(BN.ॱˋ)); case 1: return ॱ(this.ʽॱ, this.ˊᐝ, i); case 2: return ॱ(this.ʽॱ, (i - 1) / 30 + 1, (i - 1) % 30 + 1); case 8: return new Bj(i); case 3: return ᐝ((paramLong - ˋ(BN.ˈ)) * 7L); case 9: return ᐝ((paramLong - ˋ(BN.ʼॱ)) * 7L); case 10: return ॱ(this.ʽॱ, i, this.ˊˊ); case 4: if (this.ʽॱ < 1) { i = 1 - i; } return ॱ(i, this.ˊᐝ, this.ˊˊ); case 11: return ॱ(i, this.ˊᐝ, this.ˊˊ); case 12: return ॱ(1 - this.ʽॱ, this.ˊᐝ, this.ˊˊ); } throw new BX("Unsupported field: " + paramBT); } return (Bj)paramBT.ˎ(this, paramLong); } Bj ˏ(long paramLong) { if (paramLong == 0L) { return this; } int i = BM.ॱ(this.ʽॱ, (int)paramLong); return ˎ(this.ˈ, i, this.ˊᐝ, this.ˊˊ); } public Bj ˏ(BS paramBS) { return (Bj)super.ˋ(paramBS); } public BZ ॱ(BT paramBT) { if ((paramBT instanceof BN)) { if (ˊ(paramBT)) { paramBT = (BN)paramBT; switch (3.ˏ[paramBT.ordinal()]) { default: break; case 1: return BZ.ˋ(1L, ˊ()); case 2: return BZ.ˋ(1L, ˋॱ()); case 3: return BZ.ˋ(1L, 5L); case 4: return BZ.ˋ(1L, 1000L); } return ॱ().ˏ(paramBT); } throw new BX("Unsupported field: " + paramBT); } return paramBT.ॱ(this); } public Bj ॱ(long paramLong, BW paramBW) { return (Bj)super.ˊ(paramLong, paramBW); } public Bm ॱ() { return Bm.ˏ; } public long ॱˊ() { return ˋ(this.ʽॱ, this.ˊᐝ, this.ˊˊ); } Bj ॱॱ(long paramLong) { if (paramLong == 0L) { return this; } int i = this.ˊᐝ - 1 + (int)paramLong; int j = i / 12; i %= 12; while (i < 0) { i += 12; j = BM.ˏ(j, 1); } j = BM.ॱ(this.ʽॱ, j); return ˎ(this.ˈ, j, i + 1, this.ˊˊ); } public Bj ॱॱ(long paramLong, BW paramBW) { return (Bj)super.ˏ(paramLong, paramBW); } public boolean ॱॱ() { return this.ˋᐝ; } Bj ᐝ(long paramLong) { return new Bj(this.ˋˊ + paramLong); } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
d564e38c25c3fc88bbbe359424ede833144bb00a
b4455f4f99e4d3eda863812f29f0161089e4d0b8
/presentation/src/main/java/com/fernandocejas/android10/sample/presentation/ui/home/adapter/HomeViewHolder.java
e25d91b6b48430cf8bcb44e07abe5734dd7cf393
[ "Apache-2.0" ]
permissive
leeprohacker/MAndroidCleanArchitecture
a42d350881d9afcfd3cec26a3e4413701c5e0677
b45da787669cca38f9ba4c1c4df04bc9c2007c53
refs/heads/master
2021-04-12T11:02:53.788340
2018-03-23T01:28:14
2018-03-23T01:28:14
126,412,998
0
0
null
null
null
null
UTF-8
Java
false
false
2,670
java
package com.fernandocejas.android10.sample.presentation.ui.home.adapter; import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewCompat; import android.support.v7.widget.AppCompatImageView; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.chad.library.adapter.base.BaseViewHolder; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.drawee.interfaces.DraweeController; import com.facebook.drawee.view.SimpleDraweeView; import com.fernandocejas.android10.sample.presentation.R; import com.fernandocejas.android10.sample.presentation.model.giphy.PDataItem; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by Leeprohacker on 3/22/18. */ public class HomeViewHolder extends BaseViewHolder { @BindView(R.id.img_avatar) SimpleDraweeView imgAvatar; @BindView(R.id.tv_title) TextView tvTitle; @BindView(R.id.tv_content) TextView tvContent; @BindView(R.id.my_image_view) SimpleDraweeView myImageView; @BindView(R.id.img_like) AppCompatImageView imgLike; @BindView(R.id.tv_like) TextView tvLike; @BindView(R.id.view_like) LinearLayout viewLike; @BindView(R.id.img_comment) AppCompatImageView imgComment; @BindView(R.id.tv_comment) TextView tvComment; @BindView(R.id.view_comment) LinearLayout viewComment; @BindView(R.id.img_share) AppCompatImageView imgShare; @BindView(R.id.tv_share) TextView tvShare; @BindView(R.id.view_share) LinearLayout viewShare; public HomeViewHolder(View view) { super(view); ButterKnife.bind(this, view); } public void bindView(PDataItem item) { tvTitle.setText(item.getUser().getDisplayName()); tvContent.setText(item.getImportDatetime()); imgAvatar.setImageURI(item.getUser().getAvatarUrl()); myImageView.setImageURI(item.getImages().getOriginalStill().getUrl()); addOnClickListener(viewLike.getId()); addOnClickListener(viewComment.getId()); addOnClickListener(viewShare.getId()); if(item.isLike()){ imgLike.setColorFilter(ContextCompat.getColor(itemView.getContext(),R.color.colorAccent)); }else { imgLike.setColorFilter(ContextCompat.getColor(itemView.getContext(),R.color.grey_90)); } // DraweeController controller = Fresco.newDraweeControllerBuilder() // .setUri(item.getImages().getOriginalStill().getUrl()) // .setAutoPlayAnimations(true) // .build(); // imgAvatar.setController(controller); } }
[ "leeprohacker@gmail.com" ]
leeprohacker@gmail.com
ac071774453c1d64770285b598f5ae5b9dfc0490
af0dd3027f49cccf97b8841a37c5bd16d47d52ec
/app/src/main/java/com/trendyfy/volley/CustomJsonRequest.java
437f03c97638e12de0d2974d3620d3f020eff50e
[]
no_license
dpkgupta21/TrendyfyAndroid
2a0a5e6fe3832c1b7cf70eb51ed340ac9a36258d
149ad72c6b72ff5a3e6240a7c6cad590f194e750
refs/heads/master
2021-08-19T21:43:12.086945
2017-11-27T13:32:49
2017-11-27T13:32:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,689
java
package com.trendyfy.volley; import com.android.volley.Cache; import com.android.volley.NetworkResponse; import com.android.volley.ParseError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.Response.ErrorListener; import com.android.volley.Response.Listener; import com.android.volley.toolbox.HttpHeaderParser; import com.trendyfy.utility.Utils; import java.io.UnsupportedEncodingException; import java.util.Map; public class CustomJsonRequest extends Request<String> { private Listener<String> listener; private Map<String, String> params; //private String cacheKey; public CustomJsonRequest(String url, Map<String, String> params, Listener<String> reponseListener, ErrorListener errorListener) { super(Method.GET, url, errorListener); // cacheKey = params.get("action"); this.listener = reponseListener; this.params = params; } public CustomJsonRequest(int method, String url, Map<String, String> params, Listener<String> reponseListener, ErrorListener errorListener) { super(method, url, errorListener); //cacheKey = params.get("action"); this.listener = reponseListener; this.params = params; } @Override protected Map<String, String> getParams() throws com.android.volley.AuthFailureError { return params; } @Override protected Response<String> parseNetworkResponse(NetworkResponse response) { try { String jsonString = new String(response.data, HttpHeaderParser.parseCharset(response.headers)); //JSONObject jsonObject = new JSONObject(jsonString); String parseResponse = null; if (jsonString.contains("[")) { parseResponse = jsonString.substring(jsonString.indexOf("["), jsonString.indexOf("</string>")); } else { parseResponse = jsonString.substring(jsonString.lastIndexOf("<string xmlns=\"http://tempuri.org/\">"), jsonString.indexOf("</string>")); parseResponse = parseResponse.replace("<string xmlns=\"http://tempuri.org/\">", ""); } Utils.ShowLog("TAG", "" + jsonString); // force response to be cached //Map<String, String> headers = response.headers; //long cacheExpiration = 24 * 60 * 60 * 1000; // in 24 hours this cache entry expires completely //long now = System.currentTimeMillis(); //Cache.Entry entry = new Cache.Entry(); //entry.data = response.data; //entry.etag = headers.get("ETag"); //entry.ttl = now + cacheExpiration; //entry.serverDate = HttpHeaderParser.parseDateAsEpoch(headers.get("Date")); //entry.responseHeaders = headers; //entry = HttpHeaderParser.parseCacheHeaders(response); //Application.getInstance().getRequestQueue().getCache().put(cacheKey, entry); Cache.Entry entry = HttpHeaderParser.parseCacheHeaders(response); //Application.getInstance().getRequestQueue().getCache().put(cacheKey, entry); return Response.success(parseResponse, entry); //return Response.success(jsonObject, entry); } catch (UnsupportedEncodingException e) { return Response.error(new ParseError(e)); } } @Override protected void deliverResponse(String response) { listener.onResponse(response); } }
[ "dpk.gupta21@gmail.com" ]
dpk.gupta21@gmail.com
988365e997f81775a378d4e73e15098ed47b8a1a
9dc11d068f883b15a0fd45935a834c896b722ec0
/app/src/main/java/com/hotellook/dependencies/DatabaseModule_ProvideLocationFavoritesCacheFactory.java
7c9505b601f07613ea52d174efe85282ab1ddf9a
[ "Apache-2.0" ]
permissive
justyce2/HotellookDagger
7a44d9b263cbde0da05759119d9c01e9d2090dc6
7229312d711c6cb1f8fc5cfafb413a3c5aff6dbe
refs/heads/master
2020-03-31T21:04:23.472668
2016-07-27T09:03:11
2016-07-27T09:03:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,699
java
package com.hotellook.dependencies; import com.hotellook.db.FavoritesRepository; import com.hotellook.db.SearchDestinationFavoritesCache; import dagger.internal.Factory; import dagger.internal.Preconditions; import javax.inject.Provider; public final class DatabaseModule_ProvideLocationFavoritesCacheFactory implements Factory<SearchDestinationFavoritesCache> { static final /* synthetic */ boolean $assertionsDisabled; private final DatabaseModule module; private final Provider<FavoritesRepository> repositoryProvider; static { $assertionsDisabled = !DatabaseModule_ProvideLocationFavoritesCacheFactory.class.desiredAssertionStatus(); } public DatabaseModule_ProvideLocationFavoritesCacheFactory(DatabaseModule module, Provider<FavoritesRepository> repositoryProvider) { if ($assertionsDisabled || module != null) { this.module = module; if ($assertionsDisabled || repositoryProvider != null) { this.repositoryProvider = repositoryProvider; return; } throw new AssertionError(); } throw new AssertionError(); } public SearchDestinationFavoritesCache get() { return (SearchDestinationFavoritesCache) Preconditions.checkNotNull(this.module.provideLocationFavoritesCache((FavoritesRepository) this.repositoryProvider.get()), "Cannot return null from a non-@Nullable @Provides method"); } public static Factory<SearchDestinationFavoritesCache> create(DatabaseModule module, Provider<FavoritesRepository> repositoryProvider) { return new DatabaseModule_ProvideLocationFavoritesCacheFactory(module, repositoryProvider); } }
[ "mdzht@mail.ru" ]
mdzht@mail.ru
dd0481dcbe4a71fcca3ae6a75402b806e00bd2b7
59ca721ca1b2904fbdee2350cd002e1e5f17bd54
/aliyun-java-sdk-cms/src/main/java/com/aliyuncs/cms/model/v20180308/NodeUninstallResponse.java
7bf78a795fa155fb52986ce9af4452579594b44f
[ "Apache-2.0" ]
permissive
longtx/aliyun-openapi-java-sdk
8fadfd08fbcf00c4c5c1d9067cfad20a14e42c9c
7a9ab9eb99566b9e335465a3358553869563e161
refs/heads/master
2020-04-26T02:00:35.360905
2019-02-28T13:47:08
2019-02-28T13:47:08
173,221,745
2
0
NOASSERTION
2019-03-01T02:33:35
2019-03-01T02:33:35
null
UTF-8
Java
false
false
1,762
java
/* * 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.aliyuncs.cms.model.v20180308; import com.aliyuncs.AcsResponse; import com.aliyuncs.cms.transform.v20180308.NodeUninstallResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class NodeUninstallResponse extends AcsResponse { private Integer errorCode; private String errorMessage; private Boolean success; private String requestId; public Integer getErrorCode() { return this.errorCode; } public void setErrorCode(Integer errorCode) { this.errorCode = errorCode; } public String getErrorMessage() { return this.errorMessage; } public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } public Boolean getSuccess() { return this.success; } public void setSuccess(Boolean success) { this.success = success; } public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } @Override public NodeUninstallResponse getInstance(UnmarshallerContext context) { return NodeUninstallResponseUnmarshaller.unmarshall(this, context); } }
[ "haowei.yao@alibaba-inc.com" ]
haowei.yao@alibaba-inc.com
4365d5fa03cbc847dabebd08195ff6166e70e05d
368c0c6bc01a79f27b5f061aa842108282a6d4f2
/src/main/java/com/devsuperior/aulajparepository/entities/User.java
9ddb7a568b2aded9e8c4791af156b249acb6e802
[]
no_license
SPRINGBOOTJAVA/aula-jparepository
f5b96f99f4a0b33e1b68dc4ba7c09d6bb1d5e2f3
ab57a6e699cab66589bf69e4807a3100a1f537cb
refs/heads/main
2023-07-15T20:02:41.366906
2021-08-31T21:53:17
2021-08-31T21:53:17
401,847,087
0
0
null
2021-08-31T21:24:48
2021-08-31T21:24:48
null
UTF-8
Java
false
false
1,043
java
package com.devsuperior.aulajparepository.entities; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "tb_users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String email; private Double salary; public User() { } public User(Long id, String name, String email, Double salary) { super(); this.id = id; this.name = name; this.email = email; this.salary = salary; } 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 getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Double getSalary() { return salary; } public void setSalary(Double salary) { this.salary = salary; } }
[ "acenelio@gmail.com" ]
acenelio@gmail.com
a58cc77826e5f8ef9b238dc776adb9b24ccfa54b
dcee00ba00708eece05529b6f38a360d3b07e353
/src/com/hck/money/bean/Config.java
d499bfb0a45927c620c3540e8c8f81abc5a30827
[]
no_license
hhhccckkk/zhuanqian_server
68c5a39108ed7ffeb177e3f771b3db36a5f1ac03
56eee5cec8f94cc795306a23036f04cebddab5af
refs/heads/master
2021-01-21T23:03:56.234728
2016-02-15T02:33:18
2016-02-15T02:33:18
39,005,398
0
2
null
null
null
null
UTF-8
Java
false
false
980
java
package com.hck.money.bean; /** * News entity. @author MyEclipse Persistence Tools */ public class Config implements java.io.Serializable { // Fields private Integer id; private int config1; private int config2; private int config3; private String image1; private String image2; public String getImage1() { return image1; } public void setImage1(String image1) { this.image1 = image1; } public String getImage2() { return image2; } public void setImage2(String image2) { this.image2 = image2; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public int getConfig1() { return config1; } public void setConfig1(int config1) { this.config1 = config1; } public int getConfig2() { return config2; } public void setConfig2(int config2) { this.config2 = config2; } public int getConfig3() { return config3; } public void setConfig3(int config3) { this.config3 = config3; } }
[ "huangchengke@huoyunren.com" ]
huangchengke@huoyunren.com
70d41d51de2a822b8d022c7a57b0c7dd27bf9315
524b46960d37a14b4be58b4657f17fc9ff78b669
/gankio/src/main/java/com/sky/gank/net/rxutil/HttpResult.java
97992986fe5dcac6e7861c40af8b25e6a19c76e2
[ "Apache-2.0" ]
permissive
SkyZhang007/LazyCat
70a5600a24ce21c72e453fa330bd5ea5c5f9552e
7f522b88b3dcd2470458266182e8d659f725ab34
refs/heads/master
2021-06-02T16:06:06.787212
2019-03-18T09:46:51
2019-03-18T09:46:51
96,196,158
2
1
null
null
null
null
UTF-8
Java
false
false
460
java
package com.sky.gank.net.rxutil; /** * 类名称: * 类功能: * 类作者:Sky * 类日期:2019/1/8 0008. **/ public class HttpResult<T> { private boolean error; private T data; public boolean isError() { return error; } public void setError(boolean error) { this.error = error; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
[ "zk827083320@qq.com" ]
zk827083320@qq.com
2a13dec140ed6ddb8cb33ac6faad92197ebc71d5
dcd36633a849864751fb30e878b2301a879d8f95
/Samples/Biometrics/Android/multibiometric-sample/gen-external-apklibs/com.neurotec.samples_samples-utils-android_5.1.0.0/src/com/neurotec/samples/app/BaseActivity.java
5d107174c4c5a4dd12f84a08d8ee71d9ff0950dd
[]
no_license
aeadara/fingerprint-android
b3cb75241d41a670c351c5132e016f02dcbdb1c6
1a87898b37ced5ad93974c920e09eb831c619d79
refs/heads/master
2021-01-20T20:56:41.447298
2015-08-23T21:19:22
2015-08-23T21:19:22
41,186,654
1
0
null
null
null
null
UTF-8
Java
false
false
2,367
java
package com.neurotec.samples.app; import android.app.Activity; import android.app.ProgressDialog; import android.util.Log; import com.neurotec.samples.util.ExceptionUtils; import com.neurotec.samples.util.ToastManager; import com.neurotec.samples.view.ErrorDialogFragment; import com.neurotec.samples.view.InfoDialogFragment; public abstract class BaseActivity extends Activity { // =========================================================== // Private fields // =========================================================== private ProgressDialog mProgressDialog; // =========================================================== // Protected methods // =========================================================== protected void showProgress(int messageId) { showProgress(getString(messageId)); } protected void showProgress(final String message) { hideProgress(); runOnUiThread(new Runnable() { @Override public void run() { mProgressDialog = ProgressDialog.show(BaseActivity.this, "", message); } }); } protected void hideProgress() { runOnUiThread(new Runnable() { @Override public void run() { if (mProgressDialog != null && mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } } }); } protected void showToast(int messageId) { showToast(getString(messageId)); } protected void showToast(final String message) { runOnUiThread(new Runnable() { @Override public void run() { ToastManager.show(BaseActivity.this, message); } }); } protected void showError(String message, boolean close) { ErrorDialogFragment.newInstance(message, close).show(getFragmentManager(), "error"); } protected void showError(int messageId) { showError(getString(messageId)); } protected void showError(String message) { showError(message, false); } protected void showError(Throwable th) { Log.e(getClass().getSimpleName(), "Exception", th); showError(ExceptionUtils.getMessage(th), false); } protected void showInfo(int messageId) { showInfo(getString(messageId)); } protected void showInfo(String message) { InfoDialogFragment.newInstance(message).show(getFragmentManager(), "info"); } @Override protected void onStop() { super.onStop(); hideProgress(); } }
[ "aeadara@umail.iu.edu" ]
aeadara@umail.iu.edu
c31f69e6f13a7a74aa6175597472282ba44e2aec
a2fad165515c696bda3f6ddb1a6a25a36df6209d
/src/main/java/com/procedures/pojo/Studentsanswer.java
8cb9bec28dcb00fd7e3f1547b32397cc3aea189e
[]
no_license
THORSU/procedures
9644a10a466537403e29b934131da829de4fa9df
e3f443ad9a150af1a7d55311d76eab9bdfb5e8c7
refs/heads/master
2020-04-29T18:00:14.027328
2019-05-10T17:11:14
2019-05-10T17:11:14
176,311,625
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package com.procedures.pojo; import lombok.Data; import java.io.Serializable; import java.util.Date; @Data public class Studentsanswer implements Serializable { private static final long serialVersionUID = 1L; /** * 业务主键 */ private Integer id; /** * 用户id */ private String studentid; /** * 成绩 */ private Integer grade; /** * 创建时间 */ private Date createtime; }
[ "1571104304@qq.com" ]
1571104304@qq.com
d271d4b7468855ec1384a60abc2d17660f05fa72
5e2763ba05b1f3b1249dd5bad6d12e9789924caa
/src/main/java/pojo/ProductColorKey.java
571631816a0160bfa5ebe4b30ff0d072fb99e095
[]
no_license
yzl9527/test
43aa646d99b1a96f3fb8d497d78eebd5ab99723e
d3ece10cdeec87dcbffacd5ca282e5dabac2fb35
refs/heads/master
2020-04-14T16:26:41.187094
2019-01-03T08:41:00
2019-01-03T08:41:00
163,952,003
0
0
null
null
null
null
UTF-8
Java
false
false
796
java
package pojo; import org.springframework.stereotype.Component; import java.io.Serializable; @Component public class ProductColorKey implements Serializable { private int crid; private int spid; private Color color; private Product product; public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } public Color getColor() { return color; } public void setColor(Color color) { this.color = color; } public int getCrid() { return crid; } public void setCrid(int crid) { this.crid = crid; } public int getSpid() { return spid; } public void setSpid(int spid) { this.spid = spid; } }
[ "1144617761@qq.com" ]
1144617761@qq.com
5c7100e4881e9558c6ed766265c3a34721eddad7
f6b52f007e7c28bdc0963b30db2b2a7aa62761d0
/src/main/java/framework/configuration/PropertiesLoader.java
36f3fb172db635fb48ea876e9ca1de9d7c150acc
[]
no_license
srachitsky1023/uptakeInterview_NavTest
899ca9094d9f9417333ace50b85fa0e9390b8ed3
d2fb093664e2662fe2be7b689da999088dccdfe6
refs/heads/master
2020-07-19T17:27:32.727123
2016-11-14T23:40:01
2016-11-14T23:40:01
73,756,830
0
0
null
null
null
null
UTF-8
Java
false
false
814
java
package framework.configuration; import java.io.InputStream; import java.util.Properties; public class PropertiesLoader { private static final String CONFIG_FILE = "/config.properties"; private static Properties prop = new Properties(); private static void openFile(String file){ InputStream inpStream = Properties.class.getResourceAsStream(file); try { prop.load(inpStream); } catch (Exception e) { System.out.println("Error opening file: " + file); throw new RuntimeException(e); } } public static String getValue(String key){ String value = null; openFile(CONFIG_FILE); value = prop.getProperty(key); if (value == null){ String msg = "Value not found for: " + key; System.out.println(msg); throw new RuntimeException(msg); } return value; } }
[ "srachitsky.qa@gmail.com" ]
srachitsky.qa@gmail.com
44ea605c3c887f84cd7c39605b75d3a143ec85b4
8f660dc660a9cd6d3b3830bc011ae29bcc943c2c
/PoS Payment/AndroidApp/app/src/main/java/org/wso2/iot/sample/mqtt/MessageReceivedCallback.java
6bc561a2dc20291e8b985a445a166f87b24c43de
[ "Apache-2.0" ]
permissive
Nirothipan/samples-iots
b9545e83221923a770c7f3a33edc64b8ad6807f6
3144addcac3f05f4874e17087d31e3f689cdff11
refs/heads/master
2021-01-25T00:29:27.780196
2018-02-06T05:19:47
2018-02-06T05:19:47
123,297,780
0
0
Apache-2.0
2018-02-28T14:40:18
2018-02-28T14:40:17
null
UTF-8
Java
false
false
902
java
/* * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.wso2.iot.sample.mqtt; import org.json.JSONException; import org.wso2.iot.sample.util.dto.Operation; public interface MessageReceivedCallback { void onMessageReceived(Operation operation) throws JSONException; }
[ "charitha.ws@gmail.com" ]
charitha.ws@gmail.com
6e8b2508227d783293bd571fc4f1e7d7eb671680
c9a160b3694ff93bcf25d9d5a8cc3fe4d7bbc1f1
/3.UML建模/1.源代码/BridgePattern/Client.java
16c6612c36c5a578e03fd79536c90b439d45bf10
[]
no_license
ylscj/cultivate
f597c0564aba976402332559739925ab8afdd1e2
06656d66a91daf6da943e9dc027ba7ccb0d83224
refs/heads/master
2021-01-05T20:14:50.744524
2020-02-16T13:09:11
2020-02-16T13:09:11
241,126,188
1
0
null
2020-02-17T14:22:23
2020-02-17T14:22:22
null
UTF-8
Java
false
false
1,012
java
package BridgePattern; import java.util.Scanner; public class Client { public static void main(String a[]) { Color color; Pen pen; try { Scanner sc = new Scanner(System.in); System.out.println("请输入您需要用多大的笔:"); String type = sc.nextLine(); System.out.println("请输入您需要用哪种颜色:"); String type1 = sc.nextLine(); color = (Color) XMLUtilPen.getBean(type1);//color = new Red(); pen = (Pen) XMLUtilPen.getBean(type);//pen = new BigPen(); pen.setColor(color); System.out.println("请输入您要绘制的东西:"); pen.draw(sc.nextLine()); }catch(Exception e) { System.out.println("找不到您所输入的类型!"); } // color = (Color) XMLUtilPen.getBean("color"); // pen = (Pen) XMLUtilPen.getBean("pen"); // pen.setColor(color); // pen.draw("鲜花"); } }
[ "529998711@qq.com" ]
529998711@qq.com
8a74c4fa9259e597366d2c18b4dc8873eb7f5aec
2ccd067101b4932c396c93deac55c022a1ca6399
/src/main/java/com/zea7ot/leetcode/lvl3/lc0332/SolutionApproach0HierholzersAlgorithm.java
3647a175c28c63c3b6061973d18753f959304862
[]
no_license
dulekang1025/leetcode-solutions-java-zea7ot
26d9019628a3b98a8932ffdc3531229cdb6fb690
a5f2fb570733379afb0b5fc676670fe4b54f583c
refs/heads/master
2023-01-03T03:18:10.936018
2020-10-26T01:18:53
2020-10-26T01:18:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,995
java
/** * https://leetcode.com/problems/reconstruct-itinerary/ * * Time Complexity: O(N * lg(N)) + O(N) ~ O(N * lg(N)) * O(N * lg(N)), consumed by PQ * O(N), consumed by `postorder()` * * Space Complexity: O(N) + O(H) * * to sort the children and post order traverse the graph * * * References: * https://www.youtube.com/watch?v=4udFSOWQpdg * http://zxi.mytechroad.com/blog/graph/leetcode-332-reconstruct-itinerary/ * Hierholzer's algorithm: https://en.wikipedia.org/wiki/Eulerian_path */ package com.zea7ot.leetcode.lvl3.lc0332; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.PriorityQueue; public class SolutionApproach0HierholzersAlgorithm { public List<String> findItinerary(List<List<String>> tickets) { List<String> ans = new ArrayList<String>(); // sanity check if (tickets == null || tickets.isEmpty()) return ans; // a tree-like graph, with children sorted lexicographically and greedily Map<String, PriorityQueue<String>> graph = new HashMap<String, PriorityQueue<String>>(); for (List<String> ticket : tickets) { // this PriorityQueue is a minHeap graph.putIfAbsent(ticket.get(0), new PriorityQueue<String>((a, b) -> a.compareTo(b))); graph.get(ticket.get(0)).add(ticket.get(1)); } final String START = "JFK"; postorder(START, graph, ans); Collections.reverse(ans); return ans; } private void postorder(String source, Map<String, PriorityQueue<String>> graph, List<String> routes) { PriorityQueue<String> destinations = graph.get(source); if (destinations != null) { while (!destinations.isEmpty()) { String destination = destinations.poll(); postorder(destination, graph, routes); } } routes.add(source); } }
[ "yanglyu.leon.7@gmail.com" ]
yanglyu.leon.7@gmail.com
40bec7fd4fbe175a99689c5676a725abdd4d9d36
c8f0424b132efb9bedd1f3141bf61f6cb4a8ff49
/java-basic/src/main/java/com/evil/concurrent/deadlock/Deadlock.java
bdd771ac8a3f1ae29a6909552375574758e7eaa8
[ "Apache-2.0" ]
permissive
hurleychin/java-practice
3345f0cff6f6fe925ee5e27f030607eb96d56de7
aa36a717eefa8bfa2153eab8beaa3d15cb4388a9
refs/heads/master
2023-06-22T15:13:38.581330
2023-06-17T10:28:44
2023-06-17T10:29:02
113,329,388
0
1
Apache-2.0
2023-06-14T22:22:36
2017-12-06T14:55:11
Java
UTF-8
Java
false
false
1,116
java
package com.evil.concurrent.deadlock; /** * @author qinhulin on 2018-06-12 */ public class Deadlock { static class Friend { private final String name; public Friend(String name) { this.name = name; } public String getName() { return this.name; } public synchronized void bow(Friend bower) { System.out.format("%s: %s" + " has bowed to me!%n", this.name, bower.getName()); bower.bowBack(this); } public synchronized void bowBack(Friend bower) { System.out.format("%s: %s" + " has bowed back to me!%n", this.name, bower.getName()); } } public static void main(String[] args) { final Friend alphonse = new Friend("Alphonse"); final Friend gaston = new Friend("Gaston"); new Thread(new Runnable() { public void run() { alphonse.bow(gaston); } }).start(); new Thread(new Runnable() { public void run() { gaston.bow(alphonse); } }).start(); } }
[ "qinhulin@gmail.com" ]
qinhulin@gmail.com
532aae32cd77998256ffa66a1bbcff92c500a217
a28473366a8335635e5c43e3b67153c713a5d27c
/analytics-and-data-summit-2018/src/truck-client/src/main/java/com/hortonworks/solution/KafkaSensorEventCollector.java
fba57b7206cca032ab876fafed78dcf1aa6ef367
[]
no_license
rodrigo-mendes/various-demos
a71304c58eb7b668c78016edbebbe3267126ac41
2e8833d127388371560a951052f59f8586744f2f
refs/heads/master
2023-03-11T08:20:46.262097
2021-03-01T13:52:21
2021-03-01T13:52:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,142
java
package com.hortonworks.solution; import akka.actor.UntypedActor; import com.hortonworks.simulator.impl.domain.transport.MobileEyeEvent; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.log4j.Logger; import java.util.Properties; import java.util.concurrent.Future; public class KafkaSensorEventCollector extends UntypedActor { private static final String TOPIC = "truck_position"; private Logger logger = Logger.getLogger(this.getClass()); private Producer<String, String> producer = null; private Producer<String, String> connect() { Producer<String, String> producer = null; Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("acks", "all"); props.put("retries", 0); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); try { producer = new KafkaProducer<String, String>(props); } catch (Exception e) { e.printStackTrace(); } return producer; } public KafkaSensorEventCollector() { if (producer == null) { producer = connect(); } } @Override public void onReceive(Object event) throws Exception { MobileEyeEvent mee = (MobileEyeEvent) event; String eventToPass = null; if (Lab.format.equals(Lab.JSON)) { eventToPass = mee.toJSON(); } else if (Lab.format.equals(Lab.CSV)) { eventToPass = mee.toCSV(); } String truckId = String.valueOf(mee.getTruck().getTruckId()); ProducerRecord<String, String> record = new ProducerRecord<String, String>(TOPIC, truckId, eventToPass); if (producer != null) { try { Future<RecordMetadata> future = producer.send(record); RecordMetadata metadata = future.get(); } catch (Exception e) { System.err.println(e.getMessage()); e.printStackTrace(); } } } }
[ "guido.schmutz@hotmail.com" ]
guido.schmutz@hotmail.com
fed146baff6b2b516c3671b6223bd772b4c88a90
2dbccdd37702971b5b75054a36ab01dabe00ec82
/app/src/test/java/com/elab/grocery_list/ExampleUnitTest.java
71d96a1c6939b6bf6a9c211cb3d440b2dd780806
[]
no_license
TechieAditi/Grocery_list
8e9211972240219e893f88111dabf5855160f4a9
c3d7727b315b895bdd7d54f84ff7081b4d765345
refs/heads/master
2020-12-10T10:09:24.574071
2020-03-13T18:36:32
2020-03-13T18:36:32
233,563,375
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.elab.grocery_list; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
[ "55248714+TechieAditi@users.noreply.github.com" ]
55248714+TechieAditi@users.noreply.github.com
c30f7f832c16bc7d7d1e07e2634226a1d2a2c18b
be1459afd8a90edeb04af5c1886880a4de8d83c9
/src/main/java/com/test/autobot/util/Response.java
06c5ae9fb491c55a47c2bde78d9eab91e4b1c8d0
[]
no_license
kmcoderz/autobot
d2a01bd74d637a760107ebdc4082c19cce80bb20
e35ac441f3003dc4941c471ab5754da1c0df5b50
refs/heads/master
2021-01-24T11:10:06.179115
2016-10-07T10:21:59
2016-10-07T10:21:59
70,236,127
0
0
null
null
null
null
UTF-8
Java
false
false
701
java
package com.test.autobot.util; import org.springframework.http.HttpStatus; public class Response { private String responseContent; private HttpStatus responseCode; public Response() { super(); } public Response(String responseContent, HttpStatus responseCode) { super(); this.responseContent = responseContent; this.responseCode = responseCode; } public String getResponseContent() { return responseContent; } public void setResponseContent(String responseContent) { this.responseContent = responseContent; } public HttpStatus getResponseCode() { return responseCode; } public void setResponseCode(HttpStatus responseCode) { this.responseCode = responseCode; } }
[ "kalyanm@valyoo.in" ]
kalyanm@valyoo.in
a55e8875b4065618ec54e590b828931d6ba82445
2f4a058ab684068be5af77fea0bf07665b675ac0
/utils/com/google/common/collect/Synchronized$SynchronizedAsMap.java
4c7811520d55019d333941f2cb1c4153c54d6b26
[]
no_license
cengizgoren/facebook_apk_crack
ee812a57c746df3c28fb1f9263ae77190f08d8d2
a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b
refs/heads/master
2021-05-26T14:44:04.092474
2013-01-16T08:39:00
2013-01-16T08:39:00
8,321,708
1
0
null
null
null
null
UTF-8
Java
false
false
1,710
java
package com.google.common.collect; import java.util.Collection; import java.util.Map; import java.util.Map.Entry; import java.util.Set; class Synchronized$SynchronizedAsMap<K, V> extends Synchronized.SynchronizedMap<K, Collection<V>> { private static final long serialVersionUID; transient Set<Map.Entry<K, Collection<V>>> a; transient Collection<Collection<V>> b; Synchronized$SynchronizedAsMap(Map<K, Collection<V>> paramMap, Object paramObject) { super(paramMap, paramObject); } public Collection<V> a(Object paramObject) { synchronized (this.mutex) { Collection localCollection = (Collection)super.get(paramObject); if (localCollection == null) { localObject3 = null; return localObject3; } Object localObject3 = Synchronized.a(localCollection, this.mutex); } } public boolean containsValue(Object paramObject) { return values().contains(paramObject); } public Set<Map.Entry<K, Collection<V>>> entrySet() { synchronized (this.mutex) { if (this.a == null) this.a = new Synchronized.SynchronizedAsMapEntries(a().entrySet(), this.mutex); Set localSet = this.a; return localSet; } } public Collection<Collection<V>> values() { synchronized (this.mutex) { if (this.b == null) this.b = new Synchronized.SynchronizedAsMapValues(a().values(), this.mutex); Collection localCollection = this.b; return localCollection; } } } /* Location: /data1/software/apk2java/dex2jar-0.0.9.12/secondary-1.dex_dex2jar.jar * Qualified Name: com.google.common.collect.Synchronized.SynchronizedAsMap * JD-Core Version: 0.6.2 */
[ "macluz@msn.com" ]
macluz@msn.com
d145c685158be4f72f8f1cd09732c88a8df8271c
c038baf116ec206b5ba12ffc664f27116aed3896
/src/by/bsu/labs/lab14/entity/Soil.java
1c30cb440b2830bd3720a64b0be513ef82953d51
[]
no_license
Elentary/University
f38a93d3fa9a158d76188880a4cff26c54617913
8ba9c34a4350a9fd42b0be203f948f8f6013d5c0
refs/heads/master
2021-05-04T07:58:08.006390
2017-01-22T10:28:25
2017-01-22T10:28:25
70,733,595
0
0
null
null
null
null
UTF-8
Java
false
false
132
java
package by.bsu.labs.lab14.entity; /** * Created by amareelez on 13.12.16. */ public enum Soil { Ground, Podzol, SodPodzol }
[ "amareelez@gmail.com" ]
amareelez@gmail.com
b679b068594cbdb641874ccd288daf256f322e8c
fa870a93f41f924417a1647275cdd2f98f819a2d
/app/src/main/java/com/example/meet/ui/main/SectionsPagerAdapter.java
bdfd53042a74093ab51a0165fd4aa6866badb6d4
[]
no_license
18Nishant2000/Meet
c938450ec43ecbfec51c640d3902e77e182adacd
91f7e0b8feeac099351f54ef5016427fe37ec41b
refs/heads/master
2022-11-10T18:01:01.388805
2020-07-06T12:33:30
2020-07-06T12:33:30
277,257,936
0
1
null
2020-07-06T04:21:04
2020-07-05T08:06:49
Java
UTF-8
Java
false
false
1,654
java
package com.example.meet.ui.main; import android.content.Context; import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentPagerAdapter; import com.example.meet.Chats; import com.example.meet.Contacts; import com.example.meet.Groups; import com.example.meet.R; /** * A [FragmentPagerAdapter] that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentPagerAdapter { @StringRes private static final int[] TAB_TITLES = new int[]{R.string.tab_text_1, R.string.tab_text_2, R.string.tab_text_3}; private final Context mContext; public SectionsPagerAdapter(Context context, FragmentManager fm) { super(fm); mContext = context; } @Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class below). Fragment fragment = null; switch (position){ case 0: fragment = new Chats(); break; case 1: fragment = new Groups(); break; case 2: fragment = new Contacts(); } return fragment; } @Nullable @Override public CharSequence getPageTitle(int position) { return mContext.getResources().getString(TAB_TITLES[position]); } @Override public int getCount() { return 3; } }
[ "bansal.nishant18052000@gmail.com" ]
bansal.nishant18052000@gmail.com
ed6b666a1488b15e051c682bf146e91448288718
acd0f9fbd7b9f148f9b780aa7dd2b7c59c51161d
/finalproject/src/main/java/com/jhta/finalproject/vo/Gcs2Vo.java
89c9174bdf8be7f0d6588bca2c2c0e98318d3dc3
[]
no_license
MOA-LMY/finalproject
019eb14821ed49cfa3a38657ecbd9d5ea6522a62
c8fd3528f67e4c4bf733c7f23c2b7a747e93664f
refs/heads/main
2023-08-03T17:17:36.255285
2021-08-31T16:53:08
2021-08-31T16:53:08
390,265,525
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package com.jhta.finalproject.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor @AllArgsConstructor public class Gcs2Vo { private int g_num; private String sz_sizename; private String c_colorname; private String c_colorcode; }
[ "whsslfp111@naver.com" ]
whsslfp111@naver.com
c927d8b26d6730836d0b2ef8773f177c87e6f568
c1898104ac17ece71661dc59560621332693fb60
/src/Lesson6/Client.java
aeb6634ea898e29792b53cfc0869b5092aa8b3a9
[]
no_license
nikolayshuklin/GeekbrainsJava2
cab9b726cdeffc4cd942f35d2d750494c103dbcd
eb866176ff71ea96151594f6553cc2130511a24c
refs/heads/master
2022-10-14T09:24:04.784290
2020-06-11T17:37:30
2020-06-11T17:37:30
266,755,802
0
0
null
null
null
null
UTF-8
Java
false
false
1,129
java
package Lesson6; import java.io.*; import java.net.Socket; import java.io.BufferedReader; public class Client { private static final String SERVER_ADDRESS = "localhost"; private static final int SERVER_PORT = 8189; public static void main(String[] args) throws InterruptedException{ try (Socket socket = new Socket(SERVER_ADDRESS, SERVER_PORT); DataInputStream in = new DataInputStream(socket.getInputStream()); DataOutputStream out = new DataOutputStream(socket.getOutputStream()); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ) { while (true) { String serverMsg = in.readUTF(); System.out.println("Сервер:" + serverMsg); String clientMsg = br.readLine(); System.out.println("Сообщение клиента записано и отправлено на сервер"); out.writeUTF(clientMsg); } } catch (IOException e){ e.printStackTrace(); } } }
[ "nikolayshuklin@mail.ru" ]
nikolayshuklin@mail.ru
bd6f482990599257d3b5b388efc070b44274a944
f62ead2a12d78619365dee2e62aa161164a47274
/src/com/sapyoung/member/heejung/day20210726/HeejungVo.java
ef6524ed5830cd4095492dd0a9f7de21e4c83ddc
[]
no_license
withpd/sapyoung_java
f3926a14c77cb55d94f07f907e87ca76639e3711
d0d956fdd193a066271172efb5b08c56c5248c85
refs/heads/master
2023-08-01T19:00:04.228308
2021-09-12T23:43:57
2021-09-12T23:43:57
387,065,971
0
0
null
null
null
null
UTF-8
Java
false
false
931
java
package com.sapyoung.member.heejung.day20210726; public class HeejungVo { private String id; private String mail; private String floor; private String name; private String departName; private String pos; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } public String getFloor() { return floor; } public void setFloor(String floor) { this.floor = floor; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDepartName() { return departName; } public void setDepartName(String departName) { this.departName = departName; } public String getPos() { return pos; } public void setPos(String pos) { this.pos = pos; } }
[ "user@DESKTOP-SB5OCUE" ]
user@DESKTOP-SB5OCUE
004e314b386899c28ae111c72976e40b69798c50
47b2dfcb254997c76c8ad6fad5dabe820654339f
/CustomerCreditWorkShop/src/manager/CustomerManager.java
95ed8c2e54c0322916402ba9b9926fa62e342f4c
[]
no_license
GulaySahin/EtiyaCamp
0157477d7e17c107f182d8a4abc165f25a19172c
cfca3a98b6fe7aef08eadf20b1344354e94593ba
refs/heads/main
2023-09-01T20:55:29.487567
2021-10-03T14:31:45
2021-10-03T14:31:45
397,737,452
2
0
null
null
null
null
MacCentralEurope
Java
false
false
815
java
package manager; import entitites.Customer; import interfaces.CustomerService; import interfaces.UserIdentityValidatorService; public class CustomerManager implements CustomerService { UserIdentityValidatorService userIdentityValidatorService; public CustomerManager(UserIdentityValidatorService userIdentityValidatorService ) { super(); this.userIdentityValidatorService=userIdentityValidatorService; } @Override public void add(Customer customer) { if(this.userIdentityValidatorService.isValid(customer)) { System.out.println("eklendi"+customer.getFirstName()); } } @Override public void remove(Customer customer) { System.out.println("silindi"); } @Override public void update(Customer customer) { System.out.println("gŁncellendi"); } }
[ "48515114+Gulay23@users.noreply.github.com" ]
48515114+Gulay23@users.noreply.github.com