blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 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 689M โ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
62d1237c480624c4696e7e348907d0447c6b4d82 | 77489e0ad0ec8eb3d79118515771ea00577fd1b6 | /app/src/main/java/com/example/foodliapp/Remote/GoogleRetrofitClient.java | c71c8ab0cf5741e614d2289719c5e38c4f79e3e5 | [] | no_license | Mustapha5th/FoodliApp | 99cec2c0131f5289d8342b47f7f9d82ae118d49d | 441cf8ff3b9f4851226e73b8ba3a1a22deceace7 | refs/heads/master | 2023-06-18T08:32:42.081939 | 2021-07-23T19:23:29 | 2021-07-23T19:23:29 | 357,518,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 77 | java | package com.example.foodliapp.Remote;
public class GoogleRetrofitClient {
}
| [
"Mustapha5th@users.noreply.github.com"
] | Mustapha5th@users.noreply.github.com |
837a1610a9625fb213a7d4c47faab1012f27109e | eb20410af30976c723a1ec9bd2979d3a8f032770 | /src/Services/DictionaryFileService.java | a5aa892650a3ae08d1797b32115d45d42bc4e52c | [] | no_license | NikolaevDmitriyVl/DictionaryFull | 03719c08a4e546a2957e1196f687473cfd68b421 | c3f43e90e9d2acf25f1c55994d227265acc874b8 | refs/heads/master | 2023-06-10T19:42:27.020642 | 2021-07-02T16:56:32 | 2021-07-02T16:56:32 | 382,408,675 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package Services;
import Entity.Dictionary;
import java.io.FileNotFoundException;
import java.io.IOException;
public interface DictionaryFileService {
void saveToFile(String pathFile, Dictionary dictionary) throws IOException;
void readFromFile(String pathFile , Dictionary dictionary) throws FileNotFoundException;
}
| [
"dmitriynikolaev468@gmail.com"
] | dmitriynikolaev468@gmail.com |
9140db6ef5d725c8224c240eba706ba53c568bdc | 7b900ce0ad4eef7a6a101881c1049f9bacb5c33d | /src/main/java/org/wlyyy/common/domain/BaseServicePageableResponse.java | c6e2391d44db11cfb165ac841344b84f2934d322 | [
"MIT"
] | permissive | wlyyyrl/itrs-service | 995002f17b1af2f65ad2dcef59e3c43b822ad266 | a291d6d649cf7b26f618f26944be201948505dc7 | refs/heads/master | 2021-04-09T17:34:41.140583 | 2018-05-22T02:24:50 | 2018-05-22T02:24:50 | 125,874,684 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,624 | java | package org.wlyyy.common.domain;
import java.util.List;
/**
* ้กต้ขRestๆฅๅฃๅธฆ!ๅ้กต็่ฟๅ็ปๆๅบ็ก็ฑป
*/
public class BaseServicePageableResponse<T> {
private final boolean success;
private final String message;
private final List<T> datas;
private final Throwable cause;
private final int pageNo;
private final int pageSize;
private final long total;
public BaseServicePageableResponse(
boolean success, String message, List<T> datas,
int pageNo, int pageSize, long total) {
this(success, message, datas, pageNo, pageSize, total, null);
}
public BaseServicePageableResponse(
boolean success, String message, Throwable cause) {
this(success, message, null, 1, 0, 0, cause);
}
public BaseServicePageableResponse(
boolean success, String message, List<T> datas,
int pageNo, int pageSize, long total,
Throwable cause) {
this.success = success;
this.message = message;
this.datas = datas;
this.cause = cause;
this.pageNo = pageNo;
this.pageSize = pageSize;
this.total = total;
}
public boolean isSuccess() {
return success;
}
public String getMessage() {
return message;
}
public List<T> getDatas() {
return datas;
}
public Throwable getCause() {
return cause;
}
public int getPageNo() {
return pageNo;
}
public int getPageSize() {
return pageSize;
}
public long getTotal() {
return total;
}
}
| [
"yangrlx@gmail.com"
] | yangrlx@gmail.com |
870a70492872e37c5db081906c966c6417ebc9c2 | 1f19aec2ecfd756934898cf0ad2758ee18d9eca2 | /u-1/u-11/u-11-111/u-11-111-1111/u-11-111-1111-11111/u-11-111-1111-11111-f9366.java | 19b71a7a98c705ef5f3e68dd0f918cf8217d44b1 | [] | no_license | apertureatf/perftest | f6c6e69efad59265197f43af5072aa7af8393a34 | 584257a0c1ada22e5486052c11395858a87b20d5 | refs/heads/master | 2020-06-07T17:52:51.172890 | 2019-06-21T18:53:01 | 2019-06-21T18:53:01 | 193,039,805 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 106 | java | mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117
1340835769804 | [
"jenkins@khan.paloaltonetworks.local"
] | jenkins@khan.paloaltonetworks.local |
60f35b4069af1b3deee9c2d5f566b457c46c9af4 | fa5d4713c5f5d2048e0fd0411e82f3124767be35 | /CAT3/views/MainActivity.java | 6307d801fa012619cc22bfee65cb664f4ca69fff | [] | no_license | uditchrist/androidapps | 95c042ffe9be5c17804838a4e47031e5fed74cb0 | 2b618d7cf6d7bc36380559e745883a1b830f3abb | refs/heads/main | 2023-09-05T18:06:24.587934 | 2021-11-11T07:24:06 | 2021-11-11T07:24:06 | 390,050,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,161 | java | package com.example.shoppingcart.views;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompat;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.NavigationUI;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.example.shoppingcart.NotificationReceiver;
import com.example.shoppingcart.R;
import com.example.shoppingcart.models.CartItem;
import com.example.shoppingcart.viewmodels.ShopViewModel;
import java.util.List;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
NavController navController;
ShopViewModel shopViewModel;
private int cartQuantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController);
shopViewModel = new ViewModelProvider(this).get(ShopViewModel.class);
shopViewModel.getCart().observe(this, new Observer<List<CartItem>>() {
@Override
public void onChanged(List<CartItem> cartItems) {
int quantity = 0;
for (CartItem cartItem: cartItems) {
quantity += cartItem.getQuantity();
}
cartQuantity = quantity;
invalidateOptionsMenu();
}
});
}
@Override
public boolean onSupportNavigateUp() {
navController.navigateUp();
return super.onSupportNavigateUp();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
final MenuItem menuItem = menu.findItem(R.id.cartFragment);
View actionView = menuItem.getActionView();
TextView cartBadgeTextView = actionView.findViewById(R.id.cart_badge_text_view);
cartBadgeTextView.setText(String.valueOf(cartQuantity));
cartBadgeTextView.setVisibility(cartQuantity == 0 ? View.GONE : View.VISIBLE);
actionView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onOptionsItemSelected(menuItem);
}
});
return true;
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
return NavigationUI.onNavDestinationSelected(item, navController) || super.onOptionsItemSelected(item);
}
} | [
"68955313+uditchrist@users.noreply.github.com"
] | 68955313+uditchrist@users.noreply.github.com |
1c15c37001e98d77b5d06445e1abd26eb49330eb | f888d46388fe2536079ae12a0c2434e639803677 | /formic-tests/Allocate/src/allocate/Main.java | 5ac2796f3ac766e4c59f5ebf303a7f21c74f3fd3 | [] | no_license | zakkak/disquawk | 195bbe8768ec7bedb71ff5b1bc5431c5a09553b0 | d1f226060de657dca1b18d569e6632a1d42bc3a8 | refs/heads/master | 2020-12-25T23:56:32.060201 | 2015-10-20T00:13:38 | 2015-10-20T00:13:38 | 44,301,441 | 0 | 0 | null | 2019-06-04T23:36:57 | 2015-10-15T07:41:13 | Java | UTF-8 | Java | false | false | 2,052 | java | /*
* Copyright 2015 FORTH-ICS / CARV
* (Foundation for Research & Technology -- Hellas,
* Institute of Computer Science,
* Computer Architecture & VLSI Systems Laboratory)
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file Main.java
* @author Foivos S. Zakkak <zakkak@ics.forth.gr>
*
* @brief Create a new thread and try to allocate the maximum possible
* size from both the master and the worker
*/
package allocate;
import java.lang.Thread;
import java.lang.OutOfMemoryError;
public class Main {
public static void main(String[] args) throws InterruptedException {
int size = 1024*1024;
Worker task = new Worker(size);
long start, end;
Thread t;
int[] array;
start = System.currentTimeMillis();
end = System.currentTimeMillis();
System.out.println("currentTimeMillis took me " + (end-start) + " ms");
t = new Thread(task);
t.start();
while(size > 1024) { // Leave some space for prints
try {
start = System.currentTimeMillis();
array = new int[size];
end = System.currentTimeMillis();
System.out.println("It took me " + (end-start) +
" ms to allocate " + (size*4)/1024 +
"KBs");
} catch(OutOfMemoryError e) {
size /= 2;
}
}
t.join();
System.out.println("I am done");
}
}
| [
"foivos@zakkak.net"
] | foivos@zakkak.net |
6f7bb2cc8199ab237a4458c4a0be23092009aa6d | cb883bbc306a84fefb403bc59a014604b6d07675 | /src/main/java/board/board/controller/RestBoardApiController.java | 2abbc3968d61b65a0f3a878cfb56ffeec532a980 | [] | no_license | kingofahn/spring_board_practice | 8ad365901aa6001d10ee7a946264f23039986387 | 28f76149823228446930a8f4d46938c1cfa07c02 | refs/heads/master | 2022-11-19T23:26:13.382368 | 2020-07-21T05:46:20 | 2020-07-21T05:46:20 | 278,588,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,635 | java | package board.board.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import board.board.dto.BoardDto;
import board.board.service.BoardService;
@RestController
public class RestBoardApiController {
@Autowired
private BoardService boardService;
@RequestMapping(value="/api/board", method=RequestMethod.GET)
public List<BoardDto> openBoardList() throws Exception{
return boardService.selectBoardList();
}
@RequestMapping(value="/api/board/write", method=RequestMethod.POST)
public void insertBoard(@RequestBody BoardDto board) throws Exception{
boardService.insertBoard(board, null);
}
@RequestMapping(value="/api/board/{boardIdx}", method=RequestMethod.GET)
public BoardDto openBoardDetail(@PathVariable("boardIdx") int boardIdx) throws Exception{
return boardService.selectBoardDetail(boardIdx);
}
@RequestMapping(value="/api/board/{boardIdx}", method=RequestMethod.PUT)
public String updateBoard(@RequestBody BoardDto board) throws Exception{
boardService.updateBoard(board);
return "redirect:/board";
}
@RequestMapping(value="/api/board/{boardIdx}", method=RequestMethod.DELETE)
public String deleteBoard(@PathVariable("boardIdx") int boardIdx) throws Exception{
boardService.deleteBoard(boardIdx);
return "redirect:/board";
}
}
| [
"breatheye@gmail.com"
] | breatheye@gmail.com |
f80b36a048c92194633303fc8e6f68de060a298a | 77014f77c8adbded1b0feb9b84dc7f22327aea8d | /View/src/main/java/com/hs/view/textview/TagBaseAdapter.java | 32de844e377625f728cc6ec0d076e80a4f4cfdca | [] | no_license | Ypierce/evision-android | 15f88bfa78b23e504f394a4aaec151845f82403a | ed64108ecf3b83c95d248c6d73492266735fc8ba | refs/heads/master | 2020-07-06T22:10:58.783679 | 2019-08-19T09:36:01 | 2019-08-19T09:36:01 | 203,139,441 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,297 | java | package com.hs.view.textview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import com.hs.view.R;
import java.util.List;
/**
* @author fyales
* @since 8/26/15.
*/
public class TagBaseAdapter extends BaseAdapter {
private Context mContext;
private List<String> mList;
public TagBaseAdapter(Context context, List<String> list) {
mContext = context;
mList = list;
}
@Override
public int getCount() {
return mList.size();
}
@Override
public String getItem(int position) {
return mList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.tagview, null);
holder = new ViewHolder();
holder.tagBtn = (Button) convertView.findViewById(R.id.tag_btn);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final String text = getItem(position);
holder.tagBtn.setText(text);
return convertView;
}
static class ViewHolder {
Button tagBtn;
}
}
| [
"1976933130@qq.com"
] | 1976933130@qq.com |
8e8f593914332ccc07069773f2836b84f85e7cee | cc4fe92ecc4f0e91aaf2167fc309e9982e9e7cb6 | /UnitTestsCalculator/src/test/java/trigonometry_JUnit/TgTest.java | 82665c8687701c0fcab68a7b86be7ed34edd7c4b | [] | no_license | PavelSavitskiy/Hometask-M-3-UnitTest | 2345403d40ae66ab3bb9f1b630bb48cba8c2d71d | 3fd39fe22b09c94a279c7d08b87c15ea5283523e | refs/heads/master | 2022-12-26T07:54:25.723634 | 2020-07-13T19:15:04 | 2020-07-13T19:15:04 | 279,390,607 | 0 | 0 | null | 2020-10-13T23:32:41 | 2020-07-13T19:13:08 | Java | UTF-8 | Java | false | false | 745 | java | package trigonometry_JUnit;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.List;
@RunWith(Parameterized.class)
public class TgTest extends BaseJUnitTest {
public TgTest(double a, double expected) {
this.a = a;
this.expected = expected;
}
@Parameterized.Parameters
public static List numbers() {
return Arrays.asList( new Object[][]{
{315,-1},
{350,0},
{0,0},
{45,1}
});
}
@Test
public void testTg(){
Assert.assertEquals(expected,calculator.tg(a),1e-9);
}
}
| [
"noreply@github.com"
] | PavelSavitskiy.noreply@github.com |
b5c86c56f9381f43d0b6cf0a02087aa1f6212431 | 9bc7025e54c21d363e152b58d102ec8b67ff21d1 | /transclient/cls-agent/src/cn/ac/iie/cls/agent/po/MessagePo.java | f42e74466032c86000203a24f5f406f8f1c1e262 | [] | no_license | dsiiieorg/cls-agent | e4e2b2ed146d2c0bcaa5c65fa46ce2dd5724a988 | be207bf7a7b5cd224086052e227a1ea8a182dc4d | refs/heads/master | 2016-09-05T23:00:18.967509 | 2013-10-14T02:09:42 | 2013-10-14T02:09:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,214 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cn.ac.iie.cls.agent.po;
/**
*
* @author root
*/
public class MessagePo {
private String id;
private String xml;
private String content;
private boolean readFlag;
/**
* @return the content
*/
public String getContent() {
return content;
}
/**
* @param content the content to set
*/
public void setContent(String content) {
this.content = content;
}
/**
* @return the readFlag
*/
public boolean getReadFlag() {
return readFlag;
}
/**
* @param readFlag the readFlag to set
*/
public void setReadFlag(boolean readFlag) {
this.readFlag = readFlag;
}
/**
* @return the xml
*/
public String getXml() {
return xml;
}
/**
* @param xml the xml to set
*/
public void setXml(String xml) {
this.xml = xml;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
}
| [
"chang2727@sohu.com"
] | chang2727@sohu.com |
e9d5974cc5a9c2578f53380f0ec1872fda5aeee6 | bb4ef993fd7f156ffc5b847d1a7ccbb646c2ccc3 | /src/main/java/com/timecard/demo/controller/Timecardcontroller.java | b9dd83300d4c5ab3701c8990193230befc99c48a | [] | no_license | sanjay17789/Timecard-Application | d3814737a9a75d00646249eb918e40cb7ba8b1d0 | a3a110c8c6162edbb71bfe68826b26f47292d116 | refs/heads/main | 2023-08-16T03:38:57.117982 | 2021-10-20T08:24:01 | 2021-10-20T08:24:01 | 419,243,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,243 | java | package com.timecard.demo.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.timecard.demo.entity.TimeCardData;
import com.timecard.demo.repository.TimecardRepository;
@Controller
@RequestMapping("/timecard/")
public class Timecardcontroller {
@Autowired
private TimecardRepository timecardrepository;
@GetMapping("showForm")
public String showStudentForm(TimeCardData timecarddata) {
return "addtimecard";
}
@InitBinder public void initBinder(WebDataBinder webDataBinder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
dateFormat.setLenient(false);
webDataBinder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
@GetMapping("list")
public String timecard(Model model) {
model.addAttribute("timecarddata", this.timecardrepository.findAll());
return "index";
}
@RequestMapping(value="add",method = RequestMethod.GET)
public String addStudentprocess(Model model) {
model.addAttribute("timecarddata", new TimeCardData());
return "addtimecard";
}
@PostMapping("add")
public String addStudent(@Validated TimeCardData timecarddata, BindingResult result, Model model) {
if(result.hasErrors()) {
return "addtimecard";
}
this.timecardrepository.save(timecarddata);
return "redirect:list";
}
@GetMapping("edit/{id}")
public String showUpdateForm(@PathVariable ("id") long id, Model model) {
TimeCardData timecarddata = this.timecardrepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("Invalid timecard id : " + id));
model.addAttribute("timecarddata", timecarddata);
return "update-timecard";
}
@PostMapping("update/{id}")
public String updateTimecard(@PathVariable("id") long id, @Validated TimeCardData timecarddata, BindingResult result, Model model) {
if(result.hasErrors()) {
timecarddata.setId(id);
return "update-timecard";
}
// update timecard
timecardrepository.save(timecarddata);
// get all ( with update)
model.addAttribute("timecarddata", this.timecardrepository.findAll());
return "index";
}
@GetMapping("delete/{id}")
public String deleteTimecard(@PathVariable ("id") long id, Model model) {
TimeCardData timecarddata = this.timecardrepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("Invalid timecard id : " + id));
this.timecardrepository.delete(timecarddata);
model.addAttribute("timecarddata", this.timecardrepository.findAll());
return "index";
}
}
| [
"sanjay@gmail.com"
] | sanjay@gmail.com |
bcaa51b11e584102d3118f8079896e2069175c2a | 0df1cbda802c21f015fb90c6b2241d3959964a77 | /src/main/java/com/model/User.java | 0c96282a83dd203f197d7556b7bc87f904f91bd5 | [] | no_license | selvam277/spring-project | 981ef3a57e61175f364e582ad761edb5d4391d0d | 3b0db1676f8e18b19b392728644be15f13bdede2 | refs/heads/master | 2020-03-09T09:42:54.933864 | 2018-04-09T05:52:50 | 2018-04-09T05:52:50 | 128,719,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 197 | java | package com.model;
public class User {
private String userName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
| [
"selvam277@gmail.com"
] | selvam277@gmail.com |
a6ca4412b867bf4913d06855aaaeb8ff89423003 | 2c76f8e091881de6a0f1f53bb9c371987c5be298 | /src/lesson8/innernested/innerclasses/Outer4.java | bf7b1df6ef7b9e1ba7361e01971d82a18ab36990 | [] | no_license | AntonDyev/bh270819 | 7a8a0580e50f90d5940ece16fdbf7824d4fc5133 | 63bc33156f4a965f7586f714b726df2fd3519308 | refs/heads/master | 2020-08-09T04:31:59.367402 | 2019-10-08T21:12:59 | 2019-10-08T21:12:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package lesson8.innernested.innerclasses;
// ะะพัััะฟ ะบ ะฟะตัะตะผะตะฝะฝะพะน ัะธะฟะฐ final static ะฒะพะทะผะพะถะตะฝ ะฒะพ ะฒะฝะตัะฝะตะผ ะบะปะฐััะต ัะตัะตะท ะธะผั
// ะฒะฝัััะตะฝะฝะตะณะพ ะบะปะฐััะฐ.
public class Outer4 {
Inner inner;
Outer4() {
inner = new Inner();
}
public void callMethodInInner() {
System.out.println(Inner.prfsi_polr);
System.out.println(Inner.pubfsi_pole);
}
class Inner {
public final static int pubfsi_pole = 22;
private final static int prfsi_polr = 33;
}
}
| [
"s.molchanova@softteco.com"
] | s.molchanova@softteco.com |
64ea59529261e29ba406da91f3d60fec872389cc | b2dff6e5903c5457be567b92d7644470e53db7f4 | /app/src/main/java/projects/nyinyihtunlwin/news/adapters/NewsImagesPagerAdapter.java | 8f1ac100389e6c518dfca968bc1c175fe3c80901 | [
"Apache-2.0"
] | permissive | nyinyihtunlwin-codigo/LCS_01_MM_News | 649a9d8360f4ddee35da57fd0d17f92ab27b41fd | 9c45c4f623da94781cb2922259b7194afd5a1ccd | refs/heads/master | 2021-09-06T17:48:02.486167 | 2018-02-09T08:47:26 | 2018-02-09T08:47:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,584 | java | package projects.nyinyihtunlwin.news.adapters;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import projects.nyinyihtunlwin.news.R;
import projects.nyinyihtunlwin.news.viewitems.NewsDetailsImageViewItem;
/**
* Created by Dell on 11/11/2017.
*/
public class NewsImagesPagerAdapter extends PagerAdapter {
private LayoutInflater layoutInflater;
private List<String> mImages;
public NewsImagesPagerAdapter(Context context) {
super();
layoutInflater = LayoutInflater.from(context);
mImages = new ArrayList<>();
}
@Override
public int getCount() {
return mImages.size();
}
@Override
public boolean isViewFromObject(View view, Object object) {
return (view == (View) object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
NewsDetailsImageViewItem view = (NewsDetailsImageViewItem) layoutInflater.inflate(R.layout.view_item_news_details_image, container, false);
view.setData(mImages.get(position));
container.addView(view); // attach created view to container
return view;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
public void setImages(List<String> images) {
this.mImages = images;
notifyDataSetChanged();
}
}
| [
"nnhl.mgk@gmail.com"
] | nnhl.mgk@gmail.com |
d1af3dc8d6d4e354fa2e5e8561f388f0edc54449 | dc7f7b598cda58e2d952a963d13b7ea1f32781e8 | /DesignPatternVerifier/examples/src/main/java/correctimplementation/NullPointerExceptionClass.java | 14d761d84f576ba7f902ecbc8d6444658ae6d5c4 | [
"MIT"
] | permissive | ArvindGanesan95/AnnotationFramework | a3c7c0f438d3ad1c674812ce6d3a7db456cb26b3 | b77cf5cbaf59b0b6b2bce3547625457fa13998f8 | refs/heads/master | 2023-03-13T00:24:34.929502 | 2021-03-06T20:57:29 | 2021-03-06T20:57:29 | 303,016,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 931 | java | package correctimplementation;
import annotationlibrary.Handler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Handler
public class NullPointerExceptionClass extends RequestHandler {
private final Logger LOGGER = LoggerFactory.getLogger(NullPointerExceptionClass.class);
NullPointerExceptionClass(RequestHandler handler){
super(handler);
}
@Override
void handleRequest(Throwable request){
//Check if this class can handle null pointer exception. If
// yes, process it. Else call the next handler.
if(request instanceof NullPointerException){
LOGGER.info("[Handler]Caught a null pointer exception");
System.out.println("[Handler]Caught a null pointer exception");
}
else {
LOGGER.info("[Handler] Cannot process the request. Passing to next handler");
super.handleRequest(request);
}
}
}
| [
"g.arvind1995@gmail.com"
] | g.arvind1995@gmail.com |
273eb791738b4cee2ece28befe8d363e0cdde128 | b2f07f3e27b2162b5ee6896814f96c59c2c17405 | /com/sun/jmx/snmp/IPAcl/NetMaskImpl.java | 531c9a20d2d4bb8dd8d414d750319be158c1a1b2 | [] | no_license | weiju-xi/RT-JAR-CODE | e33d4ccd9306d9e63029ddb0c145e620921d2dbd | d5b2590518ffb83596a3aa3849249cf871ab6d4e | refs/heads/master | 2021-09-08T02:36:06.675911 | 2018-03-06T05:27:49 | 2018-03-06T05:27:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,520 | java | /* */ package com.sun.jmx.snmp.IPAcl;
/* */
/* */ import com.sun.jmx.defaults.JmxProperties;
/* */ import java.io.Serializable;
/* */ import java.net.InetAddress;
/* */ import java.net.UnknownHostException;
/* */ import java.security.Principal;
/* */ import java.security.acl.Group;
/* */ import java.util.Enumeration;
/* */ import java.util.Vector;
/* */ import java.util.logging.Level;
/* */ import java.util.logging.Logger;
/* */
/* */ class NetMaskImpl extends PrincipalImpl
/* */ implements Group, Serializable
/* */ {
/* */ private static final long serialVersionUID = -7332541893877932896L;
/* 51 */ protected byte[] subnet = null;
/* 52 */ protected int prefix = -1;
/* */
/* */ public NetMaskImpl()
/* */ throws UnknownHostException
/* */ {
/* */ }
/* */
/* */ private byte[] extractSubNet(byte[] paramArrayOfByte)
/* */ {
/* 61 */ int i = paramArrayOfByte.length;
/* 62 */ byte[] arrayOfByte = null;
/* 63 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 64 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "BINARY ARRAY :");
/* */
/* 66 */ StringBuffer localStringBuffer = new StringBuffer();
/* 67 */ for (k = 0; k < i; k++) {
/* 68 */ localStringBuffer.append((paramArrayOfByte[k] & 0xFF) + ":");
/* */ }
/* 70 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", localStringBuffer.toString());
/* */ }
/* */
/* 75 */ int j = this.prefix / 8;
/* 76 */ if (j == i) {
/* 77 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 78 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "The mask is the complete address, strange..." + i);
/* */ }
/* */
/* 81 */ arrayOfByte = paramArrayOfByte;
/* 82 */ return arrayOfByte;
/* */ }
/* 84 */ if (j > i) {
/* 85 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 86 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "The number of covered byte is longer than the address. BUG");
/* */ }
/* */
/* 89 */ throw new IllegalArgumentException("The number of covered byte is longer than the address.");
/* */ }
/* 91 */ int k = j;
/* 92 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 93 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Partially covered index : " + k);
/* */ }
/* */
/* 96 */ int m = paramArrayOfByte[k];
/* 97 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 98 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Partially covered byte : " + m);
/* */ }
/* */
/* 103 */ int n = this.prefix % 8;
/* 104 */ int i1 = 0;
/* */
/* 106 */ if (n == 0)
/* 107 */ i1 = k;
/* */ else {
/* 109 */ i1 = k + 1;
/* */ }
/* 111 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 112 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Remains : " + n);
/* */ }
/* */
/* 116 */ int i2 = 0;
/* 117 */ for (int i3 = 0; i3 < n; i3++) {
/* 118 */ i2 = (byte)(i2 | 1 << 7 - i3);
/* */ }
/* 120 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 121 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Mask value : " + (i2 & 0xFF));
/* */ }
/* */
/* 125 */ i3 = (byte)(m & i2);
/* */
/* 127 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 128 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Masked byte : " + (i3 & 0xFF));
/* */ }
/* */
/* 131 */ arrayOfByte = new byte[i1];
/* 132 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 133 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Resulting subnet : ");
/* */ }
/* */
/* 136 */ for (int i4 = 0; i4 < k; i4++) {
/* 137 */ arrayOfByte[i4] = paramArrayOfByte[i4];
/* */
/* 139 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 140 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", (arrayOfByte[i4] & 0xFF) + ":");
/* */ }
/* */
/* */ }
/* */
/* 145 */ if (n != 0) {
/* 146 */ arrayOfByte[k] = i3;
/* 147 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 148 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", "Last subnet byte : " + (arrayOfByte[k] & 0xFF));
/* */ }
/* */ }
/* */
/* 152 */ return arrayOfByte;
/* */ }
/* */
/* */ public NetMaskImpl(String paramString, int paramInt)
/* */ throws UnknownHostException
/* */ {
/* 162 */ super(paramString);
/* 163 */ this.prefix = paramInt;
/* 164 */ this.subnet = extractSubNet(getAddress().getAddress());
/* */ }
/* */
/* */ public boolean addMember(Principal paramPrincipal)
/* */ {
/* 176 */ return true;
/* */ }
/* */
/* */ public int hashCode() {
/* 180 */ return super.hashCode();
/* */ }
/* */
/* */ public boolean equals(Object paramObject)
/* */ {
/* 192 */ if (((paramObject instanceof PrincipalImpl)) || ((paramObject instanceof NetMaskImpl))) {
/* 193 */ PrincipalImpl localPrincipalImpl = (PrincipalImpl)paramObject;
/* 194 */ InetAddress localInetAddress = localPrincipalImpl.getAddress();
/* 195 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 196 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", "Received Address : " + localInetAddress);
/* */ }
/* */
/* 199 */ byte[] arrayOfByte = localInetAddress.getAddress();
/* 200 */ for (int i = 0; i < this.subnet.length; i++) {
/* 201 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 202 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", "(recAddr[i]) : " + (arrayOfByte[i] & 0xFF));
/* */
/* 204 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", "(recAddr[i] & subnet[i]) : " + (arrayOfByte[i] & this.subnet[i] & 0xFF) + " subnet[i] : " + (this.subnet[i] & 0xFF));
/* */ }
/* */
/* 209 */ if ((arrayOfByte[i] & this.subnet[i]) != this.subnet[i]) {
/* 210 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 211 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", "FALSE");
/* */ }
/* */
/* 214 */ return false;
/* */ }
/* */ }
/* 217 */ if (JmxProperties.SNMP_LOGGER.isLoggable(Level.FINEST)) {
/* 218 */ JmxProperties.SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", "TRUE");
/* */ }
/* */
/* 221 */ return true;
/* */ }
/* 223 */ return false;
/* */ }
/* */
/* */ public boolean isMember(Principal paramPrincipal)
/* */ {
/* 232 */ if ((paramPrincipal.hashCode() & super.hashCode()) == paramPrincipal.hashCode()) return true;
/* 233 */ return false;
/* */ }
/* */
/* */ public Enumeration<? extends Principal> members()
/* */ {
/* 242 */ Vector localVector = new Vector(1);
/* 243 */ localVector.addElement(this);
/* 244 */ return localVector.elements();
/* */ }
/* */
/* */ public boolean removeMember(Principal paramPrincipal)
/* */ {
/* 254 */ return true;
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 263 */ return "NetMaskImpl :" + super.getAddress().toString() + "/" + this.prefix;
/* */ }
/* */ }
/* Location: C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar
* Qualified Name: com.sun.jmx.snmp.IPAcl.NetMaskImpl
* JD-Core Version: 0.6.2
*/ | [
"yuexiahandao@gmail.com"
] | yuexiahandao@gmail.com |
fde9f8c1509a0cb3c16a660ec2df6d2febdbe60b | b73f9d5dfe95feab9f2ca5f4f9eb7c7b42ed97b7 | /src/main/java/com/example/demoamposrestaurant/business/converter/ItemConverter.java | 569ec889243fe2c89b52b59b7e9c993e16020f88 | [] | no_license | idontwannarock/demo-ampos-restaurant | fae7ff979573651a6f046215154e0ebb8aaa97de | 339fe3c4b0b83c6c94be67ebe2a35fbc7a046614 | refs/heads/master | 2022-02-22T20:58:44.759869 | 2019-08-30T10:54:10 | 2019-08-30T10:54:10 | 197,867,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,713 | java | package com.example.demoamposrestaurant.business.converter;
import com.example.demoamposrestaurant.persistent.domain.Item;
import com.example.demoamposrestaurant.presentation.payload.ItemRequestPayload;
import com.example.demoamposrestaurant.presentation.payload.ItemResponsePayload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Optional;
import java.util.stream.Collectors;
@Component
public class ItemConverter {
@Autowired
private TypeConverter typeConverter;
public Item toEntity(ItemRequestPayload payload) {
Item item = new Item();
Optional.ofNullable(payload.getName()).ifPresent(item::setName);
Optional.ofNullable(payload.getDescription()).ifPresent(item::setDescription);
Optional.ofNullable(payload.getImageLocation()).ifPresent(item::setImageLocation);
Optional.ofNullable(payload.getPrice()).ifPresent(item::setPrice);
return item;
}
public ItemResponsePayload toPayload(Item item) {
ItemResponsePayload payload = new ItemResponsePayload();
Optional.ofNullable(item.getId()).ifPresent(payload::setId);
Optional.ofNullable(item.getName()).ifPresent(payload::setName);
Optional.ofNullable(item.getDescription()).ifPresent(payload::setDescription);
Optional.ofNullable(item.getImageLocation()).ifPresent(payload::setImageLocation);
Optional.ofNullable(item.getPrice()).ifPresent(payload::setPrice);
if (!item.getTypes().isEmpty()) {
payload.setTypes(item.getTypes().stream().map(typeConverter::toPayload).collect(Collectors.toSet()));
}
return payload;
}
}
| [
"idontwannarock@gmail.com"
] | idontwannarock@gmail.com |
1e3eba317a7765a8cdbbc2715db2445e4fe890b5 | 6608b248780566646b9abdb5cd23d38f4bb4d3e1 | /src/main/java/com/isc/npsd/kafa/messegeproducer/MessageSenderController.java | 6022f7a980d7554c58659fd8c9b2371facb191ee | [] | no_license | mostafarastgar/dynamicconsumer | 1523ab9b6b8e2c77a050254fe0447afcbeb8cb08 | 78fbdf82c29c1c61ae0b1d4b074d13da62454e60 | refs/heads/master | 2020-11-28T04:06:03.304503 | 2019-12-23T07:20:47 | 2019-12-23T07:20:47 | 229,698,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,973 | java | package com.isc.npsd.kafa.messegeproducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.MimeTypeUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
@RestController
public class MessageSenderController {
@Autowired
@Output(Source.OUTPUT)
private MessageChannel messageChannel;
@Autowired
@Output(HassanSource.OUTPUT)
private MessageChannel hassanChannel;
@GetMapping("/messageMostafa")
public void sendMessage() {
sendMessage(messageChannel);
}
@GetMapping("/messageHassan")
public void sendMessageHassan() {
sendMessage(hassanChannel);
}
private void sendMessage(MessageChannel messageChannel) {
String formattedDate = "1398-09-23";
String formattedDateTime = formattedDate + "T" + LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss"));
String s = String.valueOf(new Date().getTime());
String transactionId = s.substring(s.length() - 4);
messageChannel.send(MessageBuilder.withPayload("test")
.setHeader(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.TEXT_PLAIN)
.setHeader("message_type", "\"ORDER\"").build());
}
private String generateMessage(String currentDate, String currentDateTime, String transactionID, String debtorAgent) {
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<Document xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation= \"iip_pacs.002.001.07.xsd\">\n" +
" <pacs.008.001.01>\n" +
" <GrpHdr>\n" +
" <MsgId>MELI-CT-2010-09-28-" + transactionID + "</MsgId>\n" +
" <CreDtTm>" + currentDateTime + "</CreDtTm>\n" +
" <NbOfTxs>1</NbOfTxs>\n" +
" <TtlIntrBkSttlmAmt Ccy=\"IRR\">100</TtlIntrBkSttlmAmt>\n" +
" <IntrBkSttlmDt>" + currentDate + "</IntrBkSttlmDt>\n" +
" <SttlmInf>\n" +
" <SttlmMtd>CLRG</SttlmMtd>\n" +
" </SttlmInf>\n" +
" </GrpHdr>\n" +
" <CdtTrfTxInf>\n" +
" <PmtId>\n" +
" <InstrId>9587432156</InstrId>\n" +
" <EndToEndId>1234567890123456</EndToEndId>\n" +
" <TxId>MELI-CT-" + currentDate + "-" + transactionID + "</TxId>\n" +
" </PmtId>\n" +
" <PmtTpInf>\n" +
" <SvcLvl>\n" +
" <Cd>SEPA</Cd>\n" +
" </SvcLvl>\n" +
" <LclInstrm>\n" +
" <Prtry>INST</Prtry>\n" +
" </LclInstrm>\n" +
" </PmtTpInf>\n" +
" <IntrBkSttlmAmt Ccy=\"IRR\">100</IntrBkSttlmAmt>\n" +
" <AccptncDtTm>" + currentDateTime + "</AccptncDtTm>\n" +
" <ChrgBr>SLEV</ChrgBr>\n" +
" <Dbtr>\n" +
" <Nm>asghar</Nm>\n" +
" </Dbtr>\n" +
" <DbtrAcct>\n" +
" <Id>\n" +
" <IBAN>IR690170000000512687432001</IBAN>\n" +
" </Id>\n" +
" </DbtrAcct>\n" +
" <DbtrAgt>\n" +
" <FinInstnId>\n" +
" <BIC>" + debtorAgent + "</BIC>\n" +
" </FinInstnId>\n" +
" </DbtrAgt>\n" +
" <CdtrAgt>\n" +
" <FinInstnId>\n" +
" <BIC>BSIRIRTHXXX</BIC>\n" +
" </FinInstnId>\n" +
" </CdtrAgt>\n" +
" <Cdtr>\n" +
" <Nm>akbar</Nm>\n" +
" </Cdtr>\n" +
" <CdtrAcct>\n" +
" <Id>\n" +
" <IBAN>IR160190000001853497200009</IBAN>\n" +
" </Id>\n" +
" </CdtrAcct>\n" +
" <Purp>\n" +
" <Cd>IPAY</Cd>\n" +
" </Purp>\n" +
"</CdtTrfTxInf>\n" +
" </pacs.008.001.01></Document>";
}
}
| [
"mostafarastgar@yahoo.com"
] | mostafarastgar@yahoo.com |
756d629b284c7bbb93e81cbc305eb26bc3c24cd5 | cd9bb972d1d4fe2c0c92857ee8d2d511e4e2a1cc | /app/src/main/java/apps/yuesaka/com/thehumanprojectfitnessapp/DailyStatsActivity.java | 7ad4b6457fbe3dfd291c8be8647dedfa46a91418 | [] | no_license | yuesaka/FitnessDemoApp | 65f19078d00f7e699072574291771b0749f2d3b0 | 850504125da854a34cfa5caa1abb4f5ea20f5f1a | refs/heads/master | 2021-01-19T12:55:20.212074 | 2019-07-31T20:58:20 | 2019-07-31T20:58:20 | 82,350,470 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,277 | java | package apps.yuesaka.com.thehumanprojectfitnessapp;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Pair;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* This Activity displays the daily statistics for the current logged in user.
*/
public class DailyStatsActivity extends ActionBarActivity {
private TextView stepsTakenText;
private TextView usernameText;
private TextView distanceText;
private TextView distanceFeetText;
private ListView stepStatsListView ;
private SessionManager sessionManager;
private DatabaseHelper dbHelper;
// Service related objects
StepCountingService stepCountingService;
boolean serviceBound = false;
// Receive update from StepCountingService about new steps
BroadcastReceiver newStepReceiver;
@Override
protected void onStart() {
super.onStart();
Intent intent = new Intent(this, StepCountingService.class);
startService(intent);
bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
LocalBroadcastManager.getInstance(this).registerReceiver((newStepReceiver),
new IntentFilter(StepCountingService.STEP_COUNT_UPDATE)
);
}
@Override
protected void onStop() {
super.onStop();
if (serviceBound) {
unbindService(serviceConnection);
serviceBound = false;
}
LocalBroadcastManager.getInstance(this).unregisterReceiver(newStepReceiver);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_daily_stats);
if(getResources().getBoolean(R.bool.portrait_only)){
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
PackageManager pm = getPackageManager();
if (!pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)) {
Toast.makeText(this, getString(R.string.sensor_lacking_message), Toast.LENGTH_LONG)
.show();
}
dbHelper = DatabaseHelper.getInstance(getApplicationContext());
stepsTakenText = (TextView) findViewById(R.id.daily_stats_steps_taken);
usernameText = (TextView) findViewById(R.id.daily_stats_greetings);
distanceText = (TextView) findViewById(R.id.daily_stats_disntace_walked);
distanceFeetText = (TextView) findViewById(R.id.daily_stats_disntace_walked_feet);
stepStatsListView = (ListView) findViewById(R.id.step_stats_list);
stepsTakenText.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent dbmanager = new Intent(DailyStatsActivity.this, AndroidDatabaseManager
.class);
startActivity(dbmanager);
}
});
sessionManager = new SessionManager(getApplicationContext());
if (!sessionManager.checkLogin()) {
finish();
return;
}
setupStepLogUI();
updateStepAndDistanceText();
usernameText.setText(getString(R.string.daily_stats_title, sessionManager
.getSessionUsername(),
Utility.getCurrentDateString()));
// Listen for the change in steps from StepCountingService
newStepReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (sessionManager.isLoggedIn()) {
updateStepAndDistanceText();
}
}
};
}
/**
* Menu related functions
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
Intent intent = null;
switch (id) {
case R.id.menu_logout:
intent = new Intent(this, StepCountingService.class);
stopService(intent);
sessionManager.logoutUser();
finish();
break;
case R.id.menu_leaderboard:
intent = new Intent(DailyStatsActivity.this,
LeaderBoardActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
}
return super.onOptionsItemSelected(item);
}
// Service connection object
private ServiceConnection serviceConnection = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName name) {
serviceBound = false;
}
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
StepCountingService.StepCountingServiceBinder myBinder = (StepCountingService.StepCountingServiceBinder) service;
stepCountingService = myBinder.getService();
serviceBound = true;
}
};
private void setupStepLogUI() {
List<Pair<String, Integer>> currentUserStepLog = dbHelper.getStepLogData(sessionManager
.getSessionUsername());
List<String> currentUserStepLogStrings = new ArrayList<>();
for (Pair<String, Integer> pair : currentUserStepLog) {
String stepLogString = new String();
String dateString = Utility.getCurrentDateString();
if (!pair.first.equals(dateString)) { // Don't display current date
int userId = dbHelper.getUserId(sessionManager
.getSessionUsername());
double distance = Utility.stepsToMeter(pair.second, dbHelper
.getUserHeight(userId), dbHelper.getUserSex(userId).equals(getString(R
.string.male_string)));
stepLogString = getString(R.string.step_log_entry,pair.first,pair.second.toString
(),Utility.formatDouble(distance),
Utility.formatDouble(distance * Utility.METER_TO_FEET_CONVERSION));
currentUserStepLogStrings.add(stepLogString);
}
}
if (currentUserStepLogStrings.isEmpty()) {
currentUserStepLogStrings.add(getString(R.string.nothing_logged));
}
ArrayAdapter<String> itemsAdapter =
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,
currentUserStepLogStrings);
stepStatsListView.setAdapter(itemsAdapter);
}
private void updateStepAndDistanceText() {
int userId = dbHelper.getUserId(sessionManager
.getSessionUsername());
int stepsWalkedToday = dbHelper.getStepsToday(userId);
stepsTakenText.setText(getString(R.string.steps_taken, stepsWalkedToday));
double distance = Utility.stepsToMeter(stepsWalkedToday, dbHelper
.getUserHeight(userId), dbHelper.getUserSex(userId).equals(getString(R
.string.male_string)));
distanceText.setText(getString(R.string.distance_walked_meter, Utility.formatDouble
(distance)));
distanceFeetText.setText(getString(R.string.distance_walked_feet, Utility.formatDouble
(distance * Utility.METER_TO_FEET_CONVERSION)));
}
}
| [
"yumasax@umich.edu"
] | yumasax@umich.edu |
f663b58c1e46d01fed4b6a8d8f14e40dcde68e28 | a0eab532bef9ce52dbaeed341e50f71efdcf8714 | /spring-boot-hw4/src/main/java/com/example/springboothw4/entities/User.java | fb6951afd0df8718bb08c86808b0128090cc88ad | [] | no_license | Tapt14/gb-spring | 131101bd07582d7ac85a0e135c2f31847f18551a | 75e7d01299321c8eae8379b5ab34267a53d53199 | refs/heads/main | 2023-04-11T17:44:05.194886 | 2021-05-14T09:26:22 | 2021-05-14T09:26:22 | 357,962,934 | 0 | 0 | null | 2021-05-14T09:25:06 | 2021-04-14T15:58:21 | Java | UTF-8 | Java | false | false | 618 | java | package com.example.springboothw4.entities;
import lombok.*;
import javax.persistence.*;
import java.util.List;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column
private String login;
@Column
private String password;
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(
name = "users_products",
joinColumns = @JoinColumn(name = "user_id"),
inverseJoinColumns = @JoinColumn(name = "product_id")
)
List<Product> products;
}
| [
"bolshovm@yandex.ru"
] | bolshovm@yandex.ru |
6e08792a06179aa3a077a3acdefc86264e2ce546 | 11f78d7f87ba6ca477eeb2270231372ebbada5a3 | /ent-creditQuery/ent-queryFlowManager/ent-queryFlowManager-ansytask/src/main/java/cn/com/dhcc/creditquery/ent/queryflowmanager/ansytash/CeqSingleQueryTask.java | 25c6a295b9fe431705a40776095822b7083b409d | [] | no_license | Kong-1123/IdeaProject | 7f4e387947426d5465ec23ee3d5d64e98e181266 | b54e178dcc47095ae64d75db6c5d475c3dc90442 | refs/heads/master | 2022-12-29T19:38:03.362647 | 2019-06-09T06:03:00 | 2019-06-09T06:03:00 | 190,969,933 | 3 | 2 | null | 2022-12-10T05:29:51 | 2019-06-09T05:58:21 | HTML | UTF-8 | Java | false | false | 3,594 | java | package cn.com.dhcc.creditquery.ent.queryflowmanager.ansytash;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
*
* ไผไธๅ็ฌ่ฏทๆฑๆฅๆๅฎไฝ
* @author yuzhao.xue
* @date 2019ๅนด3ๆ18ๆฅ
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@Entity
@Table(name = "ceq_single_query")
public class CeqSingleQueryTask implements java.io.Serializable {
// Fields
/**
*
*/
private static final long serialVersionUID = -8565475985765707811L;
@Id
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@GeneratedValue(generator = "system-uuid")
@Column(name = "ID", unique = true, nullable = false, length = 32)
private String id;
/**
* ไผไธๅ็งฐ
*/
@Column(name = "CLIENT_NAME")
private String enterpriseName;
/**
* ไธญๅพ็
*/
@Column(name = "LOANCARD_CODE")
private String signCode;
/**
* ็ปไธ็คพไผไฟก็จไปฃ็
*/
@Column(name = "US_CREDIT_CODE")
private String uniformSocialCredCode;
/**
* ็ป็ปๆบๆไปฃ็
*/
@Column(name = "COPR_CODE")
private String orgInstCode;
/**
* ๆบๆไฟก็จไปฃ็
*/
@Column(name = "ORG_CREDIT_CODE")
private String orgCreditCode;
/**
* ็บณ็จไบบ่ฏๅซๅท(ๅฝ็จ)
*/
@Column(name = "GS_REGI_CODE")
private String gsRegiNo;
/**
* ็บณ็จไบบ่ฏๅซๅท(ๅฐ็จ)
*/
@Column(name = "DS_REGI_CODE")
private String dsRegiNo;
/**
* ็ป่ฎฐๆณจๅ็ฑปๅ
*/
@Column(name = "REGI_TYPE_CODE")
private String regiTypeCode;
/**
* ็ป่ฎฐๆณจๅๅท
*/
@Column(name = "FRGCORPNO")
private String frgcorpno;
@Column(name = "QUERY_REASON", length = 2)
private String queryReason;
@Column(name = "QUERY_FORMAT", length = 2)
private String queryFormat;
@Column(name = "REPORT_TYPE", length = 2)
private String reportType;
@Column(name = "QUERY_TYPE", precision = 5, scale = 0)
private Integer queryType;
@Column(name = "SYNC_FLAG", length = 1)
private String syncFlag;
@Column(name = "ASYNC_QUERY_FLAG", length = 1)
private String asyncQueryFlag;
@Column(name = "BUSINESS_LINE", length = 2)
private String businessLine;
@Column(name = "SYS_CODE", length = 20)
private String sysCode;
@Column(name = "QUERY_USER", length = 30)
private String queryUser;
@Column(name = "CALL_SYS_USER", length = 30)
private String callSysUser;
@Column(name = "BUSSID", length = 64)
private String bussid;
@Column(name = "RECHECK_USER", length = 30)
private String recheckUser;
@Column(name = "USER_IP", length = 15)
private String userIp;
@Column(name = "USER_MAC", length = 17)
private String userMac;
@Column(name = "REPORT_VERSION", length = 5)
private String reportVersion;
@Column(name = "REQ_ID", length = 32)
private String reqId;
private String status;
@Column(name = "EXT1", length = 60)
private String ext1;
@Column(name = "EXT2", length = 60)
private String ext2;
@Column(name = "EXT3", length = 60)
private String ext3;
@Column(name = "EXT4", length = 60)
private String ext4;
@Column(name = "EXT5", length = 60)
private String ext5;
@Column(name = "EXT6", length = 60)
private String ext6;
public String toString() {
return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
}
} | [
"kong_glb@gmail.com"
] | kong_glb@gmail.com |
ba0032b02bf8de485fd46449e0009282b470170e | 470fbaaa423f6c2310a02176144cc5f0cfb9f045 | /database/src/main/java/com/database/database/DatabaseApplication.java | 294095a9ac38f3c51e452182007c4bd1c531fdaf | [] | no_license | saikiran8991/sai | 2502ec15aa365cd95f84e943a3534c9e72d867e3 | 197fad8d76ddb688f1a43dbf06e2210c0f2a7bdd | refs/heads/master | 2020-07-15T23:43:29.333380 | 2019-12-17T06:00:52 | 2019-12-17T06:00:52 | 205,674,066 | 0 | 0 | null | 2019-11-05T12:11:59 | 2019-09-01T12:37:20 | Java | UTF-8 | Java | false | false | 1,189 | java | package com.database.database;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.database.database.dao.PersonJdbcDao;
import com.database.database.entity.Person;
@SpringBootApplication
public class DatabaseApplication implements CommandLineRunner{
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
PersonJdbcDao dao;
public static void main(String[] args) {
SpringApplication.run(DatabaseApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
logger.info("All Users->{}",dao.findAll());
logger.info("user id 1 ->{}",dao.findById(1));
logger.info("deleting 5-> no of Rows deleted-{}", dao.deleteById(5));
logger.info("inserting 10 -> {} ",dao.insert(new Person(10,"kevin","america",new Date())));
logger.info("updating person 6 -> {} " , dao.update(new Person(6,"peter","kerala",new Date())));
}
}
| [
"konapuramsaikiran2@gmail.com"
] | konapuramsaikiran2@gmail.com |
d70bb76bdda3dffd7e6befae2ca735e2f6c90563 | bb9fd322bdd436c8ef7cad09839feb96749933c0 | /src/main/java/com/password4j/SCryptFunction.java | 83b7ced6629929bef7260a45d1daa2e3d4a86b78 | [
"Apache-2.0"
] | permissive | firaja/password4j-1 | fb0dfbb210b095ffd05f4c62ff52a2f0b24d2197 | 09b8f8993a380dcd7cc5e6c0d96d4a3200743d9b | refs/heads/master | 2022-12-15T07:16:56.151856 | 2020-09-09T07:43:53 | 2020-09-09T07:43:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,529 | java | /*
* (C) Copyright 2020 Password4j (http://password4j.com/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.password4j;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.util.Base64;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* Class containing the implementation of SCrypt function and its parameters.
*
* @author David Bertoldi
* @see <a href="https://en.wikipedia.org/wiki/Scrypt">SCrypt</a>
* @since 0.1.0
*/
public class SCryptFunction extends AbstractHashingFunction
{
private int workFactor; // N
private int resources; // r
private int parallelization; // p
private static ConcurrentMap<String, SCryptFunction> instances = new ConcurrentHashMap<>();
@SuppressWarnings("unused")
private SCryptFunction()
{
//
}
/**
* @param workFactor (N)
* @param resources (r)
* @param parallelization (p)
*/
protected SCryptFunction(int workFactor, int resources, int parallelization)
{
this.resources = resources;
this.workFactor = workFactor;
this.parallelization = parallelization;
}
/**
* Reads the configuration contained in the given hash and
* builds a singleton instance based on these configurations.
*
* @param hashed an already hashed password
* @return a singleton instance based on the given hash
* @since 1.0.0
*/
public static SCryptFunction getInstanceFromHash(String hashed)
{
String[] parts = hashed.split("\\$");
if (parts.length == 5)
{
long params = Long.parseLong(parts[2], 16);
int workFactor = (int) Math.pow(2.0D, (double) (params >> 16 & 65535L));
int resources = (int) params >> 8 & 255;
int parallelization = (int) params & 255;
return SCryptFunction.getInstance(workFactor, resources, parallelization);
}
throw new BadParametersException("`" + hashed + "` is not a valid hash");
}
/**
* Creates a singleton instance, depending on the provided
* N, r and p parameters.
*
* @param workFactor work factor (N)
* @param resources resources (r)
* @param parallelization parallelization (p)
* @return a singleton instance
* @since 0.3.0
*/
public static SCryptFunction getInstance(int workFactor, int resources, int parallelization)
{
String key = getUID(resources, workFactor, parallelization);
if (instances.containsKey(key))
{
return instances.get(key);
}
else
{
SCryptFunction function = new SCryptFunction(workFactor, resources, parallelization);
instances.put(key, function);
return function;
}
}
@Override
public Hash hash(CharSequence plainTextPassword)
{
byte[] salt = SaltGenerator.generate();
return hash(plainTextPassword, new String(salt));
}
@Override
public Hash hash(CharSequence plainTextPassword, String salt)
{
try
{
byte[] saltAsBytes = salt.getBytes(StandardCharsets.UTF_8);
byte[] derived = scrypt(Utilities.fromCharSequenceToBytes(plainTextPassword), saltAsBytes, 64);
String params = Long.toString(log2(workFactor) << 16 | resources << 8 | parallelization, 16);
String sb = "$s0$" + params + '$' + Base64.getEncoder().encodeToString(saltAsBytes) + '$' + Base64.getEncoder()
.encodeToString(derived);
return new Hash(this, sb, salt);
}
catch (IllegalArgumentException | GeneralSecurityException e)
{
String message = "Invalid specification with salt=" + salt + ", N=" + workFactor + ", r=" + resources + " and p=" + parallelization;
throw new BadParametersException(message, e);
}
}
@Override
public boolean check(CharSequence plainTexPassword, String hashed)
{
try
{
String[] parts = hashed.split("\\$");
if (parts.length == 5 && parts[1].equals("s0"))
{
byte[] salt = Base64.getDecoder().decode(parts[3]);
byte[] derived0 = Base64.getDecoder().decode(parts[4]);
byte[] derived1 = scrypt(Utilities.fromCharSequenceToBytes(plainTexPassword), salt, 64);
if (derived0.length != derived1.length)
{
return false;
}
else
{
int result = 0;
for (int i = 0; i < derived0.length; ++i)
{
result |= derived0[i] ^ derived1[i];
}
return result == 0;
}
}
else
{
throw new BadParametersException("Invalid hashed value");
}
}
catch (GeneralSecurityException var14)
{
throw new IllegalStateException("JVM doesn't support SHA1PRNG or HMAC_SHA256?");
}
}
/**
* Estimates the required memory to calculate an hash with
* the current configuration.
*
* @return the required memory
* @since 0.1.0
*/
public long getRequiredBytes()
{
return 128L * workFactor * resources * parallelization;
}
public int getWorkFactor()
{
return workFactor;
}
public int getResources()
{
return resources;
}
public int getParallelization()
{
return parallelization;
}
/**
* A more readable version of {@link #getRequiredMemory()},
* changing the unit (B, KB, MB) so that the number has at most
* 2 decimal places.
*
* @return the required memory
* @since 0.3.0
*/
public String getRequiredMemory()
{
long memoryInBytes = getRequiredBytes();
if (memoryInBytes > 1_000_000)
{
return Math.round(memoryInBytes / 10_000f) / 100.0 + "MB";
}
if (memoryInBytes > 1_000)
{
return Math.round(memoryInBytes / 1_000f) / 100.0 + "KB";
}
return memoryInBytes + "B";
}
@Override
public boolean equals(Object obj)
{
if (obj == null || !this.getClass().equals(obj.getClass()))
{
return false;
}
SCryptFunction otherStrategy = (SCryptFunction) obj;
return this.workFactor == otherStrategy.workFactor //
&& this.resources == otherStrategy.resources //
&& this.parallelization == otherStrategy.parallelization;
}
@Override
public String toString()
{
return getClass().getSimpleName() + '[' + getUID(this.resources, this.workFactor, this.parallelization) + ']';
}
@Override
public int hashCode()
{
return Objects.hash(resources, workFactor, parallelization);
}
protected static String getUID(int resources, int workFactor, int parallelization)
{
return workFactor + "|" + resources + "|" + parallelization;
}
/**
* Calculates the logarithm base 2 of a number that is already
* power of two
*
* @param number power of 2 positive number.
* @return the logarithm base 2
* @since 0.1.0
*/
private static int log2(int number)
{
int log = 0;
if ((number & -65536) != 0)
{
number >>>= 16;
log = 16;
}
if (number >= 256)
{
number >>>= 8;
log += 8;
}
if (number >= 16)
{
number >>>= 4;
log += 4;
}
if (number >= 4)
{
number >>>= 2;
log += 2;
}
return log + (number >>> 1);
}
public byte[] scrypt(byte[] passwd, byte[] salt, int dkLen) throws GeneralSecurityException
{
if (workFactor >= 2 && (workFactor & workFactor - 1) == 0)
{
if (workFactor > 16777215 / resources)
{
throw new IllegalArgumentException("Parameter N is too large");
}
else if (resources > 16777215 / parallelization)
{
throw new IllegalArgumentException("Parameter r is too large");
}
else
{
byte[] xyArray = new byte[256 * resources];
byte[] vArray = new byte[128 * resources * workFactor];
byte[] intensiveSalt = PBKDF2Function
.internalHash(new String(passwd).toCharArray(), salt, Hmac.SHA256, 1,
8 * parallelization * 128 * resources).getEncoded();
for (int i = 0; i < parallelization; ++i)
{
sMix(intensiveSalt, i * 128 * resources, vArray, xyArray);
}
return PBKDF2Function
.internalHash(new String(passwd).toCharArray(), intensiveSalt, Hmac.SHA256, 1,
8 * dkLen).getEncoded();
}
}
else
{
throw new IllegalArgumentException("N must be a power of 2 greater than 1. Found " + workFactor);
}
}
public void sMix(byte[] intensiveSalt, int bi, byte[] vArray, byte[] xyArray)
{
int xi = 0;
int yi = 128 * resources;
System.arraycopy(intensiveSalt, bi, xyArray, xi, 128 * resources);
int i;
for (i = 0; i < workFactor; ++i)
{
System.arraycopy(xyArray, xi, vArray, i * 128 * resources, 128 * resources);
blockmixSalsa8(xyArray, xi, yi);
}
for (i = 0; i < workFactor; ++i)
{
int j = integerify(xyArray, xi) & workFactor - 1;
blockXOR(vArray, j * 128 * resources, xyArray, xi, 128 * resources);
blockmixSalsa8(xyArray, xi, yi);
}
System.arraycopy(xyArray, xi, intensiveSalt, bi, 128 * resources);
}
public void blockmixSalsa8(byte[] xyArray, int bi, int yi)
{
byte[] xArray = new byte[64];
System.arraycopy(xyArray, bi + (2 * resources - 1) * 64, xArray, 0, 64);
int i;
for (i = 0; i < 2 * resources; ++i)
{
blockXOR(xyArray, i * 64, xArray, 0, 64);
salsa208(xArray);
System.arraycopy(xArray, 0, xyArray, yi + i * 64, 64);
}
for (i = 0; i < resources; ++i)
{
System.arraycopy(xyArray, yi + i * 2 * 64, xyArray, bi + i * 64, 64);
}
for (i = 0; i < resources; ++i)
{
System.arraycopy(xyArray, yi + (i * 2 + 1) * 64, xyArray, bi + (i + resources) * 64, 64);
}
}
public static int rOperation(int a, int b)
{
return a << b | a >>> 32 - b;
}
public static void salsa208(byte[] xArray)
{
int[] b32 = new int[16];
int[] x = new int[16];
int i;
for (i = 0; i < 16; ++i)
{
b32[i] = (xArray[i * 4] & 255);
b32[i] |= (xArray[i * 4 + 1] & 255) << 8;
b32[i] |= (xArray[i * 4 + 2] & 255) << 16;
b32[i] |= (xArray[i * 4 + 3] & 255) << 24;
}
System.arraycopy(b32, 0, x, 0, 16);
for (i = 8; i > 0; i -= 2)
{
x[4] ^= rOperation(x[0] + x[12], 7);
x[8] ^= rOperation(x[4] + x[0], 9);
x[12] ^= rOperation(x[8] + x[4], 13);
x[0] ^= rOperation(x[12] + x[8], 18);
x[9] ^= rOperation(x[5] + x[1], 7);
x[13] ^= rOperation(x[9] + x[5], 9);
x[1] ^= rOperation(x[13] + x[9], 13);
x[5] ^= rOperation(x[1] + x[13], 18);
x[14] ^= rOperation(x[10] + x[6], 7);
x[2] ^= rOperation(x[14] + x[10], 9);
x[6] ^= rOperation(x[2] + x[14], 13);
x[10] ^= rOperation(x[6] + x[2], 18);
x[3] ^= rOperation(x[15] + x[11], 7);
x[7] ^= rOperation(x[3] + x[15], 9);
x[11] ^= rOperation(x[7] + x[3], 13);
x[15] ^= rOperation(x[11] + x[7], 18);
x[1] ^= rOperation(x[0] + x[3], 7);
x[2] ^= rOperation(x[1] + x[0], 9);
x[3] ^= rOperation(x[2] + x[1], 13);
x[0] ^= rOperation(x[3] + x[2], 18);
x[6] ^= rOperation(x[5] + x[4], 7);
x[7] ^= rOperation(x[6] + x[5], 9);
x[4] ^= rOperation(x[7] + x[6], 13);
x[5] ^= rOperation(x[4] + x[7], 18);
x[11] ^= rOperation(x[10] + x[9], 7);
x[8] ^= rOperation(x[11] + x[10], 9);
x[9] ^= rOperation(x[8] + x[11], 13);
x[10] ^= rOperation(x[9] + x[8], 18);
x[12] ^= rOperation(x[15] + x[14], 7);
x[13] ^= rOperation(x[12] + x[15], 9);
x[14] ^= rOperation(x[13] + x[12], 13);
x[15] ^= rOperation(x[14] + x[13], 18);
}
for (i = 0; i < 16; ++i)
{
b32[i] += x[i];
}
for (i = 0; i < 16; ++i)
{
xArray[i * 4] = (byte) (b32[i] & 255);
xArray[i * 4 + 1] = (byte) (b32[i] >> 8 & 255);
xArray[i * 4 + 2] = (byte) (b32[i] >> 16 & 255);
xArray[i * 4 + 3] = (byte) (b32[i] >> 24 & 255);
}
}
public static void blockXOR(byte[] sArray, int si, byte[] dArray, int di, int length)
{
for (int i = 0; i < length; ++i)
{
dArray[di + i] ^= sArray[si + i];
}
}
public int integerify(byte[] xyArray, int xi)
{
xi += (2 * resources - 1) * 64;
int n = (xyArray[xi] & 255);
n |= (xyArray[xi + 1] & 255) << 8;
n |= (xyArray[xi + 2] & 255) << 16;
n |= (xyArray[xi + 3] & 255) << 24;
return n;
}
}
| [
"david.bert@ymail.com"
] | david.bert@ymail.com |
1e453ec8ab3733febda5ce57bbf3e7a8b7eb1e1f | 44153f5b4ed2d4ae91666449ae7d27303e837e00 | /src/main/java/com/bloodbank/model/UserModel.java | 201728a8edac1fe1ba23004eea70d7c4be86df49 | [] | no_license | jamtorres03/BloodBank | d40a62b7c60e34a6d0031b9c9f403012c5fd088b | 6e855aeba98f316ea303bb6f53bc38014b79e10d | refs/heads/master | 2021-04-30T06:55:28.504290 | 2018-03-23T16:35:54 | 2018-03-23T16:35:54 | 121,458,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,138 | java | package com.bloodbank.model;
public class UserModel {
private int id;
private String email;
private String password;
private String confirmPassword;
private String name;
private String contactNo;
private String age;
private String gender;
private String bloodType;
private String location;
private double longitude;
private double latitude;
private int active;
private int available;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getConfirmPassword() {
return confirmPassword;
}
public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContactNo() {
return contactNo;
}
public void setContactNo(String contactNo) {
this.contactNo = contactNo;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getBloodType() {
return bloodType;
}
public void setBloodType(String bloodType) {
this.bloodType = bloodType;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public int getActive() {
return active;
}
public void setActive(int active) {
this.active = active;
}
public int getAvailable() {
return available;
}
public void setAvailable(int available) {
this.available = available;
}
}
| [
"user@192.168.1.12"
] | user@192.168.1.12 |
4996c10834ca420192b368e172c13af5d2c5e97e | 180ed626033ca65f1673d4cbf908bc39b19ebb3a | /duome-locus(่ฝจ่ฟน็ไปฃ็ )/src/com/duome/locus/MainActivity.java | fbe19936005cddd7b4a8238ad5b2309c73a0a012 | [] | no_license | cheneyszp/TEST | b0727a9de8026d77ef0e5b0aa302793a52d128d2 | b4eb3a9617889f5c6d52b35e1a63f87795854acb | refs/heads/master | 2021-01-01T16:55:43.391477 | 2013-05-17T02:24:27 | 2013-05-17T02:24:27 | null | 0 | 0 | null | null | null | null | IBM852 | Java | false | false | 801 | java | package com.duome.locus;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
View v = (View) this.findViewById(R.id.tvReset);
v.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Intent intent = new Intent(MainActivity.this, SetPasswordActivity.class);
// โคหโยฌฤโฌรโActivity
startActivity(intent);
}
});
}
@Override
protected void onStart()
{
super.onStart();
}
@Override
protected void onStop()
{
super.onStop();
}
}
| [
"shezepeng@gmail.com"
] | shezepeng@gmail.com |
2686b0014efc92777be1f9bdebea3f2e2429e764 | e770778e830e9a34b926c5a4df94b011a7e039b1 | /ZDIM/src/zhwx/ui/dcapp/assets/model/AllAssets.java | 3e37d91dc815dce74c9e456f5a4938a3f6448002 | [] | no_license | lixinxiyou01/zdhx-im-yunxin-run | bc5290458dd0e8a4d37339da7ddb07a6d10ad317 | 3ad40223c15dac575e860136e24be690387405ad | refs/heads/master | 2021-01-12T06:51:59.284750 | 2017-10-10T08:25:40 | 2017-10-10T08:25:40 | 83,505,395 | 3 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,298 | java | package zhwx.ui.dcapp.assets.model;
/**
* @Title: AllAssets.java
* @Package zhwx.ui.dcapp.assets.model
* @Description: TODO(็จไธๅฅ่ฏๆ่ฟฐ่ฏฅๆไปถๅไปไน)
* @author Li.xin @ zdhx
* @date 2016ๅนด8ๆ22ๆฅ ไธๅ5:11:34
*/
public class AllAssets {
/**
* status : 1
* department : ไธญ็ตๅฐๅญฆ
* statusView : ๆญฃๅธธ
* unitPrice : null
* purchaseFactory :
* code : bgz-bgz1-001
* contact :
* brandName :
* warrantyPeriod : null
* assetKindName : ๅๅ
ฌๆก1
* id : 20160818181628098149178478152827
* registrationDate : 2016-08-18
* increaseWay :
* originalPrice : null
* stockNumber : 1
* purchaseDate :
* name : ๅๅ
ฌๆกๅ่
ฟ
* patternName :
*/
private String status;
private String department;
private String statusView;
private Object unitPrice;
private String purchaseFactory;
private String code;
private String contact;
private String brandName;
private Object warrantyPeriod;
private String assetKindName;
private String id;
private String registrationDate;
private String increaseWay;
private Object originalPrice;
private String stockNumber;
private String purchaseDate;
private String name;
private String patternName;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getStatusView() {
return statusView;
}
public void setStatusView(String statusView) {
this.statusView = statusView;
}
public Object getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Object unitPrice) {
this.unitPrice = unitPrice;
}
public String getPurchaseFactory() {
return purchaseFactory;
}
public void setPurchaseFactory(String purchaseFactory) {
this.purchaseFactory = purchaseFactory;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName;
}
public Object getWarrantyPeriod() {
return warrantyPeriod;
}
public void setWarrantyPeriod(Object warrantyPeriod) {
this.warrantyPeriod = warrantyPeriod;
}
public String getAssetKindName() {
return assetKindName;
}
public void setAssetKindName(String assetKindName) {
this.assetKindName = assetKindName;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getRegistrationDate() {
return registrationDate;
}
public void setRegistrationDate(String registrationDate) {
this.registrationDate = registrationDate;
}
public String getIncreaseWay() {
return increaseWay;
}
public void setIncreaseWay(String increaseWay) {
this.increaseWay = increaseWay;
}
public Object getOriginalPrice() {
return originalPrice;
}
public void setOriginalPrice(Object originalPrice) {
this.originalPrice = originalPrice;
}
public String getStockNumber() {
return stockNumber;
}
public void setStockNumber(String stockNumber) {
this.stockNumber = stockNumber;
}
public String getPurchaseDate() {
return purchaseDate;
}
public void setPurchaseDate(String purchaseDate) {
this.purchaseDate = purchaseDate;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPatternName() {
return patternName;
}
public void setPatternName(String patternName) {
this.patternName = patternName;
}
}
| [
"lixin890403@163.com"
] | lixin890403@163.com |
31fa3f2349de8254f9894b216458692b947718d9 | 36690e6cff9cebf63b7965444332c885db73c7f6 | /huobi-server/src/main/java/com/kelebujiabing/huobiserver/huobiApi/domain/Order.java | 10c00c725d5bb47162bb0fc776ffa01bcaaa6b8f | [] | no_license | CokeWithoutIce/eureka-server | 8f8d0c1ec77b9e170ade152e2014a650a99ab180 | afad3d85c33021723769dcd159e33d36c1b81c26 | refs/heads/master | 2022-07-03T07:23:36.523840 | 2020-01-31T08:36:53 | 2020-01-31T08:36:53 | 237,392,757 | 1 | 0 | null | 2020-10-13T19:11:20 | 2020-01-31T08:53:43 | Java | UTF-8 | Java | false | false | 1,610 | java | package com.kelebujiabing.huobiserver.huobiApi.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.kelebujiabing.huobiserver.huobiApi.domain.enums.OrderSource;
import com.kelebujiabing.huobiserver.huobiApi.domain.enums.OrderState;
import com.kelebujiabing.huobiserver.huobiApi.domain.enums.OrderType;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
* created by jacky. 2018/7/21 3:20 PM
*/
@Getter
@Setter
public class Order {
private String id;
private String symbol;
@JsonProperty(value = "account-id")
private String accountId;
private BigDecimal amount;
private BigDecimal price;
@JsonProperty(value = "created-at")
private Long createdAt;
private OrderType type;
//region deprecate
@JsonProperty(value = "field-amount")
private BigDecimal fieldAmount;
@JsonProperty(value = "field-cash-amount")
private BigDecimal fieldCashAmount;
@JsonProperty(value = "field-fees")
private BigDecimal fieldFees;
//endregion
@JsonProperty(value = "filled-amount")
private BigDecimal filledAmount;
@JsonProperty(value = "filled-cash-amount")
private BigDecimal filledCashAmount;
@JsonProperty(value = "filled-fees")
private BigDecimal filledFees;
@JsonProperty(value = "finished-at")
private String finishedAt;
@JsonProperty(value = "user-id")
private String userId;
private OrderSource source;
private OrderState state;
@JsonProperty(value = "canceled-at")
private Long canceledAt;
private String exchange;
private String batch;
}
| [
"751283732@qq.com"
] | 751283732@qq.com |
e074a344ec2f94cca37816f0e2c733eefe25083a | 2389c2d6bce3a9315c4b61ed9cef44f1654318f0 | /exercise34/src/main/java/Solution34.java | 5448afa8fbf6069c2b0aca2ee81c8128daeac6b3 | [] | no_license | Scootifer/Schimpf-a03 | 387a93529a0c878bdf1390d14f8dfaddc0dca924 | 8b677cc143ca8dc2f64e3acd0656783cf6199bb2 | refs/heads/main | 2023-08-16T11:05:20.052416 | 2021-10-04T00:14:41 | 2021-10-04T00:14:41 | 412,587,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 619 | java | /*
* UCF COP3330 Fall 2021 Assignment 3 Solutions
* Copyright 2021 Scott Schimpf
*/
import java.util.Scanner;
//This program will use a class EmployeeHandler to handle the arraylist and related functions
public class Solution34 {
public static void main(String[] args) {
final EmployeeManager manager = new EmployeeManager();
final Scanner scan = new Scanner(System.in);
manager.printList();
System.out.print("Please enter an employee to remove: ");
String person = scan.nextLine();
manager.removeEmployee(person);
manager.printList();
}
}
| [
"Windmill3341!"
] | Windmill3341! |
0cd5ee5a5b3a28673a2e53b6472dbc36c3a2706d | 0a2168b58673b384f2ac9ce6309e3e0d0b6d3339 | /app/src/main/java/com/example/papaya/DiaryPassDBHelper.java | d9921fdb26573f7490b267735f6cda4b04b83430 | [] | no_license | morriee/Papaya3 | 95b0a7f94b7cc0401c51cf6d06a21dbff5edbf44 | 057a08289c13cf7e97133f2b383226a3afccabc1 | refs/heads/master | 2020-10-01T13:41:08.910963 | 2019-12-12T08:43:50 | 2019-12-12T08:43:50 | 227,549,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 692 | java | package com.example.papaya;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DiaryPassDBHelper extends SQLiteOpenHelper {
public DiaryPassDBHelper(Context context) {
super(context, "Password", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql = "CREATE TABLE passwd (" +
"'pass' TEXT);";
db.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
String sql = "drop table if exists passwd";
db.execSQL(sql);
onCreate(db);
}
}
| [
"fille1803@gmail.com"
] | fille1803@gmail.com |
7a6e5d1cd77f435953886b000bdcaa6e121dd41f | 098002b3b78e724d90cef12905b6d5e2ea467d9f | /sources/com/google/android/gms/measurement/internal/zzjz.java | 201db3e271a207d1820250d09468862c43154874 | [] | no_license | chaitanyks/android | 0a5456f4fcb84b7cd9ae22d5e15b1f12e714be82 | d3f98fc1208ddf0534bfa22cb81445b0be15ea72 | refs/heads/main | 2023-03-01T03:43:05.554071 | 2021-02-09T07:00:54 | 2021-02-09T07:00:54 | 337,319,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package com.google.android.gms.measurement.internal;
/* access modifiers changed from: package-private */
/* compiled from: com.google.android.gms:play-services-measurement-impl@@17.2.2 */
public final class zzjz implements Runnable {
long zza;
final /* synthetic */ zzjy zzb;
zzjz(zzjy zzjy, long j) {
this.zzb = zzjy;
this.zza = j;
}
public final void run() {
this.zzb.zza.zzq().zza(new zzkc(this));
}
}
| [
"defcdr@gmail.com"
] | defcdr@gmail.com |
75b12f5467739ac5a5ac27635eb27180570804bc | 92b27bab408c3657d0a40c57422a4187ee0232aa | /src/main/com/chris/lambda/LambdaInCollection.java | dac1e5f476d7045c3aaacc969c7688d84459ff52 | [] | no_license | ChrisLi716/javademo | f4fd8bfbffa6db0025d886a150a9c0c308251889 | 1f21ff453f040ff22005a96ac56809232c3dd72f | refs/heads/master | 2023-06-25T09:56:39.094701 | 2022-12-07T15:15:21 | 2022-12-07T15:15:21 | 150,054,575 | 0 | 0 | null | 2023-06-14T22:23:03 | 2018-09-24T04:34:34 | Java | UTF-8 | Java | false | false | 676 | java | package com.chris.lambda;
import java.util.Arrays;
public class LambdaInCollection {
public static void main(String[] args) {
lambdaForList();
}
private static void lambdaForList() {
Arrays.asList("1", "2", "3").forEach(System.out::println);
Arrays.asList("a", "b", "d").forEach(e -> {
String newstr = e + Math.random();
System.out.println(newstr);
});
String[] datas = new String[]{"pen", "zhao", "li"};
Arrays.sort(datas, (v1, v2) -> {
return Integer.compare(v1.length(), v2.length());
});
Arrays.asList(datas).forEach(e -> System.out.println(e));
}
}
| [
"lilunlogic@163.com"
] | lilunlogic@163.com |
eff5b9511b6bd1f8091a345a645dd1d8cd40a895 | 68954f0edfbfa4e3080b92a0b6f9945b3d3403ef | /sd-distributed-horses-2/Projeto/Logger/src/main/java/Communication/MessageType.java | 393a8ef70e01ac16398b772358e2427f4bec7e5c | [] | no_license | diogodanielsoaresferreira/RMI-basedDistributedSystem | 3aad0ec6b01a724372e9059326a688e72e55b8ab | 77fcfbb6fde67bf79eb65b6c78ca3547f52acd7e | refs/heads/master | 2020-03-28T09:40:58.918835 | 2018-09-09T18:09:21 | 2018-09-09T18:09:21 | 148,051,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,249 | java |
package Communication;
/**
* Defines the message types used on the messaging system.
* @author Diogo Ferreira
* @author Luรญs Leira
*/
public enum MessageType {
/**
* When a shared region answers with an OK to a request made by an entity.
*/
STATUS_OK,
/**
* Calculate the distance of a new track.
*/
CALCULATE_TRACK_DISTANCE,
/**
* Signal the racing track to start the race.
*/
RACING_TRACK_START_RACE,
/**
* Signal the end of the current race.
*/
END_RACE,
/**
* Signal the racing track that the results will be reported.
*/
RACING_TRACK_REPORT_RESULTS,
/**
* Clear the race positions of last race.
*/
CLEAR_RACE_POSITIONS,
/**
* Set the number of a new race.
*/
SET_RACE_NUMBER,
/**
* Signal the stable to summon all horses to paddock.
*/
STABLE_SUMMON_HORSES_TO_PADDOCK,
/**
* Signal the control center to summon all horses to padock.
*/
CONTROL_CENTER_SUMMON_HORSES_TO_PADDOCK,
/**
*Broker is ready to accept the bets.
*/
ACCEPT_THE_BETS,
/**
* Signal the control center to start the race.
*/
CONTROL_CENTER_START_RACE,
/**
* Signal the control center that the results of the race will be reported.
*/
CONTROL_CENTER_REPORT_RESULTS,
/**
* Broker will entertain the guests.
*/
ENTERTAIN_THE_GUESTS,
/**
* Signal to end all races.
*/
END_RACES,
/**
* Signal control center to end all races.
*/
CONTROL_CENTER_END_RACES,
/**
* Spectator is waiting for the next race.
*/
WAIT_FOR_NEXT_RACE,
/**
* Spectator on the control center will check horses.
*/
CONTROL_CENTER_CHECK_HORSES,
/**
* Spectator will check the horses to the paddock.
*/
PADDOCK_CHECK_HORSES,
/**
* Spectator is going to watch the race.
*/
CONTROL_CENTER_GO_WATCH_THE_RACE,
/**
* Spectator has arrived to watch the race.
*/
RACING_TRACK_GO_WATCH_THE_RACE,
/**
* Spectator has left the race.
*/
SPECTATOR_END_RACE,
/**
* Spectator relaxes at the end of all races.
*/
RELAX_A_BIT,
/**
* Horse proceeds to stable.
*/
PROCEED_TO_STABLE,
/**
* Horse is added to the race.
*/
ADD_HORSE_TO_RACE,
/**
* Signal control center that horse proceeds to paddock.
*/
CONTROL_CENTER_PROCEED_TO_PADDOCK,
/**
* Horse proceeds to paddock.
*/
PADDOCK_PROCEED_TO_PADDOCK,
/**
* Horse is out of paddock.
*/
HORSE_OUT_OF_PADDOCK,
/**
* Horse is out of stable.
*/
HORSE_OUT_OF_STABLE,
/**
* Horse goes out of paddock and proceeds to start line.
*/
PADDOCK_PROCEED_TO_START_LINE,
/**
* Horse arrives at the racing track and proceeds to the start line.
*/
RACING_TRACK_PROCEED_TO_START_LINE,
/**
* Horse is not on the start line anymore.
*/
HORSE_OUT_OF_START_LINE,
/**
* Horse is at the finish line.
*/
AT_THE_FINISH_LINE,
/**
* Get the winners from a race.
*/
GET_THE_WINNERS,
/**
* Get the list of bets fro all spectators.
*/
GET_SPECTATOR_BET_LIST,
/**
* Return the list of all the horse winners.
*/
RETURN_WINNERS,
/**
* Return the list of all the bets done by the spectators.
*/
RETURN_SPECTATOR_BET_LIST,
/**
* Ask if there are any winners.
*/
ARE_ANY_WINNERS,
/**
* Answer to if there are any winners.
*/
RETURN_ARE_ANY_WINNERS,
/**
* Broker honours the spectators bets.
*/
HONOUR_THE_BETS,
/**
* Ask if the finish line has been crossed by a horse.
*/
HAS_FINISHED_LINE_BEEN_CROSSED,
/**
* Answers if the finish line has been crossed by a horse.
*/
RETURN_HAS_FINISHED_LINE_BEEN_CROSSED,
/**
* Horse makes a move.
*/
MAKE_A_MOVE,
/**
* Answers if there is a next race.
*/
RETURN_WAIT_FOR_NEXT_RACE,
/**
* Ask for all horses in the race.
*/
GET_HORSES_IN_RACE,
/**
* Return a list of all horses in the race.
*/
RETURN_HORSES_IN_RACE,
/**
* Place a bet on a horse.
*/
PLACE_A_BET,
/**
* Collect the gains obtained by the bets in a race.
*/
COLLECT_THE_GAINS,
/**
* Ask if i have won any bet.
*/
HAVE_I_WON,
/**
* Answers to have i won any bet.
*/
RETURN_HAVE_I_WON,
/**
* Returns the new distance and iterations made on a move.
*/
RETURN_MAKE_A_MOVE,
/**
* Returns a bet made by a spectator.
*/
RETURN_PLACE_A_BET,
/**
* Returns the gains made by a spectator with a bet.
*/
RETURN_COLLECT_THE_GAINS,
/**
* Notify logger to update track.
*/
UPDATE_TRACK,
/**
* Notify logger to clean the race variables.
*/
CLEAN_RACE_VARIABLES,
/**
* Notify logger to update the broker state.
*/
UPDATE_BROKER_STATE,
/**
* Notify logger to update the spectator state.
*/
UPDATE_SPECTATOR_STATE,
/**
* Notify logger to update the horse state.
*/
UPDATE_HORSE_STATE,
/**
* Notify logger to update the horses in race.
*/
UPDATE_HORSE_IN_RACE,
/**
* Notify logger to update the bets from the spectators.
*/
UPDATE_SPECTATOR_BET,
/**
* Notify logger to update the money from the spectators.
*/
UPDATE_SPECTATOR_MONEY,
/**
* Notify logger to report the results from a race.
*/
REPORT_RESULTS,
/**
* Horse notifies control center that he has ended his race day.
*/
END_HORSE_RACE,
/**
* Control center notifies shared regions that his service has ended.
*/
SERVICE_END
}
| [
"diogodanielsoaresferreira@ua.pt"
] | diogodanielsoaresferreira@ua.pt |
18c3e19f86262686a758f2fc71d04cfc9abef97e | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java | 31906ed6d29d370385e1ab93082070c402cb5bd6 | [] | no_license | aidyk/TagoApp | ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5 | e31a528c8f931df42075fc8694754be146eddc34 | refs/heads/master | 2022-12-22T02:20:58.486140 | 2021-05-16T07:42:02 | 2021-05-16T07:42:02 | 325,695,453 | 3 | 1 | null | 2022-12-16T00:32:10 | 2020-12-31T02:34:45 | Smali | UTF-8 | Java | false | false | 34,074 | java | package com.google.android.exoplayer2.trackselection;
import android.content.Context;
import android.graphics.Point;
import android.text.TextUtils;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.RendererCapabilities;
import com.google.android.exoplayer2.source.TrackGroup;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import com.google.android.exoplayer2.upstream.BandwidthMeter;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
public class DefaultTrackSelector extends MappingTrackSelector {
private static final float FRACTION_TO_CONSIDER_FULLSCREEN = 0.98f;
private static final int[] NO_TRACKS = new int[0];
private static final int WITHIN_RENDERER_CAPABILITIES_BONUS = 1000;
private final TrackSelection.Factory adaptiveTrackSelectionFactory;
private final AtomicReference<Parameters> paramsReference;
private static int compareFormatValues(int i, int i2) {
if (i == -1) {
return i2 == -1 ? 0 : -1;
}
if (i2 == -1) {
return 1;
}
return i - i2;
}
protected static boolean isSupported(int i, boolean z) {
int i2 = i & 7;
return i2 == 4 || (z && i2 == 3);
}
public static final class Parameters {
public final boolean allowMixedMimeAdaptiveness;
public final boolean allowNonSeamlessAdaptiveness;
public final boolean exceedRendererCapabilitiesIfNecessary;
public final boolean exceedVideoConstraintsIfNecessary;
public final int maxVideoBitrate;
public final int maxVideoHeight;
public final int maxVideoWidth;
public final String preferredAudioLanguage;
public final String preferredTextLanguage;
public final int viewportHeight;
public final boolean viewportOrientationMayChange;
public final int viewportWidth;
public Parameters() {
this(null, null, false, true, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, Integer.MAX_VALUE, Integer.MAX_VALUE, true);
}
public Parameters(String str, String str2, boolean z, boolean z2, int i, int i2, int i3, boolean z3, boolean z4, int i4, int i5, boolean z5) {
this.preferredAudioLanguage = str;
this.preferredTextLanguage = str2;
this.allowMixedMimeAdaptiveness = z;
this.allowNonSeamlessAdaptiveness = z2;
this.maxVideoWidth = i;
this.maxVideoHeight = i2;
this.maxVideoBitrate = i3;
this.exceedVideoConstraintsIfNecessary = z3;
this.exceedRendererCapabilitiesIfNecessary = z4;
this.viewportWidth = i4;
this.viewportHeight = i5;
this.viewportOrientationMayChange = z5;
}
public Parameters withPreferredAudioLanguage(String str) {
String normalizeLanguageCode = Util.normalizeLanguageCode(str);
if (TextUtils.equals(normalizeLanguageCode, this.preferredAudioLanguage)) {
return this;
}
return new Parameters(normalizeLanguageCode, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withPreferredTextLanguage(String str) {
String normalizeLanguageCode = Util.normalizeLanguageCode(str);
if (TextUtils.equals(normalizeLanguageCode, this.preferredTextLanguage)) {
return this;
}
return new Parameters(this.preferredAudioLanguage, normalizeLanguageCode, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withAllowMixedMimeAdaptiveness(boolean z) {
if (z == this.allowMixedMimeAdaptiveness) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, z, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withAllowNonSeamlessAdaptiveness(boolean z) {
if (z == this.allowNonSeamlessAdaptiveness) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, z, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withMaxVideoSize(int i, int i2) {
if (i == this.maxVideoWidth) {
if (i2 == this.maxVideoHeight) {
return this;
}
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, i, i2, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withMaxVideoBitrate(int i) {
if (i == this.maxVideoBitrate) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, i, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withMaxVideoSizeSd() {
return withMaxVideoSize(1279, 719);
}
public Parameters withoutVideoSizeConstraints() {
return withMaxVideoSize(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
public Parameters withExceedVideoConstraintsIfNecessary(boolean z) {
if (z == this.exceedVideoConstraintsIfNecessary) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, z, this.exceedRendererCapabilitiesIfNecessary, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withExceedRendererCapabilitiesIfNecessary(boolean z) {
if (z == this.exceedRendererCapabilitiesIfNecessary) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, z, this.viewportWidth, this.viewportHeight, this.viewportOrientationMayChange);
}
public Parameters withViewportSize(int i, int i2, boolean z) {
if (i == this.viewportWidth) {
if (i2 == this.viewportHeight) {
if (z == this.viewportOrientationMayChange) {
return this;
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, i, i2, z);
}
}
return new Parameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.allowMixedMimeAdaptiveness, this.allowNonSeamlessAdaptiveness, this.maxVideoWidth, this.maxVideoHeight, this.maxVideoBitrate, this.exceedVideoConstraintsIfNecessary, this.exceedRendererCapabilitiesIfNecessary, i, i2, z);
}
public Parameters withViewportSizeFromContext(Context context, boolean z) {
Point physicalDisplaySize = Util.getPhysicalDisplaySize(context);
return withViewportSize(physicalDisplaySize.x, physicalDisplaySize.y, z);
}
public Parameters withoutViewportSizeConstraints() {
return withViewportSize(Integer.MAX_VALUE, Integer.MAX_VALUE, true);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Parameters parameters = (Parameters) obj;
if (this.allowMixedMimeAdaptiveness == parameters.allowMixedMimeAdaptiveness && this.allowNonSeamlessAdaptiveness == parameters.allowNonSeamlessAdaptiveness && this.maxVideoWidth == parameters.maxVideoWidth && this.maxVideoHeight == parameters.maxVideoHeight && this.exceedVideoConstraintsIfNecessary == parameters.exceedVideoConstraintsIfNecessary && this.exceedRendererCapabilitiesIfNecessary == parameters.exceedRendererCapabilitiesIfNecessary && this.viewportOrientationMayChange == parameters.viewportOrientationMayChange && this.viewportWidth == parameters.viewportWidth && this.viewportHeight == parameters.viewportHeight && this.maxVideoBitrate == parameters.maxVideoBitrate && TextUtils.equals(this.preferredAudioLanguage, parameters.preferredAudioLanguage) && TextUtils.equals(this.preferredTextLanguage, parameters.preferredTextLanguage)) {
return true;
}
return false;
}
public int hashCode() {
return (((((((((((((((((((((this.preferredAudioLanguage.hashCode() * 31) + this.preferredTextLanguage.hashCode()) * 31) + (this.allowMixedMimeAdaptiveness ? 1 : 0)) * 31) + (this.allowNonSeamlessAdaptiveness ? 1 : 0)) * 31) + this.maxVideoWidth) * 31) + this.maxVideoHeight) * 31) + this.maxVideoBitrate) * 31) + (this.exceedVideoConstraintsIfNecessary ? 1 : 0)) * 31) + (this.exceedRendererCapabilitiesIfNecessary ? 1 : 0)) * 31) + (this.viewportOrientationMayChange ? 1 : 0)) * 31) + this.viewportWidth) * 31) + this.viewportHeight;
}
}
public DefaultTrackSelector() {
this((TrackSelection.Factory) null);
}
public DefaultTrackSelector(BandwidthMeter bandwidthMeter) {
this(new AdaptiveTrackSelection.Factory(bandwidthMeter));
}
public DefaultTrackSelector(TrackSelection.Factory factory) {
this.adaptiveTrackSelectionFactory = factory;
this.paramsReference = new AtomicReference<>(new Parameters());
}
public void setParameters(Parameters parameters) {
Assertions.checkNotNull(parameters);
if (!this.paramsReference.getAndSet(parameters).equals(parameters)) {
invalidate();
}
}
public Parameters getParameters() {
return this.paramsReference.get();
}
/* access modifiers changed from: protected */
@Override // com.google.android.exoplayer2.trackselection.MappingTrackSelector
public TrackSelection[] selectTracks(RendererCapabilities[] rendererCapabilitiesArr, TrackGroupArray[] trackGroupArrayArr, int[][][] iArr) throws ExoPlaybackException {
int length = rendererCapabilitiesArr.length;
TrackSelection[] trackSelectionArr = new TrackSelection[length];
Parameters parameters = this.paramsReference.get();
boolean z = false;
int i = 0;
boolean z2 = false;
while (true) {
boolean z3 = true;
if (i >= length) {
break;
}
if (2 == rendererCapabilitiesArr[i].getTrackType()) {
if (!z) {
trackSelectionArr[i] = selectVideoTrack(rendererCapabilitiesArr[i], trackGroupArrayArr[i], iArr[i], parameters, this.adaptiveTrackSelectionFactory);
z = trackSelectionArr[i] != null;
}
if (trackGroupArrayArr[i].length <= 0) {
z3 = false;
}
z2 |= z3;
}
i++;
}
boolean z4 = false;
boolean z5 = false;
for (int i2 = 0; i2 < length; i2++) {
switch (rendererCapabilitiesArr[i2].getTrackType()) {
case 1:
if (!z4) {
trackSelectionArr[i2] = selectAudioTrack(trackGroupArrayArr[i2], iArr[i2], parameters, z2 ? null : this.adaptiveTrackSelectionFactory);
if (trackSelectionArr[i2] != null) {
z4 = true;
break;
} else {
z4 = false;
break;
}
} else {
break;
}
case 2:
break;
case 3:
if (!z5) {
trackSelectionArr[i2] = selectTextTrack(trackGroupArrayArr[i2], iArr[i2], parameters);
if (trackSelectionArr[i2] != null) {
z5 = true;
break;
} else {
z5 = false;
break;
}
} else {
break;
}
default:
trackSelectionArr[i2] = selectOtherTrack(rendererCapabilitiesArr[i2].getTrackType(), trackGroupArrayArr[i2], iArr[i2], parameters);
break;
}
}
return trackSelectionArr;
}
/* access modifiers changed from: protected */
public TrackSelection selectVideoTrack(RendererCapabilities rendererCapabilities, TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters, TrackSelection.Factory factory) throws ExoPlaybackException {
TrackSelection selectAdaptiveVideoTrack = factory != null ? selectAdaptiveVideoTrack(rendererCapabilities, trackGroupArray, iArr, parameters, factory) : null;
return selectAdaptiveVideoTrack == null ? selectFixedVideoTrack(trackGroupArray, iArr, parameters) : selectAdaptiveVideoTrack;
}
private static TrackSelection selectAdaptiveVideoTrack(RendererCapabilities rendererCapabilities, TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters, TrackSelection.Factory factory) throws ExoPlaybackException {
int i = parameters.allowNonSeamlessAdaptiveness ? 24 : 16;
boolean z = parameters.allowMixedMimeAdaptiveness && (rendererCapabilities.supportsMixedMimeTypeAdaptation() & i) != 0;
for (int i2 = 0; i2 < trackGroupArray.length; i2++) {
TrackGroup trackGroup = trackGroupArray.get(i2);
int[] adaptiveVideoTracksForGroup = getAdaptiveVideoTracksForGroup(trackGroup, iArr[i2], z, i, parameters.maxVideoWidth, parameters.maxVideoHeight, parameters.maxVideoBitrate, parameters.viewportWidth, parameters.viewportHeight, parameters.viewportOrientationMayChange);
if (adaptiveVideoTracksForGroup.length > 0) {
return factory.createTrackSelection(trackGroup, adaptiveVideoTracksForGroup);
}
}
return null;
}
private static int[] getAdaptiveVideoTracksForGroup(TrackGroup trackGroup, int[] iArr, boolean z, int i, int i2, int i3, int i4, int i5, int i6, boolean z2) {
String str;
int adaptiveVideoTrackCountForMimeType;
if (trackGroup.length < 2) {
return NO_TRACKS;
}
List<Integer> viewportFilteredTrackIndices = getViewportFilteredTrackIndices(trackGroup, i5, i6, z2);
if (viewportFilteredTrackIndices.size() < 2) {
return NO_TRACKS;
}
if (!z) {
HashSet hashSet = new HashSet();
String str2 = null;
int i7 = 0;
for (int i8 = 0; i8 < viewportFilteredTrackIndices.size(); i8++) {
String str3 = trackGroup.getFormat(viewportFilteredTrackIndices.get(i8).intValue()).sampleMimeType;
if (hashSet.add(str3) && (adaptiveVideoTrackCountForMimeType = getAdaptiveVideoTrackCountForMimeType(trackGroup, iArr, i, str3, i2, i3, i4, viewportFilteredTrackIndices)) > i7) {
i7 = adaptiveVideoTrackCountForMimeType;
str2 = str3;
}
}
str = str2;
} else {
str = null;
}
filterAdaptiveVideoTrackCountForMimeType(trackGroup, iArr, i, str, i2, i3, i4, viewportFilteredTrackIndices);
return viewportFilteredTrackIndices.size() < 2 ? NO_TRACKS : Util.toArray(viewportFilteredTrackIndices);
}
private static int getAdaptiveVideoTrackCountForMimeType(TrackGroup trackGroup, int[] iArr, int i, String str, int i2, int i3, int i4, List<Integer> list) {
int i5 = 0;
for (int i6 = 0; i6 < list.size(); i6++) {
int intValue = list.get(i6).intValue();
if (isSupportedAdaptiveVideoTrack(trackGroup.getFormat(intValue), str, iArr[intValue], i, i2, i3, i4)) {
i5++;
}
}
return i5;
}
private static void filterAdaptiveVideoTrackCountForMimeType(TrackGroup trackGroup, int[] iArr, int i, String str, int i2, int i3, int i4, List<Integer> list) {
for (int size = list.size() - 1; size >= 0; size--) {
int intValue = list.get(size).intValue();
if (!isSupportedAdaptiveVideoTrack(trackGroup.getFormat(intValue), str, iArr[intValue], i, i2, i3, i4)) {
list.remove(size);
}
}
}
private static boolean isSupportedAdaptiveVideoTrack(Format format, String str, int i, int i2, int i3, int i4, int i5) {
if (!isSupported(i, false) || (i & i2) == 0) {
return false;
}
if (str != null && !Util.areEqual(format.sampleMimeType, str)) {
return false;
}
if (format.width != -1 && format.width > i3) {
return false;
}
if (format.height != -1 && format.height > i4) {
return false;
}
if (format.bitrate == -1 || format.bitrate <= i5) {
return true;
}
return false;
}
private static TrackSelection selectFixedVideoTrack(TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters) {
int i;
TrackGroupArray trackGroupArray2 = trackGroupArray;
Parameters parameters2 = parameters;
int i2 = -1;
int i3 = 0;
TrackGroup trackGroup = null;
int i4 = 0;
int i5 = 0;
int i6 = -1;
int i7 = -1;
while (i3 < trackGroupArray2.length) {
TrackGroup trackGroup2 = trackGroupArray2.get(i3);
List<Integer> viewportFilteredTrackIndices = getViewportFilteredTrackIndices(trackGroup2, parameters2.viewportWidth, parameters2.viewportHeight, parameters2.viewportOrientationMayChange);
int[] iArr2 = iArr[i3];
int i8 = i7;
int i9 = i6;
int i10 = i5;
int i11 = i4;
TrackGroup trackGroup3 = trackGroup;
int i12 = 0;
while (i12 < trackGroup2.length) {
if (isSupported(iArr2[i12], parameters2.exceedRendererCapabilitiesIfNecessary)) {
Format format = trackGroup2.getFormat(i12);
boolean z = viewportFilteredTrackIndices.contains(Integer.valueOf(i12)) && (format.width == i2 || format.width <= parameters2.maxVideoWidth) && ((format.height == -1 || format.height <= parameters2.maxVideoHeight) && (format.bitrate == -1 || format.bitrate <= parameters2.maxVideoBitrate));
if (z || parameters2.exceedVideoConstraintsIfNecessary) {
int i13 = z ? 2 : 1;
boolean isSupported = isSupported(iArr2[i12], false);
if (isSupported) {
i13 += 1000;
}
boolean z2 = i13 > i10;
if (i13 == i10) {
if (format.getPixelCount() != i9) {
i = compareFormatValues(format.getPixelCount(), i9);
} else {
i = compareFormatValues(format.bitrate, i8);
}
z2 = !isSupported || !z ? i < 0 : i > 0;
}
if (z2) {
i8 = format.bitrate;
i9 = format.getPixelCount();
i10 = i13;
i11 = i12;
trackGroup3 = trackGroup2;
}
}
}
i12++;
parameters2 = parameters;
i2 = -1;
}
i3++;
trackGroup = trackGroup3;
i4 = i11;
i5 = i10;
i6 = i9;
i7 = i8;
trackGroupArray2 = trackGroupArray;
parameters2 = parameters;
i2 = -1;
}
if (trackGroup == null) {
return null;
}
return new FixedTrackSelection(trackGroup, i4);
}
/* access modifiers changed from: protected */
public TrackSelection selectAudioTrack(TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters, TrackSelection.Factory factory) {
int audioTrackScore;
int i = 0;
int i2 = -1;
int i3 = -1;
int i4 = 0;
while (i < trackGroupArray.length) {
TrackGroup trackGroup = trackGroupArray.get(i);
int[] iArr2 = iArr[i];
int i5 = i4;
int i6 = i3;
int i7 = i2;
for (int i8 = 0; i8 < trackGroup.length; i8++) {
if (isSupported(iArr2[i8], parameters.exceedRendererCapabilitiesIfNecessary) && (audioTrackScore = getAudioTrackScore(iArr2[i8], parameters.preferredAudioLanguage, trackGroup.getFormat(i8))) > i5) {
i7 = i;
i6 = i8;
i5 = audioTrackScore;
}
}
i++;
i2 = i7;
i3 = i6;
i4 = i5;
}
if (i2 == -1) {
return null;
}
TrackGroup trackGroup2 = trackGroupArray.get(i2);
if (factory != null) {
int[] adaptiveAudioTracks = getAdaptiveAudioTracks(trackGroup2, iArr[i2], parameters.allowMixedMimeAdaptiveness);
if (adaptiveAudioTracks.length > 0) {
return factory.createTrackSelection(trackGroup2, adaptiveAudioTracks);
}
}
return new FixedTrackSelection(trackGroup2, i3);
}
private static int getAudioTrackScore(int i, String str, Format format) {
int i2 = 1;
boolean z = (format.selectionFlags & 1) != 0;
if (formatHasLanguage(format, str)) {
i2 = z ? 4 : 3;
} else if (z) {
i2 = 2;
}
return isSupported(i, false) ? i2 + 1000 : i2;
}
private static int[] getAdaptiveAudioTracks(TrackGroup trackGroup, int[] iArr, boolean z) {
int adaptiveAudioTrackCount;
HashSet hashSet = new HashSet();
AudioConfigurationTuple audioConfigurationTuple = null;
int i = 0;
for (int i2 = 0; i2 < trackGroup.length; i2++) {
Format format = trackGroup.getFormat(i2);
AudioConfigurationTuple audioConfigurationTuple2 = new AudioConfigurationTuple(format.channelCount, format.sampleRate, z ? null : format.sampleMimeType);
if (hashSet.add(audioConfigurationTuple2) && (adaptiveAudioTrackCount = getAdaptiveAudioTrackCount(trackGroup, iArr, audioConfigurationTuple2)) > i) {
i = adaptiveAudioTrackCount;
audioConfigurationTuple = audioConfigurationTuple2;
}
}
if (i <= 1) {
return NO_TRACKS;
}
int[] iArr2 = new int[i];
int i3 = 0;
for (int i4 = 0; i4 < trackGroup.length; i4++) {
if (isSupportedAdaptiveAudioTrack(trackGroup.getFormat(i4), iArr[i4], audioConfigurationTuple)) {
iArr2[i3] = i4;
i3++;
}
}
return iArr2;
}
private static int getAdaptiveAudioTrackCount(TrackGroup trackGroup, int[] iArr, AudioConfigurationTuple audioConfigurationTuple) {
int i = 0;
for (int i2 = 0; i2 < trackGroup.length; i2++) {
if (isSupportedAdaptiveAudioTrack(trackGroup.getFormat(i2), iArr[i2], audioConfigurationTuple)) {
i++;
}
}
return i;
}
private static boolean isSupportedAdaptiveAudioTrack(Format format, int i, AudioConfigurationTuple audioConfigurationTuple) {
if (!isSupported(i, false) || format.channelCount != audioConfigurationTuple.channelCount || format.sampleRate != audioConfigurationTuple.sampleRate) {
return false;
}
if (audioConfigurationTuple.mimeType == null || TextUtils.equals(audioConfigurationTuple.mimeType, format.sampleMimeType)) {
return true;
}
return false;
}
/* access modifiers changed from: protected */
public TrackSelection selectTextTrack(TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters) {
int i = 0;
TrackGroup trackGroup = null;
int i2 = 0;
int i3 = 0;
while (i < trackGroupArray.length) {
TrackGroup trackGroup2 = trackGroupArray.get(i);
int[] iArr2 = iArr[i];
int i4 = i3;
int i5 = i2;
TrackGroup trackGroup3 = trackGroup;
for (int i6 = 0; i6 < trackGroup2.length; i6++) {
if (isSupported(iArr2[i6], parameters.exceedRendererCapabilitiesIfNecessary)) {
Format format = trackGroup2.getFormat(i6);
int i7 = 1;
boolean z = (format.selectionFlags & 1) != 0;
boolean z2 = (format.selectionFlags & 2) != 0;
if (formatHasLanguage(format, parameters.preferredTextLanguage)) {
i7 = z ? 6 : !z2 ? 5 : 4;
} else if (z) {
i7 = 3;
} else if (z2) {
if (formatHasLanguage(format, parameters.preferredAudioLanguage)) {
i7 = 2;
}
}
if (isSupported(iArr2[i6], false)) {
i7 += 1000;
}
if (i7 > i4) {
i5 = i6;
trackGroup3 = trackGroup2;
i4 = i7;
}
}
}
i++;
trackGroup = trackGroup3;
i2 = i5;
i3 = i4;
}
if (trackGroup == null) {
return null;
}
return new FixedTrackSelection(trackGroup, i2);
}
/* access modifiers changed from: protected */
public TrackSelection selectOtherTrack(int i, TrackGroupArray trackGroupArray, int[][] iArr, Parameters parameters) {
TrackGroup trackGroup = null;
int i2 = 0;
int i3 = 0;
int i4 = 0;
while (i2 < trackGroupArray.length) {
TrackGroup trackGroup2 = trackGroupArray.get(i2);
int[] iArr2 = iArr[i2];
int i5 = i4;
int i6 = i3;
TrackGroup trackGroup3 = trackGroup;
for (int i7 = 0; i7 < trackGroup2.length; i7++) {
if (isSupported(iArr2[i7], parameters.exceedRendererCapabilitiesIfNecessary)) {
int i8 = 1;
if ((trackGroup2.getFormat(i7).selectionFlags & 1) != 0) {
i8 = 2;
}
if (isSupported(iArr2[i7], false)) {
i8 += 1000;
}
if (i8 > i5) {
i6 = i7;
trackGroup3 = trackGroup2;
i5 = i8;
}
}
}
i2++;
trackGroup = trackGroup3;
i3 = i6;
i4 = i5;
}
if (trackGroup == null) {
return null;
}
return new FixedTrackSelection(trackGroup, i3);
}
protected static boolean formatHasLanguage(Format format, String str) {
return str != null && TextUtils.equals(str, Util.normalizeLanguageCode(format.language));
}
private static List<Integer> getViewportFilteredTrackIndices(TrackGroup trackGroup, int i, int i2, boolean z) {
ArrayList arrayList = new ArrayList(trackGroup.length);
for (int i3 = 0; i3 < trackGroup.length; i3++) {
arrayList.add(Integer.valueOf(i3));
}
if (i == Integer.MAX_VALUE || i2 == Integer.MAX_VALUE) {
return arrayList;
}
int i4 = Integer.MAX_VALUE;
for (int i5 = 0; i5 < trackGroup.length; i5++) {
Format format = trackGroup.getFormat(i5);
if (format.width > 0 && format.height > 0) {
Point maxVideoSizeInViewport = getMaxVideoSizeInViewport(z, i, i2, format.width, format.height);
int i6 = format.width * format.height;
if (format.width >= ((int) (((float) maxVideoSizeInViewport.x) * FRACTION_TO_CONSIDER_FULLSCREEN)) && format.height >= ((int) (((float) maxVideoSizeInViewport.y) * FRACTION_TO_CONSIDER_FULLSCREEN)) && i6 < i4) {
i4 = i6;
}
}
}
if (i4 != Integer.MAX_VALUE) {
for (int size = arrayList.size() - 1; size >= 0; size--) {
int pixelCount = trackGroup.getFormat(((Integer) arrayList.get(size)).intValue()).getPixelCount();
if (pixelCount == -1 || pixelCount > i4) {
arrayList.remove(size);
}
}
}
return arrayList;
}
/* JADX WARNING: Code restructure failed: missing block: B:7:0x000c, code lost:
if (r1 != r3) goto L_0x0012;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
private static android.graphics.Point getMaxVideoSizeInViewport(boolean r3, int r4, int r5, int r6, int r7) {
/*
if (r3 == 0) goto L_0x000f
r3 = 0
r0 = 1
if (r6 <= r7) goto L_0x0008
r1 = 1
goto L_0x0009
L_0x0008:
r1 = 0
L_0x0009:
if (r4 <= r5) goto L_0x000c
r3 = 1
L_0x000c:
if (r1 == r3) goto L_0x000f
goto L_0x0012
L_0x000f:
r2 = r5
r5 = r4
r4 = r2
L_0x0012:
int r3 = r6 * r4
int r0 = r7 * r5
if (r3 < r0) goto L_0x0022
android.graphics.Point r3 = new android.graphics.Point
int r4 = com.google.android.exoplayer2.util.Util.ceilDivide(r0, r6)
r3.<init>(r5, r4)
return r3
L_0x0022:
android.graphics.Point r5 = new android.graphics.Point
int r3 = com.google.android.exoplayer2.util.Util.ceilDivide(r3, r7)
r5.<init>(r3, r4)
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer2.trackselection.DefaultTrackSelector.getMaxVideoSizeInViewport(boolean, int, int, int, int):android.graphics.Point");
}
/* access modifiers changed from: private */
public static final class AudioConfigurationTuple {
public final int channelCount;
public final String mimeType;
public final int sampleRate;
public AudioConfigurationTuple(int i, int i2, String str) {
this.channelCount = i;
this.sampleRate = i2;
this.mimeType = str;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
AudioConfigurationTuple audioConfigurationTuple = (AudioConfigurationTuple) obj;
if (this.channelCount == audioConfigurationTuple.channelCount && this.sampleRate == audioConfigurationTuple.sampleRate && TextUtils.equals(this.mimeType, audioConfigurationTuple.mimeType)) {
return true;
}
return false;
}
public int hashCode() {
return (((this.channelCount * 31) + this.sampleRate) * 31) + (this.mimeType != null ? this.mimeType.hashCode() : 0);
}
}
}
| [
"ai@AIs-MacBook-Pro.local"
] | ai@AIs-MacBook-Pro.local |
3f7f8d1a7f30e7c0dfb6546b416f181742300dbe | fbc28e5d200ed0b594fed866b1797989c53a413e | /homework1/WEB-INF/classes/DataAnalytics.java | ca28e90edae6266cc4ca3369b589b16b177d76fc | [] | no_license | AdarshVijayakumar/E-Shopping-Online-Store-Web-Application | 9674e44481ad1f86e8660c865e78583da0e53eb8 | 44303b7e4cf9a9414fb303416d7b5c6d8d4fa89d | refs/heads/master | 2021-05-26T00:48:43.739859 | 2020-04-08T04:51:20 | 2020-04-08T04:51:20 | 253,987,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,737 | java | import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mongodb.*;
import javax.servlet.http.HttpSession;
@WebServlet("/DataAnalytics")
public class DataAnalytics extends HttpServlet {
static DBCollection myReviews;
/* Trending Page Displays all the Consoles and their Information in Game Speed*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
Utilities utility = new Utilities(request, pw);
//check if the user is logged in
if(!utility.isLoggedin()){
HttpSession session = request.getSession(true);
session.setAttribute("login_msg", "Please Login to View Reviews");
response.sendRedirect("Login");
return;
}
utility.printHtml("Header.html");
utility.printHtml("LeftNavigationBar.html");
pw.print("<div id='content'><div class='post'><h2 class='title meta'>");
pw.print("<a style='font-size: 24px;'>Data Analytics on Review</a>");
pw.print("</h2><div class='entry'>");
pw.print("<table id='bestseller'>");
pw.print("<form method='post' action='FindReviews'>");
pw.print("<table id='bestseller'>");
pw.print("<tr>");
pw.print("<td> <input type='checkbox' name='queryCheckBox' value='productName'> Select </td>");
pw.print("<td> Product Name: </td>");
pw.print("<td>");
pw.print("<select name='productName'>");
pw.print("<option value='ALL_PRODUCTS'>All Products</option>");
pw.print("<option value='Sony 4K Ultra HD'>Sony 4K Ultra HD</option>");
pw.print("<option value='Sony Smart LED TV'>Sony Smart LED TV</option>");
pw.print("<option value='Sony Bravia'>Sony Bravia</option>");
pw.print(" <option value='LG 4K OLED TV '>LG 4K OLED TV </option>");
pw.print("<option value='LG 4K UHD TV'>LG 4K UHD TV</option>");
pw.print("<option value='Samsung 4K UHD 7 Series'>Samsung 4K UHD 7 Series</option>");
pw.print("<option value='Samsung 4K 8 Series'>Samsung 4K 8 Series</option>");
pw.print("<option value='Bose 8 Sorround Sound Speaker'>Bose 8 Sorround Sound Speaker</option>");
pw.print("<option value='Bose S1 Pro System'>Bose S1 Pro System</option>");
pw.print("<option value='Sony Muteki Audio System'>Sony Muteki Audio System</option>");
pw.print("<option value='Sony Portable GPX'>Sony Portable GPX</option>");
pw.print("<option value='Logitech Z313 with Subwoofer'>Logitech Z313 with Subwoofer</option>");
pw.print("<option value='Logitech Z506 2.1 Sorround Speaker System'>Logitech Z506 2.1 Sorround Speaker System</option>");
pw.print("<option value='i Phone 6s Plus'>i Phone 6s Plus</option>");
pw.print("<option value='i Phone XS Plus'>i Phone XS Plus</option>");
pw.print("<option value='Samsung Galaxy S9'>Samsung Galaxy S9</option>");
pw.print("<option value='Samsung Galaxy Note 10'>Samsung Galaxy Note 10</option>");
pw.print("<option value='Nokia 9.1 Series'>Nokia 9.1 Series</option>");
pw.print("<option value='Nokia 10 Series'>Nokia 10 Series</option>");
pw.print("<option value='MacBook Pro'>MacBook Pro</option>");
pw.print("<option value='MacBook Air'>MacBook Air</option>");
pw.print("<option value='HP Pavilion 15.6 HD'>HP Pavilion 15.6 HD</option>");
pw.print("<option value='HP Envy 15.6'>HP Envy 15.6</option>");
pw.print("<option value='DELL inspiron 15.6'>DELL inspiron 15.6</option>");
pw.print("<option value='Dell Latitude Ultrabook'>Dell Latitude Ultrabook</option>");
pw.print("<option value='Google Home'>Google Home</option>");
pw.print("<option value='Google Home mini'>Google Home mini</option>");
pw.print("<option value='Amazon Echo Dot'>Amazon Echo Dot</option>");
pw.print("<option value='Amazon echo 2nd Gen'>Amazon echo 2nd Gen</option>");
pw.print("<option value='Amazon Alexa'>Amazon Alexa</option>");
pw.print("<option value='Fitbit Fitness Tracker'>Fitbit Fitness Tracker</option>");
pw.print("<option value='Fitbit - Inspire Fit'>Fitbit - Inspire Fit</option>");
pw.print("<option value='Polar - A370 Fitness Tracker'>Polar - A370 Fitness Tracker</option>");
pw.print("<option value='Polar M430 GPS Running Watch'>Polar M430 GPS Running Watch</option>");
pw.print("<option value='Moko Smart Fitness Tracker'>Moko Smart Fitness Tracker</option>");
pw.print("<option value='Moko Fitness sweatproof wrist watch'>Moko Fitness sweatproof wrist watch</option>");
pw.print("<option value='Samsung Gear S Smart Watch'>Samsung Gear S Smart Watch</option>");
pw.print("<option value='Samsung Galaxy G3 Smartwatch'>Samsung Galaxy G3 Smartwatch</option>");
pw.print("<option value='LG W270 2.0 Series'>LG W270 2.0 Series</option>");
pw.print("<option value='LG SmartTek 2.0 W Series'>LG SmartTek 2.0 W Series</option>");
pw.print("<option value='Sony SmartWatch2 Waterproof'>Sony SmartWatch2 Waterproof</option>");
pw.print("<option value='Sony X8 Smart Watch '>Sony X8 Smart Watch </option>");
pw.print("<option value='Sony WH100XM3 Stero Headphone'>Sony WH100XM3 Stero Headphone</option>");
pw.print("<option value='Sony RF3 Noise Cancelling headphone'>Sony RF3 Noise Cancelling headphone</option>");
pw.print("<option value='Bose Sound Sport Headphones'>Bose Sound Sport Headphones</option>");
pw.print("<option value='Bose 2.1 ZX Series QuietComfort Wireless Headphone'>Bose 2.1 ZX Series QuietComfort Wireless Headphone</option>");
pw.print("<option value='Sennheiser PXC 550 Wireless Headphone'>Sennheiser PXC 550 Wireless Headphone</option>");
pw.print("<option value='Sennheiser RS 120 Noise Cancelling Headphone'>Sennheiser RS 120 Noise Cancelling Headphone</option>");
pw.print("<option value='Basic'>Basic</option>");
pw.print("<option value='Premium'>Premium</option>");
pw.print("<option value='Ultimate'>Ultimate</option>");
pw.print("</td>");
pw.print("<tr>");
pw.print("<td> <input type='checkbox' name='queryCheckBox' value='productPrice'> Select </td>");
pw.print("<td> Product Price: </td>");
pw.print(" <td>");
pw.print(" <input type='number' name='productPrice' value = '0' size=10 /> </td>");
pw.print("<td>");
pw.print("<input type='radio' name='comparePrice' value='EQUALS_TO' checked> Equals <br>");
pw.print("<input type='radio' name='comparePrice' value='GREATER_THAN'> Greater Than <br>");
pw.print("<input type='radio' name='comparePrice' value='LESS_THAN'> Less Than");
pw.print("</td></tr>");
pw.print("<tr><td> <input type='checkbox' name='queryCheckBox' value='reviewRating'> Select </td>");
pw.print(" <td> Review Rating: </td>");
pw.print(" <td>");
pw.print(" <select name='reviewRating'>");
pw.print(" <option value='1' selected>1</option>");
pw.print(" <option value='2'>2</option>");
pw.print(" <option value='3'>3</option>");
pw.print(" <option value='4'>4</option>");
pw.print(" <option value='5'>5</option>");
pw.print("</td>");
pw.print("<td>");
pw.print("<input type='radio' name='compareRating' value='EQUALS_TO' checked> Equals <br>");
pw.print("<input type='radio' name='compareRating' value='GREATER_THAN'> Greater Than");
pw.print("</td></tr>");
pw.print("<tr>");
pw.print("<td> <input type='checkbox' name='queryCheckBox' value='retailerCity'> Select </td>");
pw.print("<td> Retailer City: </td>");
pw.print("<td>");
pw.print("<input type='text' name='retailerCity' /> </td>");
pw.print("</tr>");
pw.print("<tr>");
pw.print("<td> <input type='checkbox' name='queryCheckBox' value='retailerZipcode'> Select </td>");
pw.print(" <td> Retailer Zip code: </td>");
pw.print(" <td>");
pw.print("<input type='text' name='retailerZipcode' /> </td>");
pw.print("</tr>");
pw.print("<tr><td>");
pw.print("<input type='checkbox' name='extraSettings' value='GROUP_BY'> Group By");
pw.print("</td>");
pw.print("<td>");
pw.print("<select name='groupByDropdown'>");
pw.print("<option value='GROUP_BY_CITY' selected>City</option>");
pw.print("<option value='GROUP_BY_PRODUCT'>Product Name</option>");
pw.print("</td><td>");
pw.print("<input type='radio' name='dataGroupBy' value='Count' checked> Count <br>");
pw.print("<input type='radio' name='dataGroupBy' value='Detail'> Detail <br>");
pw.print("</td></tr>");
pw.print("<tr>");
pw.print("<td colspan = '4'> <input type='submit' value='Find Data' class='btnbuy' /> </td>");
pw.print("</tr>");
pw.print("</table>");
pw.print("</div></div></div>");
utility.printHtml("Footer.html");
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
}
}
| [
"adarsh@Adarshs-PC.local"
] | adarsh@Adarshs-PC.local |
98bc00795f05926c92d035c9b9ecf6257e212fe2 | d60e287543a95a20350c2caeabafbec517cabe75 | /NLPCCd/Camel/1478_1.java | db3b20ee741d853a949b62aa27745d630d75b1cc | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | //,temp,sample_1345.java,2,16,temp,sample_276.java,2,16
//,3
public class xxx {
public void dummy_method(){
final ODataFeed feed = (ODataFeed) responseParts.get(1).getBody();
assertNotNull(feed);
ODataEntry dataEntry = (ODataEntry) responseParts.get(2).getBody();
assertNotNull(dataEntry);
dataEntry = (ODataEntry) responseParts.get(3).getBody();
assertNotNull(dataEntry);
dataEntry = (ODataEntry) responseParts.get(4).getBody();
assertNotNull(dataEntry);
int statusCode = responseParts.get(5).getStatusCode();
assertEquals(HttpStatusCodes.NO_CONTENT.getStatusCode(), statusCode);
log.info("update address status");
}
}; | [
"SHOSHIN\\sgholamian@shoshin.uwaterloo.ca"
] | SHOSHIN\sgholamian@shoshin.uwaterloo.ca |
0501c764faf2fb3babc9d85bcfda2e4815d06b47 | c0942ebd2c2109ea92ceca23e77dfdd9a3b90d77 | /ThinkingInJava/src/main/java/com/ietree/base/io/util/TextFile.java | 692054b697ff864abb8578e1c3dde41d5381c74b | [] | no_license | Ietree/ThinkingInJava | b3b12846b955c29aa492faa6fbf46a5d5d703f41 | 4e5a4abcbe413208d84b3fbd39628bd14fb5a020 | refs/heads/master | 2021-08-29T20:51:59.012270 | 2017-12-15T00:23:20 | 2017-12-15T00:23:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,840 | java | package com.ietree.base.io.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.TreeSet;
public class TextFile extends ArrayList<String>
{
private static final long serialVersionUID = 1L;
public static String read(String fileName)
{
StringBuilder sb = new StringBuilder();
try
{
BufferedReader in = new BufferedReader(new FileReader(new File(fileName).getAbsoluteFile()));
String s;
try
{
while ((s = in.readLine()) != null)
{
sb.append(s);
sb.append("\n");
}
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
in.close();
}
}
catch (IOException e)
{
e.printStackTrace();
}
return sb.toString();
}
public static void write(String fileName, String text)
{
try
{
PrintWriter out = new PrintWriter(new File(fileName).getAbsoluteFile());
try
{
out.print(text);
}
finally
{
out.close();
}
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
public TextFile(String fileName, String splitter)
{
super(Arrays.asList(read(fileName).split(splitter)));
if (get(0).equals(""))
{
remove(0);
}
}
public TextFile(String fileName)
{
this(fileName, "\n");
}
public void write(String fileName)
{
try
{
PrintWriter out = new PrintWriter(new File(fileName).getAbsoluteFile());
try
{
for (String item : this)
{
out.println(item);
}
}
finally
{
out.close();
}
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
String file = read("TextFile.java");
write("test.txt", file);
TextFile text = new TextFile("test.txt");
text.write("test2.txt");
TreeSet<String> words = new TreeSet<String>(new TextFile("TextFile.java", "\\W+"));
System.out.println(words.headSet("a"));
}
}
| [
"Dylansuns@hotmail.com"
] | Dylansuns@hotmail.com |
232b1f9faef440fd8217c604f4513d608b5ed7d9 | db6f2458ed4df2041b9884cb568f3817e14b34fe | /designpatterns/src/behavioral/template/Client.java | e68623bfc680400c3b6ec70b9bba27dfbe078c44 | [] | no_license | vaibhav050690/preparation | 25eb1fe2d3b6e590e13517659b7df8af56e5925c | f076c1382cf0bc6ede4999642143d6c4637bed5a | refs/heads/master | 2020-03-25T18:48:09.838775 | 2019-05-28T16:47:02 | 2019-05-28T16:47:02 | 144,049,111 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package behavioral.template;
import java.util.AbstractList;
public class Client {
public static void main(String[] args) {
CrossCompiler anroidComplier = new AnroidCompiler();
CrossCompiler iphoneComplier = new IPhoneCompiler();
anroidComplier.compile();
iphoneComplier.compile();
}
} | [
"vaibhav.mishra@redbus.in"
] | vaibhav.mishra@redbus.in |
796c20fa6b64cca82b4f3c924fae7d5c4731d529 | c36fd92239ee147635d7738f6adfbc9686dee22d | /src/java/admin_controller/them_san_pham_admin.java | 84643c75cd19d736ec5300948fe9bbe309743e32 | [] | no_license | cuongmanh1106/QLST_demo | 7eea533573273b8b94558b332207356d3ad29b07 | d56f9fa141de4157d1bac9b12a23f2f3143f778f | refs/heads/master | 2021-07-13T11:18:45.025982 | 2017-10-12T12:24:21 | 2017-10-12T12:24:21 | 105,558,664 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,826 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package admin_controller;
import dbHelpers.san_pham_query;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.m_san_pham;
/**
*
* @author Admin
*/
@WebServlet(name = "them_san_pham_admin", urlPatterns = {"/them_san_pham"})
public class them_san_pham_admin extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet them_san_pham_admin</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet them_san_pham_admin at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
san_pham_query sq = new san_pham_query();
String ten_san_pham = null;
int ma_loai = 1;
String mo_ta_tom_tat = null;
String mo_ta_chi_tiet = null;
int don_gia = 0;
String hinh = null;
ten_san_pham = request.getParameter("ten_san_pham");
ma_loai = Integer.parseInt(request.getParameter("ma_loai"));
mo_ta_tom_tat = request.getParameter("noi_dung_tom_tat");
mo_ta_chi_tiet = request.getParameter("noi_dung_chi_tiet");
don_gia = Integer.parseInt(request.getParameter("don_gia"));
hinh = request.getParameter("hinh");
// if(request.getParameter("ten_san_pham")!=null)
// ten_san_pham = request.getParameter("ten_san_pham");
// else
// response.sendRedirect("index.jsp");
//
// if(request.getParameter("ma_loai")!=null)
// ma_loai = Integer.parseInt(request.getParameter("ma_loai"));
// else
// response.sendRedirect("/index.jsp");
//
// if(request.getParameter("noi_dung_tom_tat")!=null)
// mo_ta_tom_tat = request.getParameter("noi_dung_tom_tat");
// else
// response.sendRedirect("/index.jsp");
//
// if(request.getParameter("noi_dung_chi_tiet")!=null)
// mo_ta_chi_tiet = request.getParameter("noi_dung_chi_tiet");
// else
// response.sendRedirect("/index.jsp");
//
// if(request.getParameter("don_gia")!=null)
// don_gia = Integer.parseInt(request.getParameter("don_gia"));
// else
// response.sendRedirect("/index.jsp");
//
// if(request.getParameter("hinh")!=null)
// hinh = request.getParameter("hinh");
// ten_san_pham = "Hat";
// ma_loai = 3;
// hinh = "abc.jpg";
// don_gia = 100;
// mo_ta_tom_tat = "abc";
// mo_ta_chi_tiet = "aaaaaaaa";
m_san_pham sp = new m_san_pham();
sp.setTen_san_pham(ten_san_pham);
sp.setMa_loai(ma_loai);
sp.setMo_ta_chi_tiet(mo_ta_chi_tiet);
sp.setMo_ta_tom_tat(mo_ta_tom_tat);
sp.setDon_gia(don_gia);
sp.setHinh(hinh);
try {
sq.them_san_pham(sp);
} catch (SQLException ex) {
Logger.getLogger(them_san_pham_admin.class.getName()).log(Level.SEVERE, null, ex);
}
String url ="/san_phams_admin";
RequestDispatcher dis = request.getRequestDispatcher(url);
dis.forward(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"cuongmanh1106@gmail.com"
] | cuongmanh1106@gmail.com |
38256b06050ff539e37412de7cb9f2fe71a937d7 | d1aad7552a64b82c10f070bdd1ae19cd58d2754c | /src/mipsy/instructions/InstructionSw.java | 9f2e288c85cde2ae87701b5a22d5c8c22147fe47 | [
"MIT"
] | permissive | adnanel/mipsy | 95e165f8e85c52de7324ba74543d8583b3af69b3 | d4fee7f1248d6f1f20081bf6507880c6500eb7fb | refs/heads/master | 2021-03-16T07:51:14.731528 | 2017-09-21T18:20:35 | 2017-09-21T18:20:35 | 86,641,039 | 0 | 0 | null | 2017-08-15T10:57:56 | 2017-03-30T00:18:17 | Java | UTF-8 | Java | false | false | 1,595 | java | package mipsy.instructions;
import mipsy.Utility;
import mipsy.types.Instruction;
import mipsy.types.Register;
import java.util.List;
/**
* Created on 4/1/2017.
*/
public class InstructionSw extends Instruction {
// example: sw $s2, 0($a2)
// sw rt, offset(base)
private String destReg;
private int offset;
private String baseReg;
public InstructionSw(List<String> args) {
super(args);
this.instruction = "sw";
if ( args.size() != 2 )
throw new IllegalArgumentException("Invalid arguments passed to sw! Expected 2, given " + args.size());
destReg = args.get(0);
//drugi arg se sastoji od offset(base)
offset = Utility.ParseInt(args.get(1).substring(0, args.get(1).indexOf('(')));
String fin = args.get(1);
fin = fin.substring(fin.indexOf('(') + 1);
fin = fin.substring(0, fin.length() - 1);
baseReg = fin;
}
@Override
public Type getType() {
return Type.IType;
}
@Override
public boolean canBranch() {
return false;
}
@Override
public int getCoded() {
int res = 0b101011;
res = (res << 5) | Register.getRegisterNumber(baseReg);
res = (res << 5) | Register.getRegisterNumber(destReg);
res = (res << 16) | offset;
return res;
}
@Override
public String toString() {
return String.format("sw %s, %s(%s)", destReg, "0x" + Integer.toHexString(offset), baseReg);
}
}
| [
"adnanel94@gmail.com"
] | adnanel94@gmail.com |
6ab2211ff213455bcb70075ae26bb79507f8d86b | 7321272655138c91005b64e0c3645baa5d7e380d | /src/test/java/com/ttn/todo/TodoApplicationTests.java | aadd2f83a9d03704fc02de407d8cbff5bf0ebf6d | [] | no_license | VineetChaudharyttn/todo | 7aa665f77f3190cf33a8e0449b6d6eacb274b87e | 9c7db0a07548e68124544914409ea33f4c466562 | refs/heads/master | 2020-10-01T13:29:03.722818 | 2019-12-19T09:02:04 | 2019-12-19T09:02:04 | 227,547,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package com.ttn.todo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TodoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"saurabh.mittal@tothenew.com"
] | saurabh.mittal@tothenew.com |
345921e244c76906a68566ace190f6817b53004d | 69a0906253e7474ddd453c6659061757c60d27fe | /app/src/main/java/com/freemoney/apidemojeetendra/utility/MySingleton.java | 2492e452f5d695791e851ac24ac78494e8b35e6f | [] | no_license | jeetwide/ApiDemoJeetendra | 85fa5fe111f411c757197570c2027b1d462331ca | 98920fe8a5af002032ed912a67d67a7e3cf709ea | refs/heads/master | 2020-03-07T01:42:37.316744 | 2018-04-17T16:24:15 | 2018-04-17T16:24:15 | 127,190,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package com.freemoney.apidemojeetendra.utility;
import android.content.Context;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
public class MySingleton {
private static MySingleton mInstance;
private RequestQueue mRequestQueue;
private static Context mContext;
private MySingleton(Context context){
// Specify the application context
mContext = context;
// Get the request queue
mRequestQueue = getRequestQueue();
}
public static synchronized MySingleton getInstance(Context context){
// If Instance is null then initialize new Instance
if(mInstance == null){
mInstance = new MySingleton(context);
}
// Return MySingleton new Instance
return mInstance;
}
public RequestQueue getRequestQueue(){
// If RequestQueue is null the initialize new RequestQueue
if(mRequestQueue == null){
mRequestQueue = Volley.newRequestQueue(mContext.getApplicationContext());
}
// Return RequestQueue
return mRequestQueue;
}
public<T> void addToRequestQueue(Request<T> request){
// Add the specified request to the request queue
getRequestQueue().add(request);
}
} | [
"wide.angle456@gmail.com"
] | wide.angle456@gmail.com |
2c2e95fe5535e36a7d2d2fb9dfe9fe8063e21efb | a2b7591663257148e040157f08c55a85fa131be4 | /app/src/main/java/com/creativeshare/emdad/activities_fragments/activities/home_activity/fragments/fragment_home/Fragment_Terms_Condition.java | 3cc455e83b351482415ed686f391129dd7e7f10d | [] | no_license | freelanceapp/Emdad | d90b0091b2eb063f4d4c8042cd650fa7e6ceac4c | 26a7fd0bacdcff4f2b8c72b7c7dabac272130464 | refs/heads/master | 2022-01-20T02:35:55.592665 | 2019-07-08T10:52:52 | 2019-07-08T10:52:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,339 | java | package com.creativeshare.emdad.activities_fragments.activities.home_activity.fragments.fragment_home;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import com.creativeshare.emdad.R;
import com.creativeshare.emdad.activities_fragments.activities.home_activity.activity.Home_Activity;
import com.creativeshare.emdad.activities_fragments.activities.sign_in_sign_up_activity.activity.Login_Activity;
import com.creativeshare.emdad.models.TermsModel;
import com.creativeshare.emdad.remote.Api;
import com.creativeshare.emdad.tags.Tags;
import java.io.IOException;
import java.util.Locale;
import io.paperdb.Paper;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class Fragment_Terms_Condition extends Fragment {
private static final String TAG="type";
private TextView tv_title;
private ImageView arrow;
private TextView tv_content;
private ProgressBar progBar;
private String current_language;
private AppCompatActivity activity;
public static Fragment_Terms_Condition newInstance(int type)
{
Bundle bundle = new Bundle();
bundle.putInt(TAG,type);
Fragment_Terms_Condition fragment_terms_condition = new Fragment_Terms_Condition();
fragment_terms_condition.setArguments(bundle);
return fragment_terms_condition;
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_terms_conditions,container,false);
initView(view);
return view;
}
private void initView(View view) {
activity = (AppCompatActivity) getActivity();
Paper.init(activity);
current_language = Paper.book().read("lang", Locale.getDefault().getLanguage());
arrow = view.findViewById(R.id.arrow);
if (current_language.equals("ar"))
{
arrow.setRotation(180.0f);
}
tv_title = view.findViewById(R.id.tv_title);
tv_content = view.findViewById(R.id.tv_content);
progBar = view.findViewById(R.id.progBar);
progBar.getIndeterminateDrawable().setColorFilter(ActivityCompat.getColor(activity,R.color.colorPrimary), PorterDuff.Mode.SRC_IN);
arrow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (activity instanceof Home_Activity)
{
Home_Activity home_activity = (Home_Activity) activity;
home_activity.Back();
}else if (activity instanceof Login_Activity)
{
Login_Activity login_activity = (Login_Activity) activity;
login_activity.Back();
}
}
});
Bundle bundle = getArguments();
if (bundle!=null)
{
int type = bundle.getInt(TAG);
if (type == 1)
{
tv_title.setText(getString(R.string.terms_of_service));
getTermsCondition();
}else if (type == 2)
{
tv_title.setText(getString(R.string.about_tour));
getAboutUs();
}
}
}
private void getTermsCondition()
{
Api.getService(Tags.base_url)
.getTerms()
.enqueue(new Callback<TermsModel>() {
@Override
public void onResponse(Call<TermsModel> call, Response<TermsModel> response) {
progBar.setVisibility(View.GONE);
if (response.isSuccessful()&&response.body()!=null)
{
if (current_language.equals("ar"))
{
tv_content.setText(response.body().getAr_content());
}else
{
tv_content.setText(response.body().getEn_content());
}
}else
{
Toast.makeText(activity, getString(R.string.failed), Toast.LENGTH_SHORT).show();
try {
Log.e("Error_code",response.code()+"_"+response.errorBody().string());
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void onFailure(Call<TermsModel> call, Throwable t) {
try {
progBar.setVisibility(View.GONE);
Toast.makeText(activity, R.string.something, Toast.LENGTH_SHORT).show();
Log.e("Error",t.getMessage());
}catch (Exception e){}
}
});
}
private void getAboutUs()
{
Api.getService(Tags.base_url)
.getAboutUs()
.enqueue(new Callback<TermsModel>() {
@Override
public void onResponse(Call<TermsModel> call, Response<TermsModel> response) {
progBar.setVisibility(View.GONE);
if (response.isSuccessful()&&response.body()!=null)
{
if (current_language.equals("ar")||current_language.equals("ur"))
{
tv_content.setText(response.body().getAr_content());
}else
{
tv_content.setText(response.body().getEn_content());
}
}else
{
Toast.makeText(activity, getString(R.string.failed), Toast.LENGTH_SHORT).show();
try {
Log.e("Error_code",response.code()+"_"+response.errorBody().string());
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void onFailure(Call<TermsModel> call, Throwable t) {
try {
progBar.setVisibility(View.GONE);
Toast.makeText(activity, R.string.something, Toast.LENGTH_SHORT).show();
Log.e("Error",t.getMessage());
}catch (Exception e){}
}
});
}
}
| [
"emadmagdi.151995@gmai.com"
] | emadmagdi.151995@gmai.com |
1e0fb5e5ef7899227a7a079447b95f7749af3c56 | ea0ce6df13ebdec6f27ec7d7f8c2c8f50656aa88 | /src/main/java/com/lujianbo/app/http/pool/ChannelObjectPool.java | e7388720540ea4321024b3aa8a8cf52ebcd43328 | [
"MIT"
] | permissive | lujianbo/moonlight-http | af71331d21e8c7050902677158164795b6aa5907 | 1413d38cbdf62eb489a0c12f73b3a39429d3e78b | refs/heads/master | 2020-12-31T00:09:57.398483 | 2017-04-05T09:58:41 | 2017-04-05T09:58:41 | 86,564,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,479 | java | package com.lujianbo.app.http.pool;
import com.google.common.net.HostAndPort;
import io.netty.channel.Channel;
import org.apache.commons.pool2.KeyedObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
/**
* Created by jianbo on 2017/3/28.
*/
public class ChannelObjectPool {
private KeyedObjectPool<HostAndPort, Channel> channelKeyedObjectPool;
public ChannelObjectPool(GenericKeyedObjectPoolConfig config) {
build(config);
}
public ChannelObjectPool() {
GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
config.setMaxTotalPerKey(64);
config.setMaxTotal(1024 * 1204);
config.setMaxIdlePerKey(6);//ไธไธช่ฟๆฅๆๅค6ไธช็ฉบ้ฒ
build(config);
}
private void build(GenericKeyedObjectPoolConfig config){
this.channelKeyedObjectPool = new GenericKeyedObjectPool<>(new HttpClientPooledObjectFactory(ConnectorBuilder.getInstance()), config);
}
public Channel getChannel(HostAndPort key) throws Exception {
return channelKeyedObjectPool.borrowObject(key);
}
public void returnChannel(HostAndPort key, Channel channel) throws Exception {
channelKeyedObjectPool.returnObject(key, channel);
}
public void invalidateChannel(HostAndPort key, Channel channel) throws Exception {
channelKeyedObjectPool.invalidateObject(key, channel);
}
}
| [
"387852424@qq.com"
] | 387852424@qq.com |
27164052162a154a724d06f0ff46e21d5a812f1b | a9acb0dd68c5e1c9de9e49d030fff1d333933e14 | /src/main/java/com/javastart/springhomework/controller/TransferController.java | aa5da6bcf453229d8889aa5a2c82b559b6f73f4f | [] | no_license | AlexBakaluk/simple-java-payment-app | 8560f1faa6c611b0a0e1ad515fd91133f341f6ee | 869a7efab95f11b18b202f06e0b7152c0f9d7db5 | refs/heads/master | 2023-04-13T13:14:47.538083 | 2021-04-21T21:12:10 | 2021-04-21T21:12:10 | 360,307,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 921 | java | package com.javastart.springhomework.controller;
import com.javastart.springhomework.controller.dto.TransferRequestDTO;
import com.javastart.springhomework.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class TransferController {
private final TransferService transferService;
@Autowired
public TransferController(TransferService transferService) {
this.transferService = transferService;
}
@PostMapping("/transfers")
public Object transfer(@RequestBody TransferRequestDTO transferRequestDTO) {
return transferService.transfer(transferRequestDTO.accountIdFrom, transferRequestDTO.accountIdTo, transferRequestDTO.amount);
}
}
| [
"bakaluk.sasha@gmail.com"
] | bakaluk.sasha@gmail.com |
f399145c7567954a81f3588119ce483810e97bec | 4765d29098bda76a330a705a5738268517c98f69 | /SoundLevel.java | c26284079e11eedea88f1916ef8f05914d69e0f6 | [] | no_license | Ritesh96Soni/test2 | 3063032a730b0bd4601384c8fccce4ae4876a515 | 2b5ddde69c23ffc5f17beb4ebb512f6dc620cc78 | refs/heads/master | 2021-07-10T20:41:26.574871 | 2017-10-10T10:59:35 | 2017-10-10T10:59:35 | 106,386,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,827 | java | package com.example.rites.test2;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.support.v4.content.ContextCompat;
import android.view.View;
class SoundLevel extends View {
private Drawable mGreen;
private Drawable mRed;
private Paint mBackgroundPaint;
private int mHeight;
private int mWidth;
private int mThreshold = 0;
private int mVol = 0;
public SoundLevel(Context context, AttributeSet attrs) {
super(context, attrs);
mGreen = ContextCompat.getDrawable(context, R.drawable.greenbar);
mRed = ContextCompat.getDrawable(context, R.drawable.redbar);
mWidth = mGreen.getIntrinsicWidth();
setMinimumWidth(mWidth*10);
mHeight = mGreen.getIntrinsicHeight();
setMinimumHeight(mHeight);
//Used to paint canvas background color
mBackgroundPaint = new Paint();
mBackgroundPaint.setColor(Color.BLACK);
}
public void setLevel(int volume, int threshold) {
if (volume == mVol && threshold == mThreshold) return;
mVol = volume;
mThreshold = threshold;
// invalidate Call onDraw method and draw voice points
invalidate();
}
@Override
public void onDraw(Canvas canvas) {
canvas.drawPaint(mBackgroundPaint);
for (int i=0; i<= mVol; i++) {
Drawable bar;
if (i< mThreshold)
bar = mGreen;
else
bar = mRed;
bar.setBounds((10-i)*mWidth, 0, (10-i+1)*mWidth, mHeight);
bar.draw(canvas);
}
}
}
| [
"noreply@github.com"
] | Ritesh96Soni.noreply@github.com |
34b08ff7881a844fe2641b39e8ca36c153c8465e | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/gradle--gradle/5046159bfc739c3d86c59411dd4b4a1c36786b81/before/ResolveIvyFactory.java | ceb1b60320542572702122de5634f3cb00aa5087 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,197 | java | /*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.api.internal.artifacts.ivyservice.ivyresolve;
import org.gradle.api.artifacts.cache.ResolutionRules;
import org.gradle.api.artifacts.component.ComponentIdentifier;
import org.gradle.api.internal.artifacts.ComponentMetadataProcessor;
import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory;
import org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal;
import org.gradle.api.internal.artifacts.configurations.dynamicversion.CachePolicy;
import org.gradle.api.internal.artifacts.ivyservice.dynamicversions.ModuleVersionsCache;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleArtifactsCache;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleMetaDataCache;
import org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultComponentSelectionRules;
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository;
import org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver;
import org.gradle.api.internal.component.ArtifactType;
import org.gradle.internal.component.model.ComponentArtifactMetadata;
import org.gradle.internal.component.model.ComponentOverrideMetadata;
import org.gradle.internal.component.model.ComponentResolveMetadata;
import org.gradle.internal.component.model.DependencyMetadata;
import org.gradle.internal.component.model.ModuleSource;
import org.gradle.internal.resolve.resolver.ArtifactResolver;
import org.gradle.internal.resolve.resolver.ComponentMetaDataResolver;
import org.gradle.internal.resolve.resolver.DependencyToComponentIdResolver;
import org.gradle.internal.resolve.resolver.OriginArtifactSelector;
import org.gradle.internal.resolve.result.BuildableArtifactResolveResult;
import org.gradle.internal.resolve.result.BuildableArtifactSetResolveResult;
import org.gradle.internal.resolve.result.BuildableComponentIdResolveResult;
import org.gradle.internal.resolve.result.BuildableComponentResolveResult;
import org.gradle.internal.resource.cached.CachedArtifactIndex;
import org.gradle.util.BuildCommencedTimeProvider;
import java.util.Collection;
public class ResolveIvyFactory {
private final ModuleVersionsCache moduleVersionsCache;
private final ModuleMetaDataCache moduleMetaDataCache;
private final ModuleArtifactsCache moduleArtifactsCache;
private final CachedArtifactIndex artifactAtRepositoryCachedResolutionIndex;
private final StartParameterResolutionOverride startParameterResolutionOverride;
private final BuildCommencedTimeProvider timeProvider;
private final InMemoryCachedRepositoryFactory inMemoryCache;
private final VersionSelectorScheme versionSelectorScheme;
private final VersionComparator versionComparator;
private final ImmutableModuleIdentifierFactory moduleIdentifierFactory;
public ResolveIvyFactory(ModuleVersionsCache moduleVersionsCache, ModuleMetaDataCache moduleMetaDataCache, ModuleArtifactsCache moduleArtifactsCache,
CachedArtifactIndex artifactAtRepositoryCachedResolutionIndex,
StartParameterResolutionOverride startParameterResolutionOverride,
BuildCommencedTimeProvider timeProvider, InMemoryCachedRepositoryFactory inMemoryCache, VersionSelectorScheme versionSelectorScheme,
VersionComparator versionComparator, ImmutableModuleIdentifierFactory moduleIdentifierFactory) {
this.moduleVersionsCache = moduleVersionsCache;
this.moduleMetaDataCache = moduleMetaDataCache;
this.moduleArtifactsCache = moduleArtifactsCache;
this.artifactAtRepositoryCachedResolutionIndex = artifactAtRepositoryCachedResolutionIndex;
this.startParameterResolutionOverride = startParameterResolutionOverride;
this.timeProvider = timeProvider;
this.inMemoryCache = inMemoryCache;
this.versionSelectorScheme = versionSelectorScheme;
this.versionComparator = versionComparator;
this.moduleIdentifierFactory = moduleIdentifierFactory;
}
public ComponentResolvers create(ResolutionStrategyInternal resolutionStrategy,
Collection<? extends ResolutionAwareRepository> repositories,
ComponentMetadataProcessor metadataProcessor) {
if (repositories.isEmpty()) {
return new NoRepositoriesResolver();
}
ResolutionRules resolutionRules = resolutionStrategy.getResolutionRules();
CachePolicy cachePolicy = resolutionStrategy.getCachePolicy();
startParameterResolutionOverride.addResolutionRules(resolutionRules);
UserResolverChain moduleResolver = new UserResolverChain(versionSelectorScheme, versionComparator, resolutionStrategy.getComponentSelection(), moduleIdentifierFactory);
ParentModuleLookupResolver parentModuleResolver = new ParentModuleLookupResolver(versionSelectorScheme, versionComparator, moduleIdentifierFactory);
for (ResolutionAwareRepository repository : repositories) {
ConfiguredModuleComponentRepository baseRepository = repository.createResolver();
if (baseRepository instanceof ExternalResourceResolver) {
((ExternalResourceResolver) baseRepository).setComponentResolvers(parentModuleResolver);
}
ModuleComponentRepository moduleComponentRepository = baseRepository;
if (baseRepository.isLocal()) {
moduleComponentRepository = new LocalModuleComponentRepository(baseRepository, metadataProcessor);
} else {
moduleComponentRepository = startParameterResolutionOverride.overrideModuleVersionRepository(moduleComponentRepository);
moduleComponentRepository = new CachingModuleComponentRepository(moduleComponentRepository, moduleVersionsCache, moduleMetaDataCache, moduleArtifactsCache, artifactAtRepositoryCachedResolutionIndex,
cachePolicy, timeProvider, metadataProcessor, moduleIdentifierFactory);
}
if (baseRepository.isDynamicResolveMode()) {
moduleComponentRepository = IvyDynamicResolveModuleComponentRepositoryAccess.wrap(moduleComponentRepository);
}
moduleComponentRepository = inMemoryCache.cached(moduleComponentRepository);
moduleComponentRepository = new ErrorHandlingModuleComponentRepository(moduleComponentRepository);
moduleResolver.add(moduleComponentRepository);
parentModuleResolver.add(moduleComponentRepository);
}
return moduleResolver;
}
/**
* Provides access to the top-level resolver chain for looking up parent modules when parsing module descriptor files.
*/
private static class ParentModuleLookupResolver implements ComponentResolvers, DependencyToComponentIdResolver, ComponentMetaDataResolver, ArtifactResolver {
private final UserResolverChain delegate;
public ParentModuleLookupResolver(VersionSelectorScheme versionSelectorScheme, VersionComparator versionComparator, ImmutableModuleIdentifierFactory moduleIdentifierFactory) {
this.delegate = new UserResolverChain(versionSelectorScheme, versionComparator, new DefaultComponentSelectionRules(moduleIdentifierFactory), moduleIdentifierFactory);
}
public void add(ModuleComponentRepository moduleComponentRepository) {
delegate.add(moduleComponentRepository);
}
public DependencyToComponentIdResolver getComponentIdResolver() {
return this;
}
public ComponentMetaDataResolver getComponentResolver() {
return this;
}
public ArtifactResolver getArtifactResolver() {
return this;
}
@Override
public OriginArtifactSelector getArtifactSelector() {
throw new UnsupportedOperationException();
}
@Override
public void resolve(final DependencyMetadata dependency, final BuildableComponentIdResolveResult result) {
delegate.getComponentIdResolver().resolve(dependency, result);
}
@Override
public void resolve(final ComponentIdentifier identifier, final ComponentOverrideMetadata componentOverrideMetadata, final BuildableComponentResolveResult result) {
delegate.getComponentResolver().resolve(identifier, componentOverrideMetadata, result);
}
@Override
public boolean isFetchingMetadataCheap(ComponentIdentifier identifier) {
return delegate.getComponentResolver().isFetchingMetadataCheap(identifier);
}
@Override
public void resolveArtifactsWithType(final ComponentResolveMetadata component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
delegate.getArtifactResolver().resolveArtifactsWithType(component, artifactType, result);
}
@Override
public void resolveArtifact(final ComponentArtifactMetadata artifact, final ModuleSource moduleSource, final BuildableArtifactResolveResult result) {
delegate.getArtifactResolver().resolveArtifact(artifact, moduleSource, result);
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
b976cd2a00720c6f9e6a4b6e351e03a916ada7ad | 967502523508f5bb48fdaac93b33e4c4aca20a4b | /aws-java-sdk-simpleworkflow/src/main/java/com/amazonaws/services/simpleworkflow/model/LambdaFunctionCompletedEventAttributes.java | 8fc441d5025050c387bd86e280a7fb8bbadfe7c1 | [
"Apache-2.0",
"JSON"
] | permissive | hanjk1234/aws-sdk-java | 3ac0d8a9bf6f7d9bf1bc5db8e73a441375df10c0 | 07da997c6b05ae068230401921860f5e81086c58 | refs/heads/master | 2021-01-17T18:25:34.913778 | 2015-10-23T03:20:07 | 2015-10-23T03:20:07 | 44,951,249 | 1 | 0 | null | 2015-10-26T06:53:25 | 2015-10-26T06:53:24 | null | UTF-8 | Java | false | false | 8,948 | java | /*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.simpleworkflow.model;
import java.io.Serializable;
/**
* <p>
* Provides details for the <code>LambdaFunctionCompleted</code> event.
* </p>
*/
public class LambdaFunctionCompletedEventAttributes implements Serializable, Cloneable {
/**
* The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*/
private Long scheduledEventId;
/**
* The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*/
private Long startedEventId;
/**
* The result of the function execution (if any).
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>0 - 32768<br/>
*/
private String result;
/**
* The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*
* @return The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*/
public Long getScheduledEventId() {
return scheduledEventId;
}
/**
* The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*
* @param scheduledEventId The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*/
public void setScheduledEventId(Long scheduledEventId) {
this.scheduledEventId = scheduledEventId;
}
/**
* The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param scheduledEventId The ID of the <code>LambdaFunctionScheduled</code> event that was
* recorded when this AWS Lambda function was scheduled. This information
* can be useful for diagnosing problems by tracing back the chain of
* events leading up to this event.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LambdaFunctionCompletedEventAttributes withScheduledEventId(Long scheduledEventId) {
this.scheduledEventId = scheduledEventId;
return this;
}
/**
* The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*
* @return The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*/
public Long getStartedEventId() {
return startedEventId;
}
/**
* The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*
* @param startedEventId The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*/
public void setStartedEventId(Long startedEventId) {
this.startedEventId = startedEventId;
}
/**
* The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param startedEventId The ID of the <code>LambdaFunctionStarted</code> event recorded in the
* history.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LambdaFunctionCompletedEventAttributes withStartedEventId(Long startedEventId) {
this.startedEventId = startedEventId;
return this;
}
/**
* The result of the function execution (if any).
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>0 - 32768<br/>
*
* @return The result of the function execution (if any).
*/
public String getResult() {
return result;
}
/**
* The result of the function execution (if any).
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>0 - 32768<br/>
*
* @param result The result of the function execution (if any).
*/
public void setResult(String result) {
this.result = result;
}
/**
* The result of the function execution (if any).
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>0 - 32768<br/>
*
* @param result The result of the function execution (if any).
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public LambdaFunctionCompletedEventAttributes withResult(String result) {
this.result = result;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getScheduledEventId() != null) sb.append("ScheduledEventId: " + getScheduledEventId() + ",");
if (getStartedEventId() != null) sb.append("StartedEventId: " + getStartedEventId() + ",");
if (getResult() != null) sb.append("Result: " + getResult() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getScheduledEventId() == null) ? 0 : getScheduledEventId().hashCode());
hashCode = prime * hashCode + ((getStartedEventId() == null) ? 0 : getStartedEventId().hashCode());
hashCode = prime * hashCode + ((getResult() == null) ? 0 : getResult().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof LambdaFunctionCompletedEventAttributes == false) return false;
LambdaFunctionCompletedEventAttributes other = (LambdaFunctionCompletedEventAttributes)obj;
if (other.getScheduledEventId() == null ^ this.getScheduledEventId() == null) return false;
if (other.getScheduledEventId() != null && other.getScheduledEventId().equals(this.getScheduledEventId()) == false) return false;
if (other.getStartedEventId() == null ^ this.getStartedEventId() == null) return false;
if (other.getStartedEventId() != null && other.getStartedEventId().equals(this.getStartedEventId()) == false) return false;
if (other.getResult() == null ^ this.getResult() == null) return false;
if (other.getResult() != null && other.getResult().equals(this.getResult()) == false) return false;
return true;
}
@Override
public LambdaFunctionCompletedEventAttributes clone() {
try {
return (LambdaFunctionCompletedEventAttributes) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!",
e);
}
}
}
| [
"aws@amazon.com"
] | aws@amazon.com |
2777684c6571a8c7d1b9e6aed1eecc99dfc145e4 | 160a34361073a54d39ffa14fdae6ce3cbc7d6e6b | /src/main/java/com/alipay/api/response/KoubeiMarketingDataIntelligentIndicatorQueryResponse.java | 587c634acb4cf76c77106eaed1a9e74f6fec817e | [
"Apache-2.0"
] | permissive | appbootup/alipay-sdk-java-all | 6a5e55629b9fc77e61ee82ea2c4cdab2091e0272 | 9ae311632a4053b8e5064b83f97cf1503a00147b | refs/heads/master | 2020-05-01T09:45:44.940180 | 2019-03-15T09:52:14 | 2019-03-15T09:52:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,004 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: koubei.marketing.data.intelligent.indicator.query response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class KoubeiMarketingDataIntelligentIndicatorQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 6142973468815813912L;
/**
* JSONๆ ผๅผๆฐ็ป๏ผๆฏไธชๅฏน่ฑก่กจ็คบไธไธช้จๅบๆไธชๅ
ทไฝๆฅๆ็ๆๆ ไฟกๆฏ๏ผKEYไธบๆๆ ไปฃ็ ๏ผVALUEไธบ่ฏฅๆๆ ๅฏนๅบ็ๅผ,ๅbiz_typeๅ
ฅๅไปฅๅ่ฟๅๅผ็่ฏฆ็ปไฟกๆฏๅ่ง<a href="https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.1AZ2QH&treeId=193&articleId=106028&docType=1">ๅฟซ้ๆฅๅ
ฅ</a>
*/
@ApiField("indicator_infos")
private String indicatorInfos;
public void setIndicatorInfos(String indicatorInfos) {
this.indicatorInfos = indicatorInfos;
}
public String getIndicatorInfos( ) {
return this.indicatorInfos;
}
}
| [
"liuqun.lq@alibaba-inc.com"
] | liuqun.lq@alibaba-inc.com |
64f2076405d4cf2b292277a5d07af4e570e5249f | 72e86a832fc6ac2eba0d42b1740d4c00442f8cea | /src/com/ssm/tsy/bean/TsyOptionsIntegral.java | 538628f56379e4cd7ec7d21e5f45401fe81a997f | [] | no_license | 18838928050/tsy | 93e381add541b9ebae4f6573a99833ece1663bb0 | 0d37acf457482754e2352d8fbb3467201669b95a | refs/heads/master | 2020-05-05T09:51:05.477384 | 2019-04-08T13:56:24 | 2019-04-08T13:56:24 | 179,919,999 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,086 | java | package com.ssm.tsy.bean;
import java.util.Date;
public class TsyOptionsIntegral {
private Integer id;
private Integer integral;
private Integer optionsId;
private Date integralTime;
private Integer integralType;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getIntegral() {
return integral;
}
public void setIntegral(Integer integral) {
this.integral = integral;
}
public Integer getOptionsId() {
return optionsId;
}
public void setOptionsId(Integer optionsId) {
this.optionsId = optionsId;
}
public Date getIntegralTime() {
return integralTime;
}
public void setIntegralTime(Date integralTime) {
this.integralTime = integralTime;
}
public Integer getIntegralType() {
return integralType;
}
public void setIntegralType(Integer integralType) {
this.integralType = integralType;
}
} | [
"18838928050@163.com"
] | 18838928050@163.com |
6137a6e444de616649509fe46e2e2c75610b0e84 | f17e89bfa1823c8697c4ddafdce91bd2ce5e8ced | /java/src/main/java/com/google/crypto/tink/CryptoFormat.java | 4f6d4059cc5b0389b22025cade42f2334513129f | [
"Apache-2.0"
] | permissive | vexille88/tink | b4a039390f8d41648e29bf64b0df9db8416a1c2f | 8895658a14a85763ba76818d6e7433bd52b147fb | refs/heads/master | 2020-03-27T20:09:45.865851 | 2020-02-17T11:41:02 | 2020-02-17T11:41:02 | 147,044,170 | 0 | 0 | null | 2018-09-02T01:10:23 | 2018-09-02T01:10:22 | null | UTF-8 | Java | false | false | 2,812 | java | // Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
package com.google.crypto.tink;
import com.google.crypto.tink.proto.Keyset.Key;
import java.nio.ByteBuffer;
import java.security.GeneralSecurityException;
/**
* Constants and convenience methods that deal with crypto format.
*
* @since 1.0.0
*/
public final class CryptoFormat {
/** Prefix size of Tink and Legacy key types. */
public static final int NON_RAW_PREFIX_SIZE = 5;
/** Legacy or Crunchy prefix starts with \x00 and followed by a 4-byte key id. */
public static final int LEGACY_PREFIX_SIZE = NON_RAW_PREFIX_SIZE;
public static final byte LEGACY_START_BYTE = (byte) 0;
/** Tink prefix starts with \x01 and followed by a 4-byte key id. */
public static final int TINK_PREFIX_SIZE = NON_RAW_PREFIX_SIZE;
public static final byte TINK_START_BYTE = (byte) 1;
/** Raw prefix is empty. */
public static final int RAW_PREFIX_SIZE = 0;
public static final byte[] RAW_PREFIX = new byte[0];
/**
* Generates the prefix of all cryptographic outputs (ciphertexts, signatures, MACs, ...) produced
* by the specified {@code key}. The prefix can be either empty (for RAW-type prefix), or consists
* of a 1-byte indicator of the type of the prefix, followed by 4 bytes of {@code key.key_id} in
* Big Endian encoding.
*
* @throws GeneralSecurityException if the prefix type of {@code key} is unknown.
* @return a prefix.
*/
public static byte[] getOutputPrefix(Key key) throws GeneralSecurityException {
switch (key.getOutputPrefixType()) {
case LEGACY: // fall through
case CRUNCHY:
return ByteBuffer.allocate(LEGACY_PREFIX_SIZE) // BIG_ENDIAN by default
.put(LEGACY_START_BYTE)
.putInt(key.getKeyId())
.array();
case TINK:
return ByteBuffer.allocate(TINK_PREFIX_SIZE) // BIG_ENDIAN by default
.put(TINK_START_BYTE)
.putInt(key.getKeyId())
.array();
case RAW:
return RAW_PREFIX;
default:
throw new GeneralSecurityException("unknown output prefix type");
}
}
}
| [
"kovner@163.com"
] | kovner@163.com |
83fcc01f0534c1b65e631ff41998fee88675c553 | f74b79b8907aa85d526807fbcc812e902cbe9e53 | /src/main/java/com/codeup/blogreview/models/PostCategory.java | 9124fef74c6574c123460e17aa0a63ec2322c059 | [] | no_license | Delabove/adlister-spring | 0e6f16d385246433c54e9a9e67d4e3fe8a4ccab3 | a279e2f275a450de8bc40b11eed8cd0cc6786b4b | refs/heads/master | 2022-11-27T12:12:33.530802 | 2020-08-10T04:15:12 | 2020-08-10T04:15:12 | 274,156,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,048 | java | package com.codeup.blogreview.models;
import javax.persistence.*;
import java.util.List;
@Entity
@Table(name="categories")
public class PostCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(nullable=false)
private String name;
@ManyToMany(mappedBy = "categories")
private List<Post> posts;
public PostCategory(){}
public PostCategory(String name,List<Post>posts){
this.name = name;
this.posts = posts;
}
public PostCategory(long id,String name, List<Post>posts){
this.id = id;
this.name = name;
this.posts = posts;
}
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 List<Post> getPosts() {
return posts;
}
public void setPosts(List<Post> posts) {
this.posts = posts;
}
} | [
"delayne.labove@gmail.com"
] | delayne.labove@gmail.com |
ac086c3930d875aa9a5d7bfda3733dff33d91e53 | fd08dee9112d5955910a6c6daf44dd51d5161ea8 | /src/main/java/com/zoo/ExamplesCollectionsArrayList.java | 320649d3104540065eac5f71912a4666a1bad75b | [] | no_license | networkdanik/zoo | 5fae6d28e738ca9651d9ae3af80a3463c65472de | 14b91d54fda8080dff7e5f4dc7c882b16eb54601 | refs/heads/master | 2016-08-09T16:38:29.554888 | 2016-01-15T20:45:49 | 2016-01-15T20:45:49 | 49,580,543 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.zoo;
/**
* Created by networkdanik on 1/15/16.
*/
public class ExamplesCollectionsArrayList {
final static String[] WEEKDAY ={"MON", "WEM", "TUE", "THU", "FRI", "SAT", "SUN"};
public static void main(String[] args) {
int i = 0;
for (String day : WEEKDAY){
System.out.println(day + " " + "is number under" + " " + i);
i++;
}
}
}
| [
"networkdanik@gmail.com"
] | networkdanik@gmail.com |
ddfd5f5c9e77dcf521331ea148208579190b7751 | 04c629aeb46dcc1d8353c82128360bd6cfa719ed | /src/main/java/algorithms/sort/MergeSort.java | 2cc6b480d53dc18d1da7011adacf7fbdbb4fd23a | [] | no_license | negarkiran/data_structures_algorithms | 45c473f987c86f15a587c06851604517af823920 | 6600b9da5c762c368941fc21d69ad0c7d2f03b4e | refs/heads/master | 2023-08-10T00:38:11.568973 | 2023-07-30T11:10:49 | 2023-07-30T11:10:49 | 277,276,455 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,420 | java | package algorithms.sort;
public class MergeSort {
public void sort(int[] arr, int l, int r) {
if (l < r) {
int m = (l + r) / 2;
//sort first and second halves
sort(arr, l, m);
sort(arr, m + 1, r);
//merge the sorted halves
merge(arr, l, m, r);
}
}
private void merge(int[] arr, int l, int m, int r) {
//find size of 2 sub arrays
int n1 = m - l + 1;
int n2 = r - m;
//create 2 temp arrays
int[] L = new int[n1];
int[] R = new int[n2];
//Copy data to temp arrays
for (int i = 0; i < n1; ++i) {
L[i] = arr[l + i];
}
for (int j = 0; j < n2; ++j) {
R[j] = arr[m + 1 + j];
}
//Merge the 2 arrays
int i = 0, j = 0;
//Initial index of merged sub array
int k = l;
while (i < n1 && j < n2) {
//choose smaller element first
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
} else {
arr[k] = R[j];
j++;
}
k++;
}
//Copy remaining values
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
}
| [
"khegde@equalexperts.com"
] | khegde@equalexperts.com |
879cf4e2d7f840a592262c82bd5652ceee21eca5 | 0cb670d2ecd589ad1fb6a9ac03b627b964d2523f | /src/org/snailysis/model/entities/snail/InitialTrajectory.java | a9f98afc552e272a0bc096afce56d4b55306f4e8 | [] | no_license | mazzio97/Snailysis | bdc814be2214cbf01ae916db6d9931e1cf903ed2 | 6be33428c87adb6cd4d4ef93eaafa54955307b8e | refs/heads/master | 2021-03-15T22:27:41.383156 | 2020-03-12T16:33:26 | 2020-03-12T16:34:18 | 246,882,713 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,549 | java | package org.snailysis.model.entities.snail;
import static org.snailysis.model.Dimension.PLANE_HEIGHT;
import org.snailysis.model.entities.function.Function2D;
import org.snailysis.model.entities.function.Functions;
/**
* Enums for snail's initial trajectories.
*/
public enum InitialTrajectory {
/**
* Constant function: f(x) = 0.
*/
CONSTANT(Functions.constant(0), 0, "0"),
/**
* Positive linear x: f(x) = x.
*/
POSITIVE_LINEAR_X(Functions.polynomial(1, 1), -PLANE_HEIGHT.get() / 2, "x"),
/**
* Negative linear x: f(x) = -x.
*/
NEGATIVE_LINEAR_X(Functions.polynomial(-1, 1), PLANE_HEIGHT.get() / 2, "-x"),
/**
* Positive linear 2x: f(x) = 2x.
*/
POSITIVE_DOUBLE_X(Functions.polynomial(2, 1), -PLANE_HEIGHT.get() / 2, "2x"),
/**
* Negative linear 2x: f(x) = -2x.
*/
NEGATIVE_DOUBLED_X(Functions.polynomial(-2, 1), PLANE_HEIGHT.get() / 2, "-2x"),
/**
* Positive squared x: f(x) = x^2.
*/
POSITIVE_SQUARED_X(Functions.polynomial(1, 2), -PLANE_HEIGHT.get() / 2, "xยฒ"),
/**
* Negative squared x: f(x) = -x^2.
*/
NEGATIVE_SQUARED_X(Functions.polynomial(-1, 2), PLANE_HEIGHT.get() / 2, "-xยฒ"),
/**
* High concavity squared function: f(x) = x^2 - 2x + 1.
*/
HIGH_CONCAVITY_PARABOLA(Functions.polynomial(1, 1).translateOnY(-1).powerOnY(2), 0, "(x - 1)ยฒ"),
/**
* Low concavity squared function: f(x) = -x^2 + 2x - 1.
*/
LOW_CONCAVITY_PARABOLA(Functions.polynomial(1, 1).translateOnY(-1).powerOnY(2).opposeOnY(), 0, "-(x - 1)ยฒ");
private static final double TRANSLATION_SCALE = 0.8;
private static final double TRANSLATION_ORIGIN = PLANE_HEIGHT.get() / 2;
private final Function2D function;
private final double yTranslation;
private final String text;
InitialTrajectory(final Function2D function, final double yTranslation, final String text) {
this.function = function;
this.yTranslation = yTranslation;
this.text = text;
}
/**
* Gets the initial trajectory.
*
* @return
* the initial trajectory
*/
public Function2D getTrajectory() {
return function;
}
/**
* Gets the y initial translation.
*
* @return
* the y initial translation
*/
public double getTranslationY() {
return yTranslation * TRANSLATION_SCALE + TRANSLATION_ORIGIN;
}
@Override
public String toString() {
return "f(x) = " + text;
}
}
| [
"diego.maz97@gmail.com"
] | diego.maz97@gmail.com |
22d3bf3d209b2b7eef59bfad35a32558d24dcca6 | cf7f056fa29a57f0c55d9d6fe9f1fbcfd846e7f5 | /ModelBuilder/ui/src/main/java/de/hsos/richwps/mb/ui/ComponentIconClickProxy.java | 92da8ed9675f75c3adb9f6cfcf668fc84189408c | [] | no_license | richwps/modelbuilder | 640aaa187287773e154b0d6dbc029840bd58c328 | 2ca405700468a8dd1953246dfd77f835a66af56c | refs/heads/master | 2020-05-31T09:30:44.782158 | 2015-03-25T09:21:45 | 2015-03-25T09:21:45 | 23,955,813 | 0 | 0 | null | 2014-10-16T10:02:35 | 2014-09-12T10:06:50 | Java | UTF-8 | Java | false | false | 4,022 | java | package de.hsos.richwps.mb.ui;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.LinkedList;
import java.util.List;
import javax.swing.Icon;
/**
* Delegates mouse events to listeners if a event occured inside the icon of a
* component. Use (add) this proxy instead of the icon, it does the icon
* rendering.
*
* @author dziegenh
*/
public class ComponentIconClickProxy implements Icon {
private static enum EVENT_TYPE {
CLICKED, ENTERED, EXITED, PRESSED, RELEASED
}
private final Component component;
private Icon icon;
protected List<MouseListener> mouseListener = new LinkedList<>();
private Point iconPos;
public ComponentIconClickProxy(Component component, final Icon icon) {
super();
this.icon = icon;
this.component = component;
// delegates the mouse event if a click occured inside the icon bounds
component.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
fireMouseEventIfInsideIcon(EVENT_TYPE.CLICKED, e);
}
@Override
public void mouseEntered(MouseEvent e) {
fireMouseEventIfInsideIcon(EVENT_TYPE.ENTERED, e);
}
@Override
public void mouseExited(MouseEvent e) {
fireMouseEventIfInsideIcon(EVENT_TYPE.EXITED, e);
}
@Override
public void mousePressed(MouseEvent e) {
fireMouseEventIfInsideIcon(EVENT_TYPE.PRESSED, e);
}
@Override
public void mouseReleased(MouseEvent e) {
fireMouseEventIfInsideIcon(EVENT_TYPE.RELEASED, e);
}
});
}
private void fireMouseEventIfInsideIcon(EVENT_TYPE eventType, MouseEvent e) {
if (null == iconPos) {
return;
}
if (e.getX() >= iconPos.x
&& e.getY() >= iconPos.y
&& e.getX() <= iconPos.x + icon.getIconWidth()
&& e.getY() <= iconPos.y + icon.getIconHeight()) {
fireMouseEvent(eventType, e);
}
}
public void setIcon(Icon icon) {
this.icon = icon;
this.iconPos = null;
component.invalidate();
component.repaint();
}
private void fireMouseEvent(EVENT_TYPE eventType, MouseEvent e) {
for (MouseListener listener : mouseListener) {
switch (eventType) {
case CLICKED:
listener.mouseClicked(e);
break;
case ENTERED:
listener.mouseEntered(e);
break;
case EXITED:
listener.mouseExited(e);
break;
case PRESSED:
listener.mousePressed(e);
break;
case RELEASED:
listener.mouseReleased(e);
break;
}
}
}
public void addMouseListener(MouseListener listener) {
mouseListener.add(listener);
}
public boolean removeMouseListener(MouseListener listener) {
return mouseListener.remove(listener);
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
getIconPos().setLocation(x, y);
icon.paintIcon(c, g, x, y);
}
private Point getIconPos() {
if (null == iconPos) {
iconPos = new Point();
}
return iconPos;
}
@Override
public int getIconWidth() {
return icon.getIconWidth();
}
@Override
public int getIconHeight() {
return icon.getIconHeight();
}
}
| [
"dennis.ziegenhagen@hs-osnabrueck.de"
] | dennis.ziegenhagen@hs-osnabrueck.de |
b5672e6863d8e30ad401da17b7fe2a4fe854a4fe | b4b0123818d6ccbc3502b1c60f56e192e00d4a08 | /eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/work/Catalina/localhost/ROOT/org/apache/jsp/WEB_002dINF/jsp/popup/cmmn/WCMP006_jsp.java | 72a0236143dff163f10630a6af72d893e98d5f72 | [] | no_license | buenaonda-chile/xwork | 79bbe94b121cef3162b09ccd636112dfdaf9e301 | f40ad9514e9eb6233cb24dd2195a21c5ea24c3c0 | refs/heads/master | 2023-06-27T11:42:16.903365 | 2021-06-29T08:37:40 | 2021-06-29T08:37:40 | 373,340,596 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 105,093 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/8.0.21
* Generated at: 2021-05-11 01:46:35 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.jsp.popup.cmmn;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.globaldenso.ai.miyabi.constant.Globals;
public final class WCMP006_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent,
org.apache.jasper.runtime.JspSourceImports {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
static {
_jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(22);
_jspx_dependants.put("/WEB-INF/jsp/base/prelude.jsp", Long.valueOf(1620624368808L));
_jspx_dependants.put("/WEB-INF/kendoui.tld", Long.valueOf(1620624375454L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/c-1_0-rt.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/fmt.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/x-1_0-rt.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/sql.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/c.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/x.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("/WEB-INF/lib/spring-security-taglibs-4.0.3.RELEASE.jar", Long.valueOf(1620624375703L));
_jspx_dependants.put("/WEB-INF/tld/ai.tld", Long.valueOf(1620624375766L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/tiles-jsp-3.0.5.jar!/META-INF/tld/tiles-extras-jsp.tld", Long.valueOf(1411309930000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/sql-1_0-rt.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/spring-webmvc-4.2.6.RELEASE.jar!/META-INF/spring.tld", Long.valueOf(1462487332000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/spring-security-taglibs-4.0.3.RELEASE.jar!/META-INF/security.tld", Long.valueOf(1446175026000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/spring-webmvc-4.2.6.RELEASE.jar!/META-INF/spring-form.tld", Long.valueOf(1462487332000L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/fmt-1_0-rt.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("/WEB-INF/lib/tiles-jsp-3.0.5.jar", Long.valueOf(1620624375724L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/jstl-1.2.jar!/META-INF/fn.tld", Long.valueOf(1153352682000L));
_jspx_dependants.put("/WEB-INF/lib/spring-webmvc-4.2.6.RELEASE.jar", Long.valueOf(1620624375712L));
_jspx_dependants.put("/WEB-INF/lib/jstl-1.2.jar", Long.valueOf(1620624375587L));
_jspx_dependants.put("/WEB-INF/jsp/base/coda.jsp", Long.valueOf(1620624368783L));
_jspx_dependants.put("jar:file:/C:/Users/user/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/DNKR-repair/WEB-INF/lib/tiles-jsp-3.0.5.jar!/META-INF/tld/tiles-jsp.tld", Long.valueOf(1411309930000L));
}
private static final java.util.Set<java.lang.String> _jspx_imports_packages;
private static final java.util.Set<java.lang.String> _jspx_imports_classes;
static {
_jspx_imports_packages = new java.util.HashSet<>();
_jspx_imports_packages.add("javax.servlet");
_jspx_imports_packages.add("javax.servlet.http");
_jspx_imports_packages.add("javax.servlet.jsp");
_jspx_imports_classes = new java.util.HashSet<>();
_jspx_imports_classes.add("com.globaldenso.ai.miyabi.constant.Globals");
}
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdataSource;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public java.util.Set<java.lang.String> getPackageImports() {
return _jspx_imports_packages;
}
public java.util.Set<java.lang.String> getClassImports() {
return _jspx_imports_classes;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdataSource = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody.release();
_005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.release();
_005fjspx_005ftagPool_005fkendo_005fdataSource.release();
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.release();
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.release();
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.release();
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.release();
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final java.lang.String _jspx_method = request.getMethod();
if (!"GET".equals(_jspx_method) && !"POST".equals(_jspx_method) && !"HEAD".equals(_jspx_method) && !javax.servlet.DispatcherType.ERROR.equals(request.getDispatcherType())) {
response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "JSPs only permit GET POST or HEAD");
return;
}
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
if (_jspx_meth_ai_005fcontextInfo_005f0(_jspx_page_context))
return;
if (_jspx_meth_fmt_005fsetLocale_005f0(_jspx_page_context))
return;
if (_jspx_meth_c_005furl_005f0(_jspx_page_context))
return;
if (_jspx_meth_c_005furl_005f1(_jspx_page_context))
return;
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_005fset_005f0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_005fset_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fset_005f0.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(8,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setVar("screenId");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(8,0) name = value type = javax.el.ValueExpression reqTime = true required = false fragment = false deferredValue = true expectedTypeName = java.lang.Object deferredMethod = false methodSignature = null
_jspx_th_c_005fset_005f0.setValue( request.getAttribute(Globals.SCREEN_ID_KEY) );
int _jspx_eval_c_005fset_005f0 = _jspx_th_c_005fset_005f0.doStartTag();
if (_jspx_th_c_005fset_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
return;
}
_005fjspx_005ftagPool_005fc_005fset_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005fset_005f0);
out.write("<h2>์ฐจ์ข
๊ฒ์</h2>\r\n");
out.write("<a onclick=\"_isDirty=false;window.close();return false;\" class=\"close ckd_close\">์ฐฝ๋ซ๊ธฐ</a>\r\n");
out.write("<div class=\"popup_body\">\r\n");
out.write("\r\n");
out.write(" <div class=\"search1\">\r\n");
out.write(" <form id=\"frm_search\" method=\"get\" data-bind=\"events: {submit: submit}\">\r\n");
out.write(" <fieldset>\r\n");
out.write(" <table>\r\n");
out.write(" <col style=\"width:65px\"/>\r\n");
out.write(" <col style=\"width:85px\"/>\r\n");
out.write(" <col style=\"width:65px\"/>\r\n");
out.write(" <col style=\"width:85px\"/>\r\n");
out.write(" <col style=\"width:65px\"/>\r\n");
out.write(" <col style=\"width:85px\"/>\r\n");
out.write(" <col style=\"width:65px\"/>\r\n");
out.write(" <col style=\"width:120px\"/>\r\n");
out.write(" <col style=\"width:65px\"/>\r\n");
out.write(" <col style=\"width:140px\"/>\r\n");
out.write(" <col/>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>์น์์ฉ</th>\r\n");
out.write(" <td>\r\n");
out.write(" ");
if (_jspx_meth_kendo_005fdropDownList_005f0(_jspx_page_context))
return;
out.write("</td>\r\n");
out.write(" <th>๋ฉ์ด์ปค</th>\r\n");
out.write(" <td>\r\n");
out.write(" ");
if (_jspx_meth_kendo_005fdropDownList_005f1(_jspx_page_context))
return;
out.write("</td>\r\n");
out.write(" <th>๋ฐฐ๊ธฐํ์</th>\r\n");
out.write(" <td>\r\n");
out.write(" ");
if (_jspx_meth_kendo_005fdropDownList_005f2(_jspx_page_context))
return;
out.write("</td>\r\n");
out.write(" <th>์์ง๋ช
</th>\r\n");
out.write(" <td>\r\n");
out.write(" ");
if (_jspx_meth_kendo_005fdropDownList_005f3(_jspx_page_context))
return;
out.write("</td>\r\n");
out.write(" <th>์ฐจ์ข
</th>\r\n");
out.write(" <td>\r\n");
out.write(" <input type=\"text\" id=\"text_model\" data-bind=\"value: criteria.model\" />\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <button type=\"submit\" value=\"submit\" class=\"button\"><i class=\"w_search\"></i>๊ฒ์\r\n");
out.write(" </button>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table>\r\n");
out.write(" </fieldset>\r\n");
out.write(" </form>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write(" <div id=\"grid\" data-grid-type=\"view\"></div>\r\n");
out.write("\r\n");
out.write("</div>\r\n");
out.write("\r\n");
out.write("<script type=\"text/javascript\">\r\n");
out.write("\r\n");
out.write(" var _dicasPage = new DicasPage('");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${screenId}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("');\r\n");
out.write(" var _openerPage = window.opener._dicasPage;\r\n");
out.write("\r\n");
out.write(" ");
out.write("\r\n");
out.write(" var grid;\r\n");
out.write(" var pagination;\r\n");
out.write(" var net;\r\n");
out.write(" ");
out.write("\r\n");
out.write("\r\n");
out.write(" var modelsMdl = kendo.data.Model.define({\r\n");
out.write(" id: \"id\",\r\n");
out.write(" fields: {\r\n");
out.write(" id: { type: \"string\" },\r\n");
out.write(" tireStd: { type: \"string\" },\r\n");
out.write(" maker: { type: \"string\" },\r\n");
out.write(" exhaustReg: { type: \"string\" },\r\n");
out.write(" engineType: { type: \"string\" },\r\n");
out.write(" model: { type: \"string\" }\r\n");
out.write(" }\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write(" var searchView = kendo.observable({\r\n");
out.write(" criteria: {\r\n");
out.write(" tireStd: null,\r\n");
out.write(" maker: null,\r\n");
out.write(" exhaustReg: null,\r\n");
out.write(" engineType: null,\r\n");
out.write(" model: null,\r\n");
out.write(" },\r\n");
out.write(" submit: function () {\r\n");
out.write(" goPage('grid1', 1);\r\n");
out.write(" return false;\r\n");
out.write(" },\r\n");
out.write(" });\r\n");
out.write(" kendo.bind($(\"#frm_search\"), searchView)\r\n");
out.write("\r\n");
out.write(" function goPage(gridId, page) {\r\n");
out.write(" if (gridId == \"grid1\") {\r\n");
out.write(" net.readData(1, searchView.criteria.toJSON(), true);\r\n");
out.write(" }\r\n");
out.write(" }\r\n");
out.write("\r\n");
out.write(" var _isDirty = false;\r\n");
out.write(" if (this.addEventListener) {\r\n");
out.write(" this.addEventListener('beforeunload', function () {\r\n");
out.write(" if (!_isDirty) _openerPage.codeHelpVal = null;\r\n");
out.write(" });\r\n");
out.write(" } else {\r\n");
out.write(" this.attachEvent('onbeforeunload', function () {\r\n");
out.write(" if (!_isDirty) _openerPage.codeHelpVal = null;\r\n");
out.write(" });\r\n");
out.write(" }\r\n");
out.write("\r\n");
out.write(" function convertUndefined(str) {\r\n");
out.write(" if (str == \"undefined\" || str == \"\" || str == \"null\") {\r\n");
out.write(" return null;\r\n");
out.write(" } else {\r\n");
out.write(" return str;\r\n");
out.write(" }\r\n");
out.write(" }\r\n");
out.write("\r\n");
out.write(" $(document).ready(function() {\r\n");
out.write("\r\n");
out.write(" var data = new modelsMdl({\r\n");
out.write(" tireStd: convertUndefined(\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${modelsForm.tireStd}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"),\r\n");
out.write(" maker: convertUndefined(\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${modelsForm.maker}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"),\r\n");
out.write(" exhaustReg: convertUndefined(\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${modelsForm.exhaustReg}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"),\r\n");
out.write(" engineType: convertUndefined(\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${modelsForm.engineType}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\"),\r\n");
out.write(" model: convertUndefined(\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${modelsForm.model}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("\")\r\n");
out.write(" });\r\n");
out.write(" searchView.set('criteria', data);\r\n");
out.write("\r\n");
out.write(" tui.Grid.applyTheme('clean');\r\n");
out.write(" grid = new tui.Grid({\r\n");
out.write(" el: $('#grid'),\r\n");
out.write(" scrollX: false,\r\n");
out.write(" scrollY: true,\r\n");
out.write(" rowHeight: 30,\r\n");
out.write(" showDummyRows: true,\r\n");
out.write(" minBodyHeight: 30,\r\n");
out.write(" bodyHeight: 280,\r\n");
out.write(" pagination: true,\r\n");
out.write(" selectionUnit: 'CELL',\r\n");
out.write(" editingEvent: false,\r\n");
out.write(" usageStatistics: false,\r\n");
out.write(" columns: [\r\n");
out.write("\r\n");
out.write(" { title: 'No', name: 'rn', align: 'center' }\r\n");
out.write(" ,{ title: '์ฐจ์ข
', name: 'model', align: 'center' }\r\n");
out.write(" ,{ title: '๋ฐฐ๊ธฐํ์', name: 'exhaustRegNm', align: 'center' }\r\n");
out.write(" ,{ title: '์์ง๋ช
', name: 'engineTypeNm', align: 'center' }\r\n");
out.write("\r\n");
out.write(" ]\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write(" grid.use('Net', {\r\n");
out.write(" el: $('#frm_input'),\r\n");
out.write(" initialRequest: false,\r\n");
out.write(" readDataMethod: 'GET',\r\n");
out.write(" perPage: 25,\r\n");
out.write(" enableAjaxHistory: false,\r\n");
out.write(" api: {\r\n");
out.write(" 'readData': '");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${readUrl}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
out.write("',\r\n");
out.write(" }\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write(" // Bind event handlers\r\n");
out.write(" grid.on('beforeRequest', function (data) {\r\n");
out.write(" // For all requests\r\n");
out.write(" _dicasPage.maskOpen();\r\n");
out.write(" }).on('response', function (data) {\r\n");
out.write(" // For all response (regardless of success or failure)\r\n");
out.write(" _dicasPage.maskClose();\r\n");
out.write(" }).on('successResponse', function (data) {\r\n");
out.write(" }).on('failResponse', function (data) {\r\n");
out.write(" }).on('errorResponse', function (data) {\r\n");
out.write(" }).on('dblclick', function (eventData) {\r\n");
out.write(" _openerPage.codeHelpVal = JSON.stringify(this.getRow(eventData.rowKey));\r\n");
out.write(" _isDirty = true;\r\n");
out.write(" window.close();\r\n");
out.write(" }).on('focusChange', function (eventData) {\r\n");
out.write(" _isDirty = false;\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write(" net = grid.getAddOn('Net');\r\n");
out.write(" pagination = grid.getPagination();\r\n");
out.write(" pagination.on('afterMove', function (eventData) {\r\n");
out.write(" if (grid.getRowCount() > 0)\r\n");
out.write(" grid.focusAt(0, 0);\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write(" searchView.submit();\r\n");
out.write("\r\n");
out.write(" });\r\n");
out.write("\r\n");
out.write("</script>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_ai_005fcontextInfo_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// ai:contextInfo
com.globaldenso.ai.miyabi.customtag.ContextInfoTag _jspx_th_ai_005fcontextInfo_005f0 = (com.globaldenso.ai.miyabi.customtag.ContextInfoTag) _005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody.get(com.globaldenso.ai.miyabi.customtag.ContextInfoTag.class);
_jspx_th_ai_005fcontextInfo_005f0.setPageContext(_jspx_page_context);
_jspx_th_ai_005fcontextInfo_005f0.setParent(null);
// /WEB-INF/jsp/base/prelude.jsp(54,0) name = key type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_ai_005fcontextInfo_005f0.setKey("locale");
// /WEB-INF/jsp/base/prelude.jsp(54,0) name = varname type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_ai_005fcontextInfo_005f0.setVarname("dclocale");
int _jspx_eval_ai_005fcontextInfo_005f0 = _jspx_th_ai_005fcontextInfo_005f0.doStartTag();
if (_jspx_th_ai_005fcontextInfo_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody.reuse(_jspx_th_ai_005fcontextInfo_005f0);
return true;
}
_005fjspx_005ftagPool_005fai_005fcontextInfo_0026_005fvarname_005fkey_005fnobody.reuse(_jspx_th_ai_005fcontextInfo_005f0);
return false;
}
private boolean _jspx_meth_fmt_005fsetLocale_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// fmt:setLocale
org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag _jspx_th_fmt_005fsetLocale_005f0 = (org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag) _005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag.class);
_jspx_th_fmt_005fsetLocale_005f0.setPageContext(_jspx_page_context);
_jspx_th_fmt_005fsetLocale_005f0.setParent(null);
// /WEB-INF/jsp/base/prelude.jsp(55,0) name = value type = null reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_fmt_005fsetLocale_005f0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${dclocale}", java.lang.Object.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
int _jspx_eval_fmt_005fsetLocale_005f0 = _jspx_th_fmt_005fsetLocale_005f0.doStartTag();
if (_jspx_th_fmt_005fsetLocale_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fsetLocale_005f0);
return true;
}
_005fjspx_005ftagPool_005ffmt_005fsetLocale_0026_005fvalue_005fnobody.reuse(_jspx_th_fmt_005fsetLocale_005f0);
return false;
}
private boolean _jspx_meth_c_005furl_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:url
org.apache.taglibs.standard.tag.rt.core.UrlTag _jspx_th_c_005furl_005f0 = (org.apache.taglibs.standard.tag.rt.core.UrlTag) _005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.UrlTag.class);
_jspx_th_c_005furl_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005furl_005f0.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(3,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f0.setVar("codeUrl");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(3,0) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f0.setValue("/code/list.json");
int _jspx_eval_c_005furl_005f0 = _jspx_th_c_005furl_005f0.doStartTag();
if (_jspx_th_c_005furl_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f0);
return true;
}
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f0);
return false;
}
private boolean _jspx_meth_c_005furl_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// c:url
org.apache.taglibs.standard.tag.rt.core.UrlTag _jspx_th_c_005furl_005f1 = (org.apache.taglibs.standard.tag.rt.core.UrlTag) _005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.get(org.apache.taglibs.standard.tag.rt.core.UrlTag.class);
_jspx_th_c_005furl_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005furl_005f1.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(5,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f1.setVar("readUrl");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(5,0) name = value type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005furl_005f1.setValue("/models/search");
int _jspx_eval_c_005furl_005f1 = _jspx_th_c_005furl_005f1.doStartTag();
if (_jspx_th_c_005furl_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f1);
return true;
}
_005fjspx_005ftagPool_005fc_005furl_0026_005fvar_005fvalue_005fnobody.reuse(_jspx_th_c_005furl_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdropDownList_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dropDownList
com.kendoui.taglib.DropDownListTag _jspx_th_kendo_005fdropDownList_005f0 = (com.kendoui.taglib.DropDownListTag) _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.get(com.kendoui.taglib.DropDownListTag.class);
_jspx_th_kendo_005fdropDownList_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdropDownList_005f0.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) name = name type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f0.setName("cmb_tireStd_search");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) name = dataTextField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f0.setDataTextField("codeNm");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) null
_jspx_th_kendo_005fdropDownList_005f0.setDynamicAttribute(null, "data-value-primitive", "true");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) name = dataValueField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f0.setDataValueField("codeCd");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) null
_jspx_th_kendo_005fdropDownList_005f0.setDynamicAttribute(null, "data-bind", "value: criteria.tireStd");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) name = optionLabel type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f0.setOptionLabel("์ ์ฒด");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(32,28) null
_jspx_th_kendo_005fdropDownList_005f0.setDynamicAttribute(null, "style", "width: 100%;");
int _jspx_eval_kendo_005fdropDownList_005f0 = _jspx_th_kendo_005fdropDownList_005f0.doStartTag();
if (_jspx_eval_kendo_005fdropDownList_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdropDownList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdropDownList_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdropDownList_005f0.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_005f0(_jspx_th_kendo_005fdropDownList_005f0, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdropDownList_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdropDownList_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdropDownList_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdropDownList_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource
com.kendoui.taglib.DataSourceTag _jspx_th_kendo_005fdataSource_005f0 = (com.kendoui.taglib.DataSourceTag) _005fjspx_005ftagPool_005fkendo_005fdataSource.get(com.kendoui.taglib.DataSourceTag.class);
_jspx_th_kendo_005fdataSource_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdropDownList_005f0);
int _jspx_eval_kendo_005fdataSource_005f0 = _jspx_th_kendo_005fdataSource_005f0.doStartTag();
if (_jspx_eval_kendo_005fdataSource_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_005f0.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_005f0(_jspx_th_kendo_005fdataSource_005f0, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dschema_005f0(_jspx_th_kendo_005fdataSource_005f0, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport
com.kendoui.taglib.datasource.TransportTag _jspx_th_kendo_005fdataSource_002dtransport_005f0 = (com.kendoui.taglib.datasource.TransportTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.get(com.kendoui.taglib.datasource.TransportTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f0);
int _jspx_eval_kendo_005fdataSource_002dtransport_005f0 = _jspx_th_kendo_005fdataSource_002dtransport_005f0.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_005f0.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f0(_jspx_th_kendo_005fdataSource_002dtransport_005f0, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f0(_jspx_th_kendo_005fdataSource_002dtransport_005f0, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-read
com.kendoui.taglib.datasource.TransportReadTag _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0 = (com.kendoui.taglib.datasource.TransportReadTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.get(com.kendoui.taglib.datasource.TransportReadTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f0);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(39,40) name = url type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.setUrl((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${codeUrl}/CAUTY", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(39,40) name = type type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.setType("POST");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(39,40) name = contentType type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.setContentType("application/json");
int _jspx_eval_kendo_005fdataSource_002dtransport_002dread_005f0 = _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.doStartTag();
if (_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-parameterMap
com.kendoui.taglib.datasource.TransportParameterMapFunctionTag _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0 = (com.kendoui.taglib.datasource.TransportParameterMapFunctionTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.get(com.kendoui.taglib.datasource.TransportParameterMapFunctionTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f0);
int _jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f0 = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write(" function(options){\r\n");
out.write(" return JSON.stringify(options);\r\n");
out.write(" }\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dschema_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-schema
com.kendoui.taglib.datasource.SchemaTag _jspx_th_kendo_005fdataSource_002dschema_005f0 = (com.kendoui.taglib.datasource.SchemaTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.get(com.kendoui.taglib.datasource.SchemaTag.class);
_jspx_th_kendo_005fdataSource_002dschema_005f0.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dschema_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f0);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(46,36) name = data type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f0.setData("data");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(46,36) name = total type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f0.setTotal("total");
int _jspx_eval_kendo_005fdataSource_002dschema_005f0 = _jspx_th_kendo_005fdataSource_002dschema_005f0.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dschema_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dschema_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dschema_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dschema_005f0.doInitBody();
}
do {
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dschema_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dschema_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dschema_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f0);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f0);
return false;
}
private boolean _jspx_meth_kendo_005fdropDownList_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dropDownList
com.kendoui.taglib.DropDownListTag _jspx_th_kendo_005fdropDownList_005f1 = (com.kendoui.taglib.DropDownListTag) _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.get(com.kendoui.taglib.DropDownListTag.class);
_jspx_th_kendo_005fdropDownList_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdropDownList_005f1.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) name = name type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f1.setName("cmb_maker_search");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) name = dataTextField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f1.setDataTextField("codeNm");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) null
_jspx_th_kendo_005fdropDownList_005f1.setDynamicAttribute(null, "data-value-primitive", "true");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) name = dataValueField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f1.setDataValueField("codeCd");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) null
_jspx_th_kendo_005fdropDownList_005f1.setDynamicAttribute(null, "data-bind", "value: criteria.maker");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) name = optionLabel type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f1.setOptionLabel("์ ์ฒด");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(53,28) null
_jspx_th_kendo_005fdropDownList_005f1.setDynamicAttribute(null, "style", "width: 100%;");
int _jspx_eval_kendo_005fdropDownList_005f1 = _jspx_th_kendo_005fdropDownList_005f1.doStartTag();
if (_jspx_eval_kendo_005fdropDownList_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdropDownList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdropDownList_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdropDownList_005f1.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_005f1(_jspx_th_kendo_005fdropDownList_005f1, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdropDownList_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdropDownList_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdropDownList_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdropDownList_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource
com.kendoui.taglib.DataSourceTag _jspx_th_kendo_005fdataSource_005f1 = (com.kendoui.taglib.DataSourceTag) _005fjspx_005ftagPool_005fkendo_005fdataSource.get(com.kendoui.taglib.DataSourceTag.class);
_jspx_th_kendo_005fdataSource_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdropDownList_005f1);
int _jspx_eval_kendo_005fdataSource_005f1 = _jspx_th_kendo_005fdataSource_005f1.doStartTag();
if (_jspx_eval_kendo_005fdataSource_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_005f1.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_005f1(_jspx_th_kendo_005fdataSource_005f1, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dschema_005f1(_jspx_th_kendo_005fdataSource_005f1, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport
com.kendoui.taglib.datasource.TransportTag _jspx_th_kendo_005fdataSource_002dtransport_005f1 = (com.kendoui.taglib.datasource.TransportTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.get(com.kendoui.taglib.datasource.TransportTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f1);
int _jspx_eval_kendo_005fdataSource_002dtransport_005f1 = _jspx_th_kendo_005fdataSource_002dtransport_005f1.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_005f1.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f1(_jspx_th_kendo_005fdataSource_002dtransport_005f1, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f1(_jspx_th_kendo_005fdataSource_002dtransport_005f1, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-read
com.kendoui.taglib.datasource.TransportReadTag _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1 = (com.kendoui.taglib.datasource.TransportReadTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.get(com.kendoui.taglib.datasource.TransportReadTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f1);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(60,40) name = url type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.setUrl((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${codeUrl}/CAMAK", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(60,40) name = type type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.setType("POST");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(60,40) name = contentType type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.setContentType("application/json");
int _jspx_eval_kendo_005fdataSource_002dtransport_002dread_005f1 = _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.doStartTag();
if (_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-parameterMap
com.kendoui.taglib.datasource.TransportParameterMapFunctionTag _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1 = (com.kendoui.taglib.datasource.TransportParameterMapFunctionTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.get(com.kendoui.taglib.datasource.TransportParameterMapFunctionTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f1);
int _jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f1 = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.doInitBody();
}
do {
out.write("\r\n");
out.write(" function(options){\r\n");
out.write(" return JSON.stringify(options);\r\n");
out.write(" }\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dschema_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-schema
com.kendoui.taglib.datasource.SchemaTag _jspx_th_kendo_005fdataSource_002dschema_005f1 = (com.kendoui.taglib.datasource.SchemaTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.get(com.kendoui.taglib.datasource.SchemaTag.class);
_jspx_th_kendo_005fdataSource_002dschema_005f1.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dschema_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f1);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(68,36) name = data type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f1.setData("data");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(68,36) name = total type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f1.setTotal("total");
int _jspx_eval_kendo_005fdataSource_002dschema_005f1 = _jspx_th_kendo_005fdataSource_002dschema_005f1.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dschema_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dschema_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dschema_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dschema_005f1.doInitBody();
}
do {
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dschema_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dschema_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dschema_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f1);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f1);
return false;
}
private boolean _jspx_meth_kendo_005fdropDownList_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dropDownList
com.kendoui.taglib.DropDownListTag _jspx_th_kendo_005fdropDownList_005f2 = (com.kendoui.taglib.DropDownListTag) _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.get(com.kendoui.taglib.DropDownListTag.class);
_jspx_th_kendo_005fdropDownList_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdropDownList_005f2.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) name = name type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f2.setName("cmb_exhaustReg_search");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) name = dataTextField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f2.setDataTextField("codeNm");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) null
_jspx_th_kendo_005fdropDownList_005f2.setDynamicAttribute(null, "data-value-primitive", "true");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) name = dataValueField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f2.setDataValueField("codeCd");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) null
_jspx_th_kendo_005fdropDownList_005f2.setDynamicAttribute(null, "data-bind", "value: criteria.exhaustReg");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) name = optionLabel type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f2.setOptionLabel("์ ์ฒด");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(75,28) null
_jspx_th_kendo_005fdropDownList_005f2.setDynamicAttribute(null, "style", "width: 100%;");
int _jspx_eval_kendo_005fdropDownList_005f2 = _jspx_th_kendo_005fdropDownList_005f2.doStartTag();
if (_jspx_eval_kendo_005fdropDownList_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdropDownList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdropDownList_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdropDownList_005f2.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_005f2(_jspx_th_kendo_005fdropDownList_005f2, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdropDownList_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdropDownList_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdropDownList_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind.reuse(_jspx_th_kendo_005fdropDownList_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdropDownList_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource
com.kendoui.taglib.DataSourceTag _jspx_th_kendo_005fdataSource_005f2 = (com.kendoui.taglib.DataSourceTag) _005fjspx_005ftagPool_005fkendo_005fdataSource.get(com.kendoui.taglib.DataSourceTag.class);
_jspx_th_kendo_005fdataSource_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdropDownList_005f2);
int _jspx_eval_kendo_005fdataSource_005f2 = _jspx_th_kendo_005fdataSource_005f2.doStartTag();
if (_jspx_eval_kendo_005fdataSource_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_005f2.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_005f2(_jspx_th_kendo_005fdataSource_005f2, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dschema_005f2(_jspx_th_kendo_005fdataSource_005f2, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport
com.kendoui.taglib.datasource.TransportTag _jspx_th_kendo_005fdataSource_002dtransport_005f2 = (com.kendoui.taglib.datasource.TransportTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.get(com.kendoui.taglib.datasource.TransportTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f2);
int _jspx_eval_kendo_005fdataSource_002dtransport_005f2 = _jspx_th_kendo_005fdataSource_002dtransport_005f2.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_005f2.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f2(_jspx_th_kendo_005fdataSource_002dtransport_005f2, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f2(_jspx_th_kendo_005fdataSource_002dtransport_005f2, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-read
com.kendoui.taglib.datasource.TransportReadTag _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2 = (com.kendoui.taglib.datasource.TransportReadTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.get(com.kendoui.taglib.datasource.TransportReadTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f2);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(82,40) name = url type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.setUrl((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${codeUrl}/C006", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(82,40) name = type type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.setType("POST");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(82,40) name = contentType type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.setContentType("application/json");
int _jspx_eval_kendo_005fdataSource_002dtransport_002dread_005f2 = _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.doStartTag();
if (_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-parameterMap
com.kendoui.taglib.datasource.TransportParameterMapFunctionTag _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2 = (com.kendoui.taglib.datasource.TransportParameterMapFunctionTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.get(com.kendoui.taglib.datasource.TransportParameterMapFunctionTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f2);
int _jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f2 = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.doInitBody();
}
do {
out.write("\r\n");
out.write(" function(options){\r\n");
out.write(" return JSON.stringify(options);\r\n");
out.write(" }\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dschema_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-schema
com.kendoui.taglib.datasource.SchemaTag _jspx_th_kendo_005fdataSource_002dschema_005f2 = (com.kendoui.taglib.datasource.SchemaTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.get(com.kendoui.taglib.datasource.SchemaTag.class);
_jspx_th_kendo_005fdataSource_002dschema_005f2.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dschema_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f2);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(90,36) name = data type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f2.setData("data");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(90,36) name = total type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f2.setTotal("total");
int _jspx_eval_kendo_005fdataSource_002dschema_005f2 = _jspx_th_kendo_005fdataSource_002dschema_005f2.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dschema_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dschema_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dschema_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dschema_005f2.doInitBody();
}
do {
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dschema_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dschema_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dschema_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f2);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f2);
return false;
}
private boolean _jspx_meth_kendo_005fdropDownList_005f3(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dropDownList
com.kendoui.taglib.DropDownListTag _jspx_th_kendo_005fdropDownList_005f3 = (com.kendoui.taglib.DropDownListTag) _005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth.get(com.kendoui.taglib.DropDownListTag.class);
_jspx_th_kendo_005fdropDownList_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdropDownList_005f3.setParent(null);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) name = name type = java.lang.String reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f3.setName("cmb_engineType_search");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) name = dataTextField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f3.setDataTextField("codeNm");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) null
_jspx_th_kendo_005fdropDownList_005f3.setDynamicAttribute(null, "data-value-primitive", "true");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) name = dataValueField type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f3.setDataValueField("codeCd");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) null
_jspx_th_kendo_005fdropDownList_005f3.setDynamicAttribute(null, "data-bind", "value: criteria.engineType");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) name = optionLabel type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f3.setOptionLabel("์ ์ฒด");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) null
_jspx_th_kendo_005fdropDownList_005f3.setDynamicAttribute(null, "style", "width: 100%;");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(97,28) name = autoWidth type = boolean reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdropDownList_005f3.setAutoWidth(true);
int _jspx_eval_kendo_005fdropDownList_005f3 = _jspx_th_kendo_005fdropDownList_005f3.doStartTag();
if (_jspx_eval_kendo_005fdropDownList_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdropDownList_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdropDownList_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdropDownList_005f3.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_005f3(_jspx_th_kendo_005fdropDownList_005f3, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdropDownList_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdropDownList_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdropDownList_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth.reuse(_jspx_th_kendo_005fdropDownList_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdropDownList_0026_005fstyle_005foptionLabel_005fname_005fdataValueField_005fdataTextField_005fdata_002dvalue_002dprimitive_005fdata_002dbind_005fautoWidth.reuse(_jspx_th_kendo_005fdropDownList_005f3);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdropDownList_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource
com.kendoui.taglib.DataSourceTag _jspx_th_kendo_005fdataSource_005f3 = (com.kendoui.taglib.DataSourceTag) _005fjspx_005ftagPool_005fkendo_005fdataSource.get(com.kendoui.taglib.DataSourceTag.class);
_jspx_th_kendo_005fdataSource_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdropDownList_005f3);
int _jspx_eval_kendo_005fdataSource_005f3 = _jspx_th_kendo_005fdataSource_005f3.doStartTag();
if (_jspx_eval_kendo_005fdataSource_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_005f3.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_005f3(_jspx_th_kendo_005fdataSource_005f3, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dschema_005f3(_jspx_th_kendo_005fdataSource_005f3, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource.reuse(_jspx_th_kendo_005fdataSource_005f3);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport
com.kendoui.taglib.datasource.TransportTag _jspx_th_kendo_005fdataSource_002dtransport_005f3 = (com.kendoui.taglib.datasource.TransportTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.get(com.kendoui.taglib.datasource.TransportTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f3);
int _jspx_eval_kendo_005fdataSource_002dtransport_005f3 = _jspx_th_kendo_005fdataSource_002dtransport_005f3.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_005f3.doInitBody();
}
do {
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f3(_jspx_th_kendo_005fdataSource_002dtransport_005f3, _jspx_page_context))
return true;
if (_jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f3(_jspx_th_kendo_005fdataSource_002dtransport_005f3, _jspx_page_context))
return true;
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport.reuse(_jspx_th_kendo_005fdataSource_002dtransport_005f3);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dread_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-read
com.kendoui.taglib.datasource.TransportReadTag _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3 = (com.kendoui.taglib.datasource.TransportReadTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.get(com.kendoui.taglib.datasource.TransportReadTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f3);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(105,40) name = url type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.setUrl((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${codeUrl}/C021", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null));
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(105,40) name = type type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.setType("POST");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(105,40) name = contentType type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.setContentType("application/json");
int _jspx_eval_kendo_005fdataSource_002dtransport_002dread_005f3 = _jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.doStartTag();
if (_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dread_0026_005furl_005ftype_005fcontentType_005fnobody.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dread_005f3);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dtransport_002dparameterMap_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_002dtransport_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-transport-parameterMap
com.kendoui.taglib.datasource.TransportParameterMapFunctionTag _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3 = (com.kendoui.taglib.datasource.TransportParameterMapFunctionTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.get(com.kendoui.taglib.datasource.TransportParameterMapFunctionTag.class);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_002dtransport_005f3);
int _jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f3 = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.doInitBody();
}
do {
out.write("\r\n");
out.write(" function(options){\r\n");
out.write(" return JSON.stringify(options);\r\n");
out.write(" }\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dtransport_002dparameterMap_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dtransport_002dparameterMap.reuse(_jspx_th_kendo_005fdataSource_002dtransport_002dparameterMap_005f3);
return false;
}
private boolean _jspx_meth_kendo_005fdataSource_002dschema_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_kendo_005fdataSource_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// kendo:dataSource-schema
com.kendoui.taglib.datasource.SchemaTag _jspx_th_kendo_005fdataSource_002dschema_005f3 = (com.kendoui.taglib.datasource.SchemaTag) _005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.get(com.kendoui.taglib.datasource.SchemaTag.class);
_jspx_th_kendo_005fdataSource_002dschema_005f3.setPageContext(_jspx_page_context);
_jspx_th_kendo_005fdataSource_002dschema_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_kendo_005fdataSource_005f3);
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(113,36) name = data type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f3.setData("data");
// /WEB-INF/jsp/popup/cmmn/WCMP006.jsp(113,36) name = total type = java.lang.String reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_kendo_005fdataSource_002dschema_005f3.setTotal("total");
int _jspx_eval_kendo_005fdataSource_002dschema_005f3 = _jspx_th_kendo_005fdataSource_002dschema_005f3.doStartTag();
if (_jspx_eval_kendo_005fdataSource_002dschema_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_kendo_005fdataSource_002dschema_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_kendo_005fdataSource_002dschema_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_kendo_005fdataSource_002dschema_005f3.doInitBody();
}
do {
int evalDoAfterBody = _jspx_th_kendo_005fdataSource_002dschema_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_kendo_005fdataSource_002dschema_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_kendo_005fdataSource_002dschema_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f3);
return true;
}
_005fjspx_005ftagPool_005fkendo_005fdataSource_002dschema_0026_005ftotal_005fdata.reuse(_jspx_th_kendo_005fdataSource_002dschema_005f3);
return false;
}
}
| [
"qwgh123@naver.com"
] | qwgh123@naver.com |
97f68b5c30cf5bf0c62f3b9a000320a203c3d1b5 | 93153e615bf3088eca761f2a8244aa323f69d213 | /hehenian-web/src/main/java/com/sp2p/dao/MyHomeInfoSettingDao.java | 13ed9af8a4ce859a68528b83b6d16862c67d053f | [] | no_license | shaimeizi/dk | 518d7b3c21af3ec3a5ebc8bfad8aa6eae002048c | 42bed19000495352e37344af9c71bf3f7e0b663f | refs/heads/master | 2021-01-18T16:55:30.027826 | 2015-07-24T05:09:14 | 2015-07-24T05:09:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 34,114 | java | package com.sp2p.dao;
import java.sql.Connection;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringEscapeUtils;
import com.shove.data.DataException;
import com.shove.data.DataSet;
import com.shove.data.dao.MySQL;
import com.shove.util.BeanMapUtils;
import com.shove.util.UtilDate;
import com.sp2p.constants.IConstants;
import com.sp2p.database.Dao;
public class MyHomeInfoSettingDao {
/**
* ไฟฎๆน็จๆทๅฏ็
* @param conn
* @param userId
* @param password
* @param type
* @return
* @throws SQLException
*/
public Long updateUserPassword(Connection conn,long userId,String password,String type) throws SQLException{
Dao.Tables.t_user tuser = new Dao().new Tables().new t_user();
if(type.endsWith("login")){
tuser.password.setValue(password);//ไฟฎๆน็ปๅฝๅฏ็
}else{//ไฟฎๆนไบคๆๅฏ็
tuser.dealpwd.setValue(password);
}
return tuser.update(conn, " id=" + userId);
}
/**
* ๅฏไฟ้ฎ้ข--ๆๆบไฟฎๆน็จๆทๅฏ็
* @param conn
* @param userId
* @param password
* @param type
* @return
* @throws SQLException
*/
public Long updatePhonePwd(Connection conn,String userName,String password,String type,String email) throws Exception{
Dao.Tables.t_user tuser = new Dao().new Tables().new t_user();
long result = -1L;
if(type.equals("1") || type == "1"){//ๆ นๆฎๆๆบๆ่
ๅฏไฟ้ฎ้ขไฟฎๆน็ปๅฝๅฏ็
tuser.password.setValue(password);
result = tuser.update(conn, " username='" + userName + "'");
}else{//ๆ นๆฎ้ฎ็ฎฑไฟฎๆน็ปๅฝๅฏ็
tuser.dealpwd.setValue(password);
result = tuser.update(conn, " email='" + email + "'");
}
return result;
}
/**
* ๅ ้คๆ็ฐ้ถ่กๅกไฟกๆฏ
* @param conn
* @param bankId
* @return
* @throws SQLException
*/
public Long deleteBankInfo(Connection conn,long bankId) throws SQLException{
Dao.Tables.t_bankcard tbank = new Dao().new Tables().new t_bankcard();
return tbank.delete(conn, " id="+bankId);
}
/**
* ๆ นๆฎ็จๆทid่ทๅพไบคๆๅฏ็
* @param conn
* @param userId
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String, String> getDealPwd(Connection conn,long userId,int limitStart,int limitCount) throws SQLException, DataException{
Dao.Tables.t_user tuser = new Dao().new Tables().new t_user();
DataSet dataSet = tuser.open(conn, "dealpwd", " id="+userId, "", limitStart, limitStart);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆทปๅ ๆ็ฐ้ถ่กๅกไฟกๆฏ
* @param conn
* @param userId
* @param cardUserName
* @param bankName
* @param subBankName
* @param bankCard
* @param cardStatus
* @param cityId
* @param provinceId
* @return
* @throws SQLException
*/
public Long addBankCardInfo(Connection conn,long userId,String cardUserName,String bankName,String subBankName,
String bankCard,int cardStatus,String province,String city,String openBankId, String provinceId, String cityId) throws SQLException{
Dao.Tables.t_bankcard t_bank = new Dao().new Tables().new t_bankcard();
t_bank.userId.setValue(userId);
t_bank.cardUserName.setValue(cardUserName);
t_bank.bankName.setValue(bankName);
t_bank.branchBankName.setValue(subBankName);
t_bank.cardNo.setValue(bankCard);
t_bank.cardStatus.setValue(cardStatus);
t_bank.commitTime.setValue(new Date());//ๆไบคๆถ้ด
t_bank.province.setValue(province);
t_bank.city.setValue(city);
t_bank.openBankId.setValue(openBankId);
t_bank.provinceId.setValue(provinceId);
t_bank.cityId.setValue(cityId);
return t_bank.insert(conn);
}
/**
* ๆทปๅ ๆๆบ็ปๅฎไฟกๆฏ
* @param conn
* @param mobile
* @return
* @throws SQLException
*/
public Long addBindingMobile(Connection conn,String mobile,long userId,int status,String content,int type,String oldPhone) throws SQLException{
Dao.Tables.t_phone_binding_info tp = new Dao().new Tables().new t_phone_binding_info();
tp.mobilePhone.setValue(mobile);
tp.userId.setValue(userId);
tp.status.setValue(status);
tp.reason.setValue(content);//ๆๆบ็ปๅฎๅๅ
tp.requsetTime.setValue(new Date());//ๆๆบ็ปๅฎๆถ้ด
tp.oldPhone.setValue(oldPhone);
//add by lw
tp.type.setValue(type);//ๅบๅๆฏๅกซๅๅบ็ก่ตๆๆๅ
ฅ็่ฟๆฏๅกซๅๆๆบๅๆดๆถๅๆๅ
ฅ
//end
return tp.insert(conn);
}
public Long updateBindingMobile(Connection conn,String mobile,long userId,int status,String content,int type)throws SQLException{
Dao.Tables.t_phone_binding_info tp = new Dao().new Tables().new t_phone_binding_info();
tp.mobilePhone.setValue(mobile);
tp.status.setValue(status);
tp.reason.setValue(content);//ๆๆบ็ปๅฎๅๅ
tp.requsetTime.setValue(new Date());//ๆๆบ็ปๅฎๆถ้ด
//add by lw
tp.type.setValue(type);//ๅบๅๆฏๅกซๅๅบ็ก่ตๆๆๅ
ฅ็่ฟๆฏๅกซๅๆๆบๅๆดๆถๅๆๅ
ฅ
//end
return tp.update(conn, " userId = "+userId);
}
/**
* ๆฅ่ฏข็ปๅฎ็ๆๆบไฟกๆฏ
* @param conn
* @param mobile
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> queryBindingMoble(Connection conn,String mobile,int limitStart,int limitCount)
throws SQLException, DataException{
Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
String condition = " mobilePhone='"+StringEscapeUtils.escapeSql(mobile)+"'";
DataSet dataSet = t_phone_binding_info.open(conn, "status", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
public Map<String,String> queryBindingMobleUserInfo(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException{
Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
String condition = " userId="+userId;
DataSet dataSet = t_phone_binding_info.open(conn, "userId,mobilePhone", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๅฆๆ่ฏฅ็จๆทๅทฒ็ป็ปๅฎไบไธไธชๆๆบๅท็ ๏ผๅไธๅ
่ฎธๅ็ปง็ปญ็ปๅฎๆๆบๅท็ ๏ผ้่ฆๆดๆขๆๆบๅท็
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> queryBindingInfoByUserId(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException{
Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
String condition = " userId='"+userId+"'";
DataSet dataSet = t_phone_binding_info.open(conn, "*", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆฅ็ๅจๆๆบ็ปๅฎ่กจไธญๆฏๅฆๅญๅจๆญคไฟกๆฏ
* @param conn
* @param userId
* @param status
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
// public Map<String,String> querySucessBindingInfoByUserId(Connection conn,long userId,int status,int limitStart,int limitCount)
// throws SQLException, DataException{
// Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
//
// String condition = " userId="+userId+" and status = "+status;
// DataSet dataSet = t_phone_binding_info.open(conn, "*", condition, " ", limitStart, limitCount);
// return BeanMapUtils.dataSetToMap(dataSet);
// }
/**
* ๆฅ็ๅจๆๆบ็ปๅฎ่กจไธญๆฏๅฆๅญๅจๆญคไฟกๆฏ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> querySucessBindingInfoByUserId(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException{
Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
String condition = " userId="+userId;
DataSet dataSet = t_phone_binding_info.open(conn, "*", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
public List<Map<String,Object>> queryBindingsByUserId(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
String condition = " userId='"+userId+"'";
Dao.Tables.t_phone_binding_info t_phone_binding_info = new Dao().new Tables().new t_phone_binding_info();
DataSet dataSet = t_phone_binding_info.open(conn, "*", condition, " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ่ทๅพ้ถ่กๅกไฟกๆฏ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> queryBankInfoList(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
DataSet dataSet = t_bankCard.open(conn, " cardUserName ,bankName,branchBankName,cardNo,modifiedCardStatus,id,cardStatus ", " userId='"+userId+"'", " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ่ทๅพ้ถ่กๅกไฟกๆฏ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> queryBankInfoList2(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
DataSet dataSet = t_bankCard.open(conn, "*", " userId='"+userId+"'", " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ๆ นๆฎ็จๆทid่ทๅพ้ถ่กๅกๅท
* @param conn
* @param userId
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String, String> getCardNo(Connection conn,long userId,int limitStart,int limitCount) throws SQLException, DataException{
Dao.Tables.t_bankcard tuser = new Dao().new Tables().new t_bankcard();
DataSet dataSet = tuser.open(conn, "id,cardNo,userId", "userId ="+userId, "", limitStart, limitStart);
return BeanMapUtils.dataSetToMap(dataSet);
}
public List<Map<String,Object>> querySuccessBankInfoList(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
DataSet dataSet = t_bankCard.open(conn, "*", " userId='"+userId+"' and cardStatus=1", " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ๆฅ่ฏข็ปๅฎ็้ถ่กๅกไฟกๆฏ๏ผๅฆๆๆ็จๆทๅทฒ็ป็ปๅฎไธคๅผ ้ถ่กๅก๏ผ้ฃไนๅฐฑไธ่ฝๅ็ปๅฎ้ถ่กๅกไฟกๆฏไบ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> queryBankInfoCardStauts(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
//ๆฅ่ฏข็ปๅฎ็้ถ่กๅกไฟกๆฏใcardStatus=1ไธบ็ปๅฎ็ถๆ
// String condition = " userId='"+userId+"' and cardStatus = 1";
String condition = " userId='"+userId+"'";
DataSet dataSet = t_bankCard.open(conn, "count(*)", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆฅ่ฏข้ถ่กๅกๆฏๅฆๅญๅจ
* @param conn
* @param userId
* @param openAcctId
* @return
* @throws SQLException
* @throws DataException [ๅๆฐ่ฏดๆ]
*
* @return Map<String,String> [่ฟๅ็ฑปๅ่ฏดๆ]
* @exception throws [่ฟไพ็ฑปๅ] [่ฟไพ่ฏดๆ]
* @see [็ฑปใ็ฑป#ๆนๆณใ็ฑป#ๆๅ]
*/
public Map<String,String> queryBankCard(Connection conn,long userId,String openAcctId)
throws SQLException, DataException {
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
String condition = " cardNo='"+openAcctId+"' and userId =" + userId;
DataSet dataSet = t_bankCard.open(conn, "cardNo", condition, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆ นๆฎ้ถ่กๅกidๆฅๆพ้ถ่กๅกๅท
* @param conn
* @param bankId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> queryBankInfoById(Connection conn,long bankId,int limitStart,int limitCount)
throws SQLException, DataException{
Dao.Tables.t_bankcard t_bankCard = new Dao().new Tables().new t_bankcard();
String condition = " id='"+bankId+"'";
DataSet dataSet = t_bankCard.open(conn, "cardNo", condition, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆ นๆฎ็จๆทid่ทๅพ็จๆท็็ๅฎๅงๅ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> getUserRealName(Connection conn,long userId,int limitStart,int limitCount) throws SQLException, DataException{
Dao.Views.t_user_person_info tperson = new Dao().new Views().new t_user_person_info();
DataSet dataSet = tperson.open(conn, "*", " userId="+userId, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
public long addNotes(Connection conn,long userId,boolean message,boolean mail,boolean notes) throws SQLException, DataException{
long result = -1L;
Dao.Tables.t_notice tnotice = new Dao().new Tables().new t_notice();
tnotice.userId.setValue(userId);
if(message){
tnotice.mailNoticeEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.mailNoticeEnable.setValue(IConstants.NOTICE_OFF);
}
if(mail){
tnotice.emailNoticeEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.emailNoticeEnable.setValue(IConstants.NOTICE_OFF);
}
if(notes){
tnotice.noteNoticeEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.noteNoticeEnable.setValue(IConstants.NOTICE_OFF);
}
Map<String,String> map = this.queryNoteInfo(conn, userId);
//ๅฆๆๆฒกๆๆฐๆฎ๏ผๅๆๅ
ฅ
if(map == null){
result = tnotice.insert(conn);
}else{//ๅฆๅ่ฟ่กๆดๆฐ
result = tnotice.update(conn, " userId="+userId);
}
return result;
}
public long addNotesSetting(Connection conn,long userId,boolean messageReceive,boolean messageDeposit,boolean messageBorrow,
boolean messageRecharge,boolean messageChange,boolean mailReceive,boolean mailDeposit,
boolean mailBorrow,boolean mailRecharge,boolean mailChange,boolean noteReceive,
boolean noteDeposit,boolean noteBorrow,boolean noteRecharge,boolean noteChange) throws SQLException, DataException{
long result = -1L;
Dao.Tables.t_noticecon tnotice = new Dao().new Tables().new t_noticecon();
//้็ฅๆนๅผ(1 ้ฎไปถ 2 ็ซๅ
ไฟก 3 ็ญไฟก) ็ถๆ(1 ๅ
ณ้ญ 2 ๅผๅฏ)
int nt1 = IConstants.MAIL_NOTICE;//Convert.strToInt(HomeInfoSettingAction.informWay[1], -1);
tnotice.noticeMode.setValue(nt1);
tnotice.userId.setValue(userId);
//ๆทปๅ ็ซๅ
ไฟกไฟกๆฏ
addToNotice(tnotice,messageReceive,messageDeposit,messageBorrow,messageRecharge,messageChange);
Map<String,String> map = this.queryNoticeSettingInfo(conn, nt1, userId);
long result1 = -1L;
if(map == null){//ๅฆๆๆฒกๆๆฐๆฎ ๅ่ฟ่กๆๅ
ฅ๏ผๅฆๅ่ฟ่กๆดๆฐ
result1 = tnotice.insert(conn);
}else{
result1 = tnotice.update(conn, " userId="+userId+" and noticeMode="+nt1);
}
//้ฎไปถ
tnotice = new Dao().new Tables().new t_noticecon();
int nt2 = IConstants.EMAIL_NOTICE;//Convert.strToInt(HomeInfoSettingAction.informWay[0], -1);
tnotice.noticeMode.setValue(nt2);
tnotice.userId.setValue(userId);
addToNotice(tnotice,mailReceive,mailDeposit,mailBorrow,mailRecharge,mailChange);
map = this.queryNoticeSettingInfo(conn, nt2, userId);
long result2 = -1L;
if(map == null){//ๅฆๆๆฒกๆๆฐๆฎ ๅ่ฟ่กๆๅ
ฅ๏ผๅฆๅ่ฟ่กๆดๆฐ
result2 = tnotice.insert(conn);
}else{
result2 = tnotice.update(conn, " userId="+userId+" and noticeMode="+nt2);
}
//็ญไฟก
tnotice = new Dao().new Tables().new t_noticecon();
int nt3 = IConstants.NOTE_NOTICE;//Convert.strToInt(HomeInfoSettingAction.informWay[2], -1);
tnotice.noticeMode.setValue(nt3);
tnotice.userId.setValue(userId);
addToNotice(tnotice,noteReceive,noteDeposit,noteBorrow,noteRecharge,noteChange);
map = this.queryNoticeSettingInfo(conn, nt3, userId);
long result3 = -1L;
if(map == null){//ๅฆๆๆฒกๆๆฐๆฎ ๅ่ฟ่กๆๅ
ฅ๏ผๅฆๅ่ฟ่กๆดๆฐ
result3 = tnotice.insert(conn);
}else{
result3 = tnotice.update(conn, " userId="+userId+" and noticeMode="+nt3);
}
if(result1 > 0 && result2 >0 && result3 >0)//ไธๆกๆฐๆฎ้ฝๆๅ
ฅๆๅ
result = 1L;
map= null;
return result;
}
private void addToNotice(Dao.Tables.t_noticecon tnotice,boolean reciveRepayEnable,boolean showSucEnable,boolean loanSucEnable,
boolean rechargeSucEnable,boolean capitalChangeEnable) throws SQLException{
if(reciveRepayEnable){//2 ไธบๅผๅฏ
tnotice.reciveRepayEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.reciveRepayEnable.setValue(IConstants.NOTICE_OFF);
}
if(showSucEnable){//2 ไธบๅผๅฏ
tnotice.showSucEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.showSucEnable.setValue(IConstants.NOTICE_OFF);
}
if(loanSucEnable){//2 ไธบๅผๅฏ
tnotice.loanSucEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.loanSucEnable.setValue(IConstants.NOTICE_OFF);
}
if(rechargeSucEnable){//2 ไธบๅผๅฏ
tnotice.rechargeSucEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.rechargeSucEnable.setValue(IConstants.NOTICE_OFF);
}
if(capitalChangeEnable){//2 ไธบๅผๅฏ
tnotice.capitalChangeEnable.setValue(IConstants.NOTICE_ON);
}else{
tnotice.capitalChangeEnable.setValue(IConstants.NOTICE_OFF);
}
}
/**
* ๆฅ่ฏขๅฏนๅบ็้็ฅ่ฎพ็ฝฎ๏ผๆป็ฑปๅ็่ฎพ็ฝฎ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public Map<String,String> queryNotes(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_notice t_notice = new Dao().new Tables().new t_notice();
String condition = " userId='"+userId+"'";
DataSet dataSet = t_notice.open(conn, "*", condition, " ", limitStart, limitCount);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ๆฅ่ฏข้็ฅ่ฎพ็ฝฎๆป็ฑปๅไธ้ข็ๅ
ทไฝ่ฎพ็ฝฎ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> queryNotesSetting(Connection conn,long userId,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_noticecon t_noticecon = new Dao().new Tables().new t_noticecon();
DataSet dataSet = t_noticecon.open(conn, "*", " userId='"+userId+"'", " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ๆฅ่ฏข็ซๅ
ไฟกไฟกๆฏ
* @param conn
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> queryMailList(Connection conn,int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
DataSet dataSet = t_mail.open(conn, "*", "", " ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ๆทปๅ ้ฎไปถไฟกๆฏ
* @param conn
* @param sendUserId
* @param receiverUserId
* @param title
* @param content
* @param mailStatus
* @param mailType
* @return
* @throws SQLException
*/
public Long addMail(Connection conn,long sendUserId,long receiverUserId,String title,String content,int mailStatus,
int mailType) throws SQLException{
Long result = -1L;
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
t_mail.sender.setValue(sendUserId);
t_mail.reciver.setValue(receiverUserId);
t_mail.mailTitle.setValue(title);
t_mail.mailContent.setValue(content);
t_mail.sendTime.setValue(new Date());
t_mail.mailStatus.setValue(mailStatus);
t_mail.mailType.setValue(mailType);
t_mail.mailMode.setValue(IConstants.MAIL_MODE);
result = t_mail.insert(conn);
return result;
}
/**
* ๆทปๅ ้ฎไปถไฟกๆฏ
* @param conn
* @param sendUserId
* @param receiverUserId
* @param title
* @param content
* @param mailStatus
* @param mailType
* @return
* @throws SQLException
*/
public Long addMail(Connection conn,long sendUserId,long receiverUserId,String title,String content,int mailStatus,Integer mailMode,
int mailType) throws SQLException{
Long result = -1L;
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
t_mail.sender.setValue(sendUserId);
t_mail.reciver.setValue(receiverUserId);
t_mail.mailTitle.setValue(title);
t_mail.mailContent.setValue(content);
t_mail.sendTime.setValue(new Date());
t_mail.mailStatus.setValue(mailStatus);
t_mail.mailType.setValue(mailType);
t_mail.mailMode.setValue(mailMode);
result = t_mail.insert(conn);
return result;
}
public Long addMail(Connection conn,long sendUserId,long receiverUserId,String title,String content,int mailStatus,Integer mailMode,
int mailType,Date date,int status) throws SQLException{
Long result = -1L;
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
t_mail.sender.setValue(sendUserId);
t_mail.reciver.setValue(receiverUserId);
t_mail.mailTitle.setValue(title);
t_mail.mailContent.setValue(content);
t_mail.sendTime.setValue(date);
t_mail.mailStatus.setValue(mailStatus);
t_mail.mailType.setValue(mailType);
t_mail.mailMode.setValue(mailMode);
result = t_mail.insert(conn);
return result;
}
private Map<String,String> queryNoteInfo(Connection conn,long userId) throws SQLException, DataException{
Dao.Tables.t_notice t_notice = new Dao().new Tables().new t_notice();
DataSet dataSet = t_notice.open(conn, "userId", " userId="+userId, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
private Map<String,String> queryNoticeSettingInfo(Connection conn,int noticeMode,long userId) throws SQLException, DataException{
Dao.Tables.t_noticecon t_noticecon = new Dao().new Tables().new t_noticecon();
DataSet dataSet = t_noticecon.open(conn, "userId", " userId="+userId+" and noticeMode="+noticeMode, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ่ทๅพๆถไปถ็ฎฑไฟกๆฏ(ไธ่ฌไฟกๆฏ็ๆถไปถ็ฎฑ่ท็ณป็ปไฟกๆฏ็ๆถไปถ็ฎฑ)
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> queryReceiveMails(Connection conn,long userId,int mailType,
int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
DataSet dataSet = t_mail.open(conn, "*", " reciver='"+userId+"' and mailType="+mailType
+" and mailMode="+IConstants.MAIL_MODE,
" ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* ่ทๅพๅไปถ็ฎฑไฟกๆฏ
* @param conn
* @param userId
* @param limitStart
* @param limitCount
* @return
* @throws SQLException
* @throws DataException
*/
public List<Map<String,Object>> querySendMails(Connection conn,long userId,
int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
DataSet dataSet = t_mail.open(conn, "*", " sender='"+userId
+"' and mailMode="+IConstants.MAIL_MODE,
" ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
//ๅ ้คๅ้้ฎไปถไฟกๆฏ
public Long deleteMail(Connection conn,String ids) throws SQLException{
String idStr = StringEscapeUtils.escapeSql("'"+ids+"'");
String idSQL = "-2";
idStr = idStr.replaceAll("'", "");
String [] array = idStr.split(",");
for(int n=0;n<=array.length-1;n++){
idSQL += ","+array[n];
}
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
return t_mail.delete(conn, " id in("+idSQL+")");
}
//ๆดๆฐ้ฎไปถไฟกๆฏ ็ซๅ
ไฟก็ถๆ(1 ้ป่ฎคๆช่ฏป 2 ๅ ้ค 3 ๅทฒ่ฏป)
public Long updateMail(Connection conn,String ids,int type) throws SQLException{
String idStr = StringEscapeUtils.escapeSql("'"+ids+"'");
String idSQL = "-2";
idStr = idStr.replaceAll("'", "");
String [] array = idStr.split(",");
for(int n=0;n<=array.length-1;n++){
idSQL += ","+array[n];
}
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
t_mail.mailStatus.setValue(type);
return t_mail.update(conn, " id in("+idSQL+")");
}
/**
* ๆ นๆฎ้ฎไปถid ๆฅ่ฏข้ฎไปถไฟกๆฏ
* @return
* @throws DataException
* @throws SQLException
*/
public Map<String,String> queryEmailById(Connection conn,long mailId) throws SQLException, DataException{
Dao.Tables.t_mail t_mail = new Dao().new Tables().new t_mail();
DataSet dataSet = t_mail.open(conn, "*", " id="+mailId, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* ไฟฎๆนไธชไบบๅคดๅ็ๆถๅๅคๆญๆฏๅฆๅกซๅ่ฟไธชไบบไฟกๆฏ
* @return
*/
public Map<String,String> queryHeadImg(Connection conn,String username) throws Exception {
StringBuffer command = new StringBuffer();
command.append(" SELECT * FROM t_person ");
command.append(" WHERE realName = '"+ StringEscapeUtils.escapeSql(username )+"' limit 0,1");
DataSet dataSet = MySQL.executeQuery(conn, command.toString());
command = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @throws SQLException
* @MethodName: updatePersonImg
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-3-28 ไธๅ08:04:48
* @Return:
* @Descb: ไฟฎๆนไธชไบบๅคดๅ
* @Throws:
*/
public Long updatePersonImg(Connection conn,String imgPath, Long id) throws SQLException {
Dao.Tables.t_person t_person = new Dao().new Tables().new t_person();
t_person.personalHead.setValue(imgPath);
return t_person.update(conn, " userId = " +id);
}
/**
* @MethodName: queryRenewalVIP
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-3-28 ไธๅ08:47:34
* @Return:
* @Descb: ๆฅ่ฏขไผๅVIPไฟกๆฏ
* @Throws:
*/
public Map<String, String> queryRenewalVIP(Connection conn, Long id) throws SQLException, DataException {
StringBuffer command = new StringBuffer();
command.append("SELECT a.vipStatus,a.username,b.realName,a.email,DATE_ADD(a.vipCreateTime, INTERVAL 1 YEAR) AS vipCreateTime");
command.append(" FROM t_user a LEFT JOIN t_person b ON b.userId=a.id");
command.append(" where a.id = "+id + " limit 0,1");
DataSet dataSet = MySQL.executeQuery(conn, command.toString());
command = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
public List<Map<String,Object>> getConcernList(Connection conn,long userId,String receiver,
int limitStart,int limitCount)
throws SQLException, DataException {
Dao.Views.v_t_user_concern_lists views = new Dao().new Views().new v_t_user_concern_lists();
DataSet dataSet = views.open(conn, "*", " userId= "+userId+" and username='"+StringEscapeUtils.escapeSql(receiver)+"'",
" ", limitStart, limitCount);
dataSet.tables.get(0).rows.genRowsMap();
return dataSet.tables.get(0).rows.rowsMap;
}
/**
* @MethodName: queryPerson
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-4-22 ไธๅ10:48:56
* @Return:
* @Descb: ๆฅ่ฏขไธชไบบๅบๆฌไฟกๆฏ
* @Throws:
*/
public Map<String, String> queryPerson(Connection conn, Long id) throws SQLException, DataException {
Dao.Tables.t_person t_person = new Dao().new Tables().new t_person();
DataSet dataSet = t_person.open(conn, " id ", " userId="+id, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @MethodName: addPersonImg
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-4-22 ไธๅ10:50:39
* @Return:
* @Descb: ๆทปๅ ไธชไบบๅคดๅ
* @Throws:
*/
public Long addPersonImg(Connection conn, String imgPath,long id) throws SQLException {
Dao.Tables.t_person t_person = new Dao().new Tables().new t_person();
t_person.userId.setValue(id);
t_person.personalHead.setValue(imgPath);
return t_person.insert(conn);
}
public Map<String, String> queryUserCashStatus(Connection conn, Long userId,int cashStatus) throws SQLException, DataException {
String sqlStr = "SELECT cashStatus FROM t_group a " +
"left JOIN t_group_user b on a.id=b.groupId where userId="+userId+" and cashStatus="+cashStatus;
DataSet dataSet = MySQL.executeQuery(conn, sqlStr);
sqlStr = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @throws DataException
* @throws SQLException
* @MethodName: queryVIPFee
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ10:25:02
* @Return:
* @Descb: ๆฅ่ฏขVIPไผ่ดน
* @Throws:
*/
public Map<String, String> queryVIPFee(Connection conn) throws SQLException, DataException {
String sqlStr = "SELECT number FROM t_cost_manager WHERE type = 4";
DataSet dataSet = MySQL.executeQuery(conn, sqlStr);
sqlStr= null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @MethodName: isRenewal
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ10:37:58
* @Return:
* @Descb: ๆฅ่ฏข็จๆทๆฏๅฆไธบVIP
* @Throws:
*/
public Map<String, String> isVIP(Connection conn, Long id) throws SQLException, DataException {
String sqlStr = "select id from t_user where id="+id+" and vipStatus !=1";
DataSet dataSet = MySQL.executeQuery(conn, sqlStr);
sqlStr = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @MethodName: isRenewal
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ10:54:25
* @Return:
* @Descb: ๆฅ่ฏข็จๆทๆฏๅฆ้่ฆ็ปญ่ดน
* @Throws:
*/
public Map<String, String> isRenewal(Connection conn, Long id) throws SQLException, DataException {
String sqlStr = "select id from t_user where id="+id+" and vipStatus = 3";
DataSet dataSet = MySQL.executeQuery(conn, sqlStr);
sqlStr = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @MethodName: isForVIPFee
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ10:58:08
* @Return:
* @Descb: ๆฅ่ฏข็จๆทๅฏ็จ้้ขๆฏๅฆๅคๆฏไปไผ่ดน
* @Throws:
*/
public Map<String, String> isForVIPFee(Connection conn, Long id,double vipFee) throws SQLException, DataException {
String sqlStr = "select usableSum,username from t_user where id="+id+" and usableSum > "+vipFee;
DataSet dataSet = MySQL.executeQuery(conn, sqlStr);
sqlStr = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
/**
* @MethodName: decucatedVIPFee
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ11:03:53
* @Return:
* @Descb: ๆฃ้คVIPไผ่ดน
* @Throws:
*/
public long decucatedVIPFee(Connection conn, Long id, double vipFee) throws SQLException {
SimpleDateFormat sf = new SimpleDateFormat(UtilDate.simple);
String date = sf.format(new Date());
String sqlStr = "update t_user set usableSum = usableSum - "+vipFee+",feeStatus=2,vipStatus=2,vipCreateTime = '"+date+"' where id ="+id;
long result=MySQL.executeNonQuery(conn, sqlStr);
sf=null;
date=null;
date=null;
return result;
}
/**
* @throws SQLException
* @MethodName: addVIPFeeRecord
* @Param: MyHomeInfoSettingDao
* @Author: gang.lv
* @Date: 2013-5-4 ไธๅ11:05:52
* @Return:
* @Descb: ๆทปๅ VIPไผ่ดน่ฎฐๅฝ
* @Throws:
*/
public long addVIPFeeRecord(Connection conn, Long id, double vipFee) throws SQLException {
Dao.Tables.t_vipsum vipsum = new Dao().new Tables().new t_vipsum();
vipsum.vipFee.setValue(vipFee);
vipsum.userId.setValue(id);
return vipsum.insert(conn);
}
/**
* @MethodName: queryUserAmountAfterHander
* @Param: BorrowManageDao
* @Author: gang.lv
* @Date: 2013-4-21 ไธๅ09:11:22
* @Return:
* @Descb: ๆฅ่ฏข็จๆท ็่ต้
* @Throws:
*/
public Map<String, String> queryUserAmountAfterHander(Connection conn,
long userId) throws SQLException, DataException {
StringBuffer command = new StringBuffer();
command.append("select a.usableSum,a.freezeSum,sum(b.recivedPrincipal+b.recievedInterest-b.hasPrincipal-b.hasInterest) forPI");
command.append(" from t_user a left join t_invest b on a.id = b.investor where a.id="+userId+" group by a.id");
DataSet dataSet = MySQL.executeQuery(conn, command.toString());
command = null;
return BeanMapUtils.dataSetToMap(dataSet);
}
public Map<String,String> queryEmailDetailById(Connection conn,long mailId) throws SQLException, DataException{
Dao.Views.v_t_mail_user_detail v_t_mail_user_detail = new Dao().new Views().new v_t_mail_user_detail();
DataSet dataSet = v_t_mail_user_detail.open(conn, "*", " id="+mailId, " ", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
public Map<String, String> queEmailUser(Connection conn, Long userId) throws SQLException, DataException {
Dao.Tables.t_user t_user = new Dao().new Tables().new t_user();
DataSet dataSet = t_user.open(conn, " username ", " id=" + userId, "", -1, -1);
return BeanMapUtils.dataSetToMap(dataSet);
}
}
| [
"zhangyunhmf@harry.hyn.com"
] | zhangyunhmf@harry.hyn.com |
a1946cad6658c06185724e81af12db86268f3513 | 331b374631cbb2d7e2b3273b1ccb994783d1521d | /src/main/java/org/ayfaar/app/utils/ValueObjectUtils.java | 4697a02b75c0a50919aa6ff0541fb102edb794cd | [] | no_license | devstarter/ii | 15bb6c73f20e599984c4667c543b8deacbda4d82 | 57b75b4a3f0dc2d11626e97bd71026118e4539ea | refs/heads/master | 2023-04-28T11:18:17.516378 | 2022-03-19T20:28:17 | 2022-03-19T20:28:17 | 21,562,994 | 18 | 67 | null | 2023-04-14T17:50:37 | 2014-07-07T08:30:40 | HTML | UTF-8 | Java | false | false | 8,563 | java | package org.ayfaar.app.utils;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.hibernate.collection.internal.PersistentBag;
import org.jetbrains.annotations.Nullable;
import org.springframework.ui.ModelMap;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@SuppressWarnings("unchecked")
public class ValueObjectUtils {
/**
* use getModelMap instead
*
* @throws Exception
*/
@Deprecated
public static Collection<ModelMap> convertToPlainObjects(Collection<?> list) {
return (Collection<ModelMap>) getModelMap(list);
}
public static <E> Collection<ModelMap> convertToPlainObjects(Collection<E> list, Modifier<E> modifier) {
return convertToPlainObjects(list, true, modifier);
}
public static <E> Collection<ModelMap> convertToPlainObjects(Collection<E> list, Boolean avoidTableAdmin, Modifier<E> modifier) {
Collection<ModelMap> result = new ArrayList<ModelMap>();
for (E entity : list) {
ModelMap map = (ModelMap) ValueObjectUtils.getModelMap(entity, avoidTableAdmin);
if (modifier != null) {
modifier.modify(entity, map);
}
result.add(map);
}
return result;
}
public static String[] excludeAnnotations = {
"javax.persistence.ManyToMany",
"javax.persistence.ManyToOne",
"javax.persistence.OneToMany",
"javax.persistence.OneToOne"
};
public static Object getModelMap(@Nullable final Object entity, String ...keepProperties) {
return getModelMap(entity, null, keepProperties.length > 0, keepProperties);
}
public static Object getModelMap(@Nullable final Object entity, Boolean avoidTableAdmin, String ...keepProperties) {
return getModelMap(entity, null, avoidTableAdmin, keepProperties);
}
protected static Object getModelMap(@Nullable final Object entity,
@Nullable TableAdminType type,
Boolean avoidTableAdmin,
@Nullable String ...keepProperties) {
if (entity == null) {
return null;
}
if (entity instanceof Number) {
return entity;
}
if (entity instanceof Collection) {
List result = new ArrayList();
Collection collection = (Collection) entity;
if (collection instanceof PersistentBag && !((PersistentBag) collection).wasInitialized()) {
return null;
}
for (Object o : collection) {
result.add(getModelMap(o, type, avoidTableAdmin, keepProperties));
}
return result;
}
if (entity instanceof Object[]) {
Object[] array = (Object[]) entity;
Object[] result = new Object[array.length];
for (int i=0; i<array.length; i++) {
result[i] = getModelMap(array[i], type, avoidTableAdmin, keepProperties);
}
return result;
}
if (entity.getClass().equals(ModelMap.class)) {
return entity;
}
ModelMap map = new ModelMap();
if (type != null && Types.FK.equals(type.value())) {
// if (type.key() != "") map.put("key", getProperty(entity, type.key()));
// if (type.name() != "") map.put("value", getProperty(entity, type.name()));
// return map;
String keyField = type.keyField();
if (keyField == null || keyField.isEmpty()) {
keyField = EntityUtils.getPrimaryKeyFiledName(entity.getClass());
}
return getProperty(entity, keyField);
}
Field[] declaredFields = entity.getClass().getDeclaredFields();
if (entity.getClass().getSuperclass() != null) {
declaredFields = ArrayUtils.addAll(declaredFields, entity.getClass().getSuperclass().getDeclaredFields());
}
for (final Field field : declaredFields) {
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
continue;
}
String fieldName = field.getName();
if ("this$0".equals(fieldName)) continue;
Object value = null;
TableAdminType fieldTypeAnnotation = !avoidTableAdmin ? field.getAnnotation(TableAdminType.class) : null;
if (keepField(fieldName, keepProperties) || (fieldTypeAnnotation != null && Types.FK.equals(fieldTypeAnnotation.value()))) {
value = getProperty(entity, field.getName());
// if (value != null) {
value = getModelMap(value, fieldTypeAnnotation, avoidTableAdmin, getNestedPropertiesChine(keepProperties));
if (fieldTypeAnnotation != null && Types.FK.equals(fieldTypeAnnotation.value())) {
fieldName += "_fk";
}
// }
} else {
Boolean avoidThisField = false;
for (Annotation annotation : field.getAnnotations()) {
if (Arrays.asList(excludeAnnotations).contains(annotation.annotationType().getName())) {
avoidThisField = true;
}
if (annotation instanceof ViewAsJoinedString) {
avoidThisField = false;
ViewAsJoinedString a = (ViewAsJoinedString) annotation;
value = getProperty(entity, field.getName());
Collection collection = (Collection) value;
String stringValue = "";
for (Object item : collection) {
stringValue += getProperty(item, a.joinField());
stringValue += a.joinBy();
}
if (stringValue.length() > 0) {
stringValue = stringValue.substring(0, stringValue.lastIndexOf(a.joinBy()));
}
value = stringValue;
fieldName = a.modelField();
break;
}
}
if (avoidThisField) continue;
}
// to avoid calling getters before it needed
if (value == null && !fieldName.matches(".+_fk$")) {
value = getProperty(entity, fieldName);
}
map.put(fieldName, value);
}
return map;
}
private static String[] getNestedPropertiesChine(String[] keepProperties) {
List<String> pps = new ArrayList<String>();
for (String propertyChain : keepProperties) {
int dotIndex = propertyChain.indexOf(".");
if (dotIndex > 0) {
pps.add(propertyChain.substring(dotIndex+1));
}
}
return pps.toArray(new String[pps.size()]);
}
private static boolean keepField(String fieldName, @Nullable String[] keepProperties) {
if (keepProperties != null) {
for (String propertyChain : keepProperties) {
String firstProperty = propertyChain.indexOf(".") > 0
? propertyChain.substring(0, propertyChain.indexOf("."))
: propertyChain;
if (fieldName.equals(firstProperty)) {
return true;
}
}
}
return false;
}
public static void setProperty(Object bean, String name, Object value) {
try {
PropertyUtils.setProperty(bean, name, value);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static interface Modifier<E> {
void modify(E entity, ModelMap map);
}
public static Object getProperty(Object bean, String name) {
if ("this$0".equals(name)) return null;
try {
Field field = null;
for (Field f : bean.getClass().getFields()) {
if (f.getName().equals(name)) {
field = f;
}
}
return (field != null) ? field.get(bean) : PropertyUtils.getProperty(bean, name);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| [
"ylebid@gmail.com"
] | ylebid@gmail.com |
f739c57ab5f82934f1e718d25b7e66986d7b5e22 | 612b7212edadece098419fca253b9a00a0cce592 | /Assignment3/INFO6205-master/src/main/java/edu/neu/coe/info6205/sort/simple/SelectionSort.java | 3fd0c40b7ba0d041be97b8d18f6c1ad8262c1391 | [
"Apache-2.0"
] | permissive | bhargavanaman/Proagram-structure-and-algorithms | 0ea98d2460eac932f81c3e3543a5a4a56ef46f50 | 541e7748b3f2c198330fcf024a21cf1e68874ba0 | refs/heads/master | 2020-03-22T12:15:16.425635 | 2018-09-16T02:24:37 | 2018-09-16T02:24:37 | 140,028,104 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package edu.neu.coe.info6205.sort.simple;
import static edu.neu.coe.info6205.sort.simple.Helper.less;
import static edu.neu.coe.info6205.sort.simple.Helper.swap;
public class SelectionSort<X extends Comparable<X>> implements Sort<X> {
@Override
public void sort(X[] xs, int from, int to) {
// TODO implement selection sort
int n = xs.length;
for (int i = 0; i < n; i++) {
int min = i;
for (int j = i + 1; j < n; j++) {
if (Helper.less(xs[j], xs[min])) {
min = j;
}
}
Helper.swap(xs, i, min);
}
}
}
| [
"bhargava.n@husky.neu.edu"
] | bhargava.n@husky.neu.edu |
f103bbab6442a7fbff5fd53dc808b4acd1b44818 | ece83e5914bd208f11db56c2055d4e8728039373 | /src/main/java/co/gov/gobierno/Service/IndexService.java | 7346b1a0d3f254d9ed3329aaa4b7b6b6ef7a0a55 | [] | no_license | julianacho/TramitesGitHub | 6fb34509c47c77d34a2647f8c54ee4245ac744b2 | da2ac814b57c7005287df5868d322c74d3ff177d | refs/heads/master | 2023-06-27T09:32:58.224654 | 2021-07-27T14:38:38 | 2021-07-27T14:38:38 | 390,016,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package co.gov.gobierno.Service;
import java.util.List;
import co.gov.gobierno.DTO.PropertieDTO;
import co.gov.gobierno.DTO.ThirdDTO;
/**
*
* @author DELL
*/
public interface IndexService
{
/*
*Este mรฉtodo consulta la informaciรณn del tercero y la retorna en el objeto ThirdDTO.
*/
public ThirdDTO ThirdConsult(ThirdDTO objThirdDTO, List<PropertieDTO> listPropertieDTOs);
}
| [
"Julian.rojas@gobiernobogota.gov.co"
] | Julian.rojas@gobiernobogota.gov.co |
022cc394512e23d66731b915547a8a3f6b3c9698 | e3d9abf33e7b29938a022702821a461f32898129 | /favouriteservice/src/main/java/com/stackroute/favouriteservice/domain/MatchCalender.java | 07ebf7eeda066ac572855d0b9e7c0d5ecd0b097d | [] | no_license | sudippain/CMatchesUsingMicroservice | 7d4484291fa517a3c51ea1bf22598afe73ba60d9 | a0af073a4176579cfbae8362f950f8fea7b05429 | refs/heads/master | 2020-05-07T08:58:59.460718 | 2019-04-09T11:55:20 | 2019-04-09T11:55:20 | 180,356,148 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,909 | java | package com.stackroute.favouriteservice.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="MatchCalender")
public class MatchCalender {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="id")
private int id;
@Column(name="match_id")
private String unique_id;
@Column(name = "name")
private String name;
@Column(name = "Date")
private String date;
@Column(name="user_id")
private String userId;
public MatchCalender() {
super();
// TODO Auto-generated constructor stub
}
public MatchCalender(int id, String unique_id, String name, String date, String userId) {
super();
this.id = id;
this.unique_id = unique_id;
this.name = name;
this.date = date;
this.userId = userId;
}
public MatchCalender(String unique_id, String name, String date, String userId) {
super();
this.unique_id = unique_id;
this.name = name;
this.date = date;
this.userId = userId;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUnique_id() {
return unique_id;
}
public void setUnique_id(String unique_id) {
this.unique_id = unique_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
@Override
public String toString() {
return "MatchCalender [id=" + id + ", unique_id=" + unique_id + ", name=" + name + ", date=" + date
+ ", userId=" + userId + "]";
}
}
| [
"sudip.pain@cognizant.com"
] | sudip.pain@cognizant.com |
2304bbcc7e88a0bf712592fa6f2bed965e7ed072 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_5d717ed54c34564265c0cbfdf371e17a16133325/OAuthITest/12_5d717ed54c34564265c0cbfdf371e17a16133325_OAuthITest_s.java | bd7c6ec756fb4339c894ea681294fbbeb6bc064a | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,014 | java | package com.jayway.restassured.itest.java;
import org.junit.Ignore;
import org.junit.Test;
import static com.jayway.restassured.RestAssured.given;
import static com.jayway.restassured.authentication.OAuthSignature.QUERY_STRING;
import static org.hamcrest.Matchers.equalTo;
public class OAuthITest {
@Test public void
oauth1_works_with_header_signing() {
given().
auth().oauth("key", "secret", "accesskey", "accesssecret").
when().
get("http://term.ie/oauth/example/echo_api.php?works=true").
then().
body("html.body", equalTo("works=true"));
}
@Ignore @Test public void
oauth1_works_with_query_signing() {
given().
auth().oauth("key", "secret", "accesskey", "accesssecret", QUERY_STRING).
when().
get("http://term.ie/oauth/example/echo_api.php?works=true").
then().
body("html.body", equalTo("works=true"));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
57e2e5527f1782348a434b752ab262592e3ec98c | 223fbbe1fa48cf80d437cf40ab5bc21b327f9dc9 | /catalog-src/service/CategoryService.java | 082506be8cc40326791440588303dbdef60799d7 | [] | no_license | yermochenko/example-soa-catalog | 6ef0920840f71d6ab7bbacf74eba9f1d9ee02582 | 5245b5c5de671a128a80f22c9a58733c86730900 | refs/heads/master | 2020-12-25T14:23:47.471140 | 2016-10-19T08:10:13 | 2016-10-19T08:10:13 | 67,857,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package service;
import java.util.List;
import domain.Category;
// TODO: add method canDelete(Integer id), ะฟัะพะฒะตััััะธะน, ะฝะตั ะปะธ ั ะบะฐัะตะณะพัะธะตะน ัะฒัะทะฐะฝะฝัั
ะพะฑัะตะบัะพะฒ
public interface CategoryService {
List<Category> findAll() throws ServiceException;
Category findById(Integer id) throws ServiceException;
List<Category> findPossibleParents(Integer id) throws ServiceException;
void save(Category category) throws ServiceException;
void delete(Integer id) throws ServiceException;
} | [
"yermochenko@gmail.com"
] | yermochenko@gmail.com |
9b87ee67c0cb29bac3bb6cc538485524c04c1413 | 30464bdd6e0c2f32dbc58f98f32e3004dc63d82e | /src/cum/edmund/models/maps/world/ForegroundWorldMap.java | 90ee3d847e1c64b84b2872d765b411eac75e2531 | [] | no_license | scm2ejm/RPG | f0d7bb14d3ffcdfa40fdf4ce5c49a93d1b9a9595 | 4cff20718b63a418811c1804f15bdc57263808fa | refs/heads/master | 2021-07-12T10:25:10.524273 | 2021-03-21T13:53:57 | 2021-03-21T13:53:57 | 31,433,195 | 0 | 0 | null | 2017-10-11T11:59:29 | 2015-02-27T18:29:49 | Java | UTF-8 | Java | false | false | 1,144 | java | package cum.edmund.models.maps.world;
import java.awt.event.KeyEvent;
import java.util.Random;
import cum.edmund.models.blocks.Birds;
import cum.edmund.models.map.Coord;
import cum.edmund.ui.View;
/**
* Foreground map allows things like birds and clouds to float by
*
* @author Ed
*
*/
public class ForegroundWorldMap extends WorldMap {
private View view;
public ForegroundWorldMap(View view) {
this.view = view;
// Put some birds on screen to start with
birds();
}
public void birds() {
// int startY = View.HALF_COURSE_GRID_SIZE + 1 + view.getViewY();
// int randomX = new Random().nextInt(View.HALF_COURSE_GRID_SIZE) + view.getViewY();
int startY = View.HALF_COURSE_GRID_SIZE + 1;
int randomX = new Random().nextInt(View.HALF_COURSE_GRID_SIZE);
put(new Coord(randomX - 1, startY + 1), new Birds(this));
put(new Coord(randomX, startY), new Birds(this));
put(new Coord(randomX + 1, startY + 1), new Birds(this));
put(new Coord(randomX + 2, startY + 2), new Birds(this));
}
public void handleKeyPress(int key) {
if (key == KeyEvent.VK_T) {
birds();
}
}
}
| [
"edmundmorris@googlemail.com"
] | edmundmorris@googlemail.com |
3f1fa1118ef717f1c49d5afb986c5990581f0bc0 | 4eb26ebb410fa8ca88a6df34cca1b6a6df2e630b | /src/main/java/com/artipie/docker/asto/DefaultLayout.java | 75344ef0b8ed1398d757d0005895162c8d46ab0e | [
"MIT"
] | permissive | olegmoz/docker-adapter | 57f6f191ff70eb04b538d6c61aa0514cac440948 | e4b010f2c4d833b8aab901afaa7812382781a0cd | refs/heads/master | 2021-04-20T16:39:26.529331 | 2021-01-14T06:00:23 | 2021-01-14T06:00:23 | 249,700,993 | 0 | 0 | MIT | 2020-03-24T12:22:33 | 2020-03-24T12:22:32 | null | UTF-8 | Java | false | false | 2,369 | java | /*
* MIT License
*
* Copyright (c) 2020 Artipie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.artipie.docker.asto;
import com.artipie.asto.Key;
import com.artipie.docker.Digest;
import com.artipie.docker.RepoName;
import com.artipie.docker.ref.ManifestRef;
/**
* Original storage layout that is compatible with reference Docker Registry implementation.
*
* @since 0.7
*/
public final class DefaultLayout implements Layout {
@Override
public Key repositories() {
return new Key.From("repositories");
}
@Override
public Key blob(final RepoName repo, final Digest digest) {
return new BlobKey(digest);
}
@Override
public Key manifest(final RepoName repo, final ManifestRef ref) {
return new Key.From(this.manifests(repo), ref.link().string());
}
@Override
public Key tags(final RepoName repo) {
return new Key.From(this.manifests(repo), "tags");
}
@Override
public Key upload(final RepoName repo, final String uuid) {
return new UploadKey(repo, uuid);
}
/**
* Create manifests root key.
*
* @param repo Repository name.
* @return Manifests key.
*/
private Key manifests(final RepoName repo) {
return new Key.From(this.repositories(), repo.value(), "_manifests");
}
}
| [
"oleg.mozzhechkov@gmail.com"
] | oleg.mozzhechkov@gmail.com |
041e14ad83f73daf3005aec05be37cf8874596b2 | 2060d35edc68e7ed7b80c44e94bf91eb016335ef | /org.xtext.example.wappm.ide/xtend-gen/org/xtext/example/wappm/ide/WappmIdeSetup.java | 2ef917184697d97a093ec931427df08aa44d360d | [] | no_license | daniel614/xtext-webapp | 73b9eb92629dee9597b6edb3d9005a41a5f7db37 | 0e55e2028fb335b99ce912f1923e9c01e42c34df | refs/heads/master | 2020-03-20T19:47:16.275765 | 2018-07-07T11:11:32 | 2018-07-07T11:11:32 | 137,653,766 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | /**
* generated by Xtext 2.14.0
*/
package org.xtext.example.wappm.ide;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.eclipse.xtext.util.Modules2;
import org.xtext.example.wappm.WappmRuntimeModule;
import org.xtext.example.wappm.WappmStandaloneSetup;
import org.xtext.example.wappm.ide.WappmIdeModule;
/**
* Initialization support for running Xtext languages as language servers.
*/
@SuppressWarnings("all")
public class WappmIdeSetup extends WappmStandaloneSetup {
@Override
public Injector createInjector() {
WappmRuntimeModule _wappmRuntimeModule = new WappmRuntimeModule();
WappmIdeModule _wappmIdeModule = new WappmIdeModule();
return Guice.createInjector(Modules2.mixin(_wappmRuntimeModule, _wappmIdeModule));
}
}
| [
"daniel-kotulla@t-online.de"
] | daniel-kotulla@t-online.de |
f4f4e91310c06e05124256c7ed2ffdb9aeb765ae | b9e4bf591dc1a66f075453307f2921074aae53d9 | /hrms_get_and_post/hrmsSwagger/src/main/java/kodlamaio/hrmsSwagger/entities/concretes/Employer.java | ebff01280db3b6eb387e116768bf1976ca9eaf0e | [] | no_license | enisceri/javaCamp | ad681d59bed9309a2bce1fec2657f8530c0c090c | a97a616ff70d805314678f4d7903c521f4de1201 | refs/heads/master | 2023-06-12T15:11:19.441971 | 2021-07-04T15:32:08 | 2021-07-04T15:36:37 | 363,488,347 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | java | package kodlamaio.hrmsSwagger.entities.concretes;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@Entity
@Table(name = "employers")
@Data
@EqualsAndHashCode(callSuper = false)
@PrimaryKeyJoinColumn(name = "user_id")
@NoArgsConstructor
@AllArgsConstructor
public class Employer extends User{
@Column(name = "company_name")
private String companyName;
@Column(name = "website")
private String website;
}
| [
"enisceri@gmail.com"
] | enisceri@gmail.com |
e7cd48d157cfe9ab69a96c6f3a977d9692c7d0b0 | a4c53eeebd148b76f356f08ef0d47c43698b8b1c | /Timer/app/src/main/java/com/indiancoffedevelopers/timer/MainActivity.java | 543480ee13b2c525c8cde2ee39381e08a5ca1ee9 | [] | no_license | ManjunathHampole/Android-Projects | 614d51de420132caeb0dd323fe85d38ce46afa39 | fbfed01afa456578b39c74d05fbd0b7cf526eed5 | refs/heads/master | 2020-04-15T03:23:50.398075 | 2019-01-06T21:31:40 | 2019-01-06T21:31:40 | 164,347,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,933 | java | package com.indiancoffedevelopers.timer;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Locale;
public class MainActivity extends AppCompatActivity {
private EditText mEditTextInput;
private TextView mtextViewCountDown;
private Button mButtonStartPause;
private Button mButtonReset;
private Button mButtonSet;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mStartTimeInMillis;
private long mTimeLeftInMillis;
private long mEndTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mEditTextInput = findViewById(R.id.edit_text_input);
mtextViewCountDown = findViewById(R.id.text_view_countdown);
mButtonSet = findViewById(R.id.button_set);
mButtonStartPause = findViewById(R.id.button_start_pause);
mButtonReset = findViewById(R.id.button_reset);
mButtonSet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String input = mEditTextInput.getText().toString();
if(input.length() == 0){
Toast.makeText(MainActivity.this, "Field can't be empty", Toast.LENGTH_SHORT).show();
return;
}
long millisInput = Long.parseLong(input) * 60000;
if(millisInput == 0) {
Toast.makeText(MainActivity.this, "Please enter a positive number", Toast.LENGTH_SHORT).show();
return;
}
setTime(millisInput);
mEditTextInput.setText("");
}
});
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mTimerRunning){
pauseTimer();
}
else{
startTimer();
}
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
}
});
}
private void setTime(long milliseconds){
mStartTimeInMillis = milliseconds;
resetTimer();
closeKeyboard();
}
private void startTimer(){
mEndTime = System.currentTimeMillis() + mTimeLeftInMillis;
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis,1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
updateWatchInterface();
}
}.start();
mTimerRunning = true;
updateWatchInterface();
}
private void pauseTimer(){
mCountDownTimer.cancel();
mTimerRunning = false;
updateWatchInterface();
}
private void resetTimer(){
mTimeLeftInMillis = mStartTimeInMillis;
updateCountDownText();
mButtonReset.setVisibility(View.INVISIBLE);
mButtonStartPause.setVisibility(View.VISIBLE);
}
private void updateCountDownText(){
int hours = (int)(mTimeLeftInMillis / 1000) / 3600;
int min = (int)((mTimeLeftInMillis / 1000) % 3600 ) / 60;
int sec = (int)(mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if(hours > 0){
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d",hours, min, sec);
}
else{
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", min, sec);
}
mtextViewCountDown.setText(timeLeftFormatted);
}
private void updateWatchInterface(){
if(mTimerRunning){
mEditTextInput.setVisibility(View.INVISIBLE);
mButtonSet.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.INVISIBLE);
mButtonStartPause.setText("Pause");
}
else{
mEditTextInput.setVisibility(View.VISIBLE);
mButtonSet.setVisibility(View.VISIBLE);
mButtonStartPause.setText("Start");
if(mTimeLeftInMillis < 1000){
mButtonStartPause.setVisibility(View.INVISIBLE);
}
else{
mButtonStartPause.setVisibility(View.VISIBLE);
}
if(mTimeLeftInMillis < mStartTimeInMillis){
mButtonReset.setVisibility(View.VISIBLE);
}
else{
mButtonReset.setVisibility(View.INVISIBLE);
}
}
}
private void closeKeyboard(){
View view = this.getCurrentFocus();
if(view!= null){
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(),0);
}
}
@Override
protected void onStart() {
super.onStart();
SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
mStartTimeInMillis = prefs.getLong("startTimeInMillis",600000);
mTimeLeftInMillis = prefs.getLong("millisLeft", mStartTimeInMillis);
mTimerRunning = prefs.getBoolean("timerRunning", false);
updateCountDownText();
updateWatchInterface();
if(mTimerRunning){
mEndTime = prefs.getLong("endTime", 0);
mTimeLeftInMillis = mEndTime - System.currentTimeMillis();
if(mTimeLeftInMillis < 0){
mTimeLeftInMillis = 0;
mTimerRunning = false;
updateCountDownText();
updateWatchInterface();
}
else {
startTimer();
}
}
}
@Override
protected void onStop() {
super.onStop();
SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putLong("startTimeInMillis", mStartTimeInMillis);
editor.putLong("millisLeft", mTimeLeftInMillis);
editor.putBoolean("timerRunning", mTimerRunning);
editor.putLong("endTime", mEndTime);
editor.apply();
if(mCountDownTimer != null){
mCountDownTimer.cancel();
}
}
}
| [
"manjunathhampole6@gmail.com"
] | manjunathhampole6@gmail.com |
7075b71bba7d5e32f8c8b7b7a736e9e03481dd93 | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201306/GeoTargetingError.java | 8d83d1ae1b2be51372011d912a0ab9d917511c3b | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,655 | java |
package com.google.api.ads.dfp.jaxws.v201306;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* Lists all errors associated with geographical targeting for a
* {@link LineItem}.
*
*
* <p>Java class for GeoTargetingError complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="GeoTargetingError">
* <complexContent>
* <extension base="{https://www.google.com/apis/ads/publisher/v201306}ApiError">
* <sequence>
* <element name="reason" type="{https://www.google.com/apis/ads/publisher/v201306}GeoTargetingError.Reason" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GeoTargetingError", propOrder = {
"reason"
})
public class GeoTargetingError
extends ApiError
{
protected GeoTargetingErrorReason reason;
/**
* Gets the value of the reason property.
*
* @return
* possible object is
* {@link GeoTargetingErrorReason }
*
*/
public GeoTargetingErrorReason getReason() {
return reason;
}
/**
* Sets the value of the reason property.
*
* @param value
* allowed object is
* {@link GeoTargetingErrorReason }
*
*/
public void setReason(GeoTargetingErrorReason value) {
this.reason = value;
}
}
| [
"jradcliff@google.com"
] | jradcliff@google.com |
910049736a221f6a74363daacd0b1a7d54ffdcfb | f60bfbfef90f5ea009cffb912ce7581e977ef7fb | /butter-test/src/main/java/com/example/butter_test/meminfo/MeminfoGcTestActivity.java | 4ad8f3b49c5fde4869162d38628abd7cc812b0b8 | [] | no_license | yangkai1989/Demos | bcd3315ca4ac780e4677e0b170b8c09aa94f70b1 | 693f7dd33f05924feaca813e18a52e50e42c139c | refs/heads/master | 2020-03-22T15:11:37.097043 | 2018-06-14T02:49:49 | 2018-06-14T02:49:49 | 140,234,641 | 1 | 0 | null | 2018-07-09T05:17:38 | 2018-07-09T05:17:37 | null | UTF-8 | Java | false | false | 8,748 | java | package com.example.butter_test.meminfo;
import android.app.ActivityManager;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.os.Debug;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.example.butter_test.R;
import com.example.butter_test.cpu.CpuMonitorUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
public class MeminfoGcTestActivity extends AppCompatActivity {
private static final String TAG = "butter-test";
TextView mTvHint;
List list = new ArrayList();
@Override
protected void onDestroy() {
super.onDestroy();
long debugCpuValue = CpuMonitorUtils.INSTANCE.endMonitor("MeminfoGcTestActivity");
Log.w(TAG, "onDestroy() end with: cpu:" + debugCpuValue);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CpuMonitorUtils.INSTANCE.startMonitor("MeminfoGcTestActivity");
mTvHint = (TextView) findViewById(R.id.tvHint);
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CpuMonitorUtils.INSTANCE.startMonitor("button");
dumpMemoInfo();
long debugCpuValue = CpuMonitorUtils.INSTANCE.endMonitor("button");
Log.d(TAG, "onClick() end with: cpu:" + debugCpuValue);
}
});
findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//startActivity(new Intent(MeminfoTestActivity.this, Main2Activity.class));
new Thread(new Runnable() {
@Override
public void run() {
//while (true) {
list.add(new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.mipmap.background))
);
list.add(new String[500000]);
dumpMemoInfo();
//}
}
}).start();
}
});
// new Thread(new Runnable() {
// @Override
// public void run() {
// while (true) {
// //Log.d(TAG, "run() called:"+Debug.getPss());
// Debug.getPss();
// Runtime.getRuntime().totalMemory();
// Runtime.getRuntime().freeMemory();
// }
//
// }
// }).start();
findViewById(R.id.btnRuntime).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick() called with: view1 = [" + view + "]");
CpuMonitorUtils.INSTANCE.startMonitor("btnRuntime");
long mem = 0;
long time1 = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
mem = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
}
long time2 = System.currentTimeMillis() - time1;
long debugCpuValue = CpuMonitorUtils.INSTANCE.endMonitor("btnRuntime");
Log.d(TAG, "onClick() end with: time2 = [" + time2 + "],mem:" + mem + ",cpu:" + debugCpuValue);
}
});
findViewById(R.id.btnDebugPss).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick() called with: view2 = [" + view + "]");
CpuMonitorUtils.INSTANCE.startMonitor("debugPss");
long mem = 0;
long time1 = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
mem = Debug.getPss();
}
long time2 = System.currentTimeMillis() - time1;
long debugPssCpuValue = CpuMonitorUtils.INSTANCE.endMonitor("debugPss");
Log.d(TAG, "onClick() end with: time2 = [" + time2 + "],mem:" + mem + ",cpu:" + debugPssCpuValue);
}
});
findViewById(R.id.btnAmPss).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d(TAG, "onClick() called with: view3 = [" + view + "]");
CpuMonitorUtils.INSTANCE.startMonitor("btnAmPss");
long mem = 0;
long time1 = System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
Debug.MemoryInfo[] memoryInfos = activityManager.getProcessMemoryInfo(new int[]{android.os.Process.myPid()});
mem = memoryInfos[0].getTotalPss();
}
long time2 = System.currentTimeMillis() - time1;
long debugCpuValue = CpuMonitorUtils.INSTANCE.endMonitor("btnAmPss");
Log.d(TAG, "onClick() end with: time2 = [" + time2 + "],mem:" + mem + ",cpu:" + debugCpuValue);
}
});
}
private void dumpMemoInfo() {
getWindow().getDecorView().post(new Runnable() {
@Override
public void run() {
long maxMemory = Runtime.getRuntime().maxMemory();
long totalMemory = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
float totalMemoK = totalMemory / 1024f;
float totalMemoM = totalMemoK / 1024f;
float freeMemoK = freeMemory / 1024f;
float freeMemoM = freeMemoK / 1024f;
float allocedMemoK = totalMemoK - freeMemoK;
float allocedMemoM = totalMemoM - freeMemoM;
float maxMemoryK = maxMemory / 1024f;
float maxMemoryM = maxMemoryK / 1024f;
long pss = Debug.getPss();
Debug.MemoryInfo memoryInfo = new Debug.MemoryInfo();
Debug.getMemoryInfo(memoryInfo);
float totalPssK = memoryInfo.getTotalPss();
float totalPssM = totalPssK / 1024f;
mTvHint.setText("maxMemory = [" + formatFLoat(maxMemoryK) + "K]" + formatFLoat(maxMemoryM) + "M"
+ "\n totalMemory = [" + formatFLoat(totalMemoK) + "K]" + formatFLoat(totalMemoM) + "M"
+ "\n freeMemory = [" + formatFLoat(freeMemoK) + "K]" + formatFLoat(freeMemoM) + "M"
+ "\n alloced = [" + formatFLoat(allocedMemoK) + "K]" + formatFLoat(allocedMemoM) + "M"
+ "\n totalPss = [" + formatFLoat(totalPssK) + "K]" + formatFLoat(totalPssM) + "M"
+ "\n pss = [" + pss + "K]" + pss + "M");
try {
Process exec = Runtime.getRuntime().exec("adb shell dumpsys meminfo 'com.example.butter_test' |grep 'Dalvik Heap'");
Log.d(TAG, "run() called:" + exec);
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
private String formatFLoat(float num) {
DecimalFormat decimalFormat = new DecimalFormat(".00");//ๆ้ ๆนๆณ็ๅญ็ฌฆๆ ผๅผ่ฟ้ๅฆๆๅฐๆฐไธ่ถณ2ไฝ,ไผไปฅ0่กฅ่ถณ.
String p = decimalFormat.format(num);//format ่ฟๅ็ๆฏๅญ็ฌฆไธฒ
return p;
}
// Executes UNIX command.
private String exec(String command) {
try {
Process process = Runtime.getRuntime().exec(command);
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
int read;
char[] buffer = new char[4096];
StringBuffer output = new StringBuffer();
while ((read = reader.read(buffer)) > 0) {
output.append(buffer, 0, read);
}
reader.close();
process.waitFor();
return output.toString();
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
| [
"zhangxutong@meituan.com"
] | zhangxutong@meituan.com |
6d5d8fd44012110e8f0f70b6ff88c889c2369a3f | 49bf60e81ba9b5894d0feacaf2a68fa909bf0d28 | /src/main/java/com/agenda/agendamentos/exception/NotFoundException.java | 9ff61ced70b3eab7281a42aeffe76d64c9184403 | [] | no_license | AnaTRJesus/agendamentos | 14ff19c7bfccc8dc03b2d7111a6e1393c1e5b3f5 | 82918303479c5a12f01ab40fda55444ec37eef1f | refs/heads/master | 2023-07-25T21:54:09.789025 | 2021-09-08T03:00:03 | 2021-09-08T03:00:03 | 401,857,444 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 213 | java | package com.agenda.agendamentos.exception;
public class NotFoundException extends RuntimeException {
static final long serialVersionUID = 1L;
public NotFoundException(String message) {
super(message);
}
}
| [
"anaribeiro183@gmail.com"
] | anaribeiro183@gmail.com |
a275185285a2e9ca533d60687b714fb0db7ebcf8 | 8bc76ba668571a7991f92dea90f59fe933ca44d9 | /Practice/src/cheryl/practice/sorting/InsertSort.java | b4b91b3a02fff30f9b67c84b186cc3b32706c3d0 | [] | no_license | LL816/Practice | c3d55d074cebe4526bd0c6d2e16b0ad2633eaf44 | 2718e5f955ce3024d6a80bae25e752dc6c657b8d | refs/heads/master | 2021-01-11T04:03:36.989008 | 2016-10-20T14:31:28 | 2016-10-20T14:31:28 | 71,254,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,321 | java | package cheryl.practice.sorting;
/**
* Created by Cheryl on 2016/10/19.
* insert sort
* input: 20,2,6,8,1,14,6,22,9,25,21,22
*/
public class InsertSort {
public static void run(int[] input){
/* int i=0;
int j;
while(i<input.length-1){
j=i+1;
for(int k=0;k<=i;k++){
if(input[k]>input[j]){
int temp = input[j];
for(int m=j;m>k;m--){
input[m]=input[m-1];
}
input[k]=temp;
}
}
i=j;
}
*/
for(int i=1;i<input.length;i++){
if(input[i]<input[i-1]){
int j=i-1;
int temp=input[i];
while(temp<input[j]){
input[j+1]=input[j];
j--;
if(j<0){
break;
}
}
input[j+1]=temp;
}
}
for(int n=0;n<input.length;n++){
System.out.print(input[n]);
System.out.print("; ");
}
}
public static void main(String... args){
int[] input ={20,2,6,8,1,14,6,22,9,25,21,22};
// int[] input ={4,2,3,4,5,6};
InsertSort.run(input);
}
}
| [
"cailuruoxin@gmail.com"
] | cailuruoxin@gmail.com |
5968393191ddbf89ffb82bde3d8d8073bc4405f1 | ef762f2102515ad3528079e10f5f2eed4dad2fe4 | /app/src/main/java/com/trantan/base_mvvm_with_restapi/model/trademark/TradeMark.java | 8d99fdc178f1bd019a7c78cae4117a4628746b23 | [] | no_license | TanTran-Dev/Base-MVVM | 61c9118d4d225b0de5cd9ba8044c345d8d77e874 | e49aa078f8b6055e9367b5ee6bff4d4d99ec9958 | refs/heads/master | 2022-11-27T23:43:52.945986 | 2020-08-04T09:54:39 | 2020-08-04T09:54:39 | 284,603,906 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,526 | java | package com.trantan.base_mvvm_with_restapi.model.trademark;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.databinding.BindingAdapter;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.trantan.base_mvvm_with_restapi.BR;
import de.hdodenhof.circleimageview.CircleImageView;
public
class TradeMark extends BaseObservable {
@SerializedName("id")
@Expose
private int id;
@SerializedName("imageUrl")
@Expose
private String imageUrl;
@SerializedName("name")
@Expose
private String name;
public TradeMark() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Bindable
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
notifyPropertyChanged(BR.imageUrl);
}
@Bindable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
notifyPropertyChanged(BR.name);
}
@BindingAdapter("imageUrl")
public static void loadImage(CircleImageView view, String imageUrl){
Glide.with(view.getContext())
.load(imageUrl)
.apply(RequestOptions.circleCropTransform())
.into(view);
}
}
| [
"trantan1999hy.tntn@gmail.com"
] | trantan1999hy.tntn@gmail.com |
061e76181da7bc9838e903f0578b6187e2159b8b | 4cb6eb202e628af499b057c329cc9411e1c095d4 | /app/src/main/java/com/example/neighbourapplication/controller/IncidentController.java | 0c883666b54c57535c2ac22a445cc69b0af220c7 | [] | no_license | dianashrdn/neighbourApplication | 814724e2eaa7716bbfb52fb787bc4288d8999a6d | 7af12700b120cd589174244a04aea9888ff97957 | refs/heads/master | 2020-06-08T11:54:30.636152 | 2019-08-06T13:21:33 | 2019-08-06T13:21:33 | 193,185,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 30,241 | java | package com.example.neighbourapplication.controller;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.example.neighbourapplication.IncidentAdapter;
import com.example.neighbourapplication.R;
import com.example.neighbourapplication.model.Incident;
import com.example.neighbourapplication.sqlite.IncidentDB;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.firestore.DocumentReference;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.QueryDocumentSnapshot;
import com.google.firebase.firestore.QuerySnapshot;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class IncidentController {
private FirebaseFirestore db;
private Context context;
private Incident incident;
private StorageReference storageReference;
public IncidentController(Context context) {
this.context = context;
db = FirebaseFirestore.getInstance();
}
public void setIncident(final Incident incident){
this.incident = incident;
}
//get data
public void getIncidents(final IncidentAdapter incidentAdapter){
final HashMap<String, Incident> incidents = new HashMap<>();
// IncidentDB localDB = new IncidentDB(context);
// localDB.fnGetIncidents(IncidentDB.tblNameIncident, incidents);
// localDB.fnGetIncidents(IncidentDB.tblNameIncidentToUpload, incidents);
final FirebaseFirestore db = FirebaseFirestore.getInstance();
Thread getIncidentThread = new Thread(){
@Override
public void run() {
db.collection("incidents")
.get()
.addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
@Override
public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
for( QueryDocumentSnapshot documentSnapshot : queryDocumentSnapshots) {
Incident incident = documentSnapshot.toObject(Incident.class);
incident.setIncidentId(documentSnapshot.getId());
System.out.println(incident.getIncidentId());
System.out.println(incident.getIncidentName());
incidents.put(incident.getIncidentId(), incident);
}
incidentAdapter.setIncidents(incidents);
incidentAdapter.notifyDataSetChanged();
}
});
}
};
getIncidentThread.run();
}
//get map location
public void getIncidentsLocation(final GoogleMap googleMap){
final HashMap<String, Marker> markers = new HashMap<>();
// final HashMap<String, Incident> incidents = new HashMap<>();
FirebaseFirestore db = FirebaseFirestore.getInstance();
// IncidentDB localDB = new IncidentDB(context);
// localDB.fnGetIncidents(IncidentDB.tblNameIncident, incidents);
// localDB.fnGetIncidents(IncidentDB.tblNameIncidentToUpload, incidents);
// for (Incident incident : incidents.values()){
// Marker marker = googleMap.addMarker(getPlaceMarker(incident));
// marker.setTag(incident.getIncidentId());
// marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
// markers.put(incident.getIncidentId(), marker);
// }
db.collection("incidents")
.get()
.addOnSuccessListener(new OnSuccessListener<QuerySnapshot>() {
@Override
public void onSuccess(QuerySnapshot queryDocumentSnapshots) {
for( QueryDocumentSnapshot documentSnapshot : queryDocumentSnapshots) {
Incident incident = documentSnapshot.toObject(Incident.class);
incident.setIncidentId(documentSnapshot.getId());
Marker marker = googleMap.addMarker(getPlaceMarker(incident));
marker.setTag(incident.getIncidentId());
marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
markers.put(incident.getIncidentId(), marker);
}
}
});
}
public void insertIncident(final Incident incident, final Uri bitmapUri, Activity activity) {
storageReference = FirebaseStorage.getInstance().getReference();
final Date date = new Date();
final SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy hh.mm.ss");
final ProgressBar progressBar = activity.findViewById(R.id.progressUpload);
progressBar.setVisibility(View.VISIBLE);
final IncidentDB localDB = new IncidentDB(context);
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (response.matches("SUCCESS")) {
storageReference = storageReference.child("images/" + formatter.format(date));
if (bitmapUri != null)
storageReference.putFile(bitmapUri)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
incident.setPhoto(uri.toString());
db.collection("incidents")
.add(incident)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Incident reported successfully", Toast.LENGTH_SHORT).show();
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
System.out.println("Notified");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error notification");
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("message", incident.getIncidentName());
return params;
}
};
queue.add(stringRequest);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Failed to add report..", Toast.LENGTH_SHORT).show();
}
});
}
});
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
// ...
}
});
else
db.collection("incidents")
.add(incident)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
localDB.fnDeleteIncident(incident.getIncidentId(), IncidentDB.tblNameIncidentToUpload);
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Incident reported successfully", Toast.LENGTH_SHORT).show();
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
System.out.println("Notified");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error notification");
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("message", incident.getIncidentName());
return params;
}
};
queue.add(stringRequest);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Failed to add report..", Toast.LENGTH_SHORT).show();
}
});
} else {
localDB.fnInsertIncident(incident, bitmapUri, IncidentDB.tblNameIncidentToUpload);
Toast.makeText(context, "No Internet connection detected, adding to local database.", Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.INVISIBLE);
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
localDB.fnInsertIncident(incident, bitmapUri, IncidentDB.tblNameIncidentToUpload);
Toast.makeText(context, "No Internet connection detected, adding to local database.", Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.INVISIBLE);
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("testConnection", "");
return params;
}
};
queue.add(stringRequest);
}
public void insertIncident(final HashMap<String, Incident> incidents, Activity activity) {
storageReference = FirebaseStorage.getInstance().getReference();
final Date date = new Date();
final SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-yyyy hh.mm.ss");
final ProgressBar progressBar = activity.findViewById(R.id.progressUpload);
progressBar.setVisibility(View.VISIBLE);
final IncidentDB localDB = new IncidentDB(context);
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
if (response.matches("SUCCESS")) {
for (final Incident incident : incidents.values()) {
Uri bitmapUri = null;
if (incident.getPhoto() != null)
bitmapUri = Uri.parse(incident.getPhoto());
storageReference = storageReference.child("images/" + formatter.format(date));
if (bitmapUri != null)
storageReference.putFile(bitmapUri)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
incident.setPhoto(uri.toString());
db.collection("incidents")
.add(incident)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
localDB.fnDeleteIncident(incident.getIncidentId(), IncidentDB.tblNameIncidentToUpload);
Toast.makeText(context, "Incident reported successfully", Toast.LENGTH_SHORT).show();
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
System.out.println("Notified");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error notification");
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("message", IncidentController.this.incident.getIncidentName());
return params;
}
};
queue.add(stringRequest);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(context, "Failed to add report..", Toast.LENGTH_SHORT).show();
}
});
}
});
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
// ...
}
});
else
db.collection("incidents")
.add(incident)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Incident reported successfully", Toast.LENGTH_SHORT).show();
RequestQueue queue = Volley.newRequestQueue(context);
String url = "https://aesuneus.000webhostapp.com/neighbourservice.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
System.out.println("Notified");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
System.out.println("Error notification");
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("message", incident.getIncidentName());
return params;
}
};
queue.add(stringRequest);
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(context, "Failed to add report..", Toast.LENGTH_SHORT).show();
}
});
}
progressBar.setVisibility(View.INVISIBLE);
} else {
progressBar.setVisibility(View.INVISIBLE);
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(context, "No Internet connection detected..", Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.INVISIBLE);
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map<String, String> params = new HashMap<String, String>();
params.put("testConnection", "");
return params;
}
};
queue.add(stringRequest);
}
/*public static void getPlace(String placeId, final PlaceInfoFragment placeInfoFragment) {
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference databaseReference = database.getReference("places");
Query query = databaseReference.orderByChild("placeId").startAt(placeId).endAt(placeId);
ChildEventListener childEventListener = query.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
Incident incident = dataSnapshot.getValue(Incident.class);
placeInfoFragment.setPlace(incident);
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}*/
public MarkerOptions getPlaceMarker(Incident incident){
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.title(incident.getIncidentName());
markerOptions.position(new LatLng(incident.getLocation().getLatitude(),incident.getLocation().getLongitude()));
return markerOptions;
}
//to download image
private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
protected Bitmap doInBackground(String... urls) {
System.out.println("Getting image");
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(urldisplay).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
System.out.println("Image retrieved");
return mIcon11;
}
protected void onPostExecute(Bitmap result) {
bmImage.setImageBitmap(result);
}
}
}
| [
"noreply@github.com"
] | dianashrdn.noreply@github.com |
5626dd319e284d65930498842f0343b4af142e12 | 8514d731c7c8dbd45d01a4a152f46ea6bc265d64 | /android/app/build/generated/source/r/debug/android/support/graphics/drawable/animated/R.java | a7245c05b76e9ff3fc33f456aa37fefff51653bd | [] | no_license | yrjwcharm/dljt_app | 70eb19d09a6e89a062be5f36f879c0492aff898c | 96e1b44ee748c3c6e7a243a2532756ab86072078 | refs/heads/master | 2020-03-27T17:15:55.228838 | 2018-08-31T04:07:29 | 2018-08-31T04:07:29 | 146,840,168 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,630 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.graphics.drawable.animated;
public final class R {
public static final class attr {
public static final int font = 0x7f020079;
public static final int fontProviderAuthority = 0x7f02007b;
public static final int fontProviderCerts = 0x7f02007c;
public static final int fontProviderFetchStrategy = 0x7f02007d;
public static final int fontProviderFetchTimeout = 0x7f02007e;
public static final int fontProviderPackage = 0x7f02007f;
public static final int fontProviderQuery = 0x7f020080;
public static final int fontStyle = 0x7f020081;
public static final int fontWeight = 0x7f020082;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 0x7f030000;
}
public static final class color {
public static final int notification_action_color_filter = 0x7f040047;
public static final int notification_icon_bg_color = 0x7f040048;
public static final int ripple_material_light = 0x7f040053;
public static final int secondary_text_default_material_light = 0x7f040055;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f05004a;
public static final int compat_button_inset_vertical_material = 0x7f05004b;
public static final int compat_button_padding_horizontal_material = 0x7f05004c;
public static final int compat_button_padding_vertical_material = 0x7f05004d;
public static final int compat_control_corner_material = 0x7f05004e;
public static final int notification_action_icon_size = 0x7f050058;
public static final int notification_action_text_size = 0x7f050059;
public static final int notification_big_circle_margin = 0x7f05005a;
public static final int notification_content_margin_start = 0x7f05005b;
public static final int notification_large_icon_height = 0x7f05005c;
public static final int notification_large_icon_width = 0x7f05005d;
public static final int notification_main_column_padding_top = 0x7f05005e;
public static final int notification_media_narrow_margin = 0x7f05005f;
public static final int notification_right_icon_size = 0x7f050060;
public static final int notification_right_side_padding_top = 0x7f050061;
public static final int notification_small_icon_background_padding = 0x7f050062;
public static final int notification_small_icon_size_as_large = 0x7f050063;
public static final int notification_subtext_size = 0x7f050064;
public static final int notification_top_pad = 0x7f050065;
public static final int notification_top_pad_large_text = 0x7f050066;
}
public static final class drawable {
public static final int notification_action_background = 0x7f060068;
public static final int notification_bg = 0x7f060069;
public static final int notification_bg_low = 0x7f06006a;
public static final int notification_bg_low_normal = 0x7f06006b;
public static final int notification_bg_low_pressed = 0x7f06006c;
public static final int notification_bg_normal = 0x7f06006d;
public static final int notification_bg_normal_pressed = 0x7f06006e;
public static final int notification_icon_background = 0x7f06006f;
public static final int notification_template_icon_bg = 0x7f060070;
public static final int notification_template_icon_low_bg = 0x7f060071;
public static final int notification_tile_bg = 0x7f060072;
public static final int notify_panel_notification_icon_bg = 0x7f060073;
}
public static final class id {
public static final int action_container = 0x7f07000e;
public static final int action_divider = 0x7f070010;
public static final int action_image = 0x7f070011;
public static final int action_text = 0x7f070017;
public static final int actions = 0x7f070018;
public static final int async = 0x7f07001f;
public static final int blocking = 0x7f070022;
public static final int chronometer = 0x7f07002b;
public static final int forever = 0x7f07003e;
public static final int icon = 0x7f070042;
public static final int icon_group = 0x7f070043;
public static final int info = 0x7f070047;
public static final int italic = 0x7f070048;
public static final int line1 = 0x7f07004a;
public static final int line3 = 0x7f07004b;
public static final int normal = 0x7f070054;
public static final int notification_background = 0x7f070055;
public static final int notification_main_column = 0x7f070056;
public static final int notification_main_column_container = 0x7f070057;
public static final int right_icon = 0x7f07005d;
public static final int right_side = 0x7f07005e;
public static final int text = 0x7f070086;
public static final int text2 = 0x7f070087;
public static final int time = 0x7f07008a;
public static final int title = 0x7f07008b;
}
public static final class integer {
public static final int status_bar_notification_info_maxnum = 0x7f080005;
}
public static final class layout {
public static final int notification_action = 0x7f09001f;
public static final int notification_action_tombstone = 0x7f090020;
public static final int notification_template_custom_big = 0x7f090027;
public static final int notification_template_icon_group = 0x7f090028;
public static final int notification_template_part_chronometer = 0x7f09002c;
public static final int notification_template_part_time = 0x7f09002d;
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f0b004b;
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f0c0105;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c0106;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c0108;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c010b;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c010d;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c017e;
public static final int Widget_Compat_NotificationActionText = 0x7f0c017f;
}
public static final class styleable {
public static final int[] FontFamily = { 0x7f02007b, 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x7f020079, 0x7f020081, 0x7f020082 };
public static final int FontFamilyFont_font = 0;
public static final int FontFamilyFont_fontStyle = 1;
public static final int FontFamilyFont_fontWeight = 2;
}
}
| [
"xlyanrui@sina.com"
] | xlyanrui@sina.com |
bc009792742c2aedb9bf494e98998aa2f94c0694 | d83a07b5b7e7a08f043d7ea27d3806ed09ec9e1e | /INF 122 Software Design Final Project/Software Design INF 122 Final Project/src/org/shared/CheckersCell.java | 053e88006b9068d0f26c3dd9b519f7d046e23588 | [] | no_license | aserran/INF122-SFT-DES-BOARDSERVER | e211d2eae87fb9ec5ec77a8ff27f05f457a6a061 | 96a79169452da43b12bafe33471f0432bf83e68f | refs/heads/master | 2021-01-19T10:42:36.987396 | 2017-04-11T06:15:23 | 2017-04-11T06:15:23 | 87,896,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 662 | java | package org.shared;
public class CheckersCell extends Cell{
boolean isKing;
boolean explored = false;
boolean captured = false;
boolean hasSecondInput = true;
public CheckersCell(PieceEnum cellStatus, boolean isKing) {
super(cellStatus);
this.isKing = isKing;
}
public boolean isKing() {
return isKing;
}
public void setKing(boolean isKing) {
this.isKing = isKing;
}
public boolean isExplored() {
return explored;
}
public void setExplored(boolean explored) {
this.explored = explored;
}
public boolean isCaptured() {
return captured;
}
public void setCaptured(boolean captured) {
this.captured = captured;
}
}
| [
"noreply@github.com"
] | aserran.noreply@github.com |
67d95dec519b0af394c978c5d3dd8c9ba4e18ecb | 0362d0b5cefbe74545a873234ec37e6fccd44bb4 | /mcmc/src/main/java/ru/shemplo/mcmc/RunMCMC.java | 6dfdd99c164c80961cd7a53fd0cde96878f0a5a0 | [
"Apache-2.0"
] | permissive | Shemplo/Signal-MCMC | 95590bbf0945dc1d44749d6d4219c1b0d14102fd | fa7025649f9e0bd759ec32d6542b2d873745ca32 | refs/heads/master | 2020-05-07T18:24:06.267393 | 2019-06-13T17:59:32 | 2019-06-13T17:59:32 | 180,764,875 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,050 | java | package ru.shemplo.mcmc;
import java.awt.Color;
import java.io.*;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import ru.shemplo.mcmc.graph.Graph;
import ru.shemplo.mcmc.graph.GraphDescriptor;
import ru.shemplo.mcmc.graph.GraphSignals;
import ru.shemplo.mcmc.graph.Vertex;
import ru.shemplo.mcmc.impl.MCMC;
import ru.shemplo.mcmc.impl.MCMCJoinOrLeave;
import ru.shemplo.mcmc.io.CSVGraphReader;
import ru.shemplo.mcmc.io.CommonWriter;
import ru.shemplo.mcmc.io.GraphReader;
import ru.shemplo.snowball.stuctures.Pair;
public class RunMCMC {
//public static final int TAU_V_N = 7, TAU_E_N = 1; // GWAS graph reader
// public static final int TAU_V_N = 17, TAU_E_N = 20; // Gatom
//public static final int TAU_V_N = 8, TAU_E_N = 1; // melanoma adv
public static final int TAU_V_N = 3, TAU_E_N = 5;
public static final Random RANDOM = new Random ();
private static final boolean SIGNALS = true, LONG_RUN = !true;
private static final int TRIES = 150, ITERATIONS = 300000;
private static final boolean REGENERATE = !true;
private static final boolean TRACE = !true;
private static final int MODULE_SIZE = 1;
private static final BiFunction <GraphDescriptor, Integer, MCMC> SUPPLIER =
(graph, iterations) -> new MCMCJoinOrLeave (graph, iterations);
private static final ExecutorService pool = Executors.newFixedThreadPool (REGENERATE ? 1 : 3);
private static final Map <Vertex, Double> occurrences = new HashMap <> ();
private static final List <Double> likelihoods = new ArrayList <> ();
private static final CommonWriter writer = new CommonWriter ();
public static void main (String ... args) throws IOException, InterruptedException {
Locale.setDefault (Locale.ENGLISH);
//final GraphReader reader = new MelanomaAdvGraphReader ();
//Graph initial = reader.readGraph ("mapped_melanoma_gwas.txt");
final GraphReader reader = new CSVGraphReader ();
//Graph initial = reader.readGraph ("gatom_");
Graph initial = reader.readGraph ("generated_");
//Graph initial = reader.readGraph ("paper_");
//GraphReader reader = new GWASGraphReader ();
//GraphReader reader = new GWASMelanomaGraphReader ();
//Graph initial = reader.readGraph ("");
System.out.println ("Vertecies: " + initial.getVertices ().size ());
System.out.println ("Signals: " + initial.getSignals ()
. getSignals ().values ().stream ()
. distinct ().count ());
System.out.println ("Graph loaded");
initial.getVertices ().stream ()
. filter (Objects::nonNull)
. forEach (vertex -> occurrences.put (vertex, 0D));
try (
PrintWriter pw = new PrintWriter (new File ("runtime/temp.dot"));
) {
@SuppressWarnings ("unused")
GraphDescriptor full = initial.getFullDescriptor (false);
System.out.println (initial.getFixedDescriptor (30, SIGNALS));
//pw.println (full.toDot ());
}
for (int i = 0; i < TRIES; i++) {
pool.execute (() -> {
try {
if (REGENERATE) {
initial.regenerateVerticesWeight (vertex -> {
double weight = RANDOM.nextDouble () * RANDOM.nextDouble ();
return vertex.isStable () ? vertex.getWeight () : weight;
});
initial.setSignals (GraphSignals.splitGraph (initial));
}
GraphDescriptor descriptor = initial.getFixedDescriptor (MODULE_SIZE, SIGNALS);
System.out.println ("Initial descriptor:");
System.out.println (descriptor);
long start = System.currentTimeMillis ();
MCMC singleRun = SUPPLIER.apply (descriptor, ITERATIONS);
singleRun.doAllIterations (false, TRACE);
long end = System.currentTimeMillis ();
System.out.println (String.format ("Run finished in `%s` (time: %.3fs, starts: %d, commits: %d)",
Thread.currentThread ().getName (), (end - start) / 1000d,
singleRun.getStarts (), singleRun.getCommits ()));
registerRun (singleRun, initial);
} catch (Exception e) {
System.out.println ("Oooops");
e.printStackTrace ();
registerRun (null, initial);
}
});
}
pool.awaitTermination (1, TimeUnit.DAYS);
}
private static int registered = 0;
private static synchronized void registerRun (MCMC singleRun, Graph graph) {
int size = -1;
if (singleRun != null) {
GraphDescriptor graphd = singleRun.getCurrentGraph ();
graphd.getVertices ().forEach (vertex ->
occurrences.compute (vertex, (___, v) -> v == null ? 1 : v + 1)
);
//System.out.println (i + " " + graph);
if (LONG_RUN) {
singleRun.getSnapshots ().forEach (gph -> {
gph.forEach (vertex ->
occurrences.compute (vertex, (___, v) -> v == null ? 1 : v + 1)
);
});
}
if (singleRun.getLikelihoods ().size () > 0) {
likelihoods.clear (); // truncate previous result
likelihoods.addAll (singleRun.getLikelihoods ());
}
size = singleRun.getCurrentGraph ().getVertices ().size ();
try (
OutputStream os = new FileOutputStream ("runtime/tmp.log", true);
PrintWriter pw = new PrintWriter (os);
) {
pw.print (String.format ("#%04d ", registered + 1));
pw.println (graphd.toVerticesString ());
} catch (IOException ioe) {}
}
System.out.println (String.format (" %04d registered at ___ %s (verticies: %d)",
registered + 1, new Date ().toString (), size));
if (++registered == TRIES) {
printResults (graph); pool.shutdown ();
}
}
private static void printResults (Graph graph) {
writer.saveMap ("runtime/mcmc_frequences.tsv", "frequency", occurrences, graph);
double inRun = LONG_RUN ? Math.max (1, ITERATIONS * 0.9 / 100) + 1 : 1;
occurrences.keySet ().forEach (key -> {
occurrences.compute (key, (__, v) -> v / (TRIES * inRun));
});
if (SIGNALS) {
writer.saveNontrivialSignalsMap ("runtime/mcmc_nontrivial.tsv",
"probability", occurrences, graph);
}
writer.saveMap ("runtime/mcmc_results.tsv", "probability", occurrences, graph);
Set <String> orientier = graph.getOrientier ();
if (orientier.size () > 0) {
List <Pair <Vertex, Double>> matched = occurrences.entrySet ().stream ()
. map (Pair::fromMapEntry)
. sorted ((a, b) -> -Double.compare (a.S, b.S))
. limit ((int) (orientier.size () * 1.5))
. filter (pair -> orientier.contains (pair.F.getName ()))
//. forEach (pair -> System.out.println (pair.F.getName ()));
. collect (Collectors.toList ());
StringJoiner sj = new StringJoiner (", ");
matched.forEach (pair -> sj.add (String.format ("%s {p: %.4f}", pair.F.getName (), pair.S)));
System.out.println ("(" + matched.size () + " / " + orientier.size () + ") " + sj.toString ());
GraphDescriptor finalD = graph.getFinalDescriptor (orientier.size (), occurrences);
writer.saveGradientDOTFile ("runtime/final.dot", finalD, occurrences, Color.YELLOW, Color.GRAY);
}
if (likelihoods.size () > 0) {
writer.saveLikelihoods ("runtime/likelihoods.csv", likelihoods);
}
}
}
| [
"shemplo@outlook.com"
] | shemplo@outlook.com |
6e8eda59a1bb4b789976c6cefc72c55773fa44be | fafd831a22b9988325c9b0574bb9a838b410986b | /api/src/main/java/com/laborguru/service/store/file/StoreDefinitionFileParserBean.java | 80ae2b6a675958b05f4d1a411ee5bac11449a44c | [] | no_license | leonards-ar/LaborGuru_SPM_API | 5275c2347f2a5a907e0cd2b60cace6c11381a868 | fb03d24ed075919ca34bfe5738b21c89a89b7151 | refs/heads/master | 2021-01-12T10:24:25.898882 | 2016-05-01T03:16:10 | 2016-05-01T03:16:10 | 76,428,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,677 | java | package com.laborguru.service.store.file;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.ss.usermodel.Row;
import com.laborguru.exception.InvalidUploadFileException;
import com.laborguru.model.Store;
import com.laborguru.util.PoiUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Parses a store definition file
*
* @author <a href="cnunezre@gmail.com">Cristian Nunez Rebolledo</a>
* @version 1.0
* @since SPM 1.0
*
*/
public class StoreDefinitionFileParserBean implements StoreDefinitionFileParser {
private static final Logger log = LoggerFactory.getLogger(StoreDefinitionFileParserBean.class);
/**
* @param storeToUpload
* @return
* @see com.laborguru.service.store.file.StoreDefinitionFileParser#parseStore(java.io.File)
*/
public Store parseStore(File storeToUpload) {
try {
StoreAssembler storeAssembler = StoreAssembler.getStoreAssembler();
Iterator<Row> rit = PoiUtils.getFirstSheetRows(storeToUpload);
//Ignoring the header
rit.next();
while(rit.hasNext()) {
Row row = rit.next();
storeAssembler.addToStore(row);
}
return storeAssembler.assemble();
} catch (FileNotFoundException exceptionFNF) {
String message = "File to parse:"+storeToUpload.getName()+ "is not found";
log.error(message);
throw new InvalidUploadFileException(exceptionFNF, message);
} catch (IOException e) {
String msg = "The file " + storeToUpload.getName() +" passed in as parameter cannot be read.";
log.error(msg);
throw new InvalidUploadFileException(msg);
}
}
}
| [
"federico.barreraoro@mulesoft.com"
] | federico.barreraoro@mulesoft.com |
f87ce54c058af93d33d8b9be8165293953e4cdac | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /fg/fe/src/main/java/org.wp.fe/ui/reader/models/ReaderImageList.java | c38c52a762381890e35945c4928790697aaf5aa4 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 1,700 | java | package org.wp.fe.ui.reader.models;
import org.wp.fe.util.UrlUtils;
import java.util.ArrayList;
/*
* used by ReaderImageScanner to compile a list of images in a specific post
*/
public class ReaderImageList extends ArrayList<String> {
private final boolean mIsPrivate;
public ReaderImageList(boolean isPrivate) {
mIsPrivate = isPrivate;
}
// image urls are always added normalized and without query params for easier matching, and
// to ensure there are no hard-coded sizes in the query
private static String fixImageUrl(final String imageUrl) {
if (imageUrl == null) {
return null;
}
return UrlUtils.normalizeUrl(UrlUtils.removeQuery(imageUrl));
}
public int indexOfImageUrl(final String imageUrl) {
if (imageUrl == null || this.isEmpty()) {
return -1;
}
String fixedUrl = fixImageUrl(imageUrl);
for (int i = 0; i < this.size(); i++) {
if (fixedUrl.equals(this.get(i))) {
return i;
}
}
return -1;
}
public boolean hasImageUrl(final String imageUrl) {
return (indexOfImageUrl(imageUrl) > -1);
}
public void addImageUrl(String imageUrl) {
if (imageUrl != null && imageUrl.startsWith("http")) {
this.add(fixImageUrl(imageUrl));
}
}
public void addImageUrl(@SuppressWarnings("SameParameterValue") int index,
String imageUrl) {
if (imageUrl != null && imageUrl.startsWith("http")) {
this.add(index, fixImageUrl(imageUrl));
}
}
public boolean isPrivate() {
return mIsPrivate;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
d6c48ff85c5ed11c79707f50ce04ead549900d7b | 15beca8181e0061b403d27d2d62010994161d12d | /Aws-MobileBackend/src/main/java/com/fab/digital/incubation/AwsMobileBackendApplication.java | 0b4abfe7bf91c19d732fa278a8abd9fac16f0e01 | [] | no_license | pradeepkumarrayapati/TestRepo | d9d5a4ca7be7e0efa7fe7c5639ad18724aa59388 | 671899d05de1b16e3474b0ac24b5009f39fd78db | refs/heads/master | 2020-04-02T17:33:04.285529 | 2018-10-25T12:07:34 | 2018-10-25T12:07:34 | 154,661,699 | 0 | 0 | null | 2018-10-25T12:07:38 | 2018-10-25T11:46:01 | Java | UTF-8 | Java | false | false | 338 | java | package com.fab.digital.incubation;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AwsMobileBackendApplication {
public static void main(String[] args) {
SpringApplication.run(AwsMobileBackendApplication.class, args);
}
}
| [
"pradeep.mbmq@gmail.com"
] | pradeep.mbmq@gmail.com |
78916622f42b1ae2a869ff6ff12cc1b8ebf1c4a6 | 11968abfbfe936770c0e811f525bdff36f77d397 | /2.JavaCore/src/com/javarush/task/task20/task2011/Solution.java | ab22de394463b6a8409113c5b84a2cb924478022 | [] | no_license | sunsey/JavaRush | 92f2e2bdc9029a694ba3ed957dc3dd377a67b05e | 247fb80d0d82e6a3b585f7abac7cdee5317c44c1 | refs/heads/master | 2020-12-13T19:24:45.684580 | 2017-09-02T14:47:09 | 2017-09-02T14:47:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | package com.javarush.task.task20.task2011;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
/*
Externalizable ะดะปั ะฐะฟะฐััะฐะผะตะฝัะพะฒ
*/
public class Solution {
public static class Apartment implements java.io.Externalizable {
private String address;
private int year;
/**
* Mandatory public no-arg constructor.
*/
public Apartment() { super(); }
public Apartment(String adr, int y) {
address = adr;
year = y;
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(address);
out.writeInt(year);
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
this.address = (String)in.readObject();
this.year = in.readInt();
}
/**
* Prints out the fields. used for testing!
*/
public String toString() {
return("Address: " + address + "\n" + "Year: " + year);
}
}
public static void main(String[] args) {
}
}
| [
"deadlords@mail.ru"
] | deadlords@mail.ru |
c69da1495623e618c5cd45703d7a9e07b372f5d9 | 7a7ba2805a15059c30f31e1b352ab6aa30592de7 | /awd.cloud.suppers/awd.cloud.suppers.interface/src/main/java/awd/cloud/suppers/interfaces/service/kss/imp/SimpleCwbService.java | c5122be0e351b12be43e7b6cd3248fae13914c00 | [] | no_license | tony-catalina/Peking_cloud2 | bc1bf7f377b68ce06c77d2de36554893eaabc697 | c47db69483c203f4aefd37a034ada6aeb182c4fd | refs/heads/master | 2022-12-13T14:55:37.859352 | 2020-03-02T08:13:48 | 2020-03-02T08:13:48 | 244,308,357 | 0 | 1 | null | 2022-12-06T00:46:17 | 2020-03-02T07:35:13 | JavaScript | UTF-8 | Java | false | false | 2,455 | java | package awd.cloud.suppers.interfaces.service.kss.imp;
import awd.cloud.suppers.interfaces.api.KssBaseServersApi;
import awd.cloud.suppers.interfaces.api.KssCoreServersApi;
import awd.cloud.suppers.interfaces.service.kss.CwbService;
import awd.cloud.suppers.interfaces.utils.PagerResult;
import awd.cloud.suppers.interfaces.utils.QueryParam;
import awd.cloud.suppers.interfaces.utils.ResponseMessage;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service("cwbService")
public class SimpleCwbService implements CwbService {
@Autowired
private KssBaseServersApi kssBaseServersApi;
@Autowired
private KssCoreServersApi kssCoreServersApi;
@Override
public ResponseMessage<PagerResult<Map<String, Object>>> getCwb(Map<String, Object> map) {
QueryParam cwParam = new QueryParam();//ๅบไฝๆกไปถ
ResponseMessage<PagerResult<Map<String, Object>>> resultMessage = kssCoreServersApi.queryPwgl(cwParam);
List<Map<String, Object>> data = resultMessage.getResult().getData();
Map<String,Object> resultMap = Maps.newHashMap();
List<Map<String,Object>> cwList = new ArrayList<>();
for (Map<String, Object> m : data) {
Map<String,Object> result = Maps.newHashMap();
result.put("cwh",m.get("cwh"));
QueryParam xxParam = new QueryParam();//ๅบๆฌไฟกๆฏๆกไปถ
xxParam.and("rybh", m.get("rybh"));
ResponseMessage<PagerResult<Map<String, Object>>> xxSesult = kssBaseServersApi.queryJbxx(xxParam);
String xm = (String)xxSesult.getResult().getData().get(0).get("xm");
result.put("xm",xm);
cwList.add(result);
}
resultMap.put("cwList",cwList);
resultMap.put("jsh",map.get("jsh"));
resultMap.put("cwbjfs","ๅบไฝๅธๅฑๆนๅผ,ๅพ
ๅฎ");
resultMessage.getResult().getData().clear();
resultMessage.getResult().getData().add(resultMap);
return resultMessage;
}
@Override
public ResponseMessage<String> saveCwb(Map<String, Object> map) {
return kssBaseServersApi.saveCwb(map);
}
@Override
public ResponseMessage<String> updateCwbById(String id,Map<String, Object> map) {
return kssBaseServersApi.updateCwbById(id,map);
}
}
| [
"m13635576437@163.com"
] | m13635576437@163.com |
52962a25d3c22fcd226abbe5c843b427c9d5f7c0 | b7412138e856f5fff0b1c305235cd5c5b02fa2e3 | /HibernateTest02/src/com/zhou/account/bean/AccountStatus.java | 896353df446a05726c19774edf0affad13d60f5a | [] | no_license | zhoujundong731/6sing | d39d13461f80ca0446f752a1b6d5a942aba321d4 | 3a84764a5f420c068d721406b1718f7b34743c30 | refs/heads/master | 2016-09-05T10:20:50.208000 | 2016-01-04T06:40:49 | 2016-01-04T06:40:49 | 34,320,748 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 88 | java | package com.zhou.account.bean;
public enum AccountStatus {
REGISTER,
NORMAL,
LOCK
}
| [
"1187131468@qq.com"
] | 1187131468@qq.com |
f67e33cca5131e552e386781f542f6949180990b | 5afcdb15f18901c9b339091c7026e749773e5344 | /Learning/src/com/deb/practice/CarPrice.java | a66e34c71c483ba6d1c3d6240bf6097823ebb3a0 | [] | no_license | newcoderDeb/Java-Learning | 84a69bcdea0c161e3c0b376a4dca7989339997d6 | fc11d48c29b4c5c1f80b62c07a774b87c6c0218e | refs/heads/master | 2021-05-18T00:24:01.950373 | 2020-03-29T11:46:49 | 2020-03-29T11:46:49 | 251,020,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 76 | java | package com.deb.practice;
public interface CarPrice {
long getPrice();
}
| [
"debmalyamondal63@gmail.com"
] | debmalyamondal63@gmail.com |
8c8bc83571730a616b729b6783dba2dd171d5ebf | 96ddf5f4096de4d94b29fbc3fc83522a5be6b5a3 | /src/main/java/kmitl/afinal/seproject/servlet/SearchServlet.java | 0c263754c5b2e9b09197155d5f7d0dca51c4cd57 | [] | no_license | belizwp/SeProject | 42d20dc60024daad0c516180e576a0880f68cf72 | 84c3ae67e0ef571717298a5f1b7550b4cb53f991 | refs/heads/master | 2021-08-29T15:53:22.087103 | 2017-12-14T07:03:57 | 2017-12-14T07:03:57 | 113,691,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,578 | java | package kmitl.afinal.seproject.servlet;
import kmitl.afinal.seproject.dao.SheetDao;
import kmitl.afinal.seproject.model.Sheet;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
@WebServlet(name = "SearchServlet", urlPatterns = "/search")
public class SearchServlet extends HttpServlet {
public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
Connection connection = (Connection) getServletContext().getAttribute("connection");
String title = request.getParameter("title");
String faculty = request.getParameter("faculty");
String department = request.getParameter("department");
String branch = request.getParameter("branch");
String subject = request.getParameter("subject");
Sheet sheet = new Sheet();
sheet.setTitle(title.trim().equals("") ? null : title);
sheet.setFaculty_id(faculty.equals("0") ? null : Integer.parseInt(faculty));
sheet.setDepartment_id(department.equals("0") ? null : Integer.parseInt(department));
sheet.setBranch_id(branch.equals("0") ? null : Integer.parseInt(branch));
sheet.setSubject_id(subject.equals("0") ? null : subject);
try {
List<Sheet> result = SheetDao.with(connection).search(sheet);
// PrintWriter out = response.getWriter();
//
// out.println("found " + result.size() + " sheet<br>");
//
// for (Sheet s : result) {
// out.println(s.getTitle() + " | create by " + s.getCreate_by() + "<br>");
// }
request.setAttribute("result", result);
request.getRequestDispatcher("test/result.jsp").forward(request, response);
} catch (SQLException e) {
e.printStackTrace();
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request, response);
}
}
| [
"belizwp@live.com"
] | belizwp@live.com |
da9b26153743ed8e554a54986b6eb0e625bc120e | 59f8a88128929af48e246a7f32b95867b744a9f7 | /hw2-nikkiwang/src/problem2/GiftCard.java | 2ee6962856a04a01b85587925d4159615c136ee4 | [] | no_license | nuopanda/object-oriented-programming | f83d1897be9ddc46596bbbe7ccfb732bddc521eb | e89ea5fa74909d1e7d60c75e091c9141a095af38 | refs/heads/master | 2021-07-12T23:52:28.513563 | 2019-09-28T01:31:39 | 2019-09-28T01:31:39 | 211,426,514 | 0 | 0 | null | 2020-10-13T16:21:45 | 2019-09-28T01:28:30 | HTML | UTF-8 | Java | false | false | 1,804 | java | package problem2;
/**
* Represents a GiftCard with their details--cardNumber, owner, balance
*
* @author nikkiwang
*/
public class GiftCard {
private String cardNumber;
private Owner owner;
private Balance balance;
/**
* Creates a new GiftCard, given the cardNumber as String, owner as Owner, balance as Balance.
*
* @param cardNumber -- the giftcard's card number
* @param owner -- the giftcard's owner
* @param balance -- the giftcard's balance
* @throws IllegalArgumentException if there are any invalid cases
*/
public GiftCard(String cardNumber, Owner owner, Balance balance) throws IllegalArgumentException {
if (cardNumber.length() != 9) throw new IllegalArgumentException("Invalid card number");
this.cardNumber = cardNumber;
this.owner = owner;
this.balance = balance;
}
/**
* @param newGift -- the deposit
* @throws IllegalArgumentException if there are any invalid cases
* update the balance of this gift card
*/
public void depositGift(Deposit newGift) throws IllegalArgumentException {
if (!this.owner.getFirstName().equals(newGift.getFirstName()))
throw new IllegalArgumentException("first name is not matched.");
if (!this.owner.getLastName().equals(newGift.getLastName()))
throw new IllegalArgumentException("last name is not matched.");
if (!this.cardNumber.equals(newGift.getCardNumber()))
throw new IllegalArgumentException("card number is not matched.");
this.balance = this.balance.deposit(newGift.getDollar(), newGift.getCents());
}
/**
* @return the gift card's balance
*/
public Balance getBalance() {
return this.balance;
}
}
| [
"wang.nu@husky.neu.edu"
] | wang.nu@husky.neu.edu |
b8fbc6a03e6ba6d130392b55f617a76a61a128b7 | 63e36d35f51bea83017ec712179302a62608333e | /OnePlusCamera/android/support/v4/graphics/drawable/RoundedBitmapDrawable.java | 804c1c2516313e74a9dfbe988807c5143754d94e | [] | no_license | hiepgaf/oneplus_blobs_decompiled | 672aa002fa670bdcba8fdf34113bc4b8e85f8294 | e1ab1f2dd111f905ff1eee18b6a072606c01c518 | refs/heads/master | 2021-06-26T11:24:21.954070 | 2017-08-26T12:45:56 | 2017-08-26T12:45:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,901 | java | package android.support.v4.graphics.drawable;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader.TileMode;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
public abstract class RoundedBitmapDrawable
extends Drawable
{
private static final int DEFAULT_PAINT_FLAGS = 6;
private boolean mApplyGravity = true;
Bitmap mBitmap;
private int mBitmapHeight;
private BitmapShader mBitmapShader;
private int mBitmapWidth;
private float mCornerRadius;
final Rect mDstRect = new Rect();
final RectF mDstRectF = new RectF();
private int mGravity = 119;
private Paint mPaint = new Paint(6);
private int mTargetDensity = 160;
RoundedBitmapDrawable(Resources paramResources, Bitmap paramBitmap)
{
if (paramResources == null) {}
for (;;)
{
this.mBitmap = paramBitmap;
if (this.mBitmap != null) {
break;
}
this.mBitmapHeight = -1;
this.mBitmapWidth = -1;
return;
this.mTargetDensity = paramResources.getDisplayMetrics().densityDpi;
}
computeBitmapSize();
this.mBitmapShader = new BitmapShader(this.mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
}
private void computeBitmapSize()
{
this.mBitmapWidth = this.mBitmap.getScaledWidth(this.mTargetDensity);
this.mBitmapHeight = this.mBitmap.getScaledHeight(this.mTargetDensity);
}
private static boolean isGreaterThanZero(float paramFloat)
{
return Float.compare(paramFloat, 0.0F) > 0;
}
public void draw(Canvas paramCanvas)
{
Bitmap localBitmap = this.mBitmap;
Paint localPaint;
if (localBitmap != null)
{
updateDstRect();
localPaint = this.mPaint;
if (localPaint.getShader() != null) {
paramCanvas.drawRoundRect(this.mDstRectF, this.mCornerRadius, this.mCornerRadius, localPaint);
}
}
else
{
return;
}
paramCanvas.drawBitmap(localBitmap, null, this.mDstRect, localPaint);
}
public int getAlpha()
{
return this.mPaint.getAlpha();
}
public final Bitmap getBitmap()
{
return this.mBitmap;
}
public ColorFilter getColorFilter()
{
return this.mPaint.getColorFilter();
}
public float getCornerRadius()
{
return this.mCornerRadius;
}
public int getGravity()
{
return this.mGravity;
}
public int getIntrinsicHeight()
{
return this.mBitmapHeight;
}
public int getIntrinsicWidth()
{
return this.mBitmapWidth;
}
public int getOpacity()
{
Bitmap localBitmap;
if (this.mGravity == 119)
{
localBitmap = this.mBitmap;
if (localBitmap != null) {
break label24;
}
}
label24:
while ((localBitmap.hasAlpha()) || (this.mPaint.getAlpha() < 255) || (isGreaterThanZero(this.mCornerRadius)))
{
return -3;
return -3;
}
return -1;
}
public final Paint getPaint()
{
return this.mPaint;
}
void gravityCompatApply(int paramInt1, int paramInt2, int paramInt3, Rect paramRect1, Rect paramRect2)
{
throw new UnsupportedOperationException();
}
public boolean hasAntiAlias()
{
return this.mPaint.isAntiAlias();
}
public boolean hasMipMap()
{
throw new UnsupportedOperationException();
}
public void setAlpha(int paramInt)
{
if (paramInt == this.mPaint.getAlpha()) {
return;
}
this.mPaint.setAlpha(paramInt);
invalidateSelf();
}
public void setAntiAlias(boolean paramBoolean)
{
this.mPaint.setAntiAlias(paramBoolean);
invalidateSelf();
}
public void setColorFilter(ColorFilter paramColorFilter)
{
this.mPaint.setColorFilter(paramColorFilter);
invalidateSelf();
}
public void setCornerRadius(float paramFloat)
{
if (!isGreaterThanZero(paramFloat)) {
this.mPaint.setShader(null);
}
for (;;)
{
this.mCornerRadius = paramFloat;
return;
this.mPaint.setShader(this.mBitmapShader);
}
}
public void setDither(boolean paramBoolean)
{
this.mPaint.setDither(paramBoolean);
invalidateSelf();
}
public void setFilterBitmap(boolean paramBoolean)
{
this.mPaint.setFilterBitmap(paramBoolean);
invalidateSelf();
}
public void setGravity(int paramInt)
{
if (this.mGravity == paramInt) {
return;
}
this.mGravity = paramInt;
this.mApplyGravity = true;
invalidateSelf();
}
public void setMipMap(boolean paramBoolean)
{
throw new UnsupportedOperationException();
}
public void setTargetDensity(int paramInt)
{
if (this.mTargetDensity == paramInt) {
return;
}
if (paramInt != 0)
{
this.mTargetDensity = paramInt;
if (this.mBitmap != null) {
break label37;
}
}
for (;;)
{
invalidateSelf();
return;
paramInt = 160;
break;
label37:
computeBitmapSize();
}
}
public void setTargetDensity(Canvas paramCanvas)
{
setTargetDensity(paramCanvas.getDensity());
}
public void setTargetDensity(DisplayMetrics paramDisplayMetrics)
{
setTargetDensity(paramDisplayMetrics.densityDpi);
}
void updateDstRect()
{
if (!this.mApplyGravity) {
return;
}
gravityCompatApply(this.mGravity, this.mBitmapWidth, this.mBitmapHeight, getBounds(), this.mDstRect);
this.mDstRectF.set(this.mDstRect);
this.mApplyGravity = false;
}
}
/* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/android/support/v4/graphics/drawable/RoundedBitmapDrawable.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"joshuous@gmail.com"
] | joshuous@gmail.com |
8fc91492a71ee68b287e7bdf0be19e1537a4bd69 | c28692fd4aa3d1865599fd36ecb353673ae706f5 | /src/lesson/arraylists/LesssonUppgift6.java | a5457df93a44ac14a3267556d7653cdb1844a248 | [
"MIT"
] | permissive | JonasAndree/Programmering2 | 99a23f0533705e962798ec6dfcd84832e2cb06b5 | 92985a953e0899016e941b67e712e48085f5365d | refs/heads/master | 2021-01-19T16:47:49.822496 | 2018-10-10T08:48:24 | 2018-10-10T08:48:24 | 101,028,943 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 695 | java | package lesson.arraylists;
import java.util.ArrayList;
import java.util.Arrays;
public class LesssonUppgift6 {
public static void main(String[] args) {
System.out.println("6.Write a Java program to find the index of an array element.\n And print the result.\n");
ArrayList<Integer> list = new ArrayList<Integer>();
int specificValue = 2013;
list.addAll(Arrays.asList(1789, 2035, 1899, 1456, 2013, 1458, 2458, 1254, 1472, 2365, 1456, 2165, 1457, 2456));
System.out.println(list.contains(2035));
ArrayList<Item> inventory = new ArrayList<Item>();
inventory.add(new Item());
inventory.add(new Item());
inventory.add(new Item());
inventory.add(new Item());
}
}
| [
"31105305+JonasAndree@users.noreply.github.com"
] | 31105305+JonasAndree@users.noreply.github.com |
8b900d20d8f6ba76cfcd2d93294b6941e1475231 | eb8f174b93a6f58762d8db7945f68092970bb1aa | /miniMaxV2/MiniMaxV2.java | e693d6f1cc3db63e006ecfe6e0048a8f9008d0b5 | [] | no_license | 5871jin/Lynx-Reversi-Player | 44d83d3916781cd8394a3e5878325953786a256d | 69c5893f3e0ada742e940d43d0d42bb7f333deac | refs/heads/master | 2021-05-27T17:37:26.460507 | 2012-02-05T11:12:49 | 2012-02-05T11:12:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,882 | java | /**
* This package is all about miniMax player version 2
*/
package miniMaxV2;
import reversi.*;
import lookOneAheadPlayer.LookOneAheadPlayer;
/**
* This player implements a method to evaluate a game situation. It tries to
* find the best move by simulating each possible move and then evaluating the
* resulting situation.
* @author Jonas Huber
* @author Benedikt Koeppel
*
*/
public class MiniMaxV2 extends LookOneAheadPlayer {
/*
* Some parameters.
*
* Don't forget the changeToMaxStrategyThreshold in super!
*/
private final int MAX_DEPTH = 6; /** The maximum depth we go down the tree. */
private final int ABORT_TIME = 100; /** The minium number of ms that have to be left before we abort. */
/*
* Global variables.
*/
private long startTime = 0;
/**
* This player makes its move by performing a minimax-search down to a
* specified depth. It also tries to stay within the given time limit.
*
* @param gb The Gameboard on which we are playing.
* @see lookOneAheadPlayer.LookOneAheadPlayer#nextMove(reversi.GameBoard)
*/
public Coordinates nextMove( GameBoard gb ) {
/*
* The first thing we do, is to remember, when the this move
* has started, so that we can track the elapsed time.
*/
startTime = System.currentTimeMillis();
/* Does a move exist? If not we do "passen"... */
if ( !possibleMoveExists( gb ) ) {
return null;
}
/* Variables used. */
Coordinates coord = null;
Coordinates bestCoord = null;
int eval = Integer.MIN_VALUE;
int bestEval = Integer.MIN_VALUE;
/* We store the current situation in a TextGameBoard. */
TextGameBoard boardAfterNextMove = new TextGameBoard( gb );
/*
* Iteration through every field on the board.
*/
for ( int row = 1; row <= gb.getSize(); row++ ) {
for ( int col = 1; col <= gb.getSize(); col++ ) {
coord = new Coordinates( row, col );
/* Setting the back to the initial situation... */
boardAfterNextMove.updateBoard( gb );
/*
* If a move to this field is possible, we're going to
* build and evaluate the resulting MiniMax-tree.
*/
if ( boardAfterNextMove.checkMove(color, coord) ) {
boardAfterNextMove.makeMove( color, coord );
eval = Math.max( eval, -miniMax( color, boardAfterNextMove, 1 ) );
System.out.println("(II) Checked move (" + coord.getRow() + "," + coord.getCol() + "): eval=" + eval);
/* If this move is better than a previous one, we choose this move. */
if ( eval > bestEval ) {
bestCoord = coord;
bestEval = eval;
}
}
}
}
if ( bestCoord == null ) {
System.out.println( "(EE) Will return null, but bestEval = " + bestEval);
}
System.out.println("(II) Chose move (" + bestCoord.getRow() + "," + bestCoord.getCol() + ") which has eval=" + bestEval + ".");
return bestCoord;
} /* End of nextMove(). */
/**
* This function performs a minimax search starting with a given situation, which
* means a gameboard and the information, which player has made the *previous* move!
*
* @param color The color of the player who made the *previous* move!
* @param tgb The gameboard with the situation to evaluate.
* @param depth The current depth in the tree.
* @return
*/
private int miniMax( int colorBefore, TextGameBoard tgb, int depth ) {
int result;
int nextColor;
Coordinates coord;
/*
* Determine the color of the next player.
*/
if ( colorBefore == GameBoard.RED ) {
nextColor = GameBoard.GREEN;
} else {
nextColor = GameBoard.RED;
}
/*
* TODO: Is here the place to check if enough time is left?
*/
if ( !timeOK() ) {
System.out.println("(WW) Runnning out of time...");
return evaluate( color, tgb );
}
/*
* We have also to check if the game is over and if yes, who has won!
*/
if ( isGameFinished( tgb ) ) {
if ( tgb.countStones( color ) > 32 ) {
System.out.println("(II) Found winning situation!");
return Integer.MAX_VALUE - 1;
} else if (tgb.countStones( enemyColor ) > 32 ){
System.out.println("(II) Found loosing situation!");
return Integer.MIN_VALUE + 1;
}
}
/*
* If we have reached the maximum depth we evaluate this situation and return.
*/
if ( depth >= MAX_DEPTH ) {
return evaluate( color, tgb );
}
/* Initialize a gameboard with the current situation. */
TextGameBoard boardAfterNextMove = new TextGameBoard( tgb );
/*
* Set the result initially to -infty. Note the "+1" which is necessary because if this is
* our only move, it has to be taken in nextMove().
*/
result = Integer.MIN_VALUE + 1;
/* Now we iterate over all the fields while searching for possible moves. */
for ( int row = 1; row <= tgb.getSize(); row++ ) {
for ( int col = 1; col <= tgb.getSize(); col++ ) {
coord = new Coordinates( row, col );
/* Resetting the board. */
boardAfterNextMove.updateBoard( tgb );
/*
* If the move is possible, we do the move and thereby check the turn
* of which player it is.
* (See English Wikipedia!)
*/
if ( boardAfterNextMove.checkMove( nextColor, coord ) ) {
boardAfterNextMove.makeMove( nextColor, coord );
result = Math.max( result, -miniMax( nextColor, boardAfterNextMove, depth + 1 ) );
}
}
} /* End of iteration over all fields. */
return result;
} /* End of miniMax(). */
/**
* Checks whether we are still within the timeout limit and didn't yet
* violate our saftey-zone...
*
* @return true if ok, false else.
*/
private boolean timeOK() {
long currentTime = System.currentTimeMillis();
if ( timeout - (currentTime - startTime) <= ABORT_TIME ) {
return false;
} else {
return true;
}
} /* End of timeOK(). */
} /* End of class MiniMaxV2. */
| [
"be.public@gmail.com"
] | be.public@gmail.com |
c942c2cd50dbcc01c3780ef9f4c386a4e34ace02 | 76a99a8d84ba9172c9f412142e53a66cc85bbed3 | /app/src/main/java/com/tomgrubbe/shoplite/database/RemovedItemsTable.java | d1fd5f929af0b5e3aa5feed10de69fb4b51696fd | [
"MIT"
] | permissive | Tomgrubbe-dot-com/ShopLite | 10c049c285f715f8800f7a49d3bffaf1a6dd5e8e | 2808b92029bbe3394638c0e2bc600c2e4e7a63ce | refs/heads/master | 2021-01-01T15:39:57.848667 | 2017-08-25T04:33:24 | 2017-08-25T04:33:24 | 97,671,061 | 0 | 0 | null | 2017-07-29T18:22:51 | 2017-07-19T03:58:45 | Java | UTF-8 | Java | false | false | 4,030 | java | package com.tomgrubbe.shoplite.database;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import com.tomgrubbe.shoplite.model.RemovedItem;
import com.tomgrubbe.shoplite.utils.Utils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
public class RemovedItemsTable extends TableBase {
public static final String TABLE_NAME = "RemovedItem";
public static final String COLUMN_ID = "RecentlyRemovedId";
public static final String COLUMN_PRODUCT_ID = "ProductId";
public static final String COLUMN_IS_CHECKED = "IsChecked";
public static final String COLUMN_DATE_TIME = "Date";
public static final String[] ALL_COLUMNS =
{ COLUMN_ID, COLUMN_PRODUCT_ID, COLUMN_IS_CHECKED, COLUMN_DATE_TIME };
public static final String SQL_CREATE =
"CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "(" +
COLUMN_ID + " TEXT PRIMARY KEY," +
COLUMN_PRODUCT_ID + " TEXT," +
COLUMN_IS_CHECKED + " TEXT," +
COLUMN_DATE_TIME + " TEXT" + ");";
public static final String SQL_DELETE =
"DROP TABLE " + TABLE_NAME;
public RemovedItemsTable(Context context) {
super(context);
openDB().execSQL(SQL_CREATE);
}
public long getRemovedItemsCount() {
return DatabaseUtils.queryNumEntries(openDB(), TABLE_NAME);
}
public void addItem(RemovedItem item) {
ContentValues values = item.toValues();
openDB().insert(TABLE_NAME, null, values);
}
public void deleteItem(RemovedItem item) {
openDB().delete(TABLE_NAME, COLUMN_ID + " = ?", new String[] { item.getRemovedItemId() } );
}
public void deleteAll() {
openDB().delete(TABLE_NAME, null, null);
}
public void updateRemovedItem(RemovedItem item) {
int checked = (item.isChecked()) ? 1 : 0;
ContentValues values = new ContentValues();
values.put(COLUMN_ID, item.getRemovedItemId());
values.put(COLUMN_PRODUCT_ID, item.getProductId());
values.put(COLUMN_IS_CHECKED, checked);
String date = Utils.getDateStringNow();
values.put(COLUMN_DATE_TIME, date);
openDB().update(TABLE_NAME, values, COLUMN_ID + "= ?", new String[] { item.getRemovedItemId() });
}
public RemovedItem fromProductId(String id) {
Cursor cursor = openDB().query(TABLE_NAME, null, COLUMN_PRODUCT_ID + "= ?", new String[] { id }, null, null, null);
if (cursor.moveToNext()) {
String itemId = cursor.getString(cursor.getColumnIndex(COLUMN_ID));
String productId = cursor.getString(cursor.getColumnIndex(COLUMN_PRODUCT_ID));
boolean isChecked = (cursor.getInt(cursor.getColumnIndex(COLUMN_IS_CHECKED)) != 0);
String date = cursor.getString(cursor.getColumnIndex(COLUMN_DATE_TIME));
cursor.close();
return new RemovedItem(itemId, productId, isChecked, date);
}
cursor.close();
return null;
}
public List<RemovedItem> getAllRemovedItems() {
List<RemovedItem> items = new ArrayList<>();
Cursor cursor = openDB().query(TABLE_NAME, ALL_COLUMNS, null, null, null, null, COLUMN_DATE_TIME + " DESC");
while (cursor.moveToNext()) {
String removedItemId = cursor.getString(cursor.getColumnIndex(COLUMN_ID));
String productId = cursor.getString(cursor.getColumnIndex(COLUMN_PRODUCT_ID));
boolean isChecked = (cursor.getInt(cursor.getColumnIndex(COLUMN_IS_CHECKED)) != 0);
String date = cursor.getString(cursor.getColumnIndex(COLUMN_DATE_TIME));
RemovedItem removedItem = new RemovedItem(removedItemId, productId, isChecked, date);
items.add(removedItem);
}
cursor.close();
return items;
}
}
| [
"tomg@tomgrubbe.com"
] | tomg@tomgrubbe.com |
625552844af0c5560e5c7594882edb173ff75c86 | 684bc40dbcf9ba8b09c1c5c3b835be227d883df3 | /app/src/main/java/com/uniport/www/uniportmobile/Directory.java | ad91264262df10324126af761a51a9ae8f4c50bb | [
"MIT"
] | permissive | ebukaprof/UniMobile | 213e4a4701de4470ebaa1e40fc91195e40c0dc8f | 21fd94b87180a568835405061f17f6a3ab559eb3 | refs/heads/master | 2021-01-01T04:41:31.720645 | 2017-07-14T10:47:56 | 2017-07-14T10:47:56 | 97,223,979 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,295 | java | package com.uniport.www.uniportmobile;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.ListView;
import GneralCustomAdapter.DirectoryListAdapter;
/**
* Created by INNOVATIONIST-PC on 3/15/2015.
*/
public class Directory extends ActionBarActivity {
ListView listView;
private String [] nameOfLecturers = {" Joseph A. Ajienka", " EthelbertChinaka Nduka "};
private String [] emails = {"Email: info@uniport.ng.edu" ," Email: info@uniport.ng.edu"};
private String [] phoneNumb = {"Tel:N/A ", "Tel:N/A "};
private String [] designations = {"Vice Chancellor" , " Deputy Vice Chancellor"};
private String [] departments = {"Department: Petroleum Engineering " ," Department: Mathematics"};
private int [] lecturerImageId = {R.drawable.vcpix, R.drawable.dvcpix};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.directory);
DirectoryListAdapter directoryListAdapter = new DirectoryListAdapter(Directory.this,nameOfLecturers,emails,phoneNumb,designations,departments,lecturerImageId);
listView = (ListView) findViewById(R.id.listViewDirectory);
listView.setAdapter(directoryListAdapter);
}
}
| [
"ebukaprof@gmail.com"
] | ebukaprof@gmail.com |
3dcfc5049574ead420fd77737a2eb378638f06dd | 8637f3a7112cae2da1fb06ef57a2fa1a3f72028e | /google-api-grpc/proto-google-cloud-vision-v1p2beta1/src/main/java/com/google/cloud/vision/v1p2beta1/ColorInfo.java | a8177291159390b077e5d602774f742752b7edf4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | DalavanCloud/google-cloud-java | 293fb286aa28c9030e611e549801197d2b6fb1d8 | d57efcf59305315a003d1b0fe92760d9972d79d0 | refs/heads/master | 2020-03-23T00:54:44.846988 | 2018-07-13T17:30:10 | 2018-07-13T17:30:10 | 140,891,775 | 1 | 0 | null | 2018-07-13T20:49:28 | 2018-07-13T20:49:28 | null | UTF-8 | Java | false | true | 24,367 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/vision/v1p2beta1/image_annotator.proto
package com.google.cloud.vision.v1p2beta1;
/**
* <pre>
* Color information consists of RGB channels, score, and the fraction of
* the image that the color occupies in the image.
* </pre>
*
* Protobuf type {@code google.cloud.vision.v1p2beta1.ColorInfo}
*/
public final class ColorInfo extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.cloud.vision.v1p2beta1.ColorInfo)
ColorInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use ColorInfo.newBuilder() to construct.
private ColorInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private ColorInfo() {
score_ = 0F;
pixelFraction_ = 0F;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private ColorInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
com.google.type.Color.Builder subBuilder = null;
if (color_ != null) {
subBuilder = color_.toBuilder();
}
color_ = input.readMessage(com.google.type.Color.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(color_);
color_ = subBuilder.buildPartial();
}
break;
}
case 21: {
score_ = input.readFloat();
break;
}
case 29: {
pixelFraction_ = input.readFloat();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p2beta1_ColorInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p2beta1_ColorInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p2beta1.ColorInfo.class, com.google.cloud.vision.v1p2beta1.ColorInfo.Builder.class);
}
public static final int COLOR_FIELD_NUMBER = 1;
private com.google.type.Color color_;
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public boolean hasColor() {
return color_ != null;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public com.google.type.Color getColor() {
return color_ == null ? com.google.type.Color.getDefaultInstance() : color_;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public com.google.type.ColorOrBuilder getColorOrBuilder() {
return getColor();
}
public static final int SCORE_FIELD_NUMBER = 2;
private float score_;
/**
* <pre>
* Image-specific score for this color. Value in range [0, 1].
* </pre>
*
* <code>float score = 2;</code>
*/
public float getScore() {
return score_;
}
public static final int PIXEL_FRACTION_FIELD_NUMBER = 3;
private float pixelFraction_;
/**
* <pre>
* The fraction of pixels the color occupies in the image.
* Value in range [0, 1].
* </pre>
*
* <code>float pixel_fraction = 3;</code>
*/
public float getPixelFraction() {
return pixelFraction_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (color_ != null) {
output.writeMessage(1, getColor());
}
if (score_ != 0F) {
output.writeFloat(2, score_);
}
if (pixelFraction_ != 0F) {
output.writeFloat(3, pixelFraction_);
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (color_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getColor());
}
if (score_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(2, score_);
}
if (pixelFraction_ != 0F) {
size += com.google.protobuf.CodedOutputStream
.computeFloatSize(3, pixelFraction_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.vision.v1p2beta1.ColorInfo)) {
return super.equals(obj);
}
com.google.cloud.vision.v1p2beta1.ColorInfo other = (com.google.cloud.vision.v1p2beta1.ColorInfo) obj;
boolean result = true;
result = result && (hasColor() == other.hasColor());
if (hasColor()) {
result = result && getColor()
.equals(other.getColor());
}
result = result && (
java.lang.Float.floatToIntBits(getScore())
== java.lang.Float.floatToIntBits(
other.getScore()));
result = result && (
java.lang.Float.floatToIntBits(getPixelFraction())
== java.lang.Float.floatToIntBits(
other.getPixelFraction()));
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasColor()) {
hash = (37 * hash) + COLOR_FIELD_NUMBER;
hash = (53 * hash) + getColor().hashCode();
}
hash = (37 * hash) + SCORE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getScore());
hash = (37 * hash) + PIXEL_FRACTION_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(
getPixelFraction());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.vision.v1p2beta1.ColorInfo prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Color information consists of RGB channels, score, and the fraction of
* the image that the color occupies in the image.
* </pre>
*
* Protobuf type {@code google.cloud.vision.v1p2beta1.ColorInfo}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p2beta1.ColorInfo)
com.google.cloud.vision.v1p2beta1.ColorInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p2beta1_ColorInfo_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p2beta1_ColorInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p2beta1.ColorInfo.class, com.google.cloud.vision.v1p2beta1.ColorInfo.Builder.class);
}
// Construct using com.google.cloud.vision.v1p2beta1.ColorInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
if (colorBuilder_ == null) {
color_ = null;
} else {
color_ = null;
colorBuilder_ = null;
}
score_ = 0F;
pixelFraction_ = 0F;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.cloud.vision.v1p2beta1.ImageAnnotatorProto.internal_static_google_cloud_vision_v1p2beta1_ColorInfo_descriptor;
}
public com.google.cloud.vision.v1p2beta1.ColorInfo getDefaultInstanceForType() {
return com.google.cloud.vision.v1p2beta1.ColorInfo.getDefaultInstance();
}
public com.google.cloud.vision.v1p2beta1.ColorInfo build() {
com.google.cloud.vision.v1p2beta1.ColorInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.cloud.vision.v1p2beta1.ColorInfo buildPartial() {
com.google.cloud.vision.v1p2beta1.ColorInfo result = new com.google.cloud.vision.v1p2beta1.ColorInfo(this);
if (colorBuilder_ == null) {
result.color_ = color_;
} else {
result.color_ = colorBuilder_.build();
}
result.score_ = score_;
result.pixelFraction_ = pixelFraction_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.vision.v1p2beta1.ColorInfo) {
return mergeFrom((com.google.cloud.vision.v1p2beta1.ColorInfo)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.vision.v1p2beta1.ColorInfo other) {
if (other == com.google.cloud.vision.v1p2beta1.ColorInfo.getDefaultInstance()) return this;
if (other.hasColor()) {
mergeColor(other.getColor());
}
if (other.getScore() != 0F) {
setScore(other.getScore());
}
if (other.getPixelFraction() != 0F) {
setPixelFraction(other.getPixelFraction());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.vision.v1p2beta1.ColorInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.cloud.vision.v1p2beta1.ColorInfo) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.type.Color color_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder> colorBuilder_;
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public boolean hasColor() {
return colorBuilder_ != null || color_ != null;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public com.google.type.Color getColor() {
if (colorBuilder_ == null) {
return color_ == null ? com.google.type.Color.getDefaultInstance() : color_;
} else {
return colorBuilder_.getMessage();
}
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public Builder setColor(com.google.type.Color value) {
if (colorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
color_ = value;
onChanged();
} else {
colorBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public Builder setColor(
com.google.type.Color.Builder builderForValue) {
if (colorBuilder_ == null) {
color_ = builderForValue.build();
onChanged();
} else {
colorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public Builder mergeColor(com.google.type.Color value) {
if (colorBuilder_ == null) {
if (color_ != null) {
color_ =
com.google.type.Color.newBuilder(color_).mergeFrom(value).buildPartial();
} else {
color_ = value;
}
onChanged();
} else {
colorBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public Builder clearColor() {
if (colorBuilder_ == null) {
color_ = null;
onChanged();
} else {
color_ = null;
colorBuilder_ = null;
}
return this;
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public com.google.type.Color.Builder getColorBuilder() {
onChanged();
return getColorFieldBuilder().getBuilder();
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
public com.google.type.ColorOrBuilder getColorOrBuilder() {
if (colorBuilder_ != null) {
return colorBuilder_.getMessageOrBuilder();
} else {
return color_ == null ?
com.google.type.Color.getDefaultInstance() : color_;
}
}
/**
* <pre>
* RGB components of the color.
* </pre>
*
* <code>.google.type.Color color = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>
getColorFieldBuilder() {
if (colorBuilder_ == null) {
colorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>(
getColor(),
getParentForChildren(),
isClean());
color_ = null;
}
return colorBuilder_;
}
private float score_ ;
/**
* <pre>
* Image-specific score for this color. Value in range [0, 1].
* </pre>
*
* <code>float score = 2;</code>
*/
public float getScore() {
return score_;
}
/**
* <pre>
* Image-specific score for this color. Value in range [0, 1].
* </pre>
*
* <code>float score = 2;</code>
*/
public Builder setScore(float value) {
score_ = value;
onChanged();
return this;
}
/**
* <pre>
* Image-specific score for this color. Value in range [0, 1].
* </pre>
*
* <code>float score = 2;</code>
*/
public Builder clearScore() {
score_ = 0F;
onChanged();
return this;
}
private float pixelFraction_ ;
/**
* <pre>
* The fraction of pixels the color occupies in the image.
* Value in range [0, 1].
* </pre>
*
* <code>float pixel_fraction = 3;</code>
*/
public float getPixelFraction() {
return pixelFraction_;
}
/**
* <pre>
* The fraction of pixels the color occupies in the image.
* Value in range [0, 1].
* </pre>
*
* <code>float pixel_fraction = 3;</code>
*/
public Builder setPixelFraction(float value) {
pixelFraction_ = value;
onChanged();
return this;
}
/**
* <pre>
* The fraction of pixels the color occupies in the image.
* Value in range [0, 1].
* </pre>
*
* <code>float pixel_fraction = 3;</code>
*/
public Builder clearPixelFraction() {
pixelFraction_ = 0F;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p2beta1.ColorInfo)
}
// @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ColorInfo)
private static final com.google.cloud.vision.v1p2beta1.ColorInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.vision.v1p2beta1.ColorInfo();
}
public static com.google.cloud.vision.v1p2beta1.ColorInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<ColorInfo>
PARSER = new com.google.protobuf.AbstractParser<ColorInfo>() {
public ColorInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ColorInfo(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<ColorInfo> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<ColorInfo> getParserForType() {
return PARSER;
}
public com.google.cloud.vision.v1p2beta1.ColorInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| [
"noreply@github.com"
] | DalavanCloud.noreply@github.com |
73055425b669c814b2d029c18f490419be01a002 | 12c08ba5a0c74acf1a84b24277c45d530f37c777 | /app/src/main/java/tabian/com/example/igtest/materialcamera/internal/BaseCaptureActivity.java | 271a577505b909b2da0ce3419759d6bd38a2b330 | [] | no_license | jy-1030/LiveShop | c23c8136604c005a22586427310b5d9358bd03fd | d78cd62f8b6a184264668adb3d5368cfc9678e12 | refs/heads/master | 2023-04-29T05:53:46.471765 | 2021-05-13T09:51:17 | 2021-05-13T09:51:17 | 366,963,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 31,602 | java | package tabian.com.example.igtest.materialcamera.internal;
import android.Manifest;
import android.app.AlertDialog;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.media.CamcorderProfile;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ProgressBar;
import android.widget.Toast;
import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import com.afollestad.materialdialogs.MaterialDialog;
import com.example.igtest.R;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import tabian.com.example.igtest.Utils.FilePaths;
import tabian.com.example.igtest.Utils.ImageManager;
import tabian.com.example.igtest.Utils.RotateBitmap;
import tabian.com.example.igtest.materialcamera.ICallback;
import tabian.com.example.igtest.materialcamera.MaterialCamera;
import tabian.com.example.igtest.materialcamera.TimeLimitReachedException;
import tabian.com.example.igtest.materialcamera.util.CameraUtil;
import tabian.com.example.igtest.videocompressor.file.FileUtils;
import tabian.com.example.igtest.videocompressor.video.MediaController;
/** @author Aidan Follestad (afollestad) */
public abstract class BaseCaptureActivity extends AppCompatActivity
implements BaseCaptureInterface {
private static final String TAG = "BaseCaptureActivity";
private static final int RESULT_ADD_NEW_STORY = 7891;
private static final int PROGRESS_BAR_ID = 5544;
private int mCameraPosition = CAMERA_POSITION_UNKNOWN;
private int mFlashMode = FLASH_MODE_OFF;
private boolean mRequestingPermission;
private long mRecordingStart = -1;
private long mRecordingEnd = -1;
private long mLengthLimit = -1;
private Object mFrontCameraId;
private Object mBackCameraId;
private boolean mDidRecord = false;
private List<Integer> mFlashModes;
private ProgressBar mProgressBar;
private AlertDialog mAlertDialog;
private String mUri = null;
private String mUploadUri = null;
private File tempFile;
private Boolean mDeleteCompressedMedia = false;
public static final int PERMISSION_RC = 69;
@IntDef({CAMERA_POSITION_UNKNOWN, CAMERA_POSITION_BACK, CAMERA_POSITION_FRONT})
@Retention(RetentionPolicy.SOURCE)
public @interface CameraPosition {}
public static final int CAMERA_POSITION_UNKNOWN = 0;
public static final int CAMERA_POSITION_FRONT = 1;
public static final int CAMERA_POSITION_BACK = 2;
@IntDef({FLASH_MODE_OFF, FLASH_MODE_ALWAYS_ON, FLASH_MODE_AUTO})
@Retention(RetentionPolicy.SOURCE)
public @interface FlashMode {}
public static final int FLASH_MODE_OFF = 0;
public static final int FLASH_MODE_ALWAYS_ON = 1;
public static final int FLASH_MODE_AUTO = 2;
@Override
protected final void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt("camera_position", mCameraPosition);
outState.putBoolean("requesting_permission", mRequestingPermission);
outState.putLong("recording_start", mRecordingStart);
outState.putLong("recording_end", mRecordingEnd);
outState.putLong(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LENGTH_LIMIT, mLengthLimit);
if (mFrontCameraId instanceof String) {
outState.putString("front_camera_id_str", (String) mFrontCameraId);
outState.putString("back_camera_id_str", (String) mBackCameraId);
} else {
if (mFrontCameraId != null) outState.putInt("front_camera_id_int", (Integer) mFrontCameraId);
if (mBackCameraId != null) outState.putInt("back_camera_id_int", (Integer) mBackCameraId);
}
outState.putInt("flash_mode", mFlashMode);
}
@Override
protected final void onCreate(Bundle savedInstanceState) {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
super.onCreate(savedInstanceState);
if (!CameraUtil.hasCamera(this)) {
new MaterialDialog.Builder(this)
.title(R.string.mcam_error)
.content(R.string.mcam_video_capture_unsupported)
.positiveText(android.R.string.ok)
.dismissListener(
new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
})
.show();
return;
}
setContentView(R.layout.mcam_activity_videocapture);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final int primaryColor = getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.PRIMARY_COLOR, 0);
final boolean isPrimaryDark = CameraUtil.isColorDark(primaryColor);
final Window window = getWindow();
window.setStatusBarColor(CameraUtil.darkenColor(primaryColor));
window.setNavigationBarColor(isPrimaryDark ? primaryColor : Color.BLUE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
final View view = window.getDecorView();
int flags = view.getSystemUiVisibility();
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
view.setSystemUiVisibility(flags);
}
}
if (null == savedInstanceState) {
checkPermissions();
mLengthLimit = getIntent().getLongExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LENGTH_LIMIT, -1);
} else {
mCameraPosition = savedInstanceState.getInt("camera_position", -1);
mRequestingPermission = savedInstanceState.getBoolean("requesting_permission", false);
mRecordingStart = savedInstanceState.getLong("recording_start", -1);
mRecordingEnd = savedInstanceState.getLong("recording_end", -1);
mLengthLimit = savedInstanceState.getLong(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LENGTH_LIMIT, -1);
if (savedInstanceState.containsKey("front_camera_id_str")) {
mFrontCameraId = savedInstanceState.getString("front_camera_id_str");
mBackCameraId = savedInstanceState.getString("back_camera_id_str");
} else {
mFrontCameraId = savedInstanceState.getInt("front_camera_id_int");
mBackCameraId = savedInstanceState.getInt("back_camera_id_int");
}
mFlashMode = savedInstanceState.getInt("flash_mode");
}
getWindow()
.addFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
private void checkPermissions() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
showInitialRecorder();
return;
}
final boolean cameraGranted =
ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
== PackageManager.PERMISSION_GRANTED;
final boolean audioGranted =
ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
== PackageManager.PERMISSION_GRANTED;
final boolean audioNeeded = !useStillshot() && !audioDisabled();
String[] perms = null;
if (cameraGranted) {
if (audioNeeded && !audioGranted) {
perms = new String[] {Manifest.permission.RECORD_AUDIO};
}
} else {
if (audioNeeded && !audioGranted) {
perms = new String[] {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO};
} else {
perms = new String[] {Manifest.permission.CAMERA};
}
}
if (perms != null) {
ActivityCompat.requestPermissions(this, perms, PERMISSION_RC);
mRequestingPermission = true;
} else {
showInitialRecorder();
}
}
@Override
protected final void onPause() {
Log.d(TAG, "onPause: called.");
super.onPause();
if (!isFinishing() && !isChangingConfigurations() && !mRequestingPermission) finish();
}
@Override
public final void onBackPressed() {
Fragment frag = getFragmentManager().findFragmentById(R.id.container);
if (frag != null) {
if (frag instanceof tabian.com.example.igtest.materialcamera.internal.PlaybackVideoFragment && allowRetry()) {
onRetry(((tabian.com.example.igtest.materialcamera.internal.CameraUriInterface) frag).getOutputUri());
return;
} else if (frag instanceof tabian.com.example.igtest.materialcamera.internal.BaseCameraFragment) {
((tabian.com.example.igtest.materialcamera.internal.BaseCameraFragment) frag).cleanup();
} else if (frag instanceof BaseGalleryFragment && allowRetry()) {
onRetry(((tabian.com.example.igtest.materialcamera.internal.CameraUriInterface) frag).getOutputUri());
return;
}
}
// deleteTempFile();
finish();
}
@NonNull
public abstract Fragment getFragment();
public final Fragment createFragment() {
Fragment frag = getFragment();
frag.setArguments(getIntent().getExtras());
return frag;
}
@Override
public void setRecordingStart(long start) {
mRecordingStart = start;
if (start > -1 && hasLengthLimit()) setRecordingEnd(mRecordingStart + getLengthLimit());
else setRecordingEnd(-1);
}
@Override
public long getRecordingStart() {
return mRecordingStart;
}
@Override
public void setRecordingEnd(long end) {
mRecordingEnd = end;
}
@Override
public long getRecordingEnd() {
return mRecordingEnd;
}
@Override
public long getLengthLimit() {
return mLengthLimit;
}
@Override
public boolean hasLengthLimit() {
return getLengthLimit() > -1;
}
@Override
public boolean countdownImmediately() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.COUNTDOWN_IMMEDIATELY, false);
}
@Override
public void setCameraPosition(int position) {
mCameraPosition = position;
}
@Override
public void toggleCameraPosition() {
if (getCurrentCameraPosition() == CAMERA_POSITION_FRONT) {
// Front, go to back if possible
if (getBackCamera() != null) setCameraPosition(CAMERA_POSITION_BACK);
} else {
// Back, go to front if possible
if (getFrontCamera() != null) setCameraPosition(CAMERA_POSITION_FRONT);
}
}
@Override
public int getCurrentCameraPosition() {
return mCameraPosition;
}
@Override
public Object getCurrentCameraId() {
if (getCurrentCameraPosition() == CAMERA_POSITION_FRONT) return getFrontCamera();
else return getBackCamera();
}
@Override
public void setFrontCamera(Object id) {
mFrontCameraId = id;
}
@Override
public Object getFrontCamera() {
return mFrontCameraId;
}
@Override
public void setBackCamera(Object id) {
mBackCameraId = id;
}
@Override
public Object getBackCamera() {
return mBackCameraId;
}
private void showInitialRecorder() {
getFragmentManager().beginTransaction().replace(R.id.container, createFragment()).commit();
}
@Override
public final void onRetry(@Nullable String outputUri) {
if (outputUri != null) deleteOutputFile(outputUri);
if (!shouldAutoSubmit() || restartTimerOnRetry()) setRecordingStart(-1);
if (getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.RETRY_EXITS, false)) {
setResult(
RESULT_OK,
new Intent().putExtra(MaterialCamera.STATUS_EXTRA, MaterialCamera.STATUS_RETRY));
finish();
return;
}
getFragmentManager().beginTransaction().replace(R.id.container, createFragment()).commit();
}
@Override
public final void onShowPreview(@Nullable final String outputUri, boolean countdownIsAtZero) {
if ((shouldAutoSubmit() && (countdownIsAtZero || !allowRetry() || !hasLengthLimit()))
|| outputUri == null) {
if (outputUri == null) {
setResult(
RESULT_CANCELED,
new Intent().putExtra(MaterialCamera.ERROR_EXTRA, new TimeLimitReachedException()));
finish();
return;
}
useMedia(outputUri);
} else {
if (!hasLengthLimit() || !continueTimerInPlayback()) {
// No countdown or countdown should not continue through playback, reset timer to 0
setRecordingStart(-1);
}
Fragment frag =
PlaybackVideoFragment.newInstance(
outputUri, allowRetry(), getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.PRIMARY_COLOR, 0));
getFragmentManager().beginTransaction().replace(R.id.container, frag).commit();
}
}
@Override
public void onShowStillshot(String outputUri) {
if (shouldAutoSubmit()) {
useMedia(outputUri);
} else {
Fragment frag =
StillshotPreviewFragment.newInstance(
outputUri, allowRetry(), getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.PRIMARY_COLOR, 0));
getFragmentManager().beginTransaction().replace(R.id.container, frag).commit();
}
}
@Override
public final boolean allowRetry() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ALLOW_RETRY, true);
}
@Override
public final boolean shouldAutoSubmit() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.AUTO_SUBMIT, false);
}
private void deleteOutputFile(@Nullable String uri) {
if (uri != null)
//noinspection ResultOfMethodCallIgnored
new File(Uri.parse(uri).getPath()).delete();
}
@Override
protected final void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PERMISSION_RC) showInitialRecorder();
}
@Override
public final void onRequestPermissionsResult(
int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
mRequestingPermission = false;
if (grantResults[0] == PackageManager.PERMISSION_DENIED) {
new MaterialDialog.Builder(this)
.title(R.string.mcam_permissions_needed)
.content(R.string.mcam_video_perm_warning)
.positiveText(android.R.string.ok)
.dismissListener(
new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
})
.show();
} else {
showInitialRecorder();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
// deleteTempFile();
}
@Override
public final void useMedia(String uri) {
if (uri != null) {
Log.d(TAG, "useMedia: upload uri: " + uri);
mUri = uri;
// setResult(
// Activity.RESULT_OK,
// getIntent()
// .putExtra(MaterialCamera.STATUS_EXTRA, MaterialCamera.STATUS_RECORDED)
// .setDataAndType(Uri.parse(uri), useStillshot() ? "image/jpeg" : "video/mp4"));
saveMediaToMemory(uri);
}
// finish();
}
@Override
public void addToStory(String uri) {
Log.d(TAG, "addToStory: adding file to story.");
initProgressBar();
if(isMediaVideo(uri)){
if(mUploadUri == null){
Log.d(TAG, "addToStory: Video was not saved. Beginning compression.");
mDeleteCompressedMedia = true;
saveTempAndCompress(uri);
}
else{
Log.d(TAG, "addToStory: video has been saved. Now uploading.");
Log.d(TAG, "addToStory: upload uri: " + mUploadUri);
finishActivityAndUpload();
}
}
else{
if(mUploadUri == null){
Log.d(TAG, "addToStory: Image was not saved. Now uploading");
mDeleteCompressedMedia = true;
mUploadUri = uri;
finishActivityAndUpload();
}
else{
Log.d(TAG, "addToStory: Image has been saved. Now uploading.");
Log.d(TAG, "addToStory: upload uri: " + mUploadUri);
finishActivityAndUpload();
}
}
}
private void finishActivityAndUpload(){
Log.d(TAG, "finishActivityAndUpload: called.");
if(mDeleteCompressedMedia){
setResult(
RESULT_ADD_NEW_STORY,
getIntent()
.putExtra(MaterialCamera.DELETE_UPLOAD_FILE_EXTRA, true)
.putExtra(MaterialCamera.STATUS_EXTRA, MaterialCamera.STATUS_RECORDED)
.setDataAndType(Uri.parse(mUploadUri), useStillshot() ? "image/jpeg" : "video/mp4"));
}
else{
setResult(
RESULT_ADD_NEW_STORY,
getIntent()
.putExtra(MaterialCamera.DELETE_UPLOAD_FILE_EXTRA, false)
.putExtra(MaterialCamera.STATUS_EXTRA, MaterialCamera.STATUS_RECORDED)
.setDataAndType(Uri.parse(mUploadUri), useStillshot() ? "image/jpeg" : "video/mp4"));
}
finish();
}
private void initProgressBar(){
// RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
// RelativeLayout.LayoutParams.MATCH_PARENT,
// RelativeLayout.LayoutParams.MATCH_PARENT
// );
// RelativeLayout relativeLayout = new RelativeLayout(this);
// relativeLayout.bringToFront();
// relativeLayout.setLayoutParams(layoutParams);
////
// FrameLayout frameLayout = ((Activity)this).findViewById(R.id.container);
// frameLayout.addView(relativeLayout);
//
// RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
// 250,
// RelativeLayout.LayoutParams.WRAP_CONTENT
// );
// params.addRule(RelativeLayout.CENTER_IN_PARENT);
// mProgressBar = new ProgressBar(this);
// mProgressBar.setId(PROGRESS_BAR_ID);
// mProgressBar.setLayoutParams(params);
// mProgressBar.setVisibility(View.VISIBLE);
// mProgressBar.bringToFront();
// relativeLayout.addView(mProgressBar);
// Drawable progressDrawable = mProgressBar.getIndeterminateDrawable().mutate();
// progressDrawable.setColorFilter(Color.WHITE, android.graphics.PorterDuff.Mode.SRC_IN);
// mProgressBar.setProgressDrawable(progressDrawable);
// retrieve display dimensions
// Rect displayRectangle = new Rect();
// Window window = this.getWindow();
// window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);
LayoutInflater li = LayoutInflater.from(this);
View layout = li.inflate(R.layout.layout_processing_dialog, null);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
150,
FrameLayout.LayoutParams.WRAP_CONTENT
);
layout.setLayoutParams(params);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setView(layout);
mAlertDialog = alertDialogBuilder.create();
mAlertDialog.setCancelable(false);
mAlertDialog.show();
}
private void saveTempAndCompress(String uri){
//save temporary file for compression
String fileName = uri.substring(uri.indexOf("Stories/") + 8);
tempFile = FileUtils.saveTempFile(fileName, this, Uri.parse(uri));
//delete the original
deleteOutputFile(uri);
//compress temp file and save new compressed version in "/Stories/"
new VideoCompressor().execute();
}
private void saveMediaToMemory(String uri){
Log.d(TAG, "saveMediaToMemory: saving media to memory.");
Log.d(TAG, "saveMediaToMemory: uri: " + uri);
initProgressBar();
if(isMediaVideo(uri)){
saveTempAndCompress(uri);
}
else{
Bitmap bm = null;
RotateBitmap rotateBitmap = new RotateBitmap();
try{
bm = rotateBitmap.HandleSamplingAndRotationBitmap(this, Uri.parse(uri));
}catch (IOException e){
e.printStackTrace();
}
//delete the old file
deleteOutputFile(uri);
saveBitmapToDisk(bm);
}
}
class VideoCompressor extends AsyncTask<Void, Void, String> {
// class VideoCompressor extends AsyncTask<Void, Void, Boolean> {
@Override
protected void onPreExecute() {
super.onPreExecute();
showProgressBar();
Log.d(TAG,"Start video compression");
}
@Override
protected String doInBackground(Void... voids) {
// protected boolean doInBackground(Void... voids) {
return MediaController.getInstance().convertVideo(tempFile.getPath());
}
@Override
protected void onPostExecute(String filePath) {
// protected void onPostExecute(Boolean compressed) {
super.onPostExecute(filePath);
// super.onPostExecute(compressed);
hideProgressBar();
if(!filePath.equals("")){
// if(compressed){
mUploadUri = filePath;
Log.d(TAG,"Compression successfully!");
if(mDeleteCompressedMedia){
finishActivityAndUpload();
}
}
}
}
private void deleteTempFile(){
if(tempFile != null && tempFile.exists()){
tempFile.delete();
}
}
private void saveBitmapToDisk(final Bitmap bm){
final ICallback callback = new ICallback() {
@Override
public void done(Exception e) {
if (e == null) {
hideProgressBar();
Log.d(TAG, "saveBitmapToDisk: saved file to disk.");
Toast.makeText(BaseCaptureActivity.this, "saved", Toast.LENGTH_SHORT).show();
} else {
e.printStackTrace();
hideProgressBar();
Toast.makeText(BaseCaptureActivity.this, "something went wrong", Toast.LENGTH_SHORT).show();
}
}
};
Log.d(TAG, "saveBitmapToDisk: saving to disc.");
final Handler handler = new Handler();
new Thread() {
@Override
public void run() {
try {
FileOutputStream out = null;
FileInputStream fis = null;
try {
FilePaths filePaths = new FilePaths();
String timeStamp =
new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
// String path = Environment.getExternalStorageDirectory().toString();
File file = new File(filePaths.STORIES + "/IMG_" + timeStamp + ".jpg");
out = new FileOutputStream(file);
bm.compress(Bitmap.CompressFormat.JPEG, ImageManager.IMAGE_SAVE_QUALITY, out);
File imagefile = new File(file.getPath());
try {
fis = new FileInputStream(imagefile);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
mUploadUri = file.getPath();
Log.d(TAG, "saveBitmapToDisk: new uri: " + mUploadUri);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
if(fis != null){
fis.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
handler.post(
new Runnable() {
@Override
public void run() {
callback.done(null);
}
});
} catch (final Exception e) {
handler.post(
new Runnable() {
@Override
public void run() {
callback.done(e);
}
});
}
}
}.start();
}
private boolean isMediaVideo(String uri){
if(uri.contains(".mp4") || uri.contains(".wmv") || uri.contains(".flv") || uri.contains(".avi")){
return true;
}
return false;
}
private void showProgressBar(){
// if(mProgressBar != null){
// mProgressBar.setVisibility(View.VISIBLE);
// }
if(mAlertDialog != null){
mAlertDialog.show();
}
}
private void hideProgressBar(){
// if(mProgressBar != null){
// mProgressBar.setVisibility(View.INVISIBLE);
// }
if(mAlertDialog != null){
mAlertDialog.dismiss();
}
}
@Override
public void setDidRecord(boolean didRecord) {
mDidRecord = didRecord;
}
@Override
public boolean didRecord() {
return mDidRecord;
}
@Override
public int getFlashMode() {
return mFlashMode;
}
@Override
public int getFlashModeVideo() {
return mFlashMode;
}
@Override
public void toggleFlashMode() {
if (mFlashModes != null) {
mFlashMode = mFlashModes.get((mFlashModes.indexOf(mFlashMode) + 1) % mFlashModes.size());
}
}
@Override
public void toggleFlashModeVideo() {
Log.d(TAG, "toggleFlashModeVideo: toggling video flash mode.");
if (mFlashModes != null) {
Log.d(TAG, "toggleFlashModeVideo: flash mode is not null");
if(mFlashMode == FLASH_MODE_ALWAYS_ON){
mFlashMode = FLASH_MODE_OFF;
}
else{
mFlashMode = FLASH_MODE_ALWAYS_ON;
}
}
}
@Override
public boolean restartTimerOnRetry() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.RESTART_TIMER_ON_RETRY, false);
}
@Override
public boolean continueTimerInPlayback() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.CONTINUE_TIMER_IN_PLAYBACK, false);
}
@Override
public int videoEncodingBitRate(int defaultVal) {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.VIDEO_BIT_RATE, defaultVal);
}
@Override
public int audioEncodingBitRate(int defaultVal) {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.AUDIO_ENCODING_BIT_RATE, defaultVal);
}
@Override
public int videoFrameRate(int defaultVal) {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.VIDEO_FRAME_RATE, defaultVal);
}
@Override
public float videoPreferredAspect() {
return getIntent().getFloatExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.VIDEO_PREFERRED_ASPECT, 4f / 3f);
}
@Override
public int videoPreferredHeight() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.VIDEO_PREFERRED_HEIGHT, 720);
}
@Override
public long maxAllowedFileSize() {
return getIntent().getLongExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.MAX_ALLOWED_FILE_SIZE, -1);
}
@Override
public int qualityProfile() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.QUALITY_PROFILE, CamcorderProfile.QUALITY_HIGH);
}
@DrawableRes
@Override
public int iconPause() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_PAUSE, R.drawable.evp_action_pause);
}
@DrawableRes
@Override
public int iconPlay() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_PLAY, R.drawable.evp_action_play);
}
@DrawableRes
@Override
public int iconRestart() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_RESTART, R.drawable.evp_action_restart);
}
@DrawableRes
@Override
public int iconRearCamera() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_REAR_CAMERA, R.drawable.mcam_camera_rear);
}
@DrawableRes
@Override
public int iconFrontCamera() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_FRONT_CAMERA, R.drawable.mcam_camera_front);
}
@DrawableRes
@Override
public int iconStop() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_STOP, R.drawable.mcam_action_stop);
}
@DrawableRes
@Override
public int iconRecord() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_RECORD, R.drawable.mcam_action_capture);
}
@StringRes
@Override
public int labelRetry() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LABEL_RETRY, R.string.mcam_retry);
}
@Deprecated
@StringRes
@Override
public int labelUseVideo() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LABEL_CONFIRM, R.string.mcam_use_video);
}
@StringRes
@Override
public int labelConfirm() {
return getIntent()
.getIntExtra(
tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.LABEL_CONFIRM,
useStillshot() ? R.string.mcam_use_stillshot : R.string.mcam_use_video);
}
@DrawableRes
@Override
public int iconStillshot() {
return getIntent()
.getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_STILL_SHOT, R.drawable.mcam_action_stillshot);
}
// @Override
// public void setUseStillshot(boolean bool) {
// getIntent().putExtra(tabian.com.instagramclone2.materialcamera.internal.CameraIntentKey.STILL_SHOT, bool);
// }
@Override
public boolean useStillshot() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.STILL_SHOT, false);
}
@DrawableRes
@Override
public int iconFlashAuto() {
return getIntent()
.getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_FLASH_AUTO, R.drawable.mcam_action_flash_auto);
}
@DrawableRes
@Override
public int iconFlashOn() {
return getIntent().getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_FLASH_ON, R.drawable.mcam_action_flash);
}
@DrawableRes
@Override
public int iconFlashOff() {
return getIntent()
.getIntExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.ICON_FLASH_OFF, R.drawable.mcam_action_flash_off);
}
@Override
public void setFlashModes(List<Integer> modes) {
mFlashModes = modes;
}
@Override
public boolean shouldHideFlash() {
return !useStillshot() || mFlashModes == null;
}
@Override
public long autoRecordDelay() {
return getIntent().getLongExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.AUTO_RECORD, -1);
}
@Override
public boolean audioDisabled() {
return getIntent().getBooleanExtra(tabian.com.example.igtest.materialcamera.internal.CameraIntentKey.AUDIO_DISABLED, false);
}
@Override
public boolean shouldHideCameraFacing() {
return !getIntent().getBooleanExtra(CameraIntentKey.ALLOW_CHANGE_CAMERA, false);
}
}
| [
"77848848+jy-1030@users.noreply.github.com"
] | 77848848+jy-1030@users.noreply.github.com |
654b8d80863b830ad6a96b6f94f40ce015d31800 | 73f38bf1dbdb98d343a26bbe258e48798799e3e6 | /src/test/java/com/alextheedom/CalculatorTest.java | 5471137597e9c829a7c9ffbf82c739acd1f754cf | [] | no_license | atheedom/Calculator | 4997e0da0b1527430a7b86db4849fa49ba6315cd | 03dd37dd93c037aa692c546f8a1314acdfda2412 | refs/heads/master | 2020-05-19T15:56:25.091019 | 2015-08-16T15:03:08 | 2015-08-16T15:03:08 | 39,700,194 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,750 | java | package com.alextheedom;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import java.math.BigDecimal;
import static com.alextheedom.Calculator.ZeroMode.NORMAL;
import static com.alextheedom.Calculator.ZeroMode.SPECIAL;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Created by atheedom on 25/07/15.
*/
@RunWith(MockitoJUnitRunner.class)
public class CalculatorTest {
private static BigDecimal FIVE = new BigDecimal(5);
private static BigDecimal NINE = new BigDecimal(9);
private static BigDecimal TWENTY = new BigDecimal(20);
// SPECIAL MODE
@Test
public void MultiplyShouldIgnoreZeroInSpecialMode() {
// arrange
Calculator calculator = new Calculator(SPECIAL, BigDecimal.TEN);
// act
calculator.multiply(BigDecimal.ZERO);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.TEN);
}
@Test
public void MultiplyShouldReturnOperandInSpecialMode() {
// arrange // act
Calculator calculator = new Calculator(SPECIAL, BigDecimal.TEN);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.TEN);
}
@Test
public void AddShouldAddNumbersInSpecialMode() {
// arrange
Calculator calculator = new Calculator(SPECIAL, BigDecimal.TEN);
// act
calculator.add(BigDecimal.TEN);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(TWENTY);
}
@Test
public void SubtractShouldSubtractNumbersInSpecialMode() {
// arrange
Calculator calculator = new Calculator(SPECIAL, BigDecimal.TEN);
// act
calculator.subtract(BigDecimal.ONE);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(NINE);
}
@Test()
public void DivideShouldIgnoreZeroInSpecialMode() {
// arrange
Calculator calculator = new Calculator(SPECIAL, BigDecimal.TEN);
// act
calculator.divide(BigDecimal.ZERO);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.TEN);
}
// NORMAL MODE
@Test
public void MultiplyShouldAccountForZeroInNormalMode() {
// arrange
Calculator calculator = new Calculator(NORMAL, BigDecimal.TEN);
// act
calculator.multiply(BigDecimal.ZERO);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.ZERO);
}
@Test
public void MultiplyShouldReturnOperandInNormalMode() {
// arrange // act
Calculator calculator = new Calculator(NORMAL, BigDecimal.TEN);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.TEN);
}
@Test
public void AddShouldAddNumbersInNormalMode() {
// arrange
Calculator calculator = new Calculator(NORMAL, BigDecimal.TEN);
// act
calculator.add(BigDecimal.TEN);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(TWENTY);
}
@Test
public void SubtractShouldSubtractNumbersInNormalMode() {
// arrange
Calculator calculator = new Calculator(NORMAL, BigDecimal.TEN);
// act
calculator.subtract(BigDecimal.ONE);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(NINE);
}
@Test(expected = ArithmeticException.class)
public void DivideShouldErrorWhenDivideByZeroInNormalMode() {
// arrange
Calculator calculator = new Calculator(NORMAL, BigDecimal.TEN);
// act
calculator.divide(BigDecimal.ZERO);
// assert
assertThat(calculator.bigDecimalValue(0, BigDecimal.ROUND_HALF_DOWN)).isEqualTo(BigDecimal.TEN);
}
@Test
public void shouldRoundDownTo2DecimalPlace() {
// arrange // act
Calculator calculator = new Calculator(new BigDecimal(0.33333));
// assert
assertThat(calculator.bigDecimalValue()).isEqualTo(new BigDecimal(0.33).setScale(2, BigDecimal.ROUND_HALF_DOWN));
}
@Test
public void shouldNotRoundDuringCalculation() {
// arrange
Calculator calculator = new Calculator(new BigDecimal(0.333));
// act
calculator.add(new BigDecimal(0.333)).add(new BigDecimal(0.334));
// assert
assertThat(calculator.bigDecimalValue()).isEqualTo(new BigDecimal(1).setScale(2, BigDecimal.ROUND_HALF_DOWN));
}
}
| [
"alex@indigococo.com"
] | alex@indigococo.com |
cc81e98c1d3fadf279b43fd345206f348222f975 | 44d4b3783ff964ecc387a4ea637a98fb4e5dc293 | /mypages-excavation/src/main/java/cn/m1yellow/mypages/excavation/service/SysConfigService.java | f194220bd63142f60d0a77dd28e700829534306c | [
"Apache-2.0"
] | permissive | zjdyzww/mypages-cloud | 15436d11b1ef1b1846722403a5edb6d598f89acf | 5c2994abf6d47321ec55207d0e86e5444f117a05 | refs/heads/master | 2023-07-31T19:02:28.740219 | 2021-09-08T14:02:37 | 2021-09-08T14:02:37 | 524,547,458 | 1 | 0 | Apache-2.0 | 2022-08-14T01:39:04 | 2022-08-14T01:39:03 | null | UTF-8 | Java | false | false | 445 | java | package cn.m1yellow.mypages.excavation.service;
import cn.m1yellow.mypages.excavation.entity.SysConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
/**
* <p>
* ็ณป็ป้
็ฝฎ่กจ ๆๅก็ฑป
* </p>
*
* @author M1Yellow
* @since 2021-06-11
*/
public interface SysConfigService extends IService<SysConfig> {
Map<String, String> getSysConfigs();
String getConfigValueByKey(String configKey);
}
| [
"m1yellow@163.com"
] | m1yellow@163.com |
4f85e9ea24af74615feff401d33ba7886c83cdcf | e0afb3c47f9b11b5f2d43becf2fd75265c5ebb19 | /bitcamp-java-application4-server/v52_1/src/main/java/com/eomcs/lms/handler/LoginCommand.java | 6aa626a2e20171ff58fe8d488158951939ae4e43 | [] | no_license | d2683317/bitcamp-java-20190527 | c8163ba329245f0da3fcc78ce7feb2a1c6066cc8 | b1407d9427c7b7f38efceeaa5957ae1aa9744cc2 | refs/heads/master | 2020-06-13T20:18:55.567763 | 2019-12-26T02:29:07 | 2019-12-26T02:29:07 | 194,775,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,198 | java | package com.eomcs.lms.handler;
import java.io.BufferedReader;
import java.io.PrintStream;
import java.util.HashMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import com.eomcs.lms.dao.MemberDao;
import com.eomcs.lms.domain.Member;
import com.eomcs.util.Input;
@Component
public class LoginCommand {
private MemberDao memberDao;
public LoginCommand(MemberDao memberDao) {
this.memberDao = memberDao;
}
@RequestMapping("/auth/login")
public void execute(BufferedReader in, PrintStream out) {
try {
HashMap<String,Object> params = new HashMap<>();
params.put("email", Input.getStringValue(in, out, "์ด๋ฉ์ผ? "));
params.put("password", Input.getStringValue(in, out, "์ํธ? "));
Member member = memberDao.findByEmailPassword(params);
if (member == null) {
out.println("์ด๋ฉ์ผ ๋๋ ์ํธ๊ฐ ๋ง์ง ์์ต๋๋ค!");
} else {
out.printf("%s๋ ํ์ํฉ๋๋ค.\n", member.getName());
}
} catch (Exception e) {
out.println("๋ก๊ทธ์ธ ์คํ์ ์คํจํ์ต๋๋ค!");
System.out.println(e.getMessage());
}
}
}
| [
"kdjj214@nate.com"
] | kdjj214@nate.com |
0c8536ea9fbec95e316a037272713b63bdc77a4e | c62a28e5a2eda1ca13a254113dba46044d67291f | /Lecture10/PA.java | 435502e0c0c357b294fe2dbb8d108ba78d423bbe | [] | no_license | SimplyyShubh/Crux_Java | 8420153b2c84c8de7bcd5ec0235ce9ac1b01a67b | d6d385774e454e80f68e59466a395b4bf161edc8 | refs/heads/master | 2020-04-24T23:22:21.986286 | 2019-02-24T13:58:54 | 2019-02-24T13:58:54 | 172,342,368 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 177 | java | package Lecture10;
public abstract class PA {
public int num=10;
public void Fun1() {
System.out.println("Inside PA's Fun1.");
}
public abstract void Fun();
}
| [
"noreply@github.com"
] | SimplyyShubh.noreply@github.com |
769541457be35fd1b3c2bb9725e6a27e9aa5ba79 | b4c8832a288a9c00616dca5140e4c4d692537980 | /src/edu/umbc/cs/similarity/Scap.java | 5dbdcc490b442da7d60088ef33474af6a0b7a84f | [] | no_license | shrikane/ThesisWork | 62888cd97a4f7edb05735736bbb649796c17d71f | e24945a4150536eb3ab942c4236fdef976acd078 | refs/heads/master | 2021-01-18T03:27:20.334579 | 2015-07-15T10:42:16 | 2015-07-15T10:42:16 | 37,150,347 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 490 | java | package edu.umbc.cs.similarity;
import java.util.Set;
import edu.umbc.cs.utils.Document;
public class Scap implements ISimilarity {
public Scap() {
// TODO Auto-generated constructor stub
}
@Override
public double getScore(Document input, Document test) {
System.out.println(input.getScoredTerms());
Set<String> inputSet = input.getScoredTerms().keySet();
Set<String> testSet = test.getScoredTerms().keySet();
inputSet.retainAll(testSet);
return inputSet.size();
}
}
| [
"skane3@umbc.edu"
] | skane3@umbc.edu |
442342fbdb0b4e3c7a8875376c914b3674a8356e | 9072296ce494526915246e6572e6e9ca4836f830 | /sql/src/main/java/org/craigmcc/library/sql/AbstractStatementBuilder.java | b4ae3540619f99f40d6bce5f5f3793c37097fdc3 | [
"Apache-2.0"
] | permissive | craigmcc/library.java | 78b49008c03831e65d939413e20214b5114f5b54 | db2652534c91cda82d5479df636a74175c394698 | refs/heads/master | 2022-11-18T18:21:38.194232 | 2020-07-16T04:20:31 | 2020-07-16T04:20:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,777 | java | /*
* Copyright 2020 craigmcc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.craigmcc.library.sql;
import org.craigmcc.library.model.Model;
import javax.validation.constraints.NotNull;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import static org.craigmcc.library.model.Constants.ID_COLUMN;
import static org.craigmcc.library.model.Constants.PUBLISHED_COLUMN;
import static org.craigmcc.library.model.Constants.UPDATED_COLUMN;
/**
* <p>Abstract base class for builders that generate SQL statements. Note that
* many of the methods apply only to certain SQL statement types (DELETE, INSERT,
* SELECT, UPDATE). Check the documentation for each method to see whether it is
* relevant or not for the builder you are creating.</p>
*
* @param <B> The builder class that is subclassing this base class
*/
public abstract class AbstractStatementBuilder<B extends StatementBuilder>
implements StatementBuilder {
// Instance Variables ----------------------------------------------------
protected boolean all = false;
protected final List<Clause> clauses = new ArrayList<>();
protected final List<Expression> expressions = new ArrayList<>();
protected boolean distinct = false;
protected final List<String> groupBys = new ArrayList<>();
protected Integer limit;
protected Integer offset;
protected boolean or = false;
protected final List<OrderBy> orderBys = new ArrayList<>();
protected final List<Pair> pairs = new ArrayList<>();
protected final List<Object> params = new ArrayList<>();
protected Pair primary = null;
protected String sql = null; // Only useful for debugging via toString() calls after the fact
protected final List<String> tables = new ArrayList<>();
// Constructors ----------------------------------------------------------
// TODO - support multiple tables for joins? With abbreviations for columns?
public AbstractStatementBuilder(@NotNull String table) {
tables.add(table);
}
// Public Methods --------------------------------------------------------
/**
* <p><strong>RELEVANT ON:</strong> DELETE, SELECT, UPDATE</p>
*
* <p>Indicate that we really do want this statement to affect all rows in the table
* (otherwise this will generate an IllegalStateException).</p>
*/
public B all() {
all = true;
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> DELETE, SELECT, UPDATE.</p>
*
* <p>Store the columns and operator for a condition that must be
* matched in order to match a row. Such conditions are ignored
* if <code>primary()</code> has been called.</p>
*
* @param leftColumn Column to the left of the operator
* @param operator The operator used to compare the columns
* @param rightColumn Column to the right of the operator
*
* @return This builder
*/
public B clause(@NotNull String leftColumn, @NotNull SqlOperator operator, @NotNull String rightColumn) {
clauses.add(new Clause(leftColumn, operator, rightColumn));
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> DELETE, SELECT, UPDATE.</p>
*
* <p>Store the column, operator, and a literal expression value
* for a condition that must be satisfied in order to match.</p>
*
* @param column Column to be matched
* @param operator The operator used to compare column and value
* @param value Literal expression value to be matched
*
* @return This builder
*/
public B expression(@NotNull String column, @NotNull SqlOperator operator, @NotNull Object value) {
expressions.add(new Expression(column, operator, value));
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> DELETE, SELECT, UPDATE</p>
*
* <p>Cause matching conditions specified by <code>clause()</code>
* or <code>expression()</code> to be linked by "OR" instead of "AND".</p>
*
* @return This builder
*/
public B or() {
this.or = true;
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> INSERT, UPDATE.</p>
*
* <p>Store a paired reference between an SQL column name and a corresponding
* value to replace it with. Column names and values will be generated in the
* order that <code>pair()</code> is called as the builder is assembled.</p>
*
* <p><strong>NOTE:</strong> Paired references are only useful on INSERT and
* UPDATE statements.</p>
*
* @param column Name of the SQL column to be included
* @param value Corresponding value to be included (will be enclosed in quotes if a String)
*
* @return This builder
*/
public B pair(@NotNull String column, Object value) {
pairs.add(new Pair(column, value));
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> INSERT, UPDATE.</p>
*
* <p>Record a pairing only if the specified value is not <code>null</code>.</p>
*
* @param column Name of the SQL column to be included
* @param value Corresponding value to be included (will be enclosed in quotes if a String)
*
* @return This builder
*/
public B pairIfNotNull(@NotNull String column, @NotNull Object value) {
if (value != null) {
pair(column, value);
}
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> INSERT, UPDATE.</p>
*
* <p>Record a pairing for a literal value (such as an SQL function call) that will
* not be enclosed in quotes in the generated statement.</p>
*
* @param column Name of the SQL column to be included
* @param value The literal value to be included
*
* @return This builder
*/
public B pairLiteral(@NotNull String column, @NotNull Object value) {
pairs.add(new Pair(column, true, value));
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> INSERT, UPDATE.</p>
*
* <p>Pair the columns and values from those included via the {@link Model}
* base class in every such object. The primary key (if any) will be stored
* separately, via a call to <code>primary()</code>, so that it can be used
* in the WHERE clause of a DELETE or UPDATE statement.</p>
*
* @param model The model object from which to copy common columns and values
*
* @return This builder
*/
public B pairModel(@NotNull Model model) {
primary(ID_COLUMN, model.getId());
// TODO - verify LocalDateTime conversions are supported
pair(PUBLISHED_COLUMN, model.getPublished());
pair(UPDATED_COLUMN, model.getUpdated());
return (B) this;
}
/**
* <p><strong>RELEVANT ON:</strong> DELETE, SELECT, UPDATE.</p>
*
* <p>Store the specified name and value of the primary key for this object
* so that it can be used in the WHERE clause of a DELETE, SELECT, or UPDATE
* statement. If specified on DELETE, SELECT, or UPDATE statements, any
* clauses specified by <code>clause()</code> and related methods will
* be ignored.</p>
*
* <p><strong>NOTE:</strong> If you are dealing with a {@link Model} object,
* calling <code>pairModel()</code> will have done this for you already.</p>
*
* @param column Name of the primary key column for this table
* @param value Primary key value for this object
*
* @return This builder
*/
public B primary(@NotNull String column, Object value) {
this.primary = new Pair(column, true, value);
return (B) this;
}
/**
* <p>Return the string representation of the SQL statement generated by
* this builder. Only includes the SQL text after <code>build()</code> has
* been called. Useful only for debugging the builders themselves.</p>
*
* @return Values of all the internally stored builder information
*/
public String toString() {
return this.getClass().getSimpleName() +
"{all=" + all + ", clauses=" + clauses + ", distinct=" + distinct +
", expressions=" + expressions +
", groupBys=" + groupBys + ", limit=" + limit + ", offset=" + offset +
", or=" + or + ", orderBys=" + orderBys + ",pairs=" + pairs +
", params=" + params + ", primary=" + primary + ", sql=" + sql + "}";
}
// Protected Methods ---------------------------------------------------------
/**
* <p>Add a WHERE clause to the SQL text being created. This will either
* be a direct primary key match (if <code>primary()</code> was specified)
* or one or more conditions (if <code>clause()</code> or <code>expression()</code>
* was specified, possibly more than once). In the latter case, if
* <code>or()</code> was specified, the conditions will be linked by OR;
* otherwise they will be linked by AND.</p>
*
* <p>If neither a primary key nor at least one condition was specified,
* throw an exception to avoid generating statements that will impact every
* row in the underlying table.</p>
*
* @param sb StringBuilder containing the SQL text being created
*/
protected void addWhere(StringBuilder sb) throws IllegalStateException {
// Allow no WHERE conditions only if it was explicitly requested
if (all) {
return;
}
// Otherwise, some condition(s) must have been explicitly requested
if ((primary == null) && (clauses.size() == 0) && (expressions.size() == 0)) {
throw new IllegalStateException("Must specify either a primary key or conditions");
}
if (primary != null) {
// Match on equality to primary key value
sb.append(" WHERE (");
sb.append(primary.column);
sb.append(" = ");
if (primary.literal) {
sb.append(primary.value);
} else {
sb.append("?");
params.add(primary.value);
}
sb.append(")");
} else {
// Match on specified condition(s)
sb.append(" WHERE ");
boolean first = true;
// First, do clauses (comparison between two column values)
for (Clause clause : clauses) {
if (first) {
first = false;
sb.append("(");
} else {
if (or) {
sb.append(" OR (");
} else {
sb.append(" AND (");
}
}
sb.append(clause.leftColumn);
sb.append(" ");
sb.append(clause.operator.getOperator());
sb.append(" ");
sb.append(clause.rightColumn);
sb.append(")");
}
// Second, do expressions (comparison between a column value and a literal)
for (Expression expression : expressions) {
if (first) {
first = false;
sb.append("(");
} else {
if (or) {
sb.append(" OR (");
} else {
sb.append(" AND (");
}
}
sb.append(expression.column);
sb.append(" ");
sb.append(expression.operator.getOperator());
sb.append(" ");
sb.append(expression.expression);
sb.append(")");
}
}
}
/**
* <p>Add a parameter value that will be used as a replacement value in the
* generated SQL statement, if required. These values <strong>MUST</strong>
* be recorded in the order of their replacement indicators ("?")
* in the generated statement text, because they are replaced
* in the order of calls to this method.</p>
*
* @param param The replacement value to be recorded
*
* @return This builder
*/
protected B addParam(Object param) {
params.add(param);
return (B) this;
}
/**
* <p>Apply any specified parameters to the <code>PreparedStatement</code>
* that is being generated.</p>
*
* @param statement The <code>PreparedStatement</code> to update
*
* @throws SQLException if a SQL exception occurs
*/
protected void applyParams(PreparedStatement statement) throws SQLException {
if (params.size() > 0) {
if (statement != null) { // TODO - Mockito does not generate this :-(
for (int i = 0; i < params.size(); i++) {
statement.setObject(i + 1, params.get(i));
}
}
}
}
// Support classes ---------------------------------------------------------
/**
* <p>A first column name, SQL operator, and second column name denoting
* two columns that will be compared (according to the specified operator
* in a WHERE clause.</p>
*/
protected static class Clause {
Clause(@NotNull String leftColumn, @NotNull SqlOperator operator, @NotNull String rightColumn) {
this.leftColumn = leftColumn;
this.operator = operator;
this.rightColumn = rightColumn;
}
final String leftColumn;
final SqlOperator operator;
final Object rightColumn;
@Override
public String toString() {
return "Clause{" +
"leftColumn=" + leftColumn +
", operator=" + operator +
", rightColumn=" + rightColumn + "}";
}
}
/**
* <p>A column name, SQL operator, and literal value to which that column
* will be compared in a WHERE clause.</p>
*/
protected static class Expression {
Expression(@NotNull String column, @NotNull SqlOperator operator, @NotNull Object expression) {
this.column = column;
this.operator = operator;
this.expression = expression;
}
final String column;
final Object expression;
final SqlOperator operator;
@Override
public String toString() {
return "Clause{" +
"column=" + column +
", operator=" + operator +
", expression=" + expression + "}";
}
}
/**
* <p>A column name and direction to be included in an ORDER BY clause.</p>
*/
protected static class OrderBy {
OrderBy(@NotNull String column, @NotNull SqlDirection direction) {
this.column = column;
this.direction = direction;
}
final String column;
final SqlDirection direction;
@Override
public String toString() {
return "OrderBy{" +
"column=" + column + '\'' +
", direction='" + direction + "'}";
}
}
/**
* <p>A column name, and a value to be stored on an INSERT or UPDATE,
* with the value being either a literal expression (literal == true)
* or an object that will be the value inserted or updated.</p>
*/
protected class Pair {
Pair(@NotNull String column, Object value) {
this.column = column;
this.literal = false;
this.value = value;
}
Pair(@NotNull String column, boolean literal, Object value) {
this.column = column;
this.literal = literal;
this.value = value;
}
final String column;
final boolean literal;
final Object value;
@Override
public String toString() {
return "Pair{" +
"column=" + column +
", literal=" + literal +
", value=" + value + "}";
}
}
}
| [
"craigmcc@gmail.com"
] | craigmcc@gmail.com |
cfe6e0c7156f05944a3fe6286ed7b19d4598248a | 1ac71c5f57896fa32203255f12b020df84120878 | /alipayservice/src/main/java/com/imooc/project/mapper/mmall_order_itemMapper.java | cd0a1682a5cd5b5c0560f618fd597db869fa1316 | [] | no_license | marryfeng/imooc | d7528cb6893a020e02cf723c7468e2caace33e82 | 6a0b1982d77ffb155df3dbf1cbceaa00704ab830 | refs/heads/master | 2021-09-03T19:46:54.122100 | 2018-01-11T13:27:42 | 2018-01-11T13:27:42 | 107,406,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 487 | java | package com.imooc.project.mapper;
import com.imooc.project.entity.mmall_order_item;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface mmall_order_itemMapper {
int deleteByPrimaryKey(Integer id);
int insert(mmall_order_item record);
int insertSelective(mmall_order_item record);
mmall_order_item selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(mmall_order_item record);
int updateByPrimaryKey(mmall_order_item record);
} | [
"1473357859@qq.com"
] | 1473357859@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.