blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
829bd3cfae79447b60bc6aacd1d761819480ffca
e01ef17c7c5104448ab2734c8cade5b2e3462804
/app/src/main/java/com/example/witassignmenttask/Modules/Home/HomeView.java
2f233d46a6051e9188c9c135f3a243b43e44fac5
[]
no_license
leonardusEdwinN/WITAssignment
78f25470bc26a3cb89c547d90ce0ef14ebbac8da
bf9f7d3d4e13f06323f98e2755c7c7ad9c957ac1
refs/heads/master
2020-05-25T02:45:04.852021
2019-05-24T16:20:21
2019-05-24T16:20:21
187,585,268
0
0
null
null
null
null
UTF-8
Java
false
false
493
java
package com.example.witassignmenttask.Modules.Home; import com.example.witassignmenttask.Models.Banner; import com.example.witassignmenttask.Models.DataBanner; import com.example.witassignmenttask.Models.DataHome; import com.example.witassignmenttask.Models.Home; import java.util.ArrayList; import java.util.List; public interface HomeView { void loadGridHome(ArrayList<DataHome> listHomeBlock); void error(String message); void loadBanner(ArrayList<DataBanner> listBanner); }
fb57d422e9788598b0610fcb99ce467e4c1d1a0c
6d71792060230d0965db8f83c4cc2ac942f4ea44
/springmvc/src/main/java/com/oracle/controller/XuWorkerController.java
d768dfaff3c1a96b41498be965a36b3d91e6f808
[]
no_license
Cherry1210/ssmtest
bb9d1de094479061a7787674bdf80eefb56396ca
d58aca50122e541476421c9f1f8696ebbfc7c2d4
refs/heads/master
2023-02-10T18:12:50.927571
2021-01-09T09:31:27
2021-01-09T09:31:27
327,910,588
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.oracle.controller; import com.oracle.pojo.Worker; import com.oracle.service.WorkerService; import com.oracle.util.workerlogin; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.SessionAttributes; import javax.servlet.http.HttpServletRequest; @SessionAttributes(value = { "worker_id","name","worker"}) @Controller @RequestMapping("/XuWorker") public class XuWorkerController { @Autowired private WorkerService workerService; @RequestMapping("/xusignin") public String signin(HttpServletRequest request, workerlogin l) { Worker pt = this.workerService.singin(l); System.out.println("-----2222222222222222222"); /*System.out.println("user"+pt.getId());*/ if (pt != null) { request.getSession().setAttribute("worker", pt); return "houtai"; } else { return "fail"; } } }
06d04442242db13f65a756ec71288ec92182e9e6
005ab2a1f2fbd956c4ed6eb8826c13b1851f6e35
/plugins/org.jkiss.dbeaver.tasks.ui/src/org/jkiss/dbeaver/tasks/ui/view/DatabaseTasksView.java
6d60bb11638073aafd2236646863e5c2bed3a4fa
[ "Apache-2.0", "EPL-2.0" ]
permissive
GergelyDobo/dbeaver
a7f12444c2ca3ed57707a401b1083246ef8a3686
d8f192f1d9a2dae08b12dfde5556171f2e4b663c
refs/heads/master
2022-12-20T14:33:52.760885
2020-05-11T10:36:04
2020-05-11T10:36:57
264,475,225
0
1
Apache-2.0
2020-10-13T22:02:41
2020-05-16T16:10:18
Java
UTF-8
Java
false
false
18,015
java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2019 Serge Rider ([email protected]) * * 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.jkiss.dbeaver.tasks.ui.view; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.viewers.*; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Tree; import org.eclipse.ui.*; import org.eclipse.ui.dialogs.FilteredTree; import org.eclipse.ui.dialogs.PatternFilter; import org.eclipse.ui.editors.text.TextFileDocumentProvider; import org.eclipse.ui.menus.CommandContributionItem; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.model.WorkbenchAdapter; import org.eclipse.ui.part.ViewPart; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.Log; import org.jkiss.dbeaver.model.app.DBPProject; import org.jkiss.dbeaver.model.task.*; import org.jkiss.dbeaver.registry.task.TaskRegistry; import org.jkiss.dbeaver.runtime.DBWorkbench; import org.jkiss.dbeaver.ui.ActionUtils; import org.jkiss.dbeaver.ui.DBeaverIcons; import org.jkiss.dbeaver.ui.UIIcon; import org.jkiss.dbeaver.ui.UIUtils; import org.jkiss.dbeaver.ui.controls.ViewerColumnController; import org.jkiss.dbeaver.ui.editors.EditorUtils; import org.jkiss.dbeaver.utils.RuntimeUtils; import org.jkiss.utils.ArrayUtils; import org.jkiss.utils.CommonUtils; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.*; public class DatabaseTasksView extends ViewPart implements DBTTaskListener { private static final Log log = Log.getLog(DatabaseTasksView.class); public static final String VIEW_ID = "org.jkiss.dbeaver.tasks"; private static final String TASKS_VIEW_MENU_ID = VIEW_ID + ".menu"; public static final String CREATE_TASK_CMD_ID = "org.jkiss.dbeaver.task.create"; public static final String COPY_TASK_CMD_ID = "org.jkiss.dbeaver.task.copy"; public static final String EDIT_TASK_CMD_ID = "org.jkiss.dbeaver.task.edit"; public static final String RUN_TASK_CMD_ID = "org.jkiss.dbeaver.task.run"; public static final String GROUP_TASK_CMD_ID = "org.jkiss.dbeaver.task.group"; private static final ArrayList<Object> EMPTY_TASK_RUN_LIST = new ArrayList<>(); private DatabaseTasksTree tasksTree; private TreeViewer taskRunViewer; private ViewerColumnController taskRunColumnController; public DatabaseTasksView() { } public DatabaseTasksTree getTasksTree() { return tasksTree; } public TreeViewer getTaskRunViewer() { return taskRunViewer; } @Override public void createPartControl(Composite parent) { SashForm sashForm = UIUtils.createPartDivider(this, parent, SWT.HORIZONTAL); createTaskTree(sashForm); createTaskRunTable(sashForm); sashForm.setWeights(new int[]{700, 300}); loadViewConfig(); loadTasks(); } private void createTaskTree(Composite composite) { tasksTree = new DatabaseTasksTree(composite, false); MenuManager menuMgr = createTaskContextMenu(tasksTree.getViewer()); getSite().registerContextMenu(TASKS_VIEW_MENU_ID, menuMgr, tasksTree.getViewer()); getSite().setSelectionProvider(tasksTree.getViewer()); tasksTree.getViewer().addDoubleClickListener(event -> ActionUtils.runCommand(EDIT_TASK_CMD_ID, getSite().getSelectionProvider().getSelection(), getSite())); tasksTree.getViewer().addSelectionChangedListener(event -> loadTaskRuns()); DatabaseTasksTree.addDragSourceSupport(tasksTree.getViewer(), null); } private void createTaskRunTable(Composite parent) { FilteredTree filteredTree = new FilteredTree(parent, SWT.SINGLE | SWT.FULL_SELECTION, new NamedObjectPatternFilter(), true); filteredTree.setInitialText("Task executions: type a part of error message"); taskRunViewer = filteredTree.getViewer(); Tree taskrunTree = taskRunViewer.getTree(); taskrunTree.setHeaderVisible(true); taskrunTree.setLayoutData(new GridData(GridData.FILL_BOTH)); taskRunColumnController = new ViewerColumnController("taskruns", taskRunViewer); taskRunColumnController.addColumn("Time", "Task start time", SWT.LEFT, true, true, new TaskRunLabelProvider() { @Override protected void update(ViewerCell cell, DBTTaskRun taskRun) { cell.setText(tasksTree.getDateFormat().format(taskRun.getStartTime())); } }); taskRunColumnController.addColumn("Duration", "Task last run duration", SWT.LEFT, true, false, new TaskRunLabelProvider() { @Override protected void update(ViewerCell cell, DBTTaskRun taskRun) { cell.setText(RuntimeUtils.formatExecutionTime(taskRun.getRunDuration())); } }); taskRunColumnController.addColumn("Result", "Task result", SWT.LEFT, true, false, new TaskRunLabelProvider() { @Override protected void update(ViewerCell cell, DBTTaskRun taskRun) { if (taskRun.isRunSuccess()) { cell.setText("Success"); } else { cell.setText(CommonUtils.notEmpty(taskRun.getErrorMessage())); } } }); taskRunColumnController.setForceAutoSize(true); taskRunColumnController.createColumns(true); taskRunViewer.setContentProvider(new TreeRunContentProvider()); MenuManager menuMgr = createTaskRunContextMenu(taskRunViewer); getSite().registerContextMenu(menuMgr, taskRunViewer); taskRunViewer.addDoubleClickListener(event -> new ViewRunLogAction().run()); } private MenuManager createTaskContextMenu(TreeViewer viewer) { final MenuManager menuMgr = new MenuManager(); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(manager -> { manager.add(ActionUtils.makeCommandContribution(getSite(), RUN_TASK_CMD_ID)); manager.add(ActionUtils.makeCommandContribution(getSite(), EDIT_TASK_CMD_ID)); //manager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.FILE_PROPERTIES, "Task properties", null)); manager.add(ActionUtils.makeCommandContribution(getSite(), CREATE_TASK_CMD_ID)); manager.add(ActionUtils.makeCommandContribution(getSite(), COPY_TASK_CMD_ID)); manager.add(ActionUtils.makeCommandContribution(getSite(), IWorkbenchCommandConstants.EDIT_DELETE, "Delete task", null)); manager.add(new Separator()); manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); manager.add(new Separator()); for (TaskHandlerGroupBy.GroupBy gb : TaskHandlerGroupBy.GroupBy.values()) { manager.add(ActionUtils.makeCommandContribution( getSite(), GROUP_TASK_CMD_ID, CommandContributionItem.STYLE_CHECK, null, null, null, true, Collections.singletonMap("group", gb.name()))); } manager.add(new Separator()); tasksTree.getColumnController().fillConfigMenu(manager); }); Control control = viewer.getControl(); control.setMenu(menuMgr.createContextMenu(control)); return menuMgr; } private MenuManager createTaskRunContextMenu(TreeViewer viewer) { final MenuManager menuMgr = new MenuManager(); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(manager -> { DBTTask task = tasksTree.getSelectedTask(); DBTTaskRun taskRun = getSelectedTaskRun(); if (task != null && taskRun != null) { manager.add(new ViewRunLogAction()); manager.add(new DeleteRunLogAction()); } if (task != null && task.getLastRun() != null) { manager.add(new ClearRunLogAction()); manager.add(new OpenRunLogFolderAction()); } manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); manager.add(new Separator()); taskRunColumnController.fillConfigMenu(manager); }); Control control = viewer.getControl(); control.setMenu(menuMgr.createContextMenu(control)); return menuMgr; } @Override public void setFocus() { tasksTree.getViewer().getControl().setFocus(); } @Nullable private DBTTaskRun getSelectedTaskRun() { ISelection selection = taskRunViewer.getSelection(); if (!(selection instanceof IStructuredSelection) || selection.isEmpty()) { return null; } Object element = ((IStructuredSelection) selection).getFirstElement(); return element instanceof DBTTaskRun ? (DBTTaskRun) element : null; } @Override public <T> T getAdapter(Class<T> adapter) { if (adapter == IWorkbenchAdapter.class) { return adapter.cast(new WorkbenchAdapter() { @Override public String getLabel(Object o) { return "Database Tasks"; } }); } return super.getAdapter(adapter); } @Override public void init(IViewSite site) throws PartInitException { super.init(site); TaskRegistry.getInstance().addTaskListener(this); } @Override public void dispose() { TaskRegistry.getInstance().removeTaskListener(this); super.dispose(); } @Override public void handleTaskEvent(DBTTaskEvent event) { UIUtils.asyncExec(() -> { DBTTask task = event.getTask(); switch (event.getAction()) { case TASK_ADD: refresh(); tasksTree.getViewer().setSelection(new StructuredSelection(task), true); break; case TASK_REMOVE: refresh(); break; case TASK_UPDATE: tasksTree.getViewer().refresh(task); if (task == tasksTree.getSelectedTask()) { loadTaskRuns(); } break; case TASK_EXECUTE: refresh(); break; } }); } private void loadViewConfig() { tasksTree.loadViewConfig(); } public void refresh() { tasksTree.refresh(); loadTaskRuns(); } private void loadTasks() { tasksTree.loadTasks(); } private void loadTaskRuns() { DBTTask selectedTask = tasksTree.getSelectedTask(); if (selectedTask == null) { taskRunViewer.setInput(EMPTY_TASK_RUN_LIST); } else { DBTTaskRun[] runs = selectedTask.getRunStatistics(); if (ArrayUtils.isEmpty(runs)) { taskRunViewer.setInput(EMPTY_TASK_RUN_LIST); } else { Arrays.sort(runs, Comparator.comparing(DBTTaskRun::getStartTime).reversed()); taskRunViewer.setInput(Arrays.asList(runs)); } } } private class TreeRunContentProvider implements ITreeContentProvider { @Override public Object[] getElements(Object inputElement) { return ((Collection) inputElement).toArray(); } @Override public Object[] getChildren(Object parentElement) { return new Object[0]; } @Override public Object getParent(Object element) { return null; } @Override public boolean hasChildren(Object element) { return false; } } public class NamedObjectPatternFilter extends PatternFilter { NamedObjectPatternFilter() { setIncludeLeadingWildcard(true); } protected boolean isLeafMatch(Viewer viewer, Object element) { if (element instanceof DBTTask) { return wordMatches(((DBTTask) element).getName()); } else if (element instanceof DBTTaskRun) { return wordMatches(element.toString()); } return true; } } private static class TaskCategoryNode { final DBPProject project; final TaskCategoryNode parent; final DBTTaskCategory category; TaskCategoryNode(DBPProject project, TaskCategoryNode parent, DBTTaskCategory category) { this.project = project; this.parent = parent; this.category = category; } @Override public String toString() { return category.getName(); } @Override public int hashCode() { return (project == null ? 0 : project.hashCode()) + (parent == null ? 0 : parent.hashCode()) + (category == null ? 0 : category.hashCode()); } @Override public boolean equals(Object obj) { if (!(obj instanceof TaskCategoryNode)) { return false; } TaskCategoryNode cmp = (TaskCategoryNode)obj; return project == cmp.project && CommonUtils.equalObjects(parent, cmp.parent) && category == cmp.category; } } private abstract class TaskRunLabelProvider extends ColumnLabelProvider { @Override public final void update(ViewerCell cell) { DBTTaskRun taskRun = (DBTTaskRun) cell.getElement(); if (taskRun != null && !taskRun.isRunSuccess()) { cell.setBackground(tasksTree.getColorError()); } else { cell.setBackground(null); } update(cell, taskRun); } protected abstract void update(ViewerCell cell, DBTTaskRun task); } private class ViewRunLogAction extends Action { ViewRunLogAction() { super("View log"); } @Override public void run() { DBTTask task = tasksTree.getSelectedTask(); DBTTaskRun taskRun = getSelectedTaskRun(); if (task != null && taskRun != null) { File runLog = task.getRunLog(taskRun); if (runLog.exists()) { try { IEditorPart editorPart = EditorUtils.openExternalFileEditor(runLog, getSite().getWorkbenchWindow()); // Set UTF8 encoding if (editorPart instanceof ITextEditor) { IDocumentProvider prov = ((ITextEditor) editorPart).getDocumentProvider(); if (prov instanceof TextFileDocumentProvider) { ((TextFileDocumentProvider) prov).setEncoding(editorPart.getEditorInput(), StandardCharsets.UTF_8.name()); prov.resetDocument(editorPart.getEditorInput()); } } } catch (Exception e) { DBWorkbench.getPlatformUI().showError("Open log error", "Error while opening task execution log", e); } } else { UIUtils.showMessageBox(getSite().getShell(), "Lof file not found", "Can't find log file '" + runLog.getAbsolutePath() + "'", SWT.ICON_ERROR); } } } } private class DeleteRunLogAction extends Action { DeleteRunLogAction() { super("Delete run log", DBeaverIcons.getImageDescriptor(UIIcon.DELETE)); } @Override public void run() { DBTTask task = tasksTree.getSelectedTask(); DBTTaskRun taskRun = getSelectedTaskRun(); if (task != null && taskRun != null && UIUtils.confirmAction( "Remove task run", "Are you sure you want to delete task '" + task.getName() + "' run at '" + tasksTree.getDateFormat().format(taskRun.getStartTime()) + "'?")) { task.removeRunLog(taskRun); } } } private class ClearRunLogAction extends Action { ClearRunLogAction() { super("Clear logs", DBeaverIcons.getImageDescriptor(UIIcon.ERASE)); } @Override public void run() { DBTTask task = tasksTree.getSelectedTask(); if (task == null || !UIUtils.confirmAction("Clear task runs", "Are you sure you want to delete all log of task '" + task.getName() + "'?")) { return; } task.cleanRunStatistics(); } } private class OpenRunLogFolderAction extends Action { OpenRunLogFolderAction() { super("Open logs folder"); } @Override public void run() { DBTTask task = tasksTree.getSelectedTask(); if (task != null) { DBWorkbench.getPlatformUI().executeShellProgram(task.getRunLogFolder().getAbsolutePath()); } } } }
838cc7ecfba8fbdf835b36d2ba3e4ee86a1b7538
048a5a1043c574a4df39220c25558b0aa9c6b914
/src/day57_Polymorphism/phoneTask/PhoneObjects.java
9da4d4974fb114e732e496ac1ff7b8ae3746f58e
[]
no_license
arvindmits/Java
97e37e6009be9364a22520f177983ab486202534
68175f96220cb812cb98f226a0dc5bcb3e8634fe
refs/heads/master
2023-03-16T06:36:47.530532
2021-01-04T19:10:06
2021-01-04T19:10:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
635
java
package day57_Polymorphism.phoneTask; public class PhoneObjects { public static void main(String[] args) { Iphone iphone = new Iphone("12","5.3",1000); Samsung samsung = new Samsung("S20", "6.1",899); Huawei huawei = new Huawei("Robbery","5.3",25); System.out.println(iphone); System.out.println(samsung); System.out.println(huawei); Phone phone1 = new Iphone("11","6", 1200); Phone phone2 = new Samsung("S8","6.5", 900); Phone phone3 = new Huawei("Something","3", 35); Phone[] phones = {iphone, samsung, huawei, phone1, phone2, phone3}; } }
8f82a9fb850149a850929217f7c55cd47d62854e
5559d17fbeb5ddcb83fa2215a42e58fb318294fc
/src/test/java/WishListTest.java
8b291348baa2bd1c8d16ad9aa5c267d7283281e7
[]
no_license
lucianbogdi14/seleniumproj
fa7facca45860d63a03acc792c24992519c0a8b4
71c8e32945146aabd8db97e528f919b2f560ba8a
refs/heads/master
2022-11-06T16:56:07.758852
2020-06-23T14:21:22
2020-06-23T14:21:22
274,425,664
0
0
null
null
null
null
UTF-8
Java
false
false
815
java
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class WishListTest { public void wishlisttest() { WebDriver driver = new ChromeDriver(); driver.get("http://testfasttrackit.info/selenium-test/"); driver.findElement(By.cssSelector("#nav > ol > li.level0.nav-5.parent > a")).click(); driver.findElement(By.cssSelector("body > div > div.page > div.main-container.col3-layout > div > div.col-wrapper > div.col-main > div.category-products > ul > li:nth-child(1) > div > div.actions > a")).click(); driver.findElement(By.cssSelector("#product_addtocart_form > div.product-shop > div.product-options-bottom > ul.add-to-links > li:nth-child(1) > a")).click(); driver.quit(); } }
3cf9cbcc9eb5dbb9435db5d90a20bbdb9baabf9d
85416869d20601d22947bc73c10c5e74692197ca
/src/main/java/com/ly/orderingsystem/service/imp/CartServiceImp.java
d41d9e0f948b7e1ed15ce5e435ee47a29d3896c5
[]
no_license
zhangxiaokun123/ordering-system
a0dbf0a02f905176b4605ef70a1a34eb1cafcb4a
bedb2d481cf3ea35bcd319b18b51e459e7681a72
refs/heads/master
2022-05-29T02:19:55.655786
2020-04-27T09:04:50
2020-04-27T09:04:50
256,383,844
0
0
null
null
null
null
UTF-8
Java
false
false
3,647
java
package com.ly.orderingsystem.service.imp; import com.ly.orderingsystem.entity.Cart; import com.ly.orderingsystem.entity.User; import com.ly.orderingsystem.mapper.CartMapper; import com.ly.orderingsystem.mapper.CartMasterMapper; import com.ly.orderingsystem.model.CartMaster; import com.ly.orderingsystem.service.CartService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.http.HttpSession; import java.util.List; @Service public class CartServiceImp implements CartService { @Autowired private CartMapper cartMapper; @Autowired private CartMasterMapper cartMasterMapper; @Override public String addCart(Integer productCode, Integer productNumber, HttpSession session) { //先判断是否为登录状态,未登录不可添加商品 Object userObj=session.getAttribute("userName"); if (userObj!=null){ String userName=userObj.toString(); //如果购物车中已存在该商品则只增加商品数量 Cart cart1=cartMapper.selectByPU(productCode,userName); if(cart1!=null) { Integer i = cart1.getProductNumber(); productNumber = productNumber + i; cart1.setProductCode(productCode); cart1.setProductNumber(productNumber); cart1.setUserName(userName); Integer j = cartMapper.updateByPU(cart1); if (j > 0) { String msg = String.format("已成功将商品添加到购物车"); return msg; } else { String msg = String.format("添加失败"); return msg; } }else { Cart cart = new Cart(); cart.setProductCode(productCode); cart.setProductNumber(productNumber); cart.setUserName(userName); //向购物车插入一条数据 Integer i = cartMapper.insert(cart); if (i > 0) { String msg = String.format("已成功将商品添加到购物车"); return msg; } else { String msg = String.format("添加失败"); return msg; } } }else { String msg=String.format("请先登录"); return msg; } } @Override public void updateProductNumber(Integer productCode, Integer productNumber, HttpSession session) { Object userObj=session.getAttribute("userName"); String userName=userObj.toString(); Cart cart=new Cart(); cart.setUserName(userName); cart.setProductCode(productCode); cart.setProductNumber(productNumber); cartMapper.updateByPU(cart); } @Override public List<CartMaster> getCarts(HttpSession session) { Object userObj=session.getAttribute("userName"); if (userObj!=null){ String userName=userObj.toString(); return cartMasterMapper.selectAll(userName); }else { return null; } } @Override public String deleteCart(Integer productCode, HttpSession session) { Object userObj=session.getAttribute("userName"); String userName=userObj.toString(); Integer i=cartMapper.delete(userName,productCode); if (i>0){ String msg=String.format("删除成功"); return msg; }else { return String.format("删除失败"); } } }
34b601ab546c6636eb44b2a05e70d0c92abf8cf7
378ca0d7c5b6f70d88042266fc0ba99e148cfc7d
/src/com/hw/edu/iit/Overdrawn.java
687e493b5cc5a32aea53aced34a943cce1878f57
[]
no_license
sangs/MDAOFATM
91eb26d83b7ba0139829800052ebf3916a2ca281
54db1ca4807f513b3239b9f87ceaf69189f33c4e
refs/heads/master
2021-01-01T19:56:50.238922
2012-05-23T14:46:59
2012-05-23T14:46:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
295
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.hw.edu.iit; /** * * @author Owner */ public abstract class Overdrawn { ATMSystemClasses dataAccess; Overdrawn() { } abstract void show_overdrawn_message(); }
4ca5e1732c134460d2b8c4a3b895b84b37d33bc2
872770c5323aa17120f2f708a1f0be09e663c9a8
/Elastos/Framework/Droid/DevSamples/GalleryDemo/gen/GalleryDemo/R.java
fc602c334fc38cae912fd6a8e1d0ccfd0bb54312
[]
no_license
xianjimli/Elastos
76a12b58db23dbf32ecbcefdaf6179510362dd21
f9f019d266a7e685544596b365cfbc05bda9cb70
refs/heads/master
2021-01-11T08:26:17.180908
2013-08-21T02:31:17
2013-08-21T02:31:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package GalleryDemo; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; public static final int sample_0=0x7f020001; public static final int sample_1=0x7f020002; public static final int sample_2=0x7f020003; public static final int sample_3=0x7f020004; public static final int sample_4=0x7f020005; public static final int sample_5=0x7f020006; } public static final class id { public static final int gallery=0x7f050000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040000; } }
9a0c20bc3c3a45c4d266b1ee027b7883b27dc198
7e469dc05152899864a930dbb4eaf69d43a79b14
/android/app/src/main/java/cn/bearever/likemosaic/MosaiApplication.java
5f9c45ffe4ff8172d50aa6582de708f7eebab6e3
[ "MIT" ]
permissive
fucora/likeMosaic
61bcec23b10e0e4d9f76cbe6b98c481eb7401d1d
7fe26b7087c0c8842e6f351af49e8c9a98bafcd4
refs/heads/master
2022-04-23T15:01:45.261294
2020-04-22T07:38:56
2020-04-22T07:38:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
package cn.bearever.likemosaic; import cn.bearever.mingbase.app.BaseApplication; /** * @author luoming * @date 2020/4/16 */ public class MosaiApplication extends BaseApplication { }
b2c94977b0f56c36f7eba84defc4c825a96ea709
e6007c1424b911e79cf1121cc463ed14300d55ef
/src/elevatorsimulation/Controllers/SimulationMenuWindowController.java
806390c48a1a5df23f6d47373f9a00bfeb2d07ab
[]
no_license
ElevatorBuilderTeam/elevator-simulator
fc057c4fb46b0dc28817248e4c9b0df87131f150
c63f3254c387dddab6a81442c462ccfca84b1ba5
refs/heads/master
2020-04-14T23:23:00.499487
2016-03-02T21:27:11
2016-03-02T21:27:11
50,942,889
0
0
null
null
null
null
UTF-8
Java
false
false
1,185
java
/* COPYRIGHT 2016 Andrew Lincoln, Andrew Briggs, Connor Dvorsky. All Rights Reserved. */ package elevatorsimulation.Controllers; import javafx.fxml.Initializable; import javafx.scene.control.MenuItem; import javafx.scene.layout.AnchorPane; import java.net.URL; import java.util.ResourceBundle; /** * FXML Controller class * * @author andrewlincoln */ public class SimulationMenuWindowController extends Controller implements Initializable { public MenuItem simulationEditorOption; public AnchorPane anchorPane; private boolean editorWindowOpened = false; /** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { } public void simulationEditorOptionClicked() { // push the editor window on top of the frame. if (editorWindowOpened) { return; } this.loadWindow("SimulationEditorWindow", (loader, stage) -> { loader.<SimulationEditorWindowController>getController().initWithParent(this); editorWindowOpened = true; stage.setOnCloseRequest((event) -> editorWindowOpened = false); }); } public void exitMenuOptionClicked() { System.exit(0); } }
378304ffefe3800981730823c12a8788eb93c8c8
b95a47c4ab7dcf5c3b597f6071cffdf55c451a3c
/app/src/main/java/org/jbossoutreach/restandroid/backend/ResponseService.java
39a6154f1935786e86b57dc1b638997e5279a8de
[ "Apache-2.0" ]
permissive
YellowShip/rest-android
1ce4e57401e5d920592827d738d921d5d5ecb709
35c0fd463ebd8dd829e8c5188c243cb5874513fb
refs/heads/master
2021-08-22T10:52:52.792610
2017-11-29T07:22:47
2017-11-29T07:22:47
112,549,261
0
0
null
2017-11-30T01:35:27
2017-11-30T01:35:26
null
UTF-8
Java
false
false
920
java
package org.jbossoutreach.restandroid.backend; import android.support.annotation.Nullable; import okhttp3.RequestBody; import okhttp3.Response; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.DELETE; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Url; /** * Created by murad on 11/11/17. */ public interface ResponseService { @GET Call<Response> getCall(@Url String url, @Nullable @Body RequestBody requestBody); @DELETE Call<Response> deleteCall(@Url String url, @Nullable @Body RequestBody requestBody); @POST Call<Response> postCall(@Url String url, @Nullable @Body RequestBody requestBody); @PUT Call<Response> putCall(@Url String url, @Nullable @Body RequestBody requestBody); }
7bd2076634cd7f474bc02e0b92a7f0162ee52d2c
7f6e998ece4672b001611f8d8dd455973ad9389a
/yeb_system/yeb_server/src/main/java/com/mornd/server/vo/EmployeeVo.java
9b7f4c1f0c8eeb5fe0bc7226e35e8b4e992d571b
[]
no_license
houyujiang/yebs
323fe521f6f0d005abce632eede6088ebebc3b89
ad3a9b5210cbc9c4a4a4f1ed7e74dfb30615fc82
refs/heads/master
2023-04-08T20:44:15.539532
2021-04-12T15:55:27
2021-04-12T15:55:27
357,253,267
0
0
null
null
null
null
UTF-8
Java
false
false
411
java
package com.mornd.server.vo; import com.mornd.server.pojo.Employee; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; /** * @author mornd * @date 2021/2/14 - 15:06 */ @Data public class EmployeeVo extends Employee { private Integer page; private Integer size; //@DateTimeFormat(pattern = "yyyy-MM-dd") private Date[] beginDateScope; }
27e71deb3b2c7a6892ac661f752a455a119c19d8
0d781e6a153da1a714a1904db85d5c352d9fa3f9
/src/main/java/be/vdab/servlets/IndexServlet.java
a1987c4e80bb20e12d41a77cee3413b2fe87e5a2
[]
no_license
michelle422/toysforboys
ec31e482609edde79ebec5ad555db14f20792e72
3c8b5c732ede81388209c1c6a9287d7b2142a577
refs/heads/master
2021-04-06T02:07:19.301995
2018-03-19T10:58:07
2018-03-19T10:58:07
124,539,050
0
0
null
null
null
null
UTF-8
Java
false
false
2,456
java
package be.vdab.servlets; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; 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 be.vdab.entities.Order; import be.vdab.exceptions.RecordAangepastException; import be.vdab.services.OrderService; /** * Servlet implementation class IndexServlet */ @WebServlet("/index.htm") public class IndexServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final String VIEW = "/WEB-INF/JSP/index.jsp"; private static final int AANTAL_RIJEN = 10; private final transient OrderService orderService = new OrderService(); /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int vanafRij = request.getParameter("vanafRij") == null ? 0 : Integer.parseInt(request.getParameter("vanafRij")); request.setAttribute("vanafRij", vanafRij); request.setAttribute("aantalRijen", AANTAL_RIJEN); List<Order> orders = orderService.findMetStatusBehalveShippedEnCancelled(vanafRij, AANTAL_RIJEN + 1); if (orders.size() <= AANTAL_RIJEN) { request.setAttribute("laatstePagina", true); } else { orders.remove(AANTAL_RIJEN); } request.setAttribute("orders", orders); request.getRequestDispatcher(VIEW).forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String[] checked = request.getParameterValues("orderIdShip"); Map<String, String> fouten = new HashMap<>(); if (checked != null) { try { orderService.updateStock(checked, fouten); } catch (RecordAangepastException ex) { fouten.put("order", "een andere gebruiker heeft deze order gewijzigd"); } } if (!fouten.isEmpty()) { request.setAttribute("fouten", fouten); doGet(request, response); // request.getRequestDispatcher(VIEW).forward(request, response); } else { // response.sendRedirect(request.getContextPath() + REDIRECT_URL); response.sendRedirect(response.encodeRedirectURL(request.getContextPath())); } } }
e59337771343b35dc74726a8df8b79943aa835a1
1f8ab6c15288c12cff50062efe34f0b5ba3178bd
/web_finalprj/src/main/java/com/web/seenema/review/repository/ReviewRepository.java
4b5c834e48b331459e06dc5cd75db990a6c61a43
[]
no_license
kh1project/kh_1
49266995a4f885b8f12899e65d894d96e38e2844
749ae2f8f2f4f98968066844260ec51c233e803b
refs/heads/main
2023-06-18T23:53:10.472268
2021-07-16T07:35:16
2021-07-16T07:35:16
386,514,707
0
0
null
null
null
null
UTF-8
Java
false
false
1,996
java
package com.web.seenema.review.repository; import java.util.*; import com.web.seenema.board.dto.BoardSearchDTO; import com.web.seenema.comment.dto.CommentSimpleDTO; import com.web.seenema.movie.dto.MovieDTO; import com.web.seenema.review.dto.ReviewAddDTO; import com.web.seenema.review.dto.ReviewDTO; import com.web.seenema.review.dto.ReviewListDTO; import com.web.seenema.review.dto.ReviewPostDTO; public interface ReviewRepository { public List<ReviewListDTO> selectReviewList() throws Exception; public List<ReviewListDTO> selectOrderbyLikeList() throws Exception; public List<ReviewListDTO> selectReviewSearchList(BoardSearchDTO search) throws Exception; public List<ReviewListDTO> selectReviewSeenList(int aid) throws Exception; public List<ReviewListDTO> selectOrderbyLikeSeenList(int aid) throws Exception; public List<ReviewListDTO> selectReviewSearchSeenList(BoardSearchDTO search) throws Exception; public ReviewDTO selectReview(int rid) throws Exception; public List<CommentSimpleDTO> selectCommList(int rid) throws Exception; public List<Integer> selectWatchList(int aid) throws Exception; public MovieDTO selectMovie(int mid) throws Exception; public boolean insertReview(ReviewAddDTO dto) throws Exception; public boolean updateReview(ReviewDTO dto) throws Exception; public boolean deleteReview(int rid) throws Exception; public Integer firstInsertPost(ReviewPostDTO rpdto) throws Exception; public boolean insertPost(ReviewPostDTO rpdto) throws Exception; public List<ReviewPostDTO> selectMergePost(String cont) throws Exception; public int firstUpdatePost(ReviewPostDTO post) throws Exception; public boolean updatePost(ReviewPostDTO post) throws Exception; public boolean rollbackPost(int mergeId) throws Exception; public int updateGcnt(ReviewDTO rdto) throws Exception; public int updateBcnt(ReviewDTO rdto) throws Exception; public int updateVcnt(ReviewDTO rdto) throws Exception; }
431348882fe061150aea6a9460d55dd3dc5c780f
4bfdcbb02394503fc1cb6154bc36c7eab0eed746
/app/src/androidTest/java/com/java/cityexplorer/ExampleInstrumentedTest.java
9c66ae59a9fd13214909b2d7e2f5b6bcd379f684
[]
no_license
induarun9086/CityExplorer
cd013fe217686bb02f1c6b66e88f260427941d8c
211760f814e4344fb3a21008bd4e02c4982c1325
refs/heads/master
2021-01-25T05:43:43.211872
2017-02-09T20:38:12
2017-02-09T20:38:12
80,665,020
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package world.com.cityexplorer; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("world.com.cityexplorer", appContext.getPackageName()); } }
0ce9f9b80d149fa2bec47abee529b6819fdd0339
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE606_Unchecked_Loop_Condition/CWE606_Unchecked_Loop_Condition__File_11.java
01e6e10c38bfee140f262ea92a7accc251bc6d89
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
20,771
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE606_Unchecked_Loop_Condition__File_11.java Label Definition File: CWE606_Unchecked_Loop_Condition.label.xml Template File: sources-sinks-11.tmpl.java */ /* * @description * CWE: 606 Unchecked Input for Loop Condition * BadSource: File Read data from file (named c:\data.txt) * GoodSource: hardcoded int in string form * Sinks: * GoodSink: validate loop variable * BadSink : loop variable not validated * Flow Variant: 11 Control flow: if(IO.static_returns_t()) and if(IO.static_returns_f()) * * */ package testcases.CWE606_Unchecked_Loop_Condition; import testcasesupport.*; import java.sql.*; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.FileInputStream; import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; public class CWE606_Unchecked_Loop_Condition__File_11 extends AbstractTestCase { public void bad() throws Throwable { String data; if(IO.static_returns_t()) { data = ""; /* Initialize data */ { File f = new File("C:\\data.txt"); FileInputStream fis = null; InputStreamReader isread = null; BufferedReader buffread = null; try { /* read string from file into data */ fis = new FileInputStream(f); isread = new InputStreamReader(fis, "UTF-8"); buffread = new BufferedReader(isread); /* POTENTIAL FLAW: Read data from a file */ data = buffread.readLine(); // This will be reading the first "line" of the file, which // could be very long if there are little or no newlines in the file } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* Close stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( isread != null ) { isread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } try { if( fis != null ) { fis.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", ioe); } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } if(IO.static_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodG2B1() - use goodsource and badsink by changing first IO.static_returns_t() to IO.static_returns_f() */ private void goodG2B1() throws Throwable { String data; if(IO.static_returns_f()) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = ""; /* Initialize data */ { File f = new File("C:\\data.txt"); FileInputStream fis = null; InputStreamReader isread = null; BufferedReader buffread = null; try { /* read string from file into data */ fis = new FileInputStream(f); isread = new InputStreamReader(fis, "UTF-8"); buffread = new BufferedReader(isread); /* POTENTIAL FLAW: Read data from a file */ data = buffread.readLine(); // This will be reading the first "line" of the file, which // could be very long if there are little or no newlines in the file } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* Close stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( isread != null ) { isread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } try { if( fis != null ) { fis.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", ioe); } } } } else { /* FIX: Use a hardcoded int as a string */ data = "5"; } if(IO.static_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodG2B2() - use goodsource and badsink by reversing statements in first if */ private void goodG2B2() throws Throwable { String data; if(IO.static_returns_t()) { /* FIX: Use a hardcoded int as a string */ data = "5"; } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ data = ""; /* Initialize data */ { File f = new File("C:\\data.txt"); FileInputStream fis = null; InputStreamReader isread = null; BufferedReader buffread = null; try { /* read string from file into data */ fis = new FileInputStream(f); isread = new InputStreamReader(fis, "UTF-8"); buffread = new BufferedReader(isread); /* POTENTIAL FLAW: Read data from a file */ data = buffread.readLine(); // This will be reading the first "line" of the file, which // could be very long if there are little or no newlines in the file } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* Close stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( isread != null ) { isread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } try { if( fis != null ) { fis.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", ioe); } } } } if(IO.static_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodB2G1() - use badsource and goodsink by changing second IO.static_returns_t() to IO.static_returns_f() */ private void goodB2G1() throws Throwable { String data; if(IO.static_returns_t()) { data = ""; /* Initialize data */ { File f = new File("C:\\data.txt"); FileInputStream fis = null; InputStreamReader isread = null; BufferedReader buffread = null; try { /* read string from file into data */ fis = new FileInputStream(f); isread = new InputStreamReader(fis, "UTF-8"); buffread = new BufferedReader(isread); /* POTENTIAL FLAW: Read data from a file */ data = buffread.readLine(); // This will be reading the first "line" of the file, which // could be very long if there are little or no newlines in the file } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* Close stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( isread != null ) { isread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } try { if( fis != null ) { fis.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", ioe); } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } if(IO.static_returns_f()) { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } else { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } } /* goodB2G2() - use badsource and goodsink by reversing statements in second if */ private void goodB2G2() throws Throwable { String data; if(IO.static_returns_t()) { data = ""; /* Initialize data */ { File f = new File("C:\\data.txt"); FileInputStream fis = null; InputStreamReader isread = null; BufferedReader buffread = null; try { /* read string from file into data */ fis = new FileInputStream(f); isread = new InputStreamReader(fis, "UTF-8"); buffread = new BufferedReader(isread); /* POTENTIAL FLAW: Read data from a file */ data = buffread.readLine(); // This will be reading the first "line" of the file, which // could be very long if there are little or no newlines in the file } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error with stream reading", ioe); } finally { /* Close stream reading objects */ try { if( buffread != null ) { buffread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe); } try { if( isread != null ) { isread.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe); } try { if( fis != null ) { fis.close(); } } catch( IOException ioe ) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", ioe); } } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ /* FIX: Use a hardcoded int as a string */ data = "5"; } if(IO.static_returns_t()) { int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } /* FIX: loop number thresholds validated */ if (loopNum >= 0 && loopNum <= 5) { for(int i=0; i < loopNum; i++) { IO.writeLine("hello world"); } } } else { /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */ int loopNum; try { loopNum = Integer.parseInt(data); } catch (NumberFormatException nfe) { IO.writeLine("Invalid response. Numeric input expected. Assuming 1."); loopNum = 1; } for(int i=0; i < loopNum; i++) { /* POTENTIAL FLAW: user supplied input used for loop counter test */ IO.writeLine("hello world"); } } } public void good() throws Throwable { goodG2B1(); goodG2B2(); goodB2G1(); goodB2G2(); } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
e2b13b6ff8d6537d92e880e431746aa95e15daa1
f58fa3b4eea1c61503784597e72341efb243ce69
/src/main/java/service/impl/AdService.java
1f45239b42ec82dde36bafa6498abd6fb7aed3bb
[]
no_license
ngoducgiahuy/tiktok-collector
a83057695c6885876f5ec910cab65cf09f97b00a
8f0493ed6ee41589ae34c5ef1a2adddc519aef91
refs/heads/main
2023-08-31T17:34:15.175067
2021-10-08T02:35:01
2021-10-08T02:35:01
414,100,903
0
0
null
null
null
null
UTF-8
Java
false
false
2,206
java
package service.impl; import java.util.ArrayList; import java.util.List; import org.hibernate.Session; import org.json.JSONArray; import org.modelmapper.ModelMapper; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.VisibilityChecker; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import dto.AdDto; import model.Ad; import service.AbstractService; import utils.GlobalVariable; public class AdService extends AbstractService { public JSONArray getDataAd(String accessToken, Long advertiserId) { String path = GlobalVariable.AD_PATH; List<String> fieldList = new ArrayList<String>(); fieldList.add("advertiser_id"); fieldList.add("campaign_id"); fieldList.add("campaign_name"); fieldList.add("adgroup_id"); fieldList.add("adgroup_name"); fieldList.add("ad_id"); fieldList.add("ad_name"); fieldList.add("ad_text"); fieldList.add("ad_format"); fieldList.add("status"); fieldList.add("opt_status"); fieldList.add("app_name"); return getListWithAllData(path, accessToken, advertiserId, fieldList); } public void importData(String accessToken, Long advertiserId, Session session) throws JsonProcessingException { JSONArray resultList = this.getDataAd(accessToken, advertiserId); for (Object ad : resultList) { AdDto adDto = convertToDto(ad); Ad adEntity = convertToEntity(adDto); session.saveOrUpdate(adEntity); } } public AdDto convertToDto(Object obj) throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new JavaTimeModule()); mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); mapper.setVisibility( VisibilityChecker.Std.defaultInstance().withFieldVisibility(JsonAutoDetect.Visibility.ANY)); AdDto adgroupDto = mapper.readValue(obj.toString(), AdDto.class); return adgroupDto; } public Ad convertToEntity(AdDto adDto) { ModelMapper mapper = new ModelMapper(); Ad adModel = mapper.map(adDto, Ad.class); return adModel; } }
edf9adc9017ba22c73c06de15690323f0b899462
a615fcd9b9cb9bc6de3af15c8b6e59a8a3be3a06
/estore.backend/src/main/java/com/nec/estore/backend/model/Cart.java
25fca63acb449889367491027b54bcb6cab48e27
[]
no_license
Kernelogy/eStore2
328d88ffe25e8f7dafd1ca2822ffb944b575fa71
457191bab3a47d56f55703bdf90e2b890973d43c
refs/heads/master
2021-05-07T03:15:59.164297
2017-11-15T10:57:47
2017-11-15T10:57:47
110,821,212
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package com.nec.estore.backend.model; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; public class Cart { private int id; private static List<CartItem> items=null; private double grandTotal; public int getId() { return id; } public void setId(int id) { this.id = id; } public List<CartItem> getItems() { if(items==null) items=new ArrayList<CartItem>(); return items; } public void setItems(List<CartItem> items) { this.items = items; } public double getGrandTotal() { double grand=0.0; for(CartItem c : items){ grand+=c.getCost(); } this.grandTotal=grand; return grand; } /* public void setGrandTotal(double grandTotal) { this.grandTotal = grandTotal; }*/ }
ba63ad32ae89fa04db58767620d5e85f6fe89cf1
87b666bcf4b0b3d1ea17a462b66c53f07aa44b02
/fili-sql/src/main/java/com/yahoo/bard/webservice/sql/DruidQueryToSqlConverter.java
9c2d137a85d968bc5f8058426e644774d6e0b2cc
[ "Apache-2.0" ]
permissive
FourSpaces/fili
ddaa951909a7c258eda8d76eb042d23d3f9db5db
fea9278b80323470117a48af83595156862ecb2d
refs/heads/master
2020-08-30T15:31:58.822170
2019-10-09T17:23:54
2019-10-09T17:23:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,149
java
// Copyright 2017 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. package com.yahoo.bard.webservice.sql; import static com.yahoo.bard.webservice.druid.model.DefaultQueryType.GROUP_BY; import com.yahoo.bard.webservice.data.dimension.Dimension; import com.yahoo.bard.webservice.druid.model.DefaultQueryType; import com.yahoo.bard.webservice.druid.model.QueryType; import com.yahoo.bard.webservice.druid.model.aggregation.Aggregation; import com.yahoo.bard.webservice.druid.model.having.Having; import com.yahoo.bard.webservice.druid.model.orderby.LimitSpec; import com.yahoo.bard.webservice.druid.model.orderby.SortDirection; import com.yahoo.bard.webservice.druid.model.query.DruidAggregationQuery; import com.yahoo.bard.webservice.druid.model.query.DruidQuery; import com.yahoo.bard.webservice.druid.model.query.GroupByQuery; import com.yahoo.bard.webservice.sql.aggregation.DruidSqlAggregationConverter; import com.yahoo.bard.webservice.sql.aggregation.SqlAggregation; import com.yahoo.bard.webservice.sql.evaluator.FilterEvaluator; import com.yahoo.bard.webservice.sql.evaluator.HavingEvaluator; import com.yahoo.bard.webservice.sql.helper.CalciteHelper; import com.yahoo.bard.webservice.sql.helper.SqlTimeConverter; import com.yahoo.bard.webservice.table.SqlPhysicalTable; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.rel2sql.RelToSqlConverter; import org.apache.calcite.rex.RexNode; import org.apache.calcite.sql.SqlSelect; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.sql.pretty.SqlPrettyWriter; import org.apache.calcite.tools.RelBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.BiFunction; import java.util.stream.Collectors; /** * Default implementation of converting a {@link DruidQuery} into a sql query. */ public class DruidQueryToSqlConverter { private static final Logger LOG = LoggerFactory.getLogger(DruidQueryToSqlConverter.class); private final CalciteHelper calciteHelper; private final SqlTimeConverter sqlTimeConverter; private final BiFunction<Aggregation, ApiToFieldMapper, Optional<SqlAggregation>> druidSqlAggregationConverter; private final HavingEvaluator havingEvaluator; private final FilterEvaluator filterEvaluator; public static final int NO_OFFSET = -1; public static final int NO_LIMIT = -1; /** * Constructs the default converter. * * TODO could make an interface with {@link #isValidQuery(DruidQuery)} and * {@link #buildSqlQuery(DruidAggregationQuery, ApiToFieldMapper)}. Maybe make it a generic * more generic like "{@code DruidQueryConverter<T>}" * * @param calciteHelper The calcite helper for this database. */ public DruidQueryToSqlConverter(CalciteHelper calciteHelper) { this.calciteHelper = calciteHelper; this.sqlTimeConverter = buildSqlTimeConverter(); this.druidSqlAggregationConverter = buildDruidSqlTypeConverter(); this.havingEvaluator = new HavingEvaluator(); this.filterEvaluator = new FilterEvaluator(); } /** * Builds a time converter to designating how to translate between druid and sql * time information. * * @return a new time converter. */ protected SqlTimeConverter buildSqlTimeConverter() { return new SqlTimeConverter(); } /** * Builds a converter between druid and sql aggregations. * * @return a new druid to sql aggregation converter. */ protected BiFunction<Aggregation, ApiToFieldMapper, Optional<SqlAggregation>> buildDruidSqlTypeConverter() { return new DruidSqlAggregationConverter(); } /** * Determines whether or not a query is able to be processed using * the Sql backend. * * @param druidQuery The query to check if is able to be processed. * * @return true if a valid query, else false. */ protected boolean isValidQuery(DruidQuery<?> druidQuery) { QueryType queryType = druidQuery.getQueryType(); LOG.debug("Processing {} query\n {}", queryType, druidQuery); if (queryType instanceof DefaultQueryType) { DefaultQueryType defaultQueryType = (DefaultQueryType) queryType; switch (defaultQueryType) { case TIMESERIES: case GROUP_BY: return true; } } return false; } /** * Builds the druid query as sql and returns it as a string. * * @param druidQuery The query to convert to sql. * @param apiToFieldMapper The mapping between api and physical names for the query. * * @return the sql equivalent of the query. */ public String buildSqlQuery(DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper) { SqlPhysicalTable sqlTable = (SqlPhysicalTable) druidQuery.getDataSource() .getPhysicalTable() .getSourceTable(); LOG.debug( "Querying table {} with schema {} using timestampColumn {}", sqlTable.getName(), sqlTable.getSchemaName(), sqlTable.getTimestampColumn() ); RelNode query = convertDruidQueryToRelNode(druidQuery, apiToFieldMapper, sqlTable); RelToSqlConverter relToSql = calciteHelper.getNewRelToSqlConverter(); SqlPrettyWriter sqlWriter = calciteHelper.getNewSqlWriter(); return writeSql(sqlWriter, relToSql, query); } /** * Converts the druid query to a {@link RelNode}. * * @param druidQuery The query to convert to sql. * @param apiToFieldMapper The mapping between api and physical names for the query. * @param sqlTable The sql table being queried against. * * @return the sql equivalent of the query. */ private RelNode convertDruidQueryToRelNode( DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper, SqlPhysicalTable sqlTable ) { RelBuilder builder = calciteHelper.getNewRelBuilder(sqlTable.getSchemaName()); return builder.scan(sqlTable.getName()) .filter( getAllWhereFilters(builder, druidQuery, apiToFieldMapper, sqlTable.getTimestampColumn()) ) .aggregate( builder.groupKey(getAllGroupByColumns( builder, druidQuery, apiToFieldMapper, sqlTable.getTimestampColumn() )), getAllQueryAggregations(builder, druidQuery, apiToFieldMapper) ) .filter( getHavingFilter(builder, druidQuery, apiToFieldMapper) ) .sortLimit( NO_OFFSET, getLimit(druidQuery), getSort(builder, druidQuery, apiToFieldMapper, sqlTable.getTimestampColumn()) ) .build(); } /** * Gets the number of rows to limit results to for a Group by Query. Otherwise no limit is applied. * * @param druidQuery The query to get the row limit from. * * @return the number of rows to include in the results. */ protected int getLimit(DruidAggregationQuery<?> druidQuery) { if (druidQuery.getQueryType().equals(GROUP_BY)) { GroupByQuery groupByQuery = (GroupByQuery) druidQuery; LimitSpec limitSpec = groupByQuery.getLimitSpec(); if (limitSpec != null) { return limitSpec.getLimit().orElse(NO_LIMIT); } } return NO_LIMIT; } /** * Finds the sorting for a druid query. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query to find the sorting from. * @param apiToFieldMapper The mapping from api to physical names. * @param timestampColumn The name of the timestamp column in the database. * * @return a collection of rexnodes to apply sorts in calcite. */ protected List<RexNode> getSort( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper, String timestampColumn ) { // druid does NULLS FIRST List<RexNode> sorts = new ArrayList<>(); int timePartFunctions = sqlTimeConverter.timeGrainToDatePartFunctions(druidQuery.getGranularity()).size(); int groupBys = druidQuery.getDimensions().size() + timePartFunctions; List<RexNode> limitSpecSorts = new ArrayList<>(); Set<String> limitSpecColumns = new HashSet<>(); if (druidQuery.getQueryType().equals(GROUP_BY)) { GroupByQuery groupByQuery = (GroupByQuery) druidQuery; LimitSpec limitSpec = groupByQuery.getLimitSpec(); if (limitSpec != null) { limitSpec.getColumns() .stream() .map(orderByColumn -> { String orderByField = apiToFieldMapper.apply(orderByColumn.getDimension()); limitSpecColumns.add(orderByField); RexNode sort = builder.field(orderByField); if (orderByColumn.getDirection().equals(SortDirection.DESC)) { sort = builder.desc(sort); } return sort; }) .forEach(limitSpecSorts::add); } } // add time group by if (timePartFunctions == 0) { sorts.add(builder.field(timestampColumn)); } sorts.addAll(builder.fields().subList(druidQuery.getDimensions().size(), groupBys)); // add limit spec group by sorts.addAll(limitSpecSorts); // add remaining group by List<RexNode> unorderedDimensions = druidQuery.getDimensions().stream() .map(Dimension::getApiName) .map(apiToFieldMapper) .filter(columnName -> !limitSpecColumns.contains(columnName)) .map(builder::field) .collect(Collectors.toList()); sorts.addAll(unorderedDimensions); return sorts.stream() .map(sort -> builder.call(SqlStdOperatorTable.NULLS_FIRST, sort)) .collect(Collectors.toList()); } /** * Gets all the dimensions from a druid query as fields for calcite. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query to find the having filter from. * @param apiToFieldMapper The mapping from api to physical name. * * @return the list of dimensions as {@link RexNode} for Calcite's builder. */ private List<RexNode> getDimensionFields( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper ) { return druidQuery.getDimensions().stream() .map(Dimension::getApiName) .map(apiToFieldMapper) .map(builder::field) .collect(Collectors.toList()); } /** * Returns the RexNode used to filter the druidQuery. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query from which to find filter all the filters for. * @param apiToFieldMapper The mapping from api to physical names. * @param timestampColumn The name of the timestamp column in the database. * * @return the combined RexNodes that should be filtered on. */ protected RexNode getAllWhereFilters( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper, String timestampColumn ) { RexNode timeFilter = sqlTimeConverter.buildTimeFilters( builder, druidQuery, timestampColumn ); if (druidQuery.getFilter() != null) { RexNode druidQueryFilter = filterEvaluator.evaluateFilter( druidQuery.getFilter(), builder, apiToFieldMapper ); return builder.and(timeFilter, druidQueryFilter); } return timeFilter; } /** * Gets the collection of having filters to be applied from the druid query. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query to find the having filter from. * @param apiToFieldMapper The mapping from api to physical name. * * @return the collection of equivalent filters for calcite. */ protected Collection<RexNode> getHavingFilter( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper ) { RexNode filter = null; if (druidQuery.getQueryType().equals(GROUP_BY)) { Having having = ((GroupByQuery) druidQuery).getHaving(); if (having != null) { filter = havingEvaluator.evaluateHaving(having, builder, apiToFieldMapper); } } return Collections.singletonList(filter); } /** * Find all druid aggregations and convert them to {@link org.apache.calcite.tools.RelBuilder.AggCall}. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The druid query to get the aggregations of. * @param apiToFieldMapper The mapping from api to physical name. * * @return the list of aggregations. */ protected List<RelBuilder.AggCall> getAllQueryAggregations( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper ) { return druidQuery.getAggregations() .stream() .map(aggregation -> druidSqlAggregationConverter.apply(aggregation, apiToFieldMapper)) .map(optionalSqlAggregation -> optionalSqlAggregation.orElseThrow(() -> { String msg = "Couldn't build sql aggregation with " + optionalSqlAggregation; LOG.debug(msg); return new RuntimeException(msg); })) .map(sqlAggregation -> builder.aggregateCall( sqlAggregation.getSqlAggFunction(), false, null, sqlAggregation.getSqlAggregationAsName(), builder.field(sqlAggregation.getSqlAggregationFieldName()) )) .collect(Collectors.toList()); } /** * Collects all the time columns and dimensions to be grouped on. * * @param builder The RelBuilder created with Calcite. * @param druidQuery The query to find grouping columns from. * @param apiToFieldMapper The mapping from api to physical name. * @param timestampColumn The name of the timestamp column in the database. * * @return all columns which should be grouped on. */ protected List<RexNode> getAllGroupByColumns( RelBuilder builder, DruidAggregationQuery<?> druidQuery, ApiToFieldMapper apiToFieldMapper, String timestampColumn ) { List<RexNode> timeFilters = sqlTimeConverter.buildGroupBy( builder, druidQuery.getGranularity(), timestampColumn ); List<RexNode> dimensionFields = getDimensionFields(builder, druidQuery, apiToFieldMapper); List<RexNode> allGroupBys = new ArrayList<>(timeFilters.size() + dimensionFields.size()); allGroupBys.addAll(timeFilters); allGroupBys.addAll(dimensionFields); return allGroupBys; } /** * Converts a RelBuilder into a sql string. * * @param sqlWriter The writer to be used when translating the {@link org.apache.calcite.rel.RelNode} to sql. * @param relToSql The converter from {@link org.apache.calcite.rel.RelNode} to * {@link org.apache.calcite.sql.SqlNode}. * @param query The RelNode representing the query. * * @return the sql string built by the RelBuilder. */ protected String writeSql(SqlPrettyWriter sqlWriter, RelToSqlConverter relToSql, RelNode query) { sqlWriter.reset(); SqlSelect select = relToSql.visitChild(0, query).asSelect(); return sqlWriter.format(select); } public SqlTimeConverter getTimeConverter() { return sqlTimeConverter; } }
96e31805507f5e82fbffa24a4d7856dad7b670f8
54aa071e6a997cc1cc4455721d0ff55d0ef8c7ae
/src/org/jeecgframework/core/util/ReflectHelper.java
cb57889722f2ec8cfb46ead8280529db6ba0dc7e
[]
no_license
cizhijingli/rcgl_v0.1
10f181021682e0d2232080c50f8268fd48a5c1de
94262143ce19a0b4e417266c4d1dcb01e1adeaaa
refs/heads/master
2021-05-16T09:22:31.935866
2017-10-06T03:13:06
2017-10-06T03:13:06
104,415,389
0
0
null
null
null
null
UTF-8
Java
false
false
2,619
java
package org.jeecgframework.core.util; import java.lang.reflect.Method; import java.util.Hashtable; import java.util.regex.Pattern; /** * * @desc 通过反射来动态调用get 和 set 方法 */ public class ReflectHelper { private Class cls; /** * 传过来的对象 */ private Object obj; /** * 存放get方法 */ private Hashtable<String, Method> getMethods = null; /** * 存放set方法 */ private Hashtable<String, Method> setMethods = null; /** * 定义构造方法 -- 一般来说是个pojo * * @param o * 目标对象 */ public ReflectHelper(Object o) { obj = o; initMethods(); } /** * * @desc 初始化 */ public void initMethods() { getMethods = new Hashtable<String, Method>(); setMethods = new Hashtable<String, Method>(); cls = obj.getClass(); Method[] methods = cls.getMethods(); // 定义正则表达式,从方法中过滤出getter / setter 函数. String gs = "get(\\w+)"; Pattern getM = Pattern.compile(gs); String ss = "set(\\w+)"; Pattern setM = Pattern.compile(ss); // 把方法中的"set" 或者 "get" 去掉 String rapl = "$1"; String param; for (int i = 0; i < methods.length; ++i) { Method m = methods[i]; String methodName = m.getName(); if (Pattern.matches(gs, methodName)) { param = getM.matcher(methodName).replaceAll(rapl).toLowerCase(); getMethods.put(param, m); } else if (Pattern.matches(ss, methodName)) { param = setM.matcher(methodName).replaceAll(rapl).toLowerCase(); setMethods.put(param, m); } else { // System.out.println(methodName + " 不是getter,setter方法!"); } } } /** * * @desc 调用set方法 */ public boolean setMethodValue(String property,Object object) { Method m = setMethods.get(property.toLowerCase()); if (m != null) { try { // 调用目标类的setter函数 m.invoke(obj, object); return true; } catch (Exception ex) { System.out.println("invoke getter on " + property + " error: " + ex.toString()); return false; } } return false; } /** * * @desc 调用set方法 */ public Object getMethodValue(String property) { Object value=null; Method m = getMethods.get(property.toLowerCase()); if (m != null) { try { /** * 调用obj类的setter函数 */ value=m.invoke(obj, new Object[] {}); } catch (Exception ex) { System.out.println("invoke getter on " + property + " error: " + ex.toString()); } } return value; } }
7f9b8b25351c41f9365004b8ff42ff2d8be24e56
494113e43de17ec9157cc9c3735078b282a341b6
/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/HyPerformanceServiceImpl.java
cc1be2045cb93edb4aa96c1c2a7e9b225e01dc93
[ "MIT" ]
permissive
zx1993312/ry
5a0ab212d6b55307b74eeb8afe382c0ab619bc14
a28ca9a5383fa576d372aeffe1863b8445751dfe
refs/heads/master
2023-06-26T14:40:06.796881
2021-07-27T01:40:31
2021-07-27T01:40:31
326,559,351
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.ruoyi.system.service.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.HyPatrolScheme; import com.ruoyi.system.mapper.HyPerformanceMapper; import com.ruoyi.system.service.IHyPerformanceService; @Service public class HyPerformanceServiceImpl implements IHyPerformanceService{ @Autowired HyPerformanceMapper hyPerformanceMapper; @Override public HyPatrolScheme selectHyPatrolSchemeById(Long id) { return hyPerformanceMapper.selectHyPatrolSchemeById(id); } @Override public List<HyPatrolScheme> selectHyPatrolSchemeList(HyPatrolScheme hyPatrolScheme) { return hyPerformanceMapper.selectHyPatrolSchemeList(hyPatrolScheme); } }
[ "Administrator@hy001" ]
Administrator@hy001
527147902589417cb79470b45760a64f5461d664
b3144a4716c3a228f14bc962be43ea2281912481
/src/spring_aop_2/test/Test1.java
459be2314d8fab7a0c1ef295b9b91fbd13876e54
[]
no_license
LittleDipper/reviewJava
07e867317c1ce0caddb7dd1078628a9009758399
22ce39c69238e4b855c0ba3038b51aa6737bcfee
refs/heads/master
2021-03-18T00:57:40.517345
2020-03-13T09:27:04
2020-03-13T09:27:04
247,012,220
0
0
null
null
null
null
UTF-8
Java
false
false
609
java
package spring_aop_2.test; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import spring_aop_2.controller.UserController; public class Test1 { @Test public void fun1(){ //1,得到容器对象 ApplicationContext ac = new ClassPathXmlApplicationContext("spring_aop_2/applicationContext.xml"); //2,从容器中哪所需对象 UserController userController = (UserController) ac.getBean("userController"); //3.测试 System.out.println(userController); userController.fun1(); } }
cece7f92bf108422a68f925a2dd13e5088e01dfb
d6605787eafb7bbc38baa1425b3f870b996bfa6d
/bricks/bricks-enterprise/src/main/java/org/bricks/enterprise/d3/help/Vector3Helper.java
c25c22a50f5c54e428463a011d0146010071428f
[]
no_license
odmyhal/Bricks
dca96f79e3c8b12c3cca059da643637b93e0425b
46f735a68b4b3544c5b161fcbfd72dcbf3e72d4f
refs/heads/master
2021-01-10T05:48:05.113789
2018-01-13T12:48:36
2018-01-13T12:48:36
46,608,261
0
0
null
null
null
null
UTF-8
Java
false
false
1,645
java
package org.bricks.enterprise.d3.help; import com.badlogic.gdx.math.Vector3; public class Vector3Helper { private Vector3 normalTmp1 = new Vector3(); private Vector3 normalTmp2 = new Vector3(); private Vector3Helper(){} private static final ThreadLocal<Vector3Helper> localHelper = new ThreadLocal<Vector3Helper>() { @Override protected Vector3Helper initialValue() { return new Vector3Helper(); } }; public static Vector3Helper instance(){ return localHelper.get(); } public Vector3 vectorSquareEquation(Vector3 a, Vector3 b, Vector3 c){ float baz = -1 * a.z / b.z; b.scl(baz).add(a); float caz = -1 * a.z / c.z; c.scl(caz).add(a); float cby = -1 * b.y / c.y; c.scl(cby).add(b); float X = c.x; float Y = -1 * X * b.x / b.y; float Z = -1 * (X * a.x + Y * a.y) / a.z; return new Vector3(X, Y, Z); } public Vector3 calcNormal(Vector3 zero, Vector3 one, Vector3 two){ normalTmp1.set(one.x - zero.x, one.y - zero.y, one.z - zero.z); normalTmp2.set(two.x - zero.x, two.y - zero.y, two.z - zero.z); Vector3 res = new Vector3(); return calcVectorNormal(normalTmp1, normalTmp2, res); /* res.x = normalTmp2.y * normalTmp1.z - normalTmp2.z * normalTmp1.y; res.y = normalTmp2.z * normalTmp1.x - normalTmp2.x * normalTmp1.z; res.z = normalTmp2.x * normalTmp1.y - normalTmp2.y * normalTmp1.x; return res.nor();*/ } public Vector3 calcVectorNormal(Vector3 one, Vector3 two, Vector3 result){ result.x = two.y * one.z - two.z * one.y; result.y = two.z * one.x - two.x * one.z; result.z = two.x * one.y - two.y * one.x; return result.nor(); } }
[ "oleh@Oleh-PC" ]
oleh@Oleh-PC
9e52014aad3267e1cff37daee802f592e2cbfe41
fe76a696af5dbf99275e83544125029100f35d78
/Chapter2/src/ch14T/Bus.java
bfffb9098ab5348fd1cf4c5016053da1bfce214a
[]
no_license
Si-Hyeak-KANG/JAVA_STUDY
283ec17229e55c8c8705e0549c7cf0a49e7e59ae
4e9ec91ec442a4f953eec51303d5d925ebf8e321
refs/heads/master
2023-03-28T00:10:28.638212
2021-03-28T10:00:37
2021-03-28T10:00:37
null
0
0
null
null
null
null
UHC
Java
false
false
391
java
package ch14T; public class Bus { int busNumber; int passengerCount; int money; public Bus(int busNumber) { this.busNumber = busNumber; } public void take(int money) { this.money += money; passengerCount++; } public void showBusInfo() { System.out.println(busNumber + "번의 승객 수는" + passengerCount + "명 이고, 수입은" + money + "입니다."); } }
6f5de7ee51ff36a23a86cc0a95fa97eb037ddeb1
fa1bdfeef6a1c83f6f1d4cefcb91b7dc2d7a74b1
/uboot-module-system/src/main/java/org/uboot/modules/system/model/SysDepartTreeWithManagerModel.java
50fedbbc3df4b6ad7fee9f903da6af06394d078f
[ "Apache-2.0" ]
permissive
lyflyy/uboot
f577c8ec74c972952196a11df127322ee450a8a4
4a8b83645937a2296bd4a611d2c623717875e4fe
refs/heads/jeecg
2022-06-23T19:57:14.238365
2020-06-20T17:03:51
2020-06-20T17:03:51
233,898,891
0
3
Apache-2.0
2022-06-21T02:38:42
2020-01-14T17:38:04
Java
UTF-8
Java
false
false
685
java
package org.uboot.modules.system.model; import lombok.Data; import org.uboot.modules.system.entity.SysDepart; import org.uboot.modules.system.entity.SysUser; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; /** * <p> * 部门表 存储树结构数据的实体类 * 继承自SysDepartTreeModel * 包含管理员信息字段 * <p> * * @Author Steve * @Since 2019-01-22 */ @Data public class SysDepartTreeWithManagerModel extends SysDepartModel implements Serializable{ private static final long serialVersionUID = 1L; private List<SysUser> userList; private Integer userCount; }
ccbeccf12019f035936bf2e3e0d367138913583d
bf3b25e98829377f95c0c072e95b51969d3652d2
/java_project/src/java_project/UserUpdate.java
b8347d520d77ab8ade19a1161214cb1ad45aeb04
[]
no_license
AhnBy/tjoeun202108
d44c40944d2e3f2b20296653bcd2e82b5cbd7a7d
7c5841879e5728886d6842beb9435792dba81e2f
refs/heads/master
2023-08-07T12:32:33.960301
2021-10-07T09:44:11
2021-10-07T09:44:11
413,296,272
0
0
null
null
null
null
UTF-8
Java
false
false
2,148
java
package java_project; import java.sql.SQLException; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class UserUpdate { public static void main(String[] args) { Scanner scan = new Scanner(System.in); UserDto user = new UserDto(); UserDao dao = UserDaoImpl.GetInstance(); System.out.println("어떤 회원의 정보를 수정하시겠습니까? 회원번호를 입력해주세요"); String userid = scan.nextLine(); int id = Integer.parseInt(userid); try { user = dao.idSelect(id); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } catch (SQLException e1) { e1.printStackTrace(); } System.out.println("어떤 정보를 수정할 지 (,)로 구분지어 수정하세요"); System.out.println("정보 : name, address, phoneNumber, birth, rental_date, return_date"); String column = scan.nextLine(); String[] col = column.split(","); for(int i = 0; i < col.length; i++) { col[i] = col[i].trim(); } List<String> columnList = new ArrayList<String>(); for (String columns : col) { System.out.println("변경할 "+columns+"을 입력하세요"); columnList.add(scan.nextLine()); } for(int i=0; i<col.length; i++) { switch (col[i]) { case "name": user.setName(columnList.get(i)); break; case "address": user.setAddress(columnList.get(i)); break; case "phoneNumber": user.setPhoneNumber(columnList.get(i)); break; case "birth": user.setBirth(LocalDate.parse(columnList.get(i))); break; case "rental_date": user.setRental_date(LocalDateTime.parse(columnList.get(i))); break; case "return_date": user.setReturn_date(LocalDateTime.parse(columnList.get(i))); break; } } try { int update = dao.userUpdate(user); if(update > 0 ) { System.out.println("수정 완료"); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } }
[ "User@DESKTOP-ADSS3S6" ]
User@DESKTOP-ADSS3S6
9d542245f9d1ced0db1023f0db0ee3d99b7ccb30
f02141e533f5e0f8d9c172df54e1804c8cc95bde
/Project_188/src/mq/corejava/method_with_parameter/Firefox_browser.java
f1f81f4e67723d03a2ce0b461025a23d391791c4
[]
no_license
PRAN9M/01_9AM_2021_April
8faa5446b63c14f58aec0343cc2021d7d36a74e4
e14ad3cfb18d1ac04dc8915cd1ba657449588dbc
refs/heads/master
2023-04-13T21:54:56.822071
2021-04-23T05:14:18
2021-04-23T05:14:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
743
java
package mq.corejava.method_with_parameter; public class Firefox_browser { //Method with fuctional parameter void siteopen(String url) { System.out.println(url); } void type_userDetails(String username,String password) { System.out.println(username); System.out.println(password); } public static void main(String[] args) { Firefox_browser obj=new Firefox_browser(); //callling method with actual parameter obj.siteopen("http://facebook.com/v1.0"); obj.siteopen("http://facebook.com/v2.0"); obj.siteopen("http://google.com"); //Calling method with multiple parameters obj.type_userDetails("sunil", "S1234"); obj.type_userDetails("Harish", "H2asd234"); } }
[ "MINDQ@MINDQ_001" ]
MINDQ@MINDQ_001
8cdbfab999ef5163821e908e44c09be32a42b114
2e6426f9591e19e92108d08af59afa65a139389b
/sporsimdi/src/com/sporsimdi/model/converter/PrimeFacesOrderListConverter.java
2181174ef5c0b94c3c234f1616c6ab92e233b697
[]
no_license
csekem/sporsimdi
ca43667bb6e6b3bddb4b14077b2d255726b62a05
99b79ded41b12c1bf7f1e11b37b2e0bed687fedd
refs/heads/master
2018-12-28T22:40:06.158387
2013-10-30T19:08:48
2013-10-30T19:08:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,943
java
package com.sporsimdi.model.converter; import java.io.Serializable; import java.util.List; import javax.ejb.EJB; import javax.faces.bean.SessionScoped; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.FacesConverter; import org.primefaces.component.orderlist.OrderList; import com.sporsimdi.action.facade.GenelFacade; import com.sporsimdi.model.base.ExtendedModel; @FacesConverter(value = "primeFacesOrderListConverter") @SessionScoped public class PrimeFacesOrderListConverter implements Converter, Serializable { private static final long serialVersionUID = 1L; @EJB private GenelFacade genelFacade; @Override public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { ExtendedModel entity = null; if (value == null) { entity = null; } else if (value != null && value.toString().equals("0")) { entity = null; } else { Long id = new Long(value); @SuppressWarnings("unchecked") List<ExtendedModel> list = ((List<ExtendedModel>) ((OrderList) component).getValue()); for (ExtendedModel model : list) { if (model.getId().longValue() == id.longValue()) { entity = model; break; } } } return entity; } @Override public String getAsString(FacesContext facesContext, UIComponent component, Object value) { if (!value.toString().equals("0") && value != null && !(value instanceof ExtendedModel)) { throw new IllegalArgumentException("This converter only handles instances of ExtendedModel"); } if (value == null) { return ""; } if (value.toString().equals("0")) { return ""; } if (value instanceof String) { return (String) value; } ExtendedModel entity = (ExtendedModel) value; return entity.getId() == null ? "" : entity.getId().toString(); } }
83c1398d6032bcd34a4688e3f161ed969b920db3
75176131d6a463926160709fec2d34f3ad9cef58
/project_n3w2b/src/main/persistence/Writable.java
1d2954a14c47f0b8565c14bd82108250f470e541
[]
no_license
Saadman120/Pokedex
9e4263f7620bb5a5cb7863669a0e9b20124c4257
d71288175f1a608fd43fa4d308f2978c7e2ee1e5
refs/heads/main
2023-08-18T02:47:35.576274
2021-09-30T18:19:00
2021-09-30T18:19:00
399,198,621
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
package persistence; import org.json.JSONObject; public interface Writable { JSONObject toJson(); }
13c017c1595b7dcf01e9cc65d06305bba64b71ef
620ade4df1cd67e2990c42bcbccab73c6dc76816
/Assignment2/src/main/java/edu/neu/ccs/cs5010/Analyser.java
593a6d249e5ff62ee96ce329cda179d70bfd53f0
[]
no_license
peishanwang/pdp-Individual
61dcab2be6536190b84b067fed96e1f27af8b7ad
c04c54a61163d4e89f04e63baec57e046de3fac9
refs/heads/master
2020-03-18T07:46:32.462258
2017-10-31T07:39:23
2017-10-31T07:39:23
134,472,179
1
0
null
null
null
null
UTF-8
Java
false
false
2,086
java
package edu.neu.ccs.cs5010; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; public class Analyser implements IAnalyser{ private static final int HIGH_URGENCY = 4; private static final int LOW_URGENCY = 9; /** * {@inheritDoc} */ @Override public double countHighestUrgencyWaitingTime(List<Patient> patients) { int size = patients.size(); if (size == 0) return 0.00; List<Patient> hList = new ArrayList<>(); for (int i = 0; i < size; i++) { if (patients.get(i).getUrgency().getValue() > HIGH_URGENCY) { continue; } hList.add(patients.get(i)); } return countAverageWaitingTime(hList); } /** * {@inheritDoc} */ @Override public double countLowestUrgencyWaitingTime(List<Patient> patients) { int size = patients.size(); if (size == 0) return 0.00; List<Patient> lList = new ArrayList<>(); for (int i = 0; i < size; i++) { if (patients.get(i).getUrgency().getValue() < LOW_URGENCY) { continue; } lList.add(patients.get(i)); } return countAverageWaitingTime(lList); } /** * {@inheritDoc} */ @Override public double countAverageWaitingTime(List<Patient> patients) { long sum = 0; int size = patients.size(); if (size == 0) return 0.00; for (int i = 0; i < size; i++) { Patient patient = patients.get(i); sum += ChronoUnit.MILLIS.between(patient.getArrivalTime(), patient.getTreatmentStart()); } return (double) (sum / size) / 1000.00; } /** * {@inheritDoc} */ @Override public double countAverageDuration(List<Patient> patients) { long sum = 0; int size = patients.size(); for (int i = 0; i < size; i++) { Patient patient = patients.get(i); sum += patient.getTreatmentMinutes(); } return sum * 1.0 / size; } /** * {@inheritDoc} */ @Override public double countMinutesBetween(LocalDateTime t1, LocalDateTime t2) { return ChronoUnit.MILLIS.between(t1, t2) / 1000.0; } }
6a837616bdd706cf5994430c0b785e8d5d2efcf4
bbe19967c1deb9896f083552204c79362849a4d2
/sappe/src/java/br/ufc/si/pet/sappe/comandos/sup/CmdSupervisorVisualizarResultadoSimulado.java
fecc3620af85141925a165a6f49e1d29ead4dec6
[]
no_license
gleysongomes/sappe-pet
5a0d5675a3335d701d3338380135c0e8c8ab3eba
8710cf063508a8990f420bce72d0515fc3e83f24
refs/heads/master
2020-06-09T17:48:31.960177
2015-08-26T11:38:28
2015-08-26T11:38:28
41,064,229
3
0
null
null
null
null
UTF-8
Java
false
false
2,073
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.ufc.si.pet.sappe.comandos.sup; import br.ufc.si.pet.sappe.entidades.Simulado; import br.ufc.si.pet.sappe.entidades.Usuario; import br.ufc.si.pet.sappe.entidades.ResultadoUsuarioSimulado; import br.ufc.si.pet.sappe.interfaces.Comando; import br.ufc.si.pet.sappe.service.SimuladoService; import br.ufc.si.pet.sappe.service.UsuarioService; import br.ufc.si.pet.sappe.service.ResultadoUsuarioSimuladoService; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.fileupload.FileUploadException; /** * * @author gleyson */ public class CmdSupervisorVisualizarResultadoSimulado implements Comando { public String executa(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ClassNotFoundException, SQLException, FileUploadException, Exception { HttpSession session = request.getSession(true); Long id = Long.parseLong(request.getParameter("id")); ResultadoUsuarioSimuladoService uss = new ResultadoUsuarioSimuladoService(); List<ResultadoUsuarioSimulado> usuarioSimulados = uss.getResultadosUsuariosSimuladosBySimuladoId(id); UsuarioService us = new UsuarioService(); List<Usuario> usuarios = new ArrayList<Usuario>(); for (ResultadoUsuarioSimulado usuarioSimulado : usuarioSimulados) { Usuario u = us.getUsuarioById(usuarioSimulado.getUsuario_id()); usuarios.add(u); } SimuladoService simuladoService = new SimuladoService(); Simulado simulado = simuladoService.getSimuladoById(id); session.setAttribute("sup_simulado2", simulado); session.setAttribute("usuarios", usuarios); return "/sup/visualizar_resultado_simulado.jsp"; } }
c5f8664f9830d22e54bf6936bd11f468b72c3e71
09bb0466d4ea3d96c278c697315923d36f9adacd
/app/src/main/java/ph/edu/ust/comparenumbers/MainActivity.java
dd989ecc323744d75fe77269ab53c9efe6a24584
[]
no_license
flaeteh/CompareNumbers
07ca202d64339a592b6a6c96e5d3d9da1b829f51
af310ac3fdca0705e4247ac92ab8ea005ea2f6e9
refs/heads/master
2020-03-27T07:27:45.987150
2018-08-26T15:27:12
2018-08-26T15:27:12
146,192,495
0
0
null
null
null
null
UTF-8
Java
false
false
1,223
java
package ph.edu.ust.comparenumbers; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button enter = findViewById(R.id.submitButton); enter.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { EditText num1 = findViewById(R.id.editNum1); EditText num2 = findViewById(R.id.editNum2); TextView result = findViewById(R.id.resultView); int num11 = Integer.parseInt(num1.getText().toString()); int num22 = Integer.parseInt(num2.getText().toString()); if (num11 > num22) { result.setText(Integer.toString(num11)); } else { result.setText(Integer.toString(num22)); } } }); } }
75350c052bb0bc3ec3b9b962bbd7b8c4529260be
ccc733f782f26f1320031bd480217dbfb0e2bd18
/SpringHibernateAnnotation/src/com/motivity/Student.java
a1dc8816477f935ef17727ebbd1a562b006398f7
[]
no_license
VishalKumar-B/training1
0439b71b414b9ec55e37786502f6fb2a05a0134a
dba6df6a29cc897aede6a58791211c76d2ebe949
refs/heads/main
2023-03-27T02:43:17.168328
2021-03-30T13:02:50
2021-03-30T13:02:50
308,148,490
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package com.motivity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "SpringAnnotation") public class Student { @Id @Column(name = "id") private int id; @Column(name = "name") private String name; @Column(name = "marks") private int marks; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getMarks() { return marks; } public void setMarks(int marks) { this.marks = marks; } }
5bad2f3f46f50c6d943975338264cd05f214f56e
dc65fb703b8de26ab80891b0fb9f4023204442e2
/base/server/src/main/java/se/lth/base/server/database/MapMapper.java
0632b6d504035f29d826ea7edfe18d0f77e134c3
[]
no_license
fredrikbjaras/CarShare
a22500b77b6279b09125c72179d9cef4d73b266e
30c2368d66e6db0a6ee1240a48ad5909f112e90c
refs/heads/master
2020-03-29T17:19:28.232488
2018-10-11T15:06:49
2018-10-11T15:06:49
150,155,604
1
2
null
2018-10-11T15:06:50
2018-09-24T19:15:51
HTML
UTF-8
Java
false
false
782
java
package se.lth.base.server.database; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.LinkedHashMap; import java.util.Map; /** * This is a convenience class which is useful for debugging SQL queries without having to write a fixed Mapper. */ public class MapMapper implements Mapper<Map<String, Object>> { @Override public Map<String, Object> map(ResultSet resultSet) throws SQLException { ResultSetMetaData metaData = resultSet.getMetaData(); int c = metaData.getColumnCount(); Map<String, Object> map = new LinkedHashMap<>(); for (int i = 0; i < c; i++) { map.put(metaData.getColumnLabel(i + 1), resultSet.getObject(i + 1)); } return map; } }
5e08195486036c0f3f2e5df4fb555489e19b6e6e
ff1c5b1f6ef32c9bce256a717dbab3939bd6c0fa
/back/pricelist/src/main/java/com/example/pricelist/model/VehicleDiscount.java
d771e0afecca61759793c4a0f4c8ea2f694409ef
[]
no_license
lukicMilan/main-app-rent-a-car
f1bf15e78c50f6cc2980d01bc84d9056890800e3
3592be522f8a1f50311420d3c351468d478924a3
refs/heads/master
2022-11-24T05:36:41.414410
2020-07-12T07:15:18
2020-07-12T07:15:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,166
java
package com.example.pricelist.model; import javax.persistence.*; @Entity public class VehicleDiscount { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name="num_days", nullable = false) private int numDays; @Column(name="discount", nullable = false) private int discount; public VehicleDiscount(Long id, int numDays, int discount) { this.id = id; this.numDays = numDays; this.discount = discount; } public VehicleDiscount() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int getNumDays() { return numDays; } public void setNumDays(int numDays) { this.numDays = numDays; } public int getDiscount() { return discount; } public void setDiscount(int discount) { this.discount = discount; } @Override public String toString() { return "VehicleDiscount{" + "id=" + id + ", numDays=" + numDays + ", discount=" + discount + '}'; } }
f42f08448ec37184b6ceda748c852fd26a413ba6
5641c1dc1e3b19e4656eeb6a644184bb1ae92f6c
/sms-core/src/main/java/com/aizuddindeyn/sms/exception/GenericSmsException.java
90b8baece07ecd67018972efdfb9b38b7c10a876
[ "MIT" ]
permissive
AbhishekEM/sms-service
acd3f30afc61ff5dca1fb0af74a2393ef3a88474
8c595b1e269150eae3f86ee6fcad97cb1d64277c
refs/heads/master
2023-03-26T05:19:34.075770
2020-11-11T17:51:06
2020-11-11T17:51:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
472
java
/* * Owned by aizuddindeyn * Visit https://gitlab.com/group-bear/sms-service */ package com.aizuddindeyn.sms.exception; import com.aizuddindeyn.sms.enums.StatusCodeEnum; /** * @author aizuddindeyn * @date 11/7/2020 */ public class GenericSmsException extends Exception { public GenericSmsException(String message, Throwable t) { super(message, t); } public StatusCodeEnum getStatusCode() { return StatusCodeEnum.SYSTEM_ERROR; } }
a5ca69374eaf764083bb5782ec375e2a00848091
eed9f0407c03efb855495ccff0d5217a748b6752
/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialog.java
01c4f803222606e8a8ff0b254681d85c63408f04
[ "MIT", "BSD-3-Clause" ]
permissive
ninamanalo19/react-native-sliding-up-panel
888b7fe02bc72b4058bc3b3fd10ded02669ce60a
6b1e3af309f4c7a74fc352ac5fcc06de356ae96a
refs/heads/master
2021-10-24T08:58:27.084971
2021-10-11T07:37:57
2021-10-11T07:37:57
48,031,937
67
18
MIT
2023-07-25T07:46:05
2015-12-15T09:11:13
null
UTF-8
Java
false
false
12,524
java
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ package com.facebook.react.devsupport; import javax.annotation.Nullable; import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.net.Uri; import android.os.AsyncTask; import android.text.SpannedString; import android.text.method.LinkMovementMethod; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.react.R; import com.facebook.react.common.MapBuilder; import com.facebook.react.common.ReactConstants; import com.facebook.react.devsupport.StackTraceHelper.StackFrame; import com.facebook.react.devsupport.RedBoxHandler.ReportCompletedListener; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import org.json.JSONObject; /** * Dialog for displaying JS errors in an eye-catching form (red box). */ /* package */ class RedBoxDialog extends Dialog implements AdapterView.OnItemClickListener { private final DevSupportManager mDevSupportManager; private final DoubleTapReloadRecognizer mDoubleTapReloadRecognizer; private final @Nullable RedBoxHandler mRedBoxHandler; private ListView mStackView; private Button mReloadJsButton; private Button mDismissButton; private Button mCopyToClipboardButton; private @Nullable Button mReportButton; private @Nullable TextView mReportTextView; private @Nullable ProgressBar mLoadingIndicator; private @Nullable View mLineSeparator; private boolean isReporting = false; private ReportCompletedListener mReportCompletedListener = new ReportCompletedListener() { @Override public void onReportSuccess(final SpannedString spannedString) { isReporting = false; Assertions.assertNotNull(mReportButton).setEnabled(true); Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE); Assertions.assertNotNull(mReportTextView).setText(spannedString); } @Override public void onReportError(final SpannedString spannedString) { isReporting = false; Assertions.assertNotNull(mReportButton).setEnabled(true); Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE); Assertions.assertNotNull(mReportTextView).setText(spannedString); } }; private View.OnClickListener mReportButtonOnClickListener = new View.OnClickListener() { @Override public void onClick(View view) { if (mRedBoxHandler == null || !mRedBoxHandler.isReportEnabled() || isReporting) { return; } isReporting = true; Assertions.assertNotNull(mReportTextView).setText("Reporting..."); Assertions.assertNotNull(mReportTextView).setVisibility(View.VISIBLE); Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.VISIBLE); Assertions.assertNotNull(mLineSeparator).setVisibility(View.VISIBLE); Assertions.assertNotNull(mReportButton).setEnabled(false); String title = Assertions.assertNotNull(mDevSupportManager.getLastErrorTitle()); StackFrame[] stack = Assertions.assertNotNull(mDevSupportManager.getLastErrorStack()); String sourceUrl = mDevSupportManager.getSourceUrl(); mRedBoxHandler.reportRedbox( title, stack, sourceUrl, Assertions.assertNotNull(mReportCompletedListener)); } }; private static class StackAdapter extends BaseAdapter { private static final int VIEW_TYPE_COUNT = 2; private static final int VIEW_TYPE_TITLE = 0; private static final int VIEW_TYPE_STACKFRAME = 1; private final String mTitle; private final StackFrame[] mStack; private static class FrameViewHolder { private final TextView mMethodView; private final TextView mFileView; private FrameViewHolder(View v) { mMethodView = (TextView) v.findViewById(R.id.rn_frame_method); mFileView = (TextView) v.findViewById(R.id.rn_frame_file); } } public StackAdapter(String title, StackFrame[] stack) { mTitle = title; mStack = stack; } @Override public boolean areAllItemsEnabled() { return false; } @Override public boolean isEnabled(int position) { return position > 0; } @Override public int getCount() { return mStack.length + 1; } @Override public Object getItem(int position) { return position == 0 ? mTitle : mStack[position - 1]; } @Override public long getItemId(int position) { return position; } @Override public int getViewTypeCount() { return VIEW_TYPE_COUNT; } @Override public int getItemViewType(int position) { return position == 0 ? VIEW_TYPE_TITLE : VIEW_TYPE_STACKFRAME; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (position == 0) { TextView title = convertView != null ? (TextView) convertView : (TextView) LayoutInflater.from(parent.getContext()) .inflate(R.layout.redbox_item_title, parent, false); title.setText(mTitle); return title; } else { if (convertView == null) { convertView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.redbox_item_frame, parent, false); convertView.setTag(new FrameViewHolder(convertView)); } StackFrame frame = mStack[position - 1]; FrameViewHolder holder = (FrameViewHolder) convertView.getTag(); holder.mMethodView.setText(frame.getMethod()); holder.mFileView.setText(StackTraceHelper.formatFrameSource(frame)); return convertView; } } } private static class OpenStackFrameTask extends AsyncTask<StackFrame, Void, Void> { private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); private final DevSupportManager mDevSupportManager; private OpenStackFrameTask(DevSupportManager devSupportManager) { mDevSupportManager = devSupportManager; } @Override protected Void doInBackground(StackFrame... stackFrames) { try { String openStackFrameUrl = Uri.parse(mDevSupportManager.getSourceUrl()).buildUpon() .path("/open-stack-frame") .query(null) .build() .toString(); OkHttpClient client = new OkHttpClient(); for (StackFrame frame: stackFrames) { String payload = stackFrameToJson(frame).toString(); RequestBody body = RequestBody.create(JSON, payload); Request request = new Request.Builder().url(openStackFrameUrl).post(body).build(); client.newCall(request).execute(); } } catch (Exception e) { FLog.e(ReactConstants.TAG, "Could not open stack frame", e); } return null; } private static JSONObject stackFrameToJson(StackFrame frame) { return new JSONObject( MapBuilder.of( "file", frame.getFile(), "methodName", frame.getMethod(), "lineNumber", frame.getLine(), "column", frame.getColumn() )); } } private static class CopyToHostClipBoardTask extends AsyncTask<String, Void, Void> { private final DevSupportManager mDevSupportManager; private CopyToHostClipBoardTask(DevSupportManager devSupportManager) { mDevSupportManager = devSupportManager; } @Override protected Void doInBackground(String... clipBoardString) { try { String sendClipBoardUrl = Uri.parse(mDevSupportManager.getSourceUrl()).buildUpon() .path("/copy-to-clipboard") .query(null) .build() .toString(); for (String string: clipBoardString) { OkHttpClient client = new OkHttpClient(); RequestBody body = RequestBody.create(null, string); Request request = new Request.Builder().url(sendClipBoardUrl).post(body).build(); client.newCall(request).execute(); } } catch (Exception e) { FLog.e(ReactConstants.TAG, "Could not copy to the host clipboard", e); } return null; } } protected RedBoxDialog( Context context, DevSupportManager devSupportManager, @Nullable RedBoxHandler redBoxHandler) { super(context, R.style.Theme_Catalyst_RedBox); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.redbox_view); mDevSupportManager = devSupportManager; mDoubleTapReloadRecognizer = new DoubleTapReloadRecognizer(); mRedBoxHandler = redBoxHandler; mStackView = (ListView) findViewById(R.id.rn_redbox_stack); mStackView.setOnItemClickListener(this); mReloadJsButton = (Button) findViewById(R.id.rn_redbox_reload_button); mReloadJsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mDevSupportManager.handleReloadJS(); } }); mDismissButton = (Button) findViewById(R.id.rn_redbox_dismiss_button); mDismissButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); mCopyToClipboardButton = (Button) findViewById(R.id.rn_redbox_copy_button); mCopyToClipboardButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String title = mDevSupportManager.getLastErrorTitle(); StackFrame[] stack = mDevSupportManager.getLastErrorStack(); Assertions.assertNotNull(title); Assertions.assertNotNull(stack); new CopyToHostClipBoardTask(mDevSupportManager).executeOnExecutor( AsyncTask.THREAD_POOL_EXECUTOR, StackTraceHelper.formatStackTrace(title, stack)); } }); if (mRedBoxHandler != null && mRedBoxHandler.isReportEnabled()) { mLoadingIndicator = (ProgressBar) findViewById(R.id.rn_redbox_loading_indicator); mLineSeparator = (View) findViewById(R.id.rn_redbox_line_separator); mReportTextView = (TextView) findViewById(R.id.rn_redbox_report_label); mReportTextView.setMovementMethod(LinkMovementMethod.getInstance()); mReportTextView.setHighlightColor(Color.TRANSPARENT); mReportButton = (Button) findViewById(R.id.rn_redbox_report_button); mReportButton.setOnClickListener(mReportButtonOnClickListener); } } public void setExceptionDetails(String title, StackFrame[] stack) { mStackView.setAdapter(new StackAdapter(title, stack)); } /** * Show the report button, hide the report textview and the loading indicator. */ public void resetReporting(boolean enabled) { if (mRedBoxHandler == null || !mRedBoxHandler.isReportEnabled()) { return; } isReporting = false; Assertions.assertNotNull(mReportTextView).setVisibility(View.GONE); Assertions.assertNotNull(mLoadingIndicator).setVisibility(View.GONE); Assertions.assertNotNull(mLineSeparator).setVisibility(View.GONE); Assertions.assertNotNull(mReportButton).setVisibility( enabled ? View.VISIBLE : View.GONE); Assertions.assertNotNull(mReportButton).setEnabled(true); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { new OpenStackFrameTask(mDevSupportManager).executeOnExecutor( AsyncTask.THREAD_POOL_EXECUTOR, (StackFrame) mStackView.getAdapter().getItem(position)); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU) { mDevSupportManager.showDevOptionsDialog(); return true; } if (mDoubleTapReloadRecognizer.didDoubleTapR(keyCode, getCurrentFocus())) { mDevSupportManager.handleReloadJS(); } return super.onKeyUp(keyCode, event); } }
2c3c1c71b5d89c0e517e04d0ec896db2682f8216
55ff7df8f1b7c4c2b34d2b6d23ec9ae807b14d63
/app/src/main/java/company/android/documentmanager/office/fc/hslf/record/TextRulerAtom.java
b19443ba55e55c3756733cfa959b9cb302fbb255
[]
no_license
venbrinoDev/DocumentManager
42ba1c375f9dcdbbbd3bb41b3bae93593642e196
f80d2489c6c074ecbdc604e1573477c90f1c6c30
refs/heads/master
2023-06-18T11:57:22.454322
2021-07-18T15:57:14
2021-07-18T15:57:14
387,053,739
0
0
null
null
null
null
UTF-8
Java
false
false
6,973
java
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ package company.android.documentmanager.office.fc.hslf.record; import java.io.IOException; import java.io.OutputStream; import company.android.documentmanager.office.fc.util.LittleEndian; /** * Ruler of a text as it differs from the style's ruler settings. * * @author Yegor Kozlov */ public final class TextRulerAtom extends RecordAtom { /** * Record header. */ private byte[] _header; /** * Record data. */ private byte[] _data; //ruler internals private int defaultTabSize; private int numLevels; private int[] tabStops; private int[] bulletOffsets = new int[]{-1, -1, -1, -1, -1}; private int[] textOffsets = new int[]{-1, -1, -1, -1, -1}; /** * Constructs a new empty ruler atom. */ public TextRulerAtom() { _header = new byte[8]; _data = new byte[0]; LittleEndian.putShort(_header, 2, (short)getRecordType()); LittleEndian.putInt(_header, 4, _data.length); } /** * Constructs the ruler atom record from its * source data. * * source the source data as a byte array. * start the start offset into the byte array. * len the length of the slice in the byte array. */ protected TextRulerAtom(byte[] source, int start, int len) { // Get the header. _header = new byte[8]; System.arraycopy(source, start, _header, 0, 8); // Get the record data. _data = new byte[len - 8]; System.arraycopy(source, start + 8, _data, 0, len - 8); try { read(); } catch(Exception e) { //logger.log(POILogger.ERROR, "Failed to parse TextRulerAtom: " + e.getMessage()); e.printStackTrace(); } } /** * Gets the record type. * * @return the record type. */ public long getRecordType() { return RecordTypes.TextRulerAtom.typeID; } /** * Write the contents of the record back, so it can be written * to disk. * * out the output stream to write to. * @throws IOException if an error occurs. */ public void writeOut(OutputStream out) throws IOException { out.write(_header); out.write(_data); } /** * Read the record bytes and initialize the internal variables */ private void read() { int pos = 0; short mask = LittleEndian.getShort(_data); pos += 4; short val; int[] bits = {1, 0, 2, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12}; for (int i = 0; i < bits.length; i++) { if ((mask & 1 << bits[i]) != 0) { switch (bits[i]) { case 0: //defaultTabSize defaultTabSize = LittleEndian.getShort(_data, pos); pos += 2; break; case 1: //numLevels numLevels = LittleEndian.getShort(_data, pos); pos += 2; break; case 2: //tabStops val = LittleEndian.getShort(_data, pos); pos += 2; tabStops = new int[val * 2]; for (int j = 0; j < tabStops.length; j++) { tabStops[j] = LittleEndian.getUShort(_data, pos); pos += 2; } break; case 3: case 4: case 5: case 6: case 7: //bullet.offset val = LittleEndian.getShort(_data, pos); pos += 2; bulletOffsets[bits[i] - 3] = val; break; case 8: case 9: case 10: case 11: case 12: //text.offset val = LittleEndian.getShort(_data, pos); pos += 2; textOffsets[bits[i] - 8] = val; break; } } } } /** * Default distance between tab stops, in master coordinates (576 dpi). */ public int getDefaultTabSize() { return defaultTabSize; } /** * Number of indent levels (maximum 5). */ public int getNumberOfLevels() { return numLevels; } /** * Default distance between tab stops, in master coordinates (576 dpi). */ public int[] getTabStops() { return tabStops; } /** * Paragraph's distance from shape's left margin, in master coordinates (576 dpi). */ public int[] getTextOffsets() { return textOffsets; } /** * First line of paragraph's distance from shape's left margin, in master coordinates (576 dpi). */ public int[] getBulletOffsets() { return bulletOffsets; } public static TextRulerAtom getParagraphInstance() { byte[] data = new byte[]{0x00, 0x00, (byte)0xA6, 0x0F, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, (byte)0xF9, 0x00, 0x41, 0x01, 0x41, 0x01}; TextRulerAtom ruler = new TextRulerAtom(data, 0, data.length); return ruler; } public void setParagraphIndent(short tetxOffset, short bulletOffset) { LittleEndian.putShort(_data, 4, tetxOffset); LittleEndian.putShort(_data, 6, bulletOffset); LittleEndian.putShort(_data, 8, bulletOffset); } /** * */ public void dispose() { _header = null; _data = null; tabStops = null; textOffsets = null; bulletOffsets = null; } }
8241c87c9fc4d3a7240c26bce00b112d9f9c775b
2b0e2a03f616787d0a7a859f545efdb4c9e93e0f
/src/main/java/com/example/demo/utils/HanlpProcess.java
13b9804acdc120dc4628bff1dbd46838ed12d68f
[]
no_license
Beteasy/SpamPro
dfbad5b5ddaaa189ca3bc929d834de02918ff130
72439ed702fac6c4f8155d9352934ca30f7ea226
refs/heads/main
2023-05-19T20:30:36.381705
2021-06-12T05:58:01
2021-06-12T05:58:01
356,446,205
0
0
null
null
null
null
UTF-8
Java
false
false
1,399
java
package com.example.demo.utils; import com.hankcs.hanlp.HanLP; import com.hankcs.hanlp.model.crf.CRFLexicalAnalyzer; import com.hankcs.hanlp.model.crf.CRFSegmenter; import com.hankcs.hanlp.seg.common.Term; import com.hankcs.hanlp.tokenizer.NLPTokenizer; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * @ClassName HanlpProcess * @Description TODO * @Author 21971 * @Date 2021/1/28 10:48 */ public class HanlpProcess { public static ArrayList<ArrayList<String>> cutWords(ArrayList<String> bodyList) { /** * @ClassName cutWords * @Description TODO * @Author 21971 * @param bodyList * @Date 2021/1/28 11:11 * 这种方式是吧每个邮件分词后的结果单独放,最后返回结果相当于是一个二维数组,每一维都是一个ArrayList<String> */ ArrayList<ArrayList<String>> wordsList = new ArrayList<ArrayList<String>>(); for (String body: bodyList){ //NLP分词 List<Term> words = NLPTokenizer.segment(body); ArrayList<String> eachMail = new ArrayList<>(); for (Term term:words){ String w = term.word; eachMail.add(w); } // System.out.println("eachMail"+eachMail); wordsList.add(eachMail); } return wordsList; } }
44ebd111c25559c21b66c3505f550b718d24cf2f
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/LANG-1b-2-5-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage-opt/org/apache/commons/lang3/math/NumberUtils_ESTest_scaffolding.java
10d05ffacacb880ac9131708db74a8b0eb244f4c
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
1,981
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Oct 29 04:11:25 UTC 2021 */ package org.apache.commons.lang3.math; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class NumberUtils_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.lang3.math.NumberUtils"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(NumberUtils_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.lang3.math.NumberUtils", "org.apache.commons.lang3.StringUtils" ); } }
3d5c1aeb7b51344318a790c7dc3cffe345f18934
3b64a5b0f642e3cb035105cdb5d2d61cdbe64880
/src/main/java/com/futao/event/MyContextStartedEvent.java
2c5fc25601dbedb231c61fb17685989be2724d05
[]
no_license
FutaoSmile/spring-source-learn
23419320971b49d51db28eada2bc34bece6316e3
57b7ce240d7a80b15cf40672200e88d5ff5c468d
refs/heads/master
2022-07-07T02:29:36.898348
2020-05-01T16:11:50
2020-05-01T16:11:50
260,372,260
1
0
null
null
null
null
UTF-8
Java
false
false
517
java
package com.futao.event; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextStoppedEvent; import org.springframework.stereotype.Component; /** * @author futao * @date 2020/5/1 */ @Component public class MyContextStartedEvent implements ApplicationListener<ContextStoppedEvent> { @Override public void onApplicationEvent(ContextStoppedEvent event) { System.out.println("...................................ContextStoppedEvent" + event.getTimestamp()); } }
bc7c3880658ba8177b38259949fc081c97b5259b
889b62c3c8434d073f578718ebcf00fabbac3c25
/app/src/main/java/com/tramboo/basit/olachallenge/common/Constants.java
32b31129832e3cb261f8deec1b58ab22ec5fb336
[]
no_license
BasitTramboo/MusicPlayer
4e729595a283a57b5feda09e007f313e93fdda93
d25c5d84f75f32bf49dfe2d6cd0a486d739d7800
refs/heads/master
2021-08-30T22:04:34.391183
2017-12-19T15:37:06
2017-12-19T15:37:06
114,484,118
0
0
null
null
null
null
UTF-8
Java
false
false
199
java
package com.tramboo.basit.olachallenge.common; /** * Created by basit on 12/19/17. */ public class Constants { public static final String BASE_URL_ADDRESS="http://starlord.hackerearth.com/"; }
0f1f31f22d511a7a5d2fbad58853ca05308e8d82
43b86fe6013d38a7c193ea775423ee89fd873d4a
/src/main/java/com/tp/soa/service/package-info.java
e1160454b4ff746a912a3c84bd6b7c5eefc04f39
[]
no_license
khawlaakermi/jhipster_crud
e622bb9817c9c05427aa38e2785bf30efff56af1
514a5b406de99784a1795d016b53de124f527ebd
refs/heads/master
2023-02-04T22:32:45.350772
2020-12-26T10:38:04
2020-12-26T10:38:04
324,551,993
0
0
null
null
null
null
UTF-8
Java
false
false
60
java
/** * Service layer beans. */ package com.tp.soa.service;
d37782c7fc278677ce95e2b31c070490e405b862
ffecdb7b9fcc0a4ba5dc29af4fc5c9bc3f8d5827
/Source/orion.desif/src/br/gov/pbh/desif/esec/config/InvalidConfigurationException.java
520672c09135540a25ad9e9be6b2f07d0ecd44e3
[]
no_license
jhenriquecosta/java-desif
742bc3700b28947fed3af1c9e1d0324b88a6951e
2ebdb0771b37cb88a75e5ff009051a8101b694d9
refs/heads/main
2023-07-01T06:02:03.201337
2021-08-11T01:56:59
2021-08-11T01:56:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
414
java
package br.gov.pbh.desif.esec.config; public class InvalidConfigurationException extends Exception { private static final long serialVersionUID = 1L; private Exception exception; public InvalidConfigurationException() { } public InvalidConfigurationException(Exception e) { exception = e; } public Exception getException() { return exception; } }
aab5d3fd10497d2722f471e8896f78ea59f7b73b
1a9c7c3d97d34d5ea084eb7f3f23ce2bf5bbc59a
/src/qp/operators/SortMergeJoin.java
2b1c8479960ee2b287e400711b366fe97b2f23c3
[]
no_license
kangism/query-processing-engine
99818575d5b45c210284e4674047df511ffd22f7
c3ce24362145ff879b579f07f618f8895a1e5cd4
refs/heads/master
2021-01-25T08:28:50.498947
2010-11-07T11:59:41
2010-11-07T11:59:41
32,125,568
0
0
null
null
null
null
UTF-8
Java
false
false
5,682
java
package qp.operators; import java.util.ArrayList; import java.util.List; import qp.utils.Attribute; import qp.utils.Batch; import qp.utils.OrderByOption; import qp.utils.Tuple; /** * Sort merge join as an additional item of our project. * * @author Yann-Loup */ public class SortMergeJoin extends Join { /** * number of tuples per out batch */ int batchsize; /** * index of the join attribute in left table */ int leftindex; /** * index of the join attribute in right table */ int rightindex; Batch leftbatch = null; Batch rightbatch = null; Batch outbatch = null; Batch outbatchOverflow = null; Tuple leftPointer = null; Tuple rightPointer = null; OrderByOption orderByOption = OrderByOption.ASC; List<Tuple> rightTuplesEqualsForJoin; List<Tuple> leftTuplesEqualsForJoin; public SortMergeJoin(Join jn) { super(jn.getLeft(), jn.getRight(), jn.getCondition(), jn.getOperatorType()); schema = jn.getSchema(); jointype = jn.getJoinType(); numBuff = jn.getNumBuff(); } public boolean open() { int tuplesize = schema.getTupleSize(); batchsize = Batch.getPageSize() / tuplesize; Attribute leftattr = con.getLhs(); Attribute rightattr = (Attribute) con.getRhs(); leftindex = left.getSchema().indexOf(leftattr); rightindex = right.getSchema().indexOf(rightattr); if (!left.open()) return false; if (!right.open()) return false; leftbatch = left.next(); rightbatch = right.next(); rightTuplesEqualsForJoin = new ArrayList<Tuple>(); leftTuplesEqualsForJoin = new ArrayList<Tuple>(); leftPointer = pollOutNextTuple(leftbatch, left); rightPointer = pollOutNextTuple(rightbatch, right); outbatchOverflow = new Batch(batchsize); return true; } public Batch next() { // Join is completed if (joinIsCompleted()) { return null; } // System.out.println("new page"); outbatch = new Batch(batchsize); // add the one of the previous work that would have been overflowed while (!outbatch.isFull() && !outbatchOverflow.isEmpty()) { outbatch.add(outbatchOverflow.elementAt(0)); outbatchOverflow.remove(0); } // We continue the join while (!outbatch.isFull() && !joinIsCompleted()) { int compare = compareTuplesForJoin(leftPointer, rightPointer); if (compare == 0) { leftTuplesEqualsForJoin.add(leftPointer); rightTuplesEqualsForJoin.add(rightPointer); // get all the tuple from the right that are equal rightPointer = pollOutNextRightTuple(); while (rightPointer != null && compareTuplesForJoin(leftTuplesEqualsForJoin.get(0), rightPointer) == 0) { rightTuplesEqualsForJoin.add(rightPointer); rightPointer = pollOutNextRightTuple(); } // get all the tuple from the left that are equal leftPointer = pollOutNextLeftTuple(); while (leftPointer != null && compareTuplesForJoin(leftPointer, rightTuplesEqualsForJoin.get(0)) == 0) { leftTuplesEqualsForJoin.add(leftPointer); leftPointer = pollOutNextLeftTuple(); } // make all association // System.out.println("addSize: " + leftTuplesEqualsForJoin.size() + " x " + // rightTuplesEqualsForJoin.size()); for (Tuple leftTuple : leftTuplesEqualsForJoin) { for (Tuple rightTuple : rightTuplesEqualsForJoin) { if (!outbatch.isFull()) { // System.out.println("add: " + leftTuple.dataAt(leftindex) + "=" + // rightTuple.dataAt(rightindex)); outbatch.add(leftTuple.joinWith(rightTuple)); } else { // System.out.println("addT: " + leftTuple.dataAt(leftindex) + "=" + // rightTuple.dataAt(rightindex)); outbatchOverflow.add(leftTuple.joinWith(rightTuple)); } } } rightTuplesEqualsForJoin = new ArrayList<Tuple>(); leftTuplesEqualsForJoin = new ArrayList<Tuple>(); } else if (compare < 0) { leftPointer = pollOutNextLeftTuple(); } else if (compare > 0) { rightPointer = pollOutNextRightTuple(); } } return outbatch; } public boolean close() { if (left.close() && right.close()) { return true; } else return false; } /** * To know when we should stop the operator. * * @return */ private boolean joinIsCompleted() { return leftbatch == null || rightbatch == null; } /** * To know from which table the next tuple should be taken. * * @throws Exception */ private int compareTuplesForJoin(Tuple leftTuple, Tuple rightTuple) throws RuntimeException { // System.out.println(leftTuple.dataAt(leftindex) + "?=" + rightTuple.dataAt(rightindex)); int compareTuples = Tuple.compareTuples(leftTuple, rightTuple, leftindex, rightindex); switch (orderByOption) { case ASC: return compareTuples; case DESC: return -compareTuples; default: throw new RuntimeException("No orderByOption"); } } private Tuple pollOutNextTuple(Batch batch, Operator node) { if (batch != null) { Tuple tuple = batch.getTuples().get(0); batch.getTuples().remove(0); return tuple; } else { return null; } } private Tuple pollOutNextLeftTuple() { if (leftbatch.isEmpty()) { // System.out.println("new left presort"); leftbatch = left.next(); } return pollOutNextTuple(leftbatch, left); } private Tuple pollOutNextRightTuple() { if (rightbatch.isEmpty()) { // System.out.println("new right presort"); rightbatch = right.next(); } return pollOutNextTuple(rightbatch, right); } /** * @param orderByOption * the orderByOption to set */ public void setOrderByOption(OrderByOption orderByOption) { this.orderByOption = orderByOption; } }
[ "[email protected]@97d403de-bac6-683a-bfd6-53bccf9f65de" ]
[email protected]@97d403de-bac6-683a-bfd6-53bccf9f65de
3e0956e10cb96df0dd943dea8616fd3b3e5e4d80
3a286d49437f7b7a9eb81518614c8e40bbbe9143
/JUnit/src/JUnitUse.java
570681941ecd2c4b592cdf4e9dd5202f432dfacd
[]
no_license
ipipip1735/JavaBasics
ed622a770c3a6540b8f53f49084fb57ff44618a7
107f3e77fcc05a52983c47adb82919fa157bcc76
refs/heads/master
2022-12-10T10:23:13.686026
2022-12-01T22:40:39
2022-12-01T22:40:39
96,012,671
1
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
import org.junit.Test; /** * Created by Administrator on 2017/5/21. */ public class JUnitUse { public static void main (String[] args) { JUnitUse jUnitUse = new JUnitUse(); // jUnitUse.myNum(1, 2, 3); jUnitUse.a(); // ScopeTest st = new ScopeTest(); // System.out.println(st.i); } public void showArray(String[] arr) { // for (int i = 0; i < 4; i++) { // System.out.println(arr[i]); // } } @Test public void assignArray() { System.out.println("dd"); // showArray({"a", "b"}); } @Test public void myNum(int... ints) { System.out.println("dd"); System.out.println(ints.length); System.out.println(ints[0]); System.out.println(ints[1]); System.out.println(ints[2]); } public boolean a() { return b() || c(); } public boolean b() { System.out.println("b"); return false; } public boolean c() { System.out.println("c"); return false; } }
7b4e35f2ad8c019f224f5c4104f1b7943fd23b66
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/coolapk/market/view/backupList/BackupCreateDialog.java
7935ca7ed7964e9168ef624c34b39e64444440c0
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
11,059
java
package com.coolapk.market.view.backupList; import android.app.Dialog; import android.content.DialogInterface; import android.os.Build; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.widget.EditText; import androidx.appcompat.app.AlertDialog; import androidx.databinding.DataBindingUtil; import androidx.databinding.ViewDataBinding; import androidx.fragment.app.DialogFragment; import com.coolapk.market.AppHolder; import com.coolapk.market.databinding.DialogBackupCreateBinding; import com.coolapk.market.manager.DataManager; import com.coolapk.market.model.DeviceInfo; import com.coolapk.market.util.DateUtils; import com.coolapk.market.util.RxUtils; import com.coolapk.market.util.TintHelper; import com.coolapk.market.util.ViewUtil; import kotlin.Metadata; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import rx.Subscription; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000N\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 \u001a2\u00020\u0001:\u0001\u001aB\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u000e\u001a\u00020\u000fH\u0002J\u0012\u0010\u0010\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0016J\u0010\u0010\u0014\u001a\u00020\u000f2\u0006\u0010\u0015\u001a\u00020\u0016H\u0002J\u0010\u0010\u0017\u001a\u00020\u000f2\u0006\u0010\u0018\u001a\u00020\u0019H\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X‚.¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X‚.¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X‚.¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u0004\u0018\u00010\tX‚\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u0004\u0018\u00010\u0004X‚\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX‚.¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\fX‚.¢\u0006\u0002\n\u0000¨\u0006\u001b"}, d2 = {"Lcom/coolapk/market/view/backupList/BackupCreateDialog;", "Landroidx/fragment/app/DialogFragment;", "()V", "appList", "", "backupTitle", "binding", "Lcom/coolapk/market/databinding/DialogBackupCreateBinding;", "createSubscription", "Lrx/Subscription;", "deviceTitle", "intro", "Landroid/widget/EditText;", "titleView", "loadDeviceInfo", "", "onCreateDialog", "Landroid/app/Dialog;", "savedInstanceState", "Landroid/os/Bundle;", "onDeviceInfoLoaded", "info", "Lcom/coolapk/market/model/DeviceInfo;", "onDismiss", "dialog", "Landroid/content/DialogInterface;", "Companion", "presentation_coolapkAppRelease"}, k = 1, mv = {1, 4, 2}) /* compiled from: BackupCreatDialog.kt */ public final class BackupCreateDialog extends DialogFragment { public static final Companion Companion = new Companion(null); private static final String KEY_APP_LIST = "ALBUMTITLE"; private static final String KEY_INTRO = "ALBUMINTRO"; private String appList; private String backupTitle; private DialogBackupCreateBinding binding; private Subscription createSubscription; private String deviceTitle; private EditText intro; private EditText titleView; public static final /* synthetic */ String access$getBackupTitle$p(BackupCreateDialog backupCreateDialog) { String str = backupCreateDialog.backupTitle; if (str == null) { Intrinsics.throwUninitializedPropertyAccessException("backupTitle"); } return str; } public static final /* synthetic */ DialogBackupCreateBinding access$getBinding$p(BackupCreateDialog backupCreateDialog) { DialogBackupCreateBinding dialogBackupCreateBinding = backupCreateDialog.binding; if (dialogBackupCreateBinding == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } return dialogBackupCreateBinding; } @Override // androidx.fragment.app.DialogFragment, android.content.DialogInterface.OnDismissListener public void onDismiss(DialogInterface dialogInterface) { Intrinsics.checkNotNullParameter(dialogInterface, "dialog"); super.onDismiss(dialogInterface); RxUtils.unsubscribe(this.createSubscription); } @Override // androidx.fragment.app.DialogFragment public Dialog onCreateDialog(Bundle bundle) { AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity()); ViewDataBinding inflate = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), 2131558520, null, false); Intrinsics.checkNotNullExpressionValue(inflate, "DataBindingUtil.inflate(…ckup_create, null, false)"); DialogBackupCreateBinding dialogBackupCreateBinding = (DialogBackupCreateBinding) inflate; this.binding = dialogBackupCreateBinding; if (dialogBackupCreateBinding == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } EditText editText = dialogBackupCreateBinding.titleEditText; Intrinsics.checkNotNullExpressionValue(editText, "binding.titleEditText"); this.titleView = editText; DialogBackupCreateBinding dialogBackupCreateBinding2 = this.binding; if (dialogBackupCreateBinding2 == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } EditText editText2 = dialogBackupCreateBinding2.titleEditText; Intrinsics.checkNotNullExpressionValue(editText2, "binding.titleEditText"); this.intro = editText2; if (editText2 == null) { Intrinsics.throwUninitializedPropertyAccessException("intro"); } editText2.setHint(""); loadDeviceInfo(); int colorAccent = AppHolder.getAppTheme().getColorAccent(); DialogBackupCreateBinding dialogBackupCreateBinding3 = this.binding; if (dialogBackupCreateBinding3 == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } dialogBackupCreateBinding3.dialogConfirm.setTextColor(colorAccent); DialogBackupCreateBinding dialogBackupCreateBinding4 = this.binding; if (dialogBackupCreateBinding4 == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } dialogBackupCreateBinding4.dialogCancel.setTextColor(colorAccent); EditText editText3 = this.intro; if (editText3 == null) { Intrinsics.throwUninitializedPropertyAccessException("intro"); } TintHelper.setTint(editText3, colorAccent, false); EditText editText4 = this.titleView; if (editText4 == null) { Intrinsics.throwUninitializedPropertyAccessException("titleView"); } TintHelper.setTint(editText4, colorAccent, false); DialogBackupCreateBinding dialogBackupCreateBinding5 = this.binding; if (dialogBackupCreateBinding5 == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } builder.setView(dialogBackupCreateBinding5.getRoot()); builder.setCancelable(true); AlertDialog create = builder.create(); Intrinsics.checkNotNullExpressionValue(create, "builder.create()"); return create; } private final void loadDeviceInfo() { DataManager instance = DataManager.getInstance(); Intrinsics.checkNotNullExpressionValue(instance, "DataManager.getInstance()"); instance.getDeviceInfo().compose(RxUtils.applyIOSchedulers()).subscribe(new BackupCreateDialog$loadDeviceInfo$1(this)); } /* access modifiers changed from: private */ public final void onDeviceInfoLoaded(DeviceInfo deviceInfo) { String createTimeDescription = DateUtils.getCreateTimeDescription(getActivity(), Long.valueOf(DateUtils.getTimestamp()), false); boolean isEmpty = TextUtils.isEmpty(deviceInfo.getDeviceTitle()); String str = Build.BRAND + '-' + Build.MODEL; String deviceTitle2 = deviceInfo.getDeviceTitle(); if (!isEmpty) { str = deviceTitle2; } this.backupTitle = str + "的备份单 " + createTimeDescription; EditText editText = this.intro; if (editText == null) { Intrinsics.throwUninitializedPropertyAccessException("intro"); } String str2 = this.backupTitle; if (str2 == null) { Intrinsics.throwUninitializedPropertyAccessException("backupTitle"); } editText.setHint(str2); DialogBackupCreateBinding dialogBackupCreateBinding = this.binding; if (dialogBackupCreateBinding == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } ViewUtil.clickListener(dialogBackupCreateBinding.dialogConfirm, new BackupCreateDialog$onDeviceInfoLoaded$1(this)); DialogBackupCreateBinding dialogBackupCreateBinding2 = this.binding; if (dialogBackupCreateBinding2 == null) { Intrinsics.throwUninitializedPropertyAccessException("binding"); } ViewUtil.clickListener(dialogBackupCreateBinding2.dialogCancel, new BackupCreateDialog$onDeviceInfoLoaded$2(this)); } @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b†\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0006\u001a\u00020\u0007J\u000e\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0004R\u000e\u0010\u0003\u001a\u00020\u0004X‚D¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X‚D¢\u0006\u0002\n\u0000¨\u0006\t"}, d2 = {"Lcom/coolapk/market/view/backupList/BackupCreateDialog$Companion;", "", "()V", "KEY_APP_LIST", "", "KEY_INTRO", "newInstance", "Lcom/coolapk/market/view/backupList/BackupCreateDialog;", "introtext", "presentation_coolapkAppRelease"}, k = 1, mv = {1, 4, 2}) /* compiled from: BackupCreatDialog.kt */ public static final class Companion { private Companion() { } public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) { this(); } public final BackupCreateDialog newInstance() { BackupCreateDialog backupCreateDialog = new BackupCreateDialog(); backupCreateDialog.setArguments(new Bundle()); return backupCreateDialog; } public final BackupCreateDialog newInstance(String str) { Intrinsics.checkNotNullParameter(str, "introtext"); BackupCreateDialog backupCreateDialog = new BackupCreateDialog(); Bundle bundle = new Bundle(); bundle.putString(BackupCreateDialog.KEY_INTRO, str); backupCreateDialog.setArguments(bundle); return backupCreateDialog; } } }
bdb23811d863d33f111af60d9124b1b0339772c8
30f360871b57c1ec8bbeae2636739a58728374d3
/spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java
4703d3579bc00e99f960f95347e8a7c7a567daee
[ "Apache-2.0" ]
permissive
neilwangweili/msb-spring
1321afac7920e821d53695973ba5fc794658a0b1
47f88eb2c8f54c94f597a3dae7d4199d8ece3512
refs/heads/main
2023-05-30T17:48:52.824534
2021-06-09T08:59:46
2021-06-09T08:59:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
20,118
java
/* * Copyright 2002-2020 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.context.support; import java.io.IOException; import java.lang.reflect.Constructor; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Supplier; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionCustomizer; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.context.ApplicationContext; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.core.metrics.ApplicationStartup; import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** * Generic ApplicationContext implementation that holds a single internal * {@link org.springframework.beans.factory.support.DefaultListableBeanFactory} * instance and does not assume a specific bean definition format. Implements * the {@link org.springframework.beans.factory.support.BeanDefinitionRegistry} * interface in order to allow for applying any bean definition readers to it. * * <p>Typical usage is to register a variety of bean definitions via the * {@link org.springframework.beans.factory.support.BeanDefinitionRegistry} * interface and then call {@link #refresh()} to initialize those beans * with application context semantics (handling * {@link org.springframework.context.ApplicationContextAware}, auto-detecting * {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessors}, * etc). * * <p>In contrast to other ApplicationContext implementations that create a new * internal BeanFactory instance for each refresh, the internal BeanFactory of * this context is available right from the start, to be able to register bean * definitions on it. {@link #refresh()} may only be called once. * * <p>Usage example: * * <pre class="code"> * GenericApplicationContext ctx = new GenericApplicationContext(); * XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ctx); * xmlReader.loadBeanDefinitions(new ClassPathResource("applicationContext.xml")); * PropertiesBeanDefinitionReader propReader = new PropertiesBeanDefinitionReader(ctx); * propReader.loadBeanDefinitions(new ClassPathResource("otherBeans.properties")); * ctx.refresh(); * * MyBean myBean = (MyBean) ctx.getBean("myBean"); * ...</pre> * * For the typical case of XML bean definitions, simply use * {@link ClassPathXmlApplicationContext} or {@link FileSystemXmlApplicationContext}, * which are easier to set up - but less flexible, since you can just use standard * resource locations for XML bean definitions, rather than mixing arbitrary bean * definition formats. The equivalent in a web environment is * {@link org.springframework.web.context.support.XmlWebApplicationContext}. * * <p>For custom application context implementations that are supposed to read * special bean definition formats in a refreshable manner, consider deriving * from the {@link AbstractRefreshableApplicationContext} base class. * * @author Juergen Hoeller * @author Chris Beams * @since 1.1.2 * @see #registerBeanDefinition * @see #refresh() * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader * @see org.springframework.beans.factory.support.PropertiesBeanDefinitionReader */ public class GenericApplicationContext extends AbstractApplicationContext implements BeanDefinitionRegistry { private final DefaultListableBeanFactory beanFactory; @Nullable private ResourceLoader resourceLoader; private boolean customClassLoader = false; private final AtomicBoolean refreshed = new AtomicBoolean(); /** * Create a new GenericApplicationContext. * @see #registerBeanDefinition * @see #refresh */ public GenericApplicationContext() { this.beanFactory = new DefaultListableBeanFactory(); } /** * Create a new GenericApplicationContext with the given DefaultListableBeanFactory. * @param beanFactory the DefaultListableBeanFactory instance to use for this context * @see #registerBeanDefinition * @see #refresh */ public GenericApplicationContext(DefaultListableBeanFactory beanFactory) { Assert.notNull(beanFactory, "BeanFactory must not be null"); this.beanFactory = beanFactory; } /** * Create a new GenericApplicationContext with the given parent. * @param parent the parent application context * @see #registerBeanDefinition * @see #refresh */ public GenericApplicationContext(@Nullable ApplicationContext parent) { this(); setParent(parent); } /** * Create a new GenericApplicationContext with the given DefaultListableBeanFactory. * @param beanFactory the DefaultListableBeanFactory instance to use for this context * @param parent the parent application context * @see #registerBeanDefinition * @see #refresh */ public GenericApplicationContext(DefaultListableBeanFactory beanFactory, ApplicationContext parent) { this(beanFactory); setParent(parent); } /** * Set the parent of this application context, also setting * the parent of the internal BeanFactory accordingly. * @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setParentBeanFactory */ @Override public void setParent(@Nullable ApplicationContext parent) { super.setParent(parent); this.beanFactory.setParentBeanFactory(getInternalParentBeanFactory()); } @Override public void setApplicationStartup(ApplicationStartup applicationStartup) { super.setApplicationStartup(applicationStartup); this.beanFactory.setApplicationStartup(applicationStartup); } /** * Set whether it should be allowed to override bean definitions by registering * a different definition with the same name, automatically replacing the former. * If not, an exception will be thrown. Default is "true". * @since 3.0 * @see org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowBeanDefinitionOverriding */ public void setAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding) { this.beanFactory.setAllowBeanDefinitionOverriding(allowBeanDefinitionOverriding); } /** * Set whether to allow circular references between beans - and automatically * try to resolve them. * <p>Default is "true". Turn this off to throw an exception when encountering * a circular reference, disallowing them completely. * @since 3.0 * @see org.springframework.beans.factory.support.DefaultListableBeanFactory#setAllowCircularReferences */ public void setAllowCircularReferences(boolean allowCircularReferences) { this.beanFactory.setAllowCircularReferences(allowCircularReferences); } /** * Set a ResourceLoader to use for this context. If set, the context will * delegate all {@code getResource} calls to the given ResourceLoader. * If not set, default resource loading will apply. * <p>The main reason to specify a custom ResourceLoader is to resolve * resource paths (without URL prefix) in a specific fashion. * The default behavior is to resolve such paths as class path locations. * To resolve resource paths as file system locations, specify a * FileSystemResourceLoader here. * <p>You can also pass in a full ResourcePatternResolver, which will * be autodetected by the context and used for {@code getResources} * calls as well. Else, default resource pattern matching will apply. * @see #getResource * @see org.springframework.core.io.DefaultResourceLoader * @see org.springframework.core.io.FileSystemResourceLoader * @see org.springframework.core.io.support.ResourcePatternResolver * @see #getResources */ public void setResourceLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } //--------------------------------------------------------------------- // ResourceLoader / ResourcePatternResolver override if necessary //--------------------------------------------------------------------- /** * This implementation delegates to this context's ResourceLoader if set, * falling back to the default superclass behavior else. * @see #setResourceLoader */ @Override public Resource getResource(String location) { if (this.resourceLoader != null) { return this.resourceLoader.getResource(location); } return super.getResource(location); } /** * This implementation delegates to this context's ResourceLoader if it * implements the ResourcePatternResolver interface, falling back to the * default superclass behavior else. * @see #setResourceLoader */ @Override public Resource[] getResources(String locationPattern) throws IOException { if (this.resourceLoader instanceof ResourcePatternResolver) { return ((ResourcePatternResolver) this.resourceLoader).getResources(locationPattern); } return super.getResources(locationPattern); } @Override public void setClassLoader(@Nullable ClassLoader classLoader) { super.setClassLoader(classLoader); this.customClassLoader = true; } @Override @Nullable public ClassLoader getClassLoader() { if (this.resourceLoader != null && !this.customClassLoader) { return this.resourceLoader.getClassLoader(); } return super.getClassLoader(); } //--------------------------------------------------------------------- // Implementations of AbstractApplicationContext's template methods //--------------------------------------------------------------------- /** * 将容器需要的BeanFactory对象注册为Bean * Do nothing: We hold a single internal BeanFactory and rely on callers * to register beans through our public methods (or the BeanFactory's). * @see #registerBeanDefinition */ @Override protected final void refreshBeanFactory() throws IllegalStateException { if (!this.refreshed.compareAndSet(false, true)) { throw new IllegalStateException( "GenericApplicationContext does not support multiple refresh attempts: just call 'refresh' once"); } this.beanFactory.setSerializationId(getId()); } @Override protected void cancelRefresh(BeansException ex) { this.beanFactory.setSerializationId(null); super.cancelRefresh(ex); } /** * Not much to do: We hold a single internal BeanFactory that will never * get released. */ @Override protected final void closeBeanFactory() { this.beanFactory.setSerializationId(null); } /** * Return the single internal BeanFactory held by this context * (as ConfigurableListableBeanFactory). */ @Override public final ConfigurableListableBeanFactory getBeanFactory() { return this.beanFactory; } /** * Return the underlying bean factory of this context, * available for registering bean definitions. * <p><b>NOTE:</b> You need to call {@link #refresh()} to initialize the * bean factory and its contained beans with application context semantics * (autodetecting BeanFactoryPostProcessors, etc). * @return the internal bean factory (as DefaultListableBeanFactory) */ public final DefaultListableBeanFactory getDefaultListableBeanFactory() { return this.beanFactory; } @Override public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException { assertBeanFactoryActive(); return this.beanFactory; } //--------------------------------------------------------------------- // Implementation of BeanDefinitionRegistry //--------------------------------------------------------------------- @Override public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException { this.beanFactory.registerBeanDefinition(beanName, beanDefinition); } @Override public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { this.beanFactory.removeBeanDefinition(beanName); } @Override public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException { return this.beanFactory.getBeanDefinition(beanName); } @Override public boolean isBeanNameInUse(String beanName) { return this.beanFactory.isBeanNameInUse(beanName); } @Override public void registerAlias(String beanName, String alias) { this.beanFactory.registerAlias(beanName, alias); } @Override public void removeAlias(String alias) { this.beanFactory.removeAlias(alias); } @Override public boolean isAlias(String beanName) { return this.beanFactory.isAlias(beanName); } //--------------------------------------------------------------------- // Convenient methods for registering individual beans //--------------------------------------------------------------------- /** * Register a bean from the given bean class, optionally providing explicit * constructor arguments for consideration in the autowiring process. * @param beanClass the class of the bean * @param constructorArgs custom argument values to be fed into Spring's * constructor resolution algorithm, resolving either all arguments or just * specific ones, with the rest to be resolved through regular autowiring * (may be {@code null} or empty) * @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass) */ public <T> void registerBean(Class<T> beanClass, Object... constructorArgs) { registerBean(null, beanClass, constructorArgs); } /** * Register a bean from the given bean class, optionally providing explicit * constructor arguments for consideration in the autowiring process. * @param beanName the name of the bean (may be {@code null}) * @param beanClass the class of the bean * @param constructorArgs custom argument values to be fed into Spring's * constructor resolution algorithm, resolving either all arguments or just * specific ones, with the rest to be resolved through regular autowiring * (may be {@code null} or empty) * @since 5.2 (since 5.0 on the AnnotationConfigApplicationContext subclass) */ public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, Object... constructorArgs) { registerBean(beanName, beanClass, (Supplier<T>) null, bd -> { for (Object arg : constructorArgs) { bd.getConstructorArgumentValues().addGenericArgumentValue(arg); } }); } /** * Register a bean from the given bean class, optionally customizing its * bean definition metadata (typically declared as a lambda expression). * @param beanClass the class of the bean (resolving a public constructor * to be autowired, possibly simply the default constructor) * @param customizers one or more callbacks for customizing the factory's * {@link BeanDefinition}, e.g. setting a lazy-init or primary flag * @since 5.0 * @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...) */ public final <T> void registerBean(Class<T> beanClass, BeanDefinitionCustomizer... customizers) { registerBean(null, beanClass, null, customizers); } /** * Register a bean from the given bean class, optionally customizing its * bean definition metadata (typically declared as a lambda expression). * @param beanName the name of the bean (may be {@code null}) * @param beanClass the class of the bean (resolving a public constructor * to be autowired, possibly simply the default constructor) * @param customizers one or more callbacks for customizing the factory's * {@link BeanDefinition}, e.g. setting a lazy-init or primary flag * @since 5.0 * @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...) */ public final <T> void registerBean( @Nullable String beanName, Class<T> beanClass, BeanDefinitionCustomizer... customizers) { registerBean(beanName, beanClass, null, customizers); } /** * Register a bean from the given bean class, using the given supplier for * obtaining a new instance (typically declared as a lambda expression or * method reference), optionally customizing its bean definition metadata * (again typically declared as a lambda expression). * @param beanClass the class of the bean * @param supplier a callback for creating an instance of the bean * @param customizers one or more callbacks for customizing the factory's * {@link BeanDefinition}, e.g. setting a lazy-init or primary flag * @since 5.0 * @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...) */ public final <T> void registerBean( Class<T> beanClass, Supplier<T> supplier, BeanDefinitionCustomizer... customizers) { registerBean(null, beanClass, supplier, customizers); } /** * Register a bean from the given bean class, using the given supplier for * obtaining a new instance (typically declared as a lambda expression or * method reference), optionally customizing its bean definition metadata * (again typically declared as a lambda expression). * <p>This method can be overridden to adapt the registration mechanism for * all {@code registerBean} methods (since they all delegate to this one). * @param beanName the name of the bean (may be {@code null}) * @param beanClass the class of the bean * @param supplier a callback for creating an instance of the bean (in case * of {@code null}, resolving a public constructor to be autowired instead) * @param customizers one or more callbacks for customizing the factory's * {@link BeanDefinition}, e.g. setting a lazy-init or primary flag * @since 5.0 */ public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, @Nullable Supplier<T> supplier, BeanDefinitionCustomizer... customizers) { ClassDerivedBeanDefinition beanDefinition = new ClassDerivedBeanDefinition(beanClass); if (supplier != null) { beanDefinition.setInstanceSupplier(supplier); } for (BeanDefinitionCustomizer customizer : customizers) { customizer.customize(beanDefinition); } String nameToUse = (beanName != null ? beanName : beanClass.getName()); registerBeanDefinition(nameToUse, beanDefinition); } /** * {@link RootBeanDefinition} marker subclass for {@code #registerBean} based * registrations with flexible autowiring for public constructors. */ @SuppressWarnings("serial") private static class ClassDerivedBeanDefinition extends RootBeanDefinition { public ClassDerivedBeanDefinition(Class<?> beanClass) { super(beanClass); } public ClassDerivedBeanDefinition(ClassDerivedBeanDefinition original) { super(original); } @Override @Nullable public Constructor<?>[] getPreferredConstructors() { Class<?> clazz = getBeanClass(); Constructor<?> primaryCtor = BeanUtils.findPrimaryConstructor(clazz); if (primaryCtor != null) { return new Constructor<?>[] {primaryCtor}; } Constructor<?>[] publicCtors = clazz.getConstructors(); if (publicCtors.length > 0) { return publicCtors; } return null; } @Override public RootBeanDefinition cloneBeanDefinition() { return new ClassDerivedBeanDefinition(this); } } }
12c8ff1c230e3ccf3cbda818a591ba7d5e7760ff
dc0770df55fe5c86dc0d7e01953564e4e1381893
/src/main/java/com/sreeram/didemo/Controllers/ConstructorInjectedController.java
22843742a7e66976657fa5c24a3b09b280cb52af
[]
no_license
indysreeram/di-demo
605a447bb0d19dbb0ff4c04bd6c7cb8f8414dbd7
7943a4a92878e83e7bc2dd3b2d3bcb86ee6b42b5
refs/heads/master
2020-04-04T16:33:19.085481
2018-11-18T16:27:45
2018-11-18T16:27:45
156,082,660
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package com.sreeram.didemo.Controllers; import com.sreeram.didemo.Services.GreetingService; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; @Controller public class ConstructorInjectedController { GreetingService greetingService; public ConstructorInjectedController(@Qualifier("constructorGreetingService") GreetingService greetingService) { this.greetingService = greetingService; } public String sayHello(){ return greetingService.sayGreeting(); } }
e2771c49d613a5a5b9bc524aa406119c82b0a3b0
c8d58970d544ec03ee2420370bac67cc4a9aa0ca
/word/src/main/java/org/apdplat/word/recognition/Quantifier.java
8e7df6324ce5d68c9952cd1d0fdc599873f73e27
[ "Apache-2.0" ]
permissive
bjlifeng/bjlf
cef126825c5c409025b840f2b139168f0221b873
416d43aa777f282aed0ef38ff976f146c52f89ce
refs/heads/master
2021-01-10T14:09:38.164623
2016-04-01T03:14:57
2016-04-01T03:14:57
55,199,842
0
0
null
null
null
null
UTF-8
Java
false
false
3,418
java
/** * * APDPlat - Application Product Development Platform * Copyright (c) 2013, 杨尚川, [email protected] * * 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/>. * */ package org.apdplat.word.recognition; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apdplat.word.util.AutoDetector; import org.apdplat.word.util.ResourceLoader; import org.apdplat.word.util.WordConfTools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 数量词识别 * @author 杨尚川 */ public class Quantifier { private static final Logger LOGGER = LoggerFactory.getLogger(Quantifier.class); private static final Set<Character> quantifiers=new HashSet<>(); static{ reload(); } public static void reload(){ AutoDetector.loadAndWatch(new ResourceLoader(){ @Override public void clear() { quantifiers.clear(); } @Override public void load(List<String> lines) { LOGGER.info("初始化数量词"); for(String line : lines){ if(line.length() == 1){ char _char = line.charAt(0); if(quantifiers.contains(_char)){ LOGGER.info("配置文件有重复项:"+line); }else{ quantifiers.add(_char); } }else{ LOGGER.info("忽略不合法数量词:"+line); } } LOGGER.info("数量词初始化完毕,数量词个数:"+quantifiers.size()); } @Override public void add(String line) { if (line.length() == 1) { char _char = line.charAt(0); quantifiers.add(_char); } else { LOGGER.info("忽略不合法数量词:" + line); } } @Override public void remove(String line) { if (line.length() == 1) { char _char = line.charAt(0); quantifiers.remove(_char); } else { LOGGER.info("忽略不合法数量词:" + line); } } }, WordConfTools.get("quantifier.path", "classpath:quantifier.txt")); } public static boolean is(char _char){ return quantifiers.contains(_char); } public static void main(String[] args){ int i=1; for(char quantifier : quantifiers){ LOGGER.info((i++)+" : "+quantifier); } } }
8cafb6c72ed63d9b7d2ce7ba345bab6fe9a5aaec
6acfa014895ff1c89393fff05251f4d0079109d5
/src/controller/Hotel.java
2115f1b473ef86f890f07d7ee3a82eeace351fad
[]
no_license
son-nguyen-ronaldo/quanlyHotel
0cf283a64d48765f8aab090cbb90891ded281875
5d26a233fe1f7370ad82289d3a5a36c85a9e0ee7
refs/heads/master
2023-08-17T10:00:31.809837
2021-10-12T10:27:45
2021-10-12T10:27:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,191
java
package controller; import model.Oder; import model.Room; import model.User; import java.util.ArrayList; import java.util.List; public class Hotel { ArrayList<User> userList = new ArrayList<>(); ArrayList<Room> roomList = new ArrayList<>(); ArrayList<Oder> oders = new ArrayList<>(); public void addNewRoom(Room room){ roomList.add(room); } public long getAllTotal(){ long total=0; for (Oder order: oders ) { total+= order.getTotalPrice(); } return total; } public ArrayList<Oder> getOders() { return oders; } public void setOders(ArrayList<Oder> oders) { this.oders = oders; } public Hotel(ArrayList<User> userList, ArrayList<Room> roomList) { this.userList = userList; this.roomList = roomList; } public ArrayList<User> getUserList() { return userList; } public void setUserList(ArrayList<User> userList) { this.userList = userList; } public ArrayList<Room> getRoomList() { return roomList; } public void setRoomList(ArrayList<Room> roomList) { this.roomList = roomList; } }
df80ef7edb1a2b2ba4b34bebd2684c4f174a1547
80ed74a078380e2dc854b127c6c74981767bc9a4
/editor/src/main/java/com/ostsoft/games/jsm/editor/credits/CreditsPanelData.java
d05af7aded1335ec0c9dc0f8f0696f2d9aaa4c0f
[]
no_license
OsteHovel/jsm
b38306055d9b228694ccca67e91f96517a314822
64e4238d4b05e0b6faea6021104b7280a66d4427
refs/heads/master
2021-08-27T21:28:55.098592
2017-12-10T11:34:17
2017-12-10T11:34:21
113,744,340
3
0
null
null
null
null
UTF-8
Java
false
false
671
java
package com.ostsoft.games.jsm.editor.credits; import com.ostsoft.games.jsm.credits.CreditLine; import com.ostsoft.games.jsm.editor.EditorData; import com.ostsoft.games.jsm.editor.common.PanelData; public class CreditsPanelData extends PanelData { private CreditLine selectedCreditsLine; public CreditsPanelData(EditorData editorData) { super(editorData); setScale(editorData.getOptions().getCreditsScale()); } public CreditLine getSelectedCreditsLine() { return selectedCreditsLine; } public void setSelectedCreditsLine(CreditLine selectedCreditsLine) { this.selectedCreditsLine = selectedCreditsLine; } }
04f5c7b9e7ad7730798d50f7f900acb10eb2313b
fd532dafb44e74703e1e9417070b123f0de18b9f
/src/main/java/cn/com/xinli/portal/core/runtime/Reportable.java
0e5f66e6f130ee9c5f4e24b2b2dc44273c16a03b
[]
no_license
Morcal/SpringBootServer
865b998255299c203f5fe07e8ce046933527d59a
5d4e254b76c342d913db37f5bf69d6258aecd1c0
refs/heads/master
2021-01-20T19:27:02.899755
2016-07-06T13:27:40
2016-07-06T13:27:40
62,722,827
1
0
null
null
null
null
UTF-8
Java
false
false
287
java
package cn.com.xinli.portal.core.runtime; /** * Reportable. * * <p>Classes implement this interface can export a report. * @author zhoupeng, created on 2016/4/8. */ public interface Reportable { /** * Generate report. * @return report. */ Report report(); }
3cdd8a1caeefa92bbd434d4319ff361674531caa
aebecff8c6d84dc4fe2fc32288e54a978cd0278d
/Aula12/src/aula12/Tartaruga.java
99560434e3951e82331d29de24d9ed8648f086e0
[ "MIT" ]
permissive
jamezaguiar/Curso-de-POO-em-Java-cursoemvideo.com
e769d2e0c99c6e2428fc90989f5e0beda0b2783f
097fa85f123c1ea7e45701a30ba1962cc916e2ae
refs/heads/master
2022-05-28T17:31:05.301810
2020-04-29T12:21:16
2020-04-29T12:21:16
259,917,267
0
0
null
null
null
null
UTF-8
Java
false
false
65
java
package aula12; public class Tartaruga extends Reptil { }
7117cab7f62d421282d8b4a93d6fe57627d9e444
cd81f5246d9a6b8471454782cda01440990a2b6b
/igesture-framework/src/main/java/org/ximtec/igesture/core/composite/parameter/ProximityConstraintParameters.java
d92ee45b6528884029878a6dcdd75ce04ec67b8e
[ "Apache-2.0" ]
permissive
UeliKurmann/igesture
fd73a345347f60c96a6cf51a4c141abd0a4d4d3d
95dd46fb321851c1e2a989e0c7c8328f57b43f4d
refs/heads/master
2021-07-17T01:21:00.887072
2012-10-21T21:59:28
2012-10-21T21:59:28
219,012,943
0
0
Apache-2.0
2020-10-13T17:09:58
2019-11-01T15:31:53
Java
UTF-8
Java
false
false
5,473
java
/** * */ package org.ximtec.igesture.core.composite.parameter; import java.util.ArrayList; import java.util.Calendar; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.sigtec.ink.Note; import org.ximtec.igesture.core.Gesture; import org.ximtec.igesture.core.GestureSample; import org.ximtec.igesture.core.GestureSample3D; import org.ximtec.igesture.core.composite.ConstraintTool; import org.ximtec.igesture.core.composite.DefaultConstraintEntry; import org.ximtec.igesture.io.IDeviceManager; import org.ximtec.igesture.util.Constant; import org.ximtec.igesture.util.Note3DTool; import org.ximtec.igesture.util.additions3d.Note3D; /** * @author Björn Puype, [email protected] * */ public class ProximityConstraintParameters extends AbstractConstraintParameters{ public enum Config{ MIN_DISTANCE, MAX_DISTANCE, DISTANCE_UNIT } private final static String MIN_DISTANCE = "0"; private final static String MAX_DISTANCE = "10"; private final static String DISTANCE_UNIT = Constant.CM; private double minDistance; private double maxDistance; private String distanceUnit; public ProximityConstraintParameters() { super(); DEFAULT_CONFIGURATION.put(Config.MIN_DISTANCE.name(), MIN_DISTANCE); DEFAULT_CONFIGURATION.put(Config.MAX_DISTANCE.name(), MAX_DISTANCE); DEFAULT_CONFIGURATION.put(Config.DISTANCE_UNIT.name(), DISTANCE_UNIT); setterMapping.put(Config.DISTANCE_UNIT.name(), "setDistanceUnit"); setterMapping.put(Config.MIN_DISTANCE.name(), "setMinDistance"); setterMapping.put(Config.MAX_DISTANCE.name(), "setMaxDistance"); setMinDistance(MIN_DISTANCE); setMaxDistance(MAX_DISTANCE); setDistanceUnit(DISTANCE_UNIT); } /** * Get the minimum distance between two gestures. */ public double getMinDistance() { return minDistance; } /** * Set the minimum distance between two gestures. */ public void setMinDistance(String minDistance) throws NumberFormatException{ this.minDistance = Double.parseDouble(minDistance); } /** * Get the maximum distance between two gestures. */ public double getMaxDistance() { return maxDistance; } /** * Set the maximum distance between two gestures. */ public void setMaxDistance(String maxDistance) throws NumberFormatException{ this.maxDistance = Double.parseDouble(maxDistance); } /** * Get the distance unit. * @see org.ximtec.igesture.core.composite.Constraint */ public String getDistanceUnit() { return distanceUnit; } /** * Set the distance unit. * @see org.ximtec.igesture.core.composite.Constraint */ public void setDistanceUnit(String distanceUnit) { this.distanceUnit = distanceUnit; } /* (non-Javadoc) * @see org.ximtec.igesture.core.composite.parameter.AbstractConstraintParameters#validateConditions(java.util.List, org.ximtec.igesture.io.IDeviceManager) */ @Override public boolean validateConditions(List<Gesture<?>> gestures, IDeviceManager manager) { boolean conditionsValid = true; /* distance check */ boolean same = true; Gesture<?> gest = gestures.get(0); if(gest instanceof GestureSample) { List<Note> notes = new ArrayList<Note>(); for (Iterator<Gesture<?>> iterator = gestures.iterator(); iterator.hasNext();) { Gesture<?> gesture = iterator.next(); if(gesture instanceof GestureSample) { notes.add(((GestureSample)gesture).getGesture()); } else { same = false; break; } } if(same) { conditionsValid = ConstraintTool.isBoundsDiagonalValid(notes,minDistance,maxDistance); } // else // throw new RuntimeException("Gestures need to be of same type. 2D and 3D gestures cannot be mixed in proximity based constraints"); } else if(gest instanceof GestureSample3D) { List<Note> notesXY = new ArrayList<Note>(); List<Note> notesYZ = new ArrayList<Note>(); List<Note> notesXZ = new ArrayList<Note>(); for (Iterator<Gesture<?>> iterator = gestures.iterator(); iterator.hasNext();) { Gesture<?> gesture = iterator.next(); if(gesture instanceof GestureSample3D) { Note3D record = ((GestureSample3D)gesture).getGesture(); List<Gesture<Note>> notes = Note3DTool.splitToPlanes(record); notesXY.add(notes.get(0).getGesture()); notesYZ.add(notes.get(1).getGesture()); notesXZ.add(notes.get(2).getGesture()); } else { same = false; break; } } if(same) { conditionsValid = ConstraintTool.isBoundsDiagonalValid(notesXZ,minDistance,maxDistance); if(conditionsValid) { conditionsValid = ConstraintTool.isBoundsDiagonalValid(notesYZ,minDistance,maxDistance); if(conditionsValid) conditionsValid = ConstraintTool.isBoundsDiagonalValid(notesXY,minDistance,maxDistance); } } // else // throw new ProximityException(); } return conditionsValid; } /* (non-Javadoc) * @see org.ximtec.igesture.core.composite.parameter.AbstractConstraintParameters#determineTimeWindows(java.util.List) */ @Override public Map<String, Calendar> determineTimeWindows(List<DefaultConstraintEntry> gestures) { return null; } /* (non-Javadoc) * @see org.ximtec.igesture.core.composite.parameter.AbstractConstraintParameters#generatePatterns(java.util.Map, java.util.List) */ @Override public Set<String> generatePatterns(Map<String, String> charMapping, List<DefaultConstraintEntry> gestures) { return null; } }
[ "bpuype@f93bbda9-e428-0410-8f24-ec21284828af" ]
bpuype@f93bbda9-e428-0410-8f24-ec21284828af
d807e0e10d0f9843edc84540645e2e3bd1eda27e
7d7016ae3f693a7af8fcae75c46b1076dcae720a
/src/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/datatypes/StudentHBaseDateTest.java
9b9ad90d4697e78017f98758384583bf7f06ae87
[]
no_license
gurkerl83/Kundera
1ac0b0d72acfb94ed9e2066726fce01f29238220
0bafc3dc13fb401f95b3af7128ca958ea568eab2
refs/heads/trunk
2020-12-25T00:50:21.669754
2015-02-02T10:43:47
2015-02-02T10:43:47
30,255,355
1
0
null
2015-02-03T17:31:48
2015-02-03T17:31:47
null
UTF-8
Java
false
false
18,945
java
package com.impetus.client.hbase.crud.datatypes; import java.util.Date; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.Query; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.impetus.client.hbase.crud.datatypes.entities.StudentHBaseDate; import com.impetus.client.hbase.junits.HBaseCli; public class StudentHBaseDateTest extends Base { private static final String table = "StudentHBaseDate"; private HBaseCli cli; private static final String keyspace = "KunderaHbaseDataType"; private EntityManagerFactory emf; @Before public void setUp() throws Exception { if (RUN_IN_EMBEDDED_MODE) { startCluster(); } if (AUTO_MANAGE_SCHEMA) { createSchema(); } emf = Persistence.createEntityManagerFactory("HbaseDataTypeTest"); } @After public void tearDown() throws Exception { emf.close(); if (AUTO_MANAGE_SCHEMA) { dropSchema(); } if (RUN_IN_EMBEDDED_MODE) { stopCluster(); } } @Test public void testExecuteUseSameEm() { testPersist(true); testFindById(true); testMerge(true); testFindByQuery(true); testNamedQueryUseSameEm(true); testDelete(true); } @Test public void testExecute() { testPersist(false); testFindById(false); testMerge(false); testFindByQuery(false); testNamedQuery(false); testDelete(false); } public void testPersist(boolean useSameEm) { EntityManager em = emf.createEntityManager(); // Insert random value of Date StudentHBaseDate student = new StudentHBaseDate(); student.setAge((Short) getRandomValue(short.class)); student.setId((Date) getRandomValue(Date.class)); student.setName((String) getRandomValue(String.class)); em.persist(student); // Insert max value of Date StudentHBaseDate studentMax = new StudentHBaseDate(); studentMax.setAge((Short) getMaxValue(short.class)); studentMax.setId((Date) getMaxValue(Date.class)); studentMax.setName((String) getMaxValue(String.class)); em.persist(studentMax); // Insert min value of Date StudentHBaseDate studentMin = new StudentHBaseDate(); studentMin.setAge((Short) getPartialValue(short.class)); studentMin.setId((Date) getMinValue(Date.class)); studentMin.setName((String) getMinValue(String.class)); em.persist(studentMin); em.close(); } public void testFindById(boolean useSameEm) { EntityManager em = emf.createEntityManager(); StudentHBaseDate studentMax = em.find(StudentHBaseDate.class, getMaxValue(Date.class)); Assert.assertNotNull(studentMax); Assert.assertEquals(getMaxValue(short.class), studentMax.getAge()); Assert.assertEquals(getMaxValue(String.class), studentMax.getName()); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseDate studentMin = em.find(StudentHBaseDate.class, getMinValue(Date.class)); Assert.assertNotNull(studentMin); Assert.assertEquals(getPartialValue(short.class), studentMin.getAge()); Assert.assertEquals(getMinValue(String.class), studentMin.getName()); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseDate student = em.find(StudentHBaseDate.class, getRandomValue(Date.class)); Assert.assertNotNull(student); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); em.close(); } public void testMerge(boolean useSameEm) { EntityManager em = emf.createEntityManager(); StudentHBaseDate student = em.find(StudentHBaseDate.class, getMaxValue(Date.class)); Assert.assertNotNull(student); Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals(getMaxValue(String.class), student.getName()); student.setName("Kuldeep"); em.merge(student); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseDate newStudent = em.find(StudentHBaseDate.class, getMaxValue(Date.class)); Assert.assertNotNull(newStudent); Assert.assertEquals(getMaxValue(short.class), newStudent.getAge()); Assert.assertEquals("Kuldeep", newStudent.getName()); } public void testFindByQuery(boolean useSameEm) { findAllQuery(); findByName(); findByAge(); findByNameAndAgeGTAndLT(); findByNameAndAgeGTEQAndLTEQ(); findByNameAndAgeGTAndLTEQ(); findByNameAndAgeWithOrClause(); findByAgeAndNameGTAndLT(); findByNameAndAGEBetween(); findByRange(); } private void findByAgeAndNameGTAndLT() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.age = " + getPartialValue(short.class) + " and s.name > Amresh and s.name <= " + getMaxValue(String.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getMinValue(Date.class), student.getId()); Assert.assertEquals(getPartialValue(short.class), student.getAge()); Assert.assertEquals(getMinValue(String.class), student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } private void findByRange() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.id between " + getMinValue(Date.class) + " and " + getMaxValue(Date.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(2, students.size()); int count = 0; for (StudentHBaseDate student : students) { /* * if (student.getId().equals(getMaxValue(Date.class))) { * Assert.assertEquals(getMaxValue(short.class), student.getAge()); * Assert.assertEquals("Kuldeep", student.getName()); count++; } * else */if (student.getId().equals(getMinValue(Date.class))) { Assert.assertEquals(getPartialValue(short.class), student.getAge()); Assert.assertEquals(getMinValue(String.class), student.getName()); count++; } else { Assert.assertEquals(getRandomValue(Date.class), student.getId()); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); count++; } } Assert.assertEquals(2, count); em.close(); } private void findByNameAndAgeWithOrClause() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Kuldeep and s.age > " + getPartialValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getMaxValue(Date.class), student.getId()); Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals("Kuldeep", student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } private void findByNameAndAgeGTAndLTEQ() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Kuldeep and s.age > " + getPartialValue(short.class) + " and s.age <= " + getMaxValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getMaxValue(Date.class), student.getId()); Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals("Kuldeep", student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } public void testNamedQueryUseSameEm(boolean useSameEm) { updateNamed(true); deleteNamed(true); } public void testNamedQuery(boolean useSameEm) { updateNamed(false); deleteNamed(false); } public void testDelete(boolean useSameEm) { EntityManager em = emf.createEntityManager(); StudentHBaseDate studentMax = em.find(StudentHBaseDate.class, getMaxValue(Date.class)); Assert.assertNotNull(studentMax); Assert.assertEquals(getMaxValue(short.class), studentMax.getAge()); Assert.assertEquals("Kuldeep", studentMax.getName()); em.remove(studentMax); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } studentMax = em.find(StudentHBaseDate.class, getMaxValue(Date.class)); Assert.assertNull(studentMax); em.close(); } /** * */ private void deleteNamed(boolean useSameEm) { String deleteQuery = "Delete From StudentHBaseDate s where s.name=Vivek"; EntityManager em = emf.createEntityManager(); Query q = em.createQuery(deleteQuery); q.executeUpdate(); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseDate newStudent = em.find(StudentHBaseDate.class, getRandomValue(Date.class)); Assert.assertNull(newStudent); em.close(); } /** * @return */ private void updateNamed(boolean useSameEm) { EntityManager em = emf.createEntityManager(); String updateQuery = "Update StudentHBaseDate s SET s.name=Vivek where s.name=Amresh"; Query q = em.createQuery(updateQuery); q.executeUpdate(); if (!useSameEm) { em.close(); em = emf.createEntityManager(); } StudentHBaseDate newStudent = em.find(StudentHBaseDate.class, getRandomValue(Date.class)); Assert.assertNotNull(newStudent); Assert.assertEquals(getRandomValue(short.class), newStudent.getAge()); Assert.assertEquals("Vivek", newStudent.getName()); em.close(); } private void findByNameAndAGEBetween() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Amresh and s.age between " + getPartialValue(short.class) + " and " + getMaxValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getRandomValue(Date.class), student.getId()); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } private void findByNameAndAgeGTAndLT() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Amresh and s.age > " + getPartialValue(short.class) + " and s.age < " + getMaxValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getRandomValue(Date.class), student.getId()); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } private void findByNameAndAgeGTEQAndLTEQ() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Kuldeep and s.age >= " + getPartialValue(short.class) + " and s.age <= " + getMaxValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(2, students.size()); count = 0; for (StudentHBaseDate student : students) { if (student.getId().equals(getMaxValue(Date.class))) { Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals("Kuldeep", student.getName()); count++; } else { Assert.assertEquals(getMinValue(Date.class), student.getId()); Assert.assertEquals(getPartialValue(short.class), student.getAge()); Assert.assertEquals(getMinValue(String.class), student.getName()); count++; } } Assert.assertEquals(2, count); em.close(); } private void findByAge() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.age = " + getRandomValue(short.class); q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(1, students.size()); count = 0; for (StudentHBaseDate student : students) { Assert.assertEquals(getRandomValue(Date.class), student.getId()); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); count++; } Assert.assertEquals(1, count); em.close(); } /** * */ private void findByName() { EntityManager em; String query; Query q; List<StudentHBaseDate> students; int count; em = emf.createEntityManager(); query = "Select s From StudentHBaseDate s where s.name = Kuldeep"; q = em.createQuery(query); students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(2, students.size()); count = 0; for (StudentHBaseDate student : students) { if (student.getId().equals(getMaxValue(Date.class))) { Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals("Kuldeep", student.getName()); count++; } else { Assert.assertEquals(getMinValue(Date.class), student.getId()); Assert.assertEquals(getPartialValue(short.class), student.getAge()); Assert.assertEquals(getMinValue(String.class), student.getName()); count++; } } Assert.assertEquals(2, count); em.close(); } /** * */ private void findAllQuery() { EntityManager em = emf.createEntityManager(); // Selet all query. String query = "Select s From StudentHBaseDate s "; Query q = em.createQuery(query); List<StudentHBaseDate> students = q.getResultList(); Assert.assertNotNull(students); Assert.assertEquals(3, students.size()); int count = 0; for (StudentHBaseDate student : students) { if (student.getId().equals(getMaxValue(Date.class))) { Assert.assertEquals(getMaxValue(short.class), student.getAge()); Assert.assertEquals("Kuldeep", student.getName()); count++; } else if (student.getId().equals(getMinValue(Date.class))) { Assert.assertEquals(getPartialValue(short.class), student.getAge()); Assert.assertEquals(getMinValue(String.class), student.getName()); count++; } else { Assert.assertEquals(((Date) getRandomValue(Date.class)).getTime(), student.getId().getTime()); Assert.assertEquals(getRandomValue(short.class), student.getAge()); Assert.assertEquals(getRandomValue(String.class), student.getName()); count++; } } Assert.assertEquals(3, count); em.close(); } public void startCluster() { cli = new HBaseCli(); cli.startCluster(); } public void stopCluster() { cli.stopCluster(); } public void createSchema() { cli.createTable(keyspace, table); } public void dropSchema() { cli.dropTable(keyspace); } }
7d142272fcd4bfce8510c6dc77581098cc84d617
b4dceeb3c50cdc978aaa684d6529ce859e851208
/src/main/java/kklazy/hrc/model/Vote.java
779fec5f951ae44ef716e30c9b4a416c1cb82e8a
[]
no_license
runzhaoli/wechat
e5923ca822b03a09aa159c5287072f33a653f671
34b47dc076e7edcf803b7113222ac9e3ef8ff82b
refs/heads/master
2020-04-20T14:23:52.438348
2019-02-03T01:21:04
2019-02-03T01:21:04
168,896,964
0
0
null
null
null
null
UTF-8
Java
false
false
3,719
java
/** * */ package kklazy.hrc.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import javax.persistence.Transient; import kklazy.persistence.model.DefaultModel; /** * @author kk * */ @Entity @Table(name = "HRC_VOTE") public class Vote extends DefaultModel { /** * */ private static final long serialVersionUID = -8677009833442233194L; private String type; // 投票类型 private String empno; // 工号、团队编号 private String name; // 姓名、团队名称 private String dept; // 部门 private String project; // 所在项目 private String description; // 事迹介绍 private String declaration; // 个人宣言 private String recommend; // 推荐词 private String reference; // 推荐人 private Integer total; // 总票数 private float percent = 0;// 总票数百分比 private String today; // 当天已投 /** * @return the type */ @Column(name = "TYPE") public String getType() { return type; } /** * @param type the type to set */ public void setType(String type) { this.type = type; } /** * @return the empno */ @Column(name = "EMPNO") public String getEmpno() { return empno; } /** * @param empno the empno to set */ public void setEmpno(String empno) { this.empno = empno; } /** * @return the name */ @Column(name = "NAME") public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the dept */ @Column(name = "DEPARTMENT") public String getDept() { return dept; } /** * @param dept the dept to set */ public void setDept(String dept) { this.dept = dept; } /** * @return the project */ @Column(name = "PROJECT_NAME") public String getProject() { return project; } /** * @param project the project to set */ public void setProject(String project) { this.project = project; } /** * @return the description */ @Column(name = "DESCRIPTION", length = 4096) public String getDescription() { return description; } /** * @param description the description to set */ public void setDescription(String description) { this.description = description; } /** * @return the declaration */ @Column(name = "DECLARATION", length = 4096) public String getDeclaration() { return declaration; } /** * @param declaration the declaration to set */ public void setDeclaration(String declaration) { this.declaration = declaration; } /** * @return the recommend */ @Column(name = "RECOMMEND", length = 4096) public String getRecommend() { return recommend; } /** * @param recommend the recommend to set */ public void setRecommend(String recommend) { this.recommend = recommend; } /** * @return the reference */ @Column(name = "REFERENCE") public String getReference() { return reference; } /** * @param reference the reference to set */ public void setReference(String reference) { this.reference = reference; } /** * @return the total */ @Transient public Integer getTotal() { return total == null ? 0 : total; } /** * @param total the total to set */ public void setTotal(Integer total) { this.total = total; } /** * @return the percent */ @Transient public float getPercent() { return percent; } /** * @param percent the percent to set */ public void setPercent(float percent) { this.percent = percent; } /** * @return the today */ @Transient public String getToday() { return today; } /** * @param today the today to set */ public void setToday(String today) { this.today = today; } }
7037cad9b4dcaf6af0d6707754d942e4c624e12c
9c422dc4c660e69f91a97d385f51f7ff36aa7d6d
/microservicecloud-provider-dept-8001/src/main/java/pers/hanco/springcloud/controller/DeptController.java
5767c9c98d364db51111e891d1988bd859de99e3
[]
no_license
HancoZou/springclouddemo
3f0a883216f9f38119ad6fa78078f7683d9632bd
49b34bfacf93059f38f4d80e601d9c24463f1529
refs/heads/master
2022-06-25T19:23:10.144304
2019-06-26T15:51:00
2019-06-26T15:51:00
193,933,031
0
0
null
2020-10-13T14:10:41
2019-06-26T15:37:37
Java
UTF-8
Java
false
false
1,774
java
package pers.hanco.springcloud.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.web.bind.annotation.*; import pers.hanco.springcloud.entity.Dept; import pers.hanco.springcloud.service.DeptService; import java.util.List; /** * @author Hanco on 2019/6/13 */ @RestController public class DeptController { @Autowired private DeptService deptService; @Autowired private DiscoveryClient discoveryClient; @RequestMapping(value = "/dept/add", method = RequestMethod.POST) public boolean add(@RequestBody Dept dept) { return deptService.add(dept); } @RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET) public Dept get(@PathVariable("id") Long id) { Dept dept = deptService.get(id); if (dept == null) { throw new RuntimeException("该id:" + id + "没有对应的信息"); } return dept; } @RequestMapping(value = "/dept/list", method = RequestMethod.GET) public List<Dept> list() { return deptService.list(); } @RequestMapping(value = "/dept/discovery", method = RequestMethod.GET) public Object discovery() { List<String> list = discoveryClient.getServices(); System.out.println(">>>>>>>>>>>>>>" + list); List<ServiceInstance> instanceList = discoveryClient.getInstances("MICROSERVICECLOUD-DEPT"); instanceList.forEach(instance -> System.out.println(instance.getServiceId() + "\t" + instance.getHost() + "\t" + instance.getPort() + "\t" + instance.getUri())); return this.discoveryClient; } }
a2fbf622dec91bebd2b7669225f08466824c2ae1
72235fcbdf4a4f6051031a8f8d34c35f0a601386
/src/main/java/com/example/votedemo/mapper/CheerLeadingMapper.java
75b1f97a6b3a5fb10491d272d120af954f984a65
[]
no_license
1234zhang/votedemo
5328e75b2c57a124c4d300c465684a860f6e93ec
d31025c8775cc1d0049c0a855245b9f894d073c5
refs/heads/master
2020-05-15T18:26:44.269725
2019-04-20T16:10:25
2019-04-20T16:10:25
182,426,812
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package com.example.votedemo.mapper; import com.example.votedemo.entity.CheerLeadingEntity; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; import java.util.List; /** * @author Brandon. * @date 2019/4/18. * @time 10:11. */ @Mapper @Repository public interface CheerLeadingMapper { @Update("update cheerleading set local_vote = local_vote + 1 where college = #{college}") boolean updateLocal(String college); @Update("update cheerleading set other_vote = other_vote + 1 where college = #{college}") boolean updateOther(String college); @Select("select * from cheerleading where (college = #{college})") boolean checkCheerleading(String college); @Select("select * from cheerleading") @Results({ @Result(property = "localVote",column = "local_vote"), @Result(property = "otherVote",column = "other_vote") }) List<CheerLeadingEntity> getCheer(); }
e1edffc1458b78ecb28d198e08bbb9646e90e377
fd50c95a052c6e235b110ba895a76b10ca9ce724
/app/src/main/java/com/example/blesscom/kamusisyarat/GetDataAdapter.java
2c9ce559c2d7c8612f4d52b0fe42139942109487
[]
no_license
Tikaoktavia/Kamussibi
61fa4067f13a1b58a8301c50acae61602c1bf45a
58e6339bcb4674f240bd115f28625d3a6a2fd0da
refs/heads/master
2021-01-23T04:44:20.146202
2017-05-31T11:56:57
2017-05-31T11:56:57
92,939,477
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package com.example.blesscom.kamusisyarat; /** * Created by JUNED on 6/16/2016. */ public class GetDataAdapter { public String ImageServerUrl; public String ImageTitleName; public String getImageServerUrl() { return ImageServerUrl; } public void setImageServerUrl(String imageServerUrl) { this.ImageServerUrl = imageServerUrl; } public String getImageTitleName() { return ImageTitleName; } public void setImageTitleNamee(String Imagetitlename) { this.ImageTitleName = Imagetitlename; } }
50ebea7ca02e1df13a972fe6a843374be099a104
a515d6daa3f2d8ee70ebc333c07caabd90e7eb6a
/src/com/download/app/MainActivity.java
013ecd350ae89d02673d546e0d4e98fa54fa8803
[]
no_license
cat996/Download_demo
eb93948aad302041e7b521e5d4b762ac2d093ce9
6cfb7a9606fe9ca799f6cff1c5b075927660e9ef
refs/heads/master
2020-04-18T12:29:19.518593
2016-08-24T14:00:39
2016-08-24T14:00:39
66,468,679
0
0
null
null
null
null
GB18030
Java
false
false
2,077
java
package com.download.app; import com.download.entities.FileInfo; import com.download.services.DownloadService; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; public class MainActivity extends Activity { private TextView mTvFileName=null; private ProgressBar mPbProgress=null; private Button mBtStop=null; private Button mBtStart=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTvFileName=(TextView) findViewById(R.id.tvFileName); mPbProgress=(ProgressBar) findViewById(R.id.pbProgress); mBtStop=(Button) findViewById(R.id.btStop); mBtStart=(Button) findViewById(R.id.btStart); //创建一个文件实体类对象 final FileInfo fileInfo=new FileInfo(0, //"http://sw.bos.baidu.com/sw-search-sp/software/dcef3f16cf0c4/kugou_8.0.73.19052_setup.exe", "http://dlsw.baidu.com/sw-search-sp/soft/3f/12289/Weibo.4.5.3.37575common_wbupdate.1423811415.exe", "Weibo.4.5.3.37575common_wbupdate.1423811415.exe",0,0);//id,路径,名字,长度,进度 mBtStart.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //通过intent传递参数给 service Intent intent=new Intent(MainActivity.this,DownloadService.class ); intent.setAction(DownloadService.ACTION_START); intent.putExtra("fileinfo", fileInfo); startService(intent); } }); mBtStop.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { //通过intent传递参数给 service Intent intent=new Intent(MainActivity.this,DownloadService.class ); intent.setAction(DownloadService.ACTION_STOP); intent.putExtra("fileinfo", fileInfo); startService(intent); } }); } }
4016a60f17447061027fe11d033e8bab8d59a012
d5ac37c854c182ba2997ceee6acc40d052c9c3a5
/src/test/java/com/learnreactivespring/learnreactivespring/fluxandmonoplaygraound/FluxAndMonoFactoryTest.java
cf039d1ac25d050bc91022ac0e4aa3bf1aed71c7
[]
no_license
guvenbe/learn-reactivespring
06bb2364962e89f25277d6c84752167f878c473f
2373d2fec63b1d06b2c54df3439892c7f2a9afea
refs/heads/master
2023-01-24T18:48:56.137529
2020-12-07T06:46:12
2020-12-07T06:46:12
319,203,102
0
0
null
null
null
null
UTF-8
Java
false
false
2,039
java
package com.learnreactivespring.learnreactivespring.fluxandmonoplaygraound; import org.junit.Test; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Supplier; public class FluxAndMonoFactoryTest { List<String> names = Arrays.asList("adam", "anna", "jack", "jenny"); @Test public void flusUsingIterable() { Flux<String> namesFlux = Flux.fromIterable(names).log(); StepVerifier.create(namesFlux) .expectNext("adam", "anna", "jack", "jenny") .verifyComplete(); } @Test public void fluxUsingArray() { String[] names = new String[]{"adam", "anna", "jack", "jenny"}; Flux<String> namesFlux = Flux.fromArray(names).log(); StepVerifier.create(namesFlux) .expectNext("adam", "anna", "jack", "jenny") .verifyComplete(); } @Test public void fluxUsingStreamTest() { Flux<String> namesFlux = Flux.fromStream(names.stream()); StepVerifier.create(namesFlux) .expectNext("adam", "anna", "jack", "jenny") .verifyComplete(); } @Test public void monoUsingJustOreEmpty() { Mono<String> mono = Mono.justOrEmpty(null); StepVerifier.create(mono.log()) .verifyComplete(); } @Test public void monoUsingSupplierTest() { Supplier<String> stringSupplier = () -> "adam"; Mono<String> stringMono = Mono.fromSupplier(stringSupplier); System.out.println(stringSupplier.get()); StepVerifier.create(stringMono.log()) .expectNext("adam") .verifyComplete(); } @Test public void fluxUsingRangeTest() { Flux<Integer> integerFlux = Flux.range(1, 5).log(); StepVerifier.create(integerFlux) .expectNext(1,2,3,4,5) .verifyComplete(); } }
9ece251cd0de6500084e780b3a8b061a92319a69
db36ae2d06185137ac733fe1f14b5f7fe30b0059
/mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/storefront/ProductClient.java
58383d563ae4c118f0dc19f8451ae3cc2d8622c8
[ "MIT" ]
permissive
VeerendraMarni/mozu-java
dcc20b0df05c15f08aa82753afd2e2163ee64f0b
6cc24536969ef748b374ed915c9e52adbd337780
refs/heads/master
2023-04-08T07:44:25.539154
2018-06-13T12:02:15
2018-06-13T12:02:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
32,310
java
/** * This code was auto-generated by a Codezu. * * Changes to this file may cause incorrect behavior and will be lost if * the code is regenerated. */ package com.mozu.api.clients.commerce.catalog.storefront; import java.util.List; import java.util.ArrayList; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; import com.mozu.api.Headers; import org.joda.time.DateTime; import com.mozu.api.AsyncCallback; import java.util.concurrent.CountDownLatch; import com.mozu.api.security.AuthTicket; import org.apache.commons.lang.StringUtils; import com.mozu.api.DataViewMode; /** <summary> * Use the Storefront Products resource to manage the shopper product selection process during a visit to the web storefront. You can update product options as shoppers pick and choose their product choices. A shopper cannot add a product to a cart until all of its required options have been selected. * </summary> */ public class ProductClient { /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductCollection> mozuClient=GetProductsClient(dataViewMode); * client.setBaseAddress(url); * client.executeRequest(); * ProductCollection productCollection = client.Result(); * </code></pre></p> * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductCollection> * @see com.mozu.api.contracts.productruntime.ProductCollection */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductCollection> getProductsClient(com.mozu.api.DataViewMode dataViewMode) throws Exception { return getProductsClient(dataViewMode, null, null, null, null, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductCollection> mozuClient=GetProductsClient(dataViewMode, filter, startIndex, pageSize, sortBy, responseOptions, cursorMark, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * ProductCollection productCollection = client.Result(); * </code></pre></p> * @param cursorMark In your first deep paged request, set this parameter to . Then, in all subsequent requests, set this parameter to the subsequent values of that's returned in each response to continue paging through the results. Continue this pattern until is null, which signifies the end of the paged results. * @param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters. * @param pageSize When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with this parameter set to 25, to get the 51st through the 75th items, set startIndex to 50. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param responseOptions Options you can specify for the response. This parameter is null by default.You can primarily use this parameter to return volume price band information in product details, which you can then display on category pages and search results depanding on your theme configuration. To return volume price band information, set this parameter to . * @param sortBy The element to sort the results by and the channel in which the results appear. Either ascending (a-z) or descending (z-a) channel. Optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for more information. * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with pageSize set to 25, to get the 51st through the 75th items, set this parameter to 50. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductCollection> * @see com.mozu.api.contracts.productruntime.ProductCollection */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductCollection> getProductsClient(com.mozu.api.DataViewMode dataViewMode, String filter, Integer startIndex, Integer pageSize, String sortBy, String responseOptions, String cursorMark, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductsUrl(cursorMark, filter, pageSize, responseFields, responseOptions, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productruntime.ProductCollection.class; MozuClient<com.mozu.api.contracts.productruntime.ProductCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.ProductCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient=GetProductInventoryClient(dataViewMode, productCode); * client.setBaseAddress(url); * client.executeRequest(); * LocationInventoryCollection locationInventoryCollection = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.LocationInventoryCollection> * @see com.mozu.api.contracts.productruntime.LocationInventoryCollection */ public static MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> getProductInventoryClient(com.mozu.api.DataViewMode dataViewMode, String productCode) throws Exception { return getProductInventoryClient(dataViewMode, productCode, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient=GetProductInventoryClient(dataViewMode, productCode, locationCodes, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * LocationInventoryCollection locationInventoryCollection = client.Result(); * </code></pre></p> * @param locationCodes Array of location codes for which to retrieve product inventory information. * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.LocationInventoryCollection> * @see com.mozu.api.contracts.productruntime.LocationInventoryCollection */ public static MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> getProductInventoryClient(com.mozu.api.DataViewMode dataViewMode, String productCode, String locationCodes, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductInventoryUrl(locationCodes, productCode, responseFields); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productruntime.LocationInventoryCollection.class; MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient=GetProductClient(dataViewMode, productCode); * client.setBaseAddress(url); * client.executeRequest(); * Product product = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.Product> * @see com.mozu.api.contracts.productruntime.Product */ public static MozuClient<com.mozu.api.contracts.productruntime.Product> getProductClient(com.mozu.api.DataViewMode dataViewMode, String productCode) throws Exception { return getProductClient(dataViewMode, productCode, null, null, null, null, null, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient=GetProductClient(dataViewMode, productCode, variationProductCode, allowInactive, skipInventoryCheck, supressOutOfStock404, quantity, acceptVariantProductCode, purchaseLocation, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Product product = client.Result(); * </code></pre></p> * @param acceptVariantProductCode Specifies whether to accept a product variant's code as the .When you set this parameter to , you can pass in a product variant's code in the GetProduct call to retrieve the product variant details that are associated with the base product. * @param allowInactive If true, allow inactive categories to be retrieved in the category list response. If false, the categories retrieved will not include ones marked inactive. * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param purchaseLocation The location where the order item(s) was purchased. * @param quantity The number of cart items in the shopper's active cart. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param skipInventoryCheck If true, skip the process to validate inventory when creating this product reservation. * @param supressOutOfStock404 Specifies whether to supress the 404 error when the product is out of stock. * @param variationProductCode Merchant-created code associated with a specific product variation. Variation product codes maintain an association with the base product code. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.Product> * @see com.mozu.api.contracts.productruntime.Product */ public static MozuClient<com.mozu.api.contracts.productruntime.Product> getProductClient(com.mozu.api.DataViewMode dataViewMode, String productCode, String variationProductCode, Boolean allowInactive, Boolean skipInventoryCheck, Boolean supressOutOfStock404, Integer quantity, Boolean acceptVariantProductCode, String purchaseLocation, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductUrl(acceptVariantProductCode, allowInactive, productCode, purchaseLocation, quantity, responseFields, skipInventoryCheck, supressOutOfStock404, variationProductCode); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productruntime.Product.class; MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.Product>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient=GetProductForIndexingClient(dataViewMode, productCode); * client.setBaseAddress(url); * client.executeRequest(); * Product product = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.Product> * @see com.mozu.api.contracts.productruntime.Product */ public static MozuClient<com.mozu.api.contracts.productruntime.Product> getProductForIndexingClient(com.mozu.api.DataViewMode dataViewMode, String productCode) throws Exception { return getProductForIndexingClient(dataViewMode, productCode, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient=GetProductForIndexingClient(dataViewMode, productCode, productVersion, lastModifiedDate, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * Product product = client.Result(); * </code></pre></p> * @param lastModifiedDate The date when the product was last updated. * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param productVersion The product version. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.Product> * @see com.mozu.api.contracts.productruntime.Product */ public static MozuClient<com.mozu.api.contracts.productruntime.Product> getProductForIndexingClient(com.mozu.api.DataViewMode dataViewMode, String productCode, Long productVersion, DateTime lastModifiedDate, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductForIndexingUrl(lastModifiedDate, productCode, productVersion, responseFields); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productruntime.Product.class; MozuClient<com.mozu.api.contracts.productruntime.Product> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.Product>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct> mozuClient=ConfiguredProductClient( productOptionSelections, productCode); * client.setBaseAddress(url); * client.executeRequest(); * ConfiguredProduct configuredProduct = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param productOptionSelections For a product with shopper-configurable options, the properties of the product options selected by the shopper. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ConfiguredProduct> * @see com.mozu.api.contracts.productruntime.ConfiguredProduct * @see com.mozu.api.contracts.productruntime.ProductOptionSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct> configuredProductClient(com.mozu.api.contracts.productruntime.ProductOptionSelections productOptionSelections, String productCode) throws Exception { return configuredProductClient( productOptionSelections, productCode, null, null, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct> mozuClient=ConfiguredProductClient( productOptionSelections, productCode, includeOptionDetails, skipInventoryCheck, quantity, purchaseLocation, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * ConfiguredProduct configuredProduct = client.Result(); * </code></pre></p> * @param includeOptionDetails If true, the response returns details about the product. If false, returns a product summary such as the product name, price, and sale price. * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param purchaseLocation The location where the order item(s) was purchased. * @param quantity The number of cart items in the shopper's active cart. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param skipInventoryCheck If true, skip the process to validate inventory when creating this product reservation. * @param productOptionSelections For a product with shopper-configurable options, the properties of the product options selected by the shopper. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ConfiguredProduct> * @see com.mozu.api.contracts.productruntime.ConfiguredProduct * @see com.mozu.api.contracts.productruntime.ProductOptionSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct> configuredProductClient(com.mozu.api.contracts.productruntime.ProductOptionSelections productOptionSelections, String productCode, Boolean includeOptionDetails, Boolean skipInventoryCheck, Integer quantity, String purchaseLocation, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.configuredProductUrl(includeOptionDetails, productCode, purchaseLocation, quantity, responseFields, skipInventoryCheck); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productruntime.ConfiguredProduct.class; MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.ConfiguredProduct>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(productOptionSelections); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary> mozuClient=ValidateProductClient( productOptionSelections, productCode); * client.setBaseAddress(url); * client.executeRequest(); * ProductValidationSummary productValidationSummary = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param productOptionSelections For a product with shopper-configurable options, the properties of the product options selected by the shopper. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductValidationSummary> * @see com.mozu.api.contracts.productruntime.ProductValidationSummary * @see com.mozu.api.contracts.productruntime.ProductOptionSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary> validateProductClient(com.mozu.api.contracts.productruntime.ProductOptionSelections productOptionSelections, String productCode) throws Exception { return validateProductClient( productOptionSelections, productCode, null, null, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary> mozuClient=ValidateProductClient( productOptionSelections, productCode, skipInventoryCheck, quantity, skipDefaults, purchaseLocation, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * ProductValidationSummary productValidationSummary = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param purchaseLocation The location where the order item(s) was purchased. * @param quantity The number of cart items in the shopper's active cart. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param skipDefaults Normally, product validation applies default extras to products that do not have options specified. If , product validation does not apply default extras to products. * @param skipInventoryCheck If true, skip the process to validate inventory when creating this product reservation. * @param productOptionSelections For a product with shopper-configurable options, the properties of the product options selected by the shopper. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductValidationSummary> * @see com.mozu.api.contracts.productruntime.ProductValidationSummary * @see com.mozu.api.contracts.productruntime.ProductOptionSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary> validateProductClient(com.mozu.api.contracts.productruntime.ProductOptionSelections productOptionSelections, String productCode, Boolean skipInventoryCheck, Integer quantity, Boolean skipDefaults, String purchaseLocation, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.validateProductUrl(productCode, purchaseLocation, quantity, responseFields, skipDefaults, skipInventoryCheck); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productruntime.ProductValidationSummary.class; MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.ProductValidationSummary>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(productOptionSelections); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary> mozuClient=ValidateDiscountsClient( discountSelections, productCode); * client.setBaseAddress(url); * client.executeRequest(); * DiscountValidationSummary discountValidationSummary = client.Result(); * </code></pre></p> * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param discountSelections The discounts to evaluate for a specified product code at the time of purchase. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.DiscountValidationSummary> * @see com.mozu.api.contracts.productruntime.DiscountValidationSummary * @see com.mozu.api.contracts.productruntime.DiscountSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary> validateDiscountsClient(com.mozu.api.contracts.productruntime.DiscountSelections discountSelections, String productCode) throws Exception { return validateDiscountsClient( discountSelections, productCode, null, null, null, null, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary> mozuClient=ValidateDiscountsClient( discountSelections, productCode, variationProductCode, customerAccountId, allowInactive, skipInventoryCheck, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * DiscountValidationSummary discountValidationSummary = client.Result(); * </code></pre></p> * @param allowInactive If true, allow inactive categories to be retrieved in the category list response. If false, the categories retrieved will not include ones marked inactive. * @param customerAccountId The unique identifier of the customer account for which to retrieve wish lists. * @param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product. * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param skipInventoryCheck If true, skip the process to validate inventory when creating this product reservation. * @param variationProductCode Merchant-created code associated with a specific product variation. Variation product codes maintain an association with the base product code. * @param discountSelections The discounts to evaluate for a specified product code at the time of purchase. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.DiscountValidationSummary> * @see com.mozu.api.contracts.productruntime.DiscountValidationSummary * @see com.mozu.api.contracts.productruntime.DiscountSelections */ public static MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary> validateDiscountsClient(com.mozu.api.contracts.productruntime.DiscountSelections discountSelections, String productCode, String variationProductCode, Integer customerAccountId, Boolean allowInactive, Boolean skipInventoryCheck, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.validateDiscountsUrl(allowInactive, customerAccountId, productCode, responseFields, skipInventoryCheck, variationProductCode); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productruntime.DiscountValidationSummary.class; MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.DiscountValidationSummary>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(discountSelections); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection> mozuClient=GetProductCostsClient(dataViewMode, query); * client.setBaseAddress(url); * client.executeRequest(); * ProductCostCollection productCostCollection = client.Result(); * </code></pre></p> * @param query Properties for the product location inventory provided for queries to locate products by their location. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductCostCollection> * @see com.mozu.api.contracts.productruntime.ProductCostCollection * @see com.mozu.api.contracts.productruntime.ProductCostQuery */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection> getProductCostsClient(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productruntime.ProductCostQuery query) throws Exception { return getProductCostsClient(dataViewMode, query, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection> mozuClient=GetProductCostsClient(dataViewMode, query, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * ProductCostCollection productCostCollection = client.Result(); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param query Properties for the product location inventory provided for queries to locate products by their location. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.ProductCostCollection> * @see com.mozu.api.contracts.productruntime.ProductCostCollection * @see com.mozu.api.contracts.productruntime.ProductCostQuery */ public static MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection> getProductCostsClient(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productruntime.ProductCostQuery query, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductCostsUrl(responseFields); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productruntime.ProductCostCollection.class; MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.ProductCostCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(query); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient=GetProductInventoriesClient(dataViewMode, query); * client.setBaseAddress(url); * client.executeRequest(); * LocationInventoryCollection locationInventoryCollection = client.Result(); * </code></pre></p> * @param query Properties for the product location inventory provided for queries to locate products by their location. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.LocationInventoryCollection> * @see com.mozu.api.contracts.productruntime.LocationInventoryCollection * @see com.mozu.api.contracts.productruntime.LocationInventoryQuery */ public static MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> getProductInventoriesClient(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productruntime.LocationInventoryQuery query) throws Exception { return getProductInventoriesClient(dataViewMode, query, null); } /** * * <p><pre><code> * MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient=GetProductInventoriesClient(dataViewMode, query, responseFields); * client.setBaseAddress(url); * client.executeRequest(); * LocationInventoryCollection locationInventoryCollection = client.Result(); * </code></pre></p> * @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss. * @param query Properties for the product location inventory provided for queries to locate products by their location. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productruntime.LocationInventoryCollection> * @see com.mozu.api.contracts.productruntime.LocationInventoryCollection * @see com.mozu.api.contracts.productruntime.LocationInventoryQuery */ public static MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> getProductInventoriesClient(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productruntime.LocationInventoryQuery query, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.storefront.ProductUrl.getProductInventoriesUrl(responseFields); String verb = "POST"; Class<?> clz = com.mozu.api.contracts.productruntime.LocationInventoryCollection.class; MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productruntime.LocationInventoryCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(query); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); return mozuClient; } }
03ce73cd4846d921a33e1dfa5c82ed1ec25e8bb1
af16c1e86590035bbd0e395b17a0849b14b4f073
/src/main/java/com/rogue/logore/listener/listeners/BlockListener.java
c5be558cadd8f0b7574d2078cf8246eaa6697efe
[]
no_license
1Rogue/LogOre
42b0b2d4d6660df74ad9135729411cdcc3e89ef2
b88118473de6f9cc1ef5008e410e5393cf314ad0
refs/heads/master
2016-09-06T16:39:46.528192
2014-01-19T09:28:51
2014-01-19T09:28:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,226
java
/* * Copyright (C) 2013 Spencer Alderman * * 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/>. */ package com.rogue.logore.listener.listeners; import com.rogue.logore.LogOre; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; /** * Monitors mined blocks * * @since 1.0.0 * @author 1Rogue * @version 1.0.0 */ public class BlockListener implements Listener { private final LogOre plugin; public BlockListener(LogOre plugin) { this.plugin = plugin; } @EventHandler public void onBlockBreak(BlockBreakEvent event) { } }
60914ffcd92dcefeb96e128a53f0c1bdd4dc1591
7f370d4257fa0f4ec8a4788627232bda81f701d8
/wochacha/build/generated/source/r/debug/com/handmark/pulltorefresh/library/R.java
d85a9900afa3323107362f58c3ca359d283e14d3
[]
no_license
Frankenjoy123/yunsoo-android
57bdd266ea497d04d264073d3ef024e41446f9df
49b5c33ff41679f13659e044d1a41915e67fa910
refs/heads/master
2021-01-18T02:21:16.475313
2015-04-26T16:30:57
2015-04-26T16:31:01
34,719,641
0
0
null
2015-04-28T08:54:44
2015-04-28T08:54:44
null
UTF-8
Java
false
false
5,613
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.handmark.pulltorefresh.library; public final class R { public static final class anim { public static final int slide_in_from_bottom = 0x7f040000; public static final int slide_in_from_top = 0x7f040001; public static final int slide_out_to_bottom = 0x7f040002; public static final int slide_out_to_top = 0x7f040003; } public static final class attr { public static final int ptrAdapterViewBackground = 0x7f01001d; public static final int ptrAnimationStyle = 0x7f010019; public static final int ptrDrawable = 0x7f010013; public static final int ptrDrawableBottom = 0x7f01001f; public static final int ptrDrawableEnd = 0x7f010015; public static final int ptrDrawableStart = 0x7f010014; public static final int ptrDrawableTop = 0x7f01001e; public static final int ptrHeaderBackground = 0x7f01000e; public static final int ptrHeaderSubTextColor = 0x7f010010; public static final int ptrHeaderTextAppearance = 0x7f010017; public static final int ptrHeaderTextColor = 0x7f01000f; public static final int ptrListViewExtrasEnabled = 0x7f01001b; public static final int ptrMode = 0x7f010011; public static final int ptrOverScroll = 0x7f010016; public static final int ptrRefreshableViewBackground = 0x7f01000d; public static final int ptrRotateDrawableWhilePulling = 0x7f01001c; public static final int ptrScrollingWhileRefreshingEnabled = 0x7f01001a; public static final int ptrShowIndicator = 0x7f010012; public static final int ptrSubHeaderTextAppearance = 0x7f010018; } public static final class dimen { public static final int header_footer_left_right_padding = 0x7f08000f; public static final int header_footer_top_bottom_padding = 0x7f080010; public static final int indicator_corner_radius = 0x7f080011; public static final int indicator_internal_padding = 0x7f080012; public static final int indicator_right_padding = 0x7f080013; } public static final class drawable { public static final int default_ptr_flip = 0x7f02000e; public static final int default_ptr_rotate = 0x7f02000f; public static final int indicator_arrow = 0x7f020040; public static final int indicator_bg_bottom = 0x7f020044; public static final int indicator_bg_top = 0x7f020045; } public static final class id { public static final int both = 0x7f090011; public static final int disabled = 0x7f090012; public static final int fl_inner = 0x7f090087; public static final int flip = 0x7f090018; public static final int gridview = 0x7f090007; public static final int manualOnly = 0x7f090013; public static final int pullDownFromTop = 0x7f090014; public static final int pullFromEnd = 0x7f090015; public static final int pullFromStart = 0x7f090016; public static final int pullUpFromBottom = 0x7f090017; public static final int pull_to_refresh_image = 0x7f090084; public static final int pull_to_refresh_progress = 0x7f090083; public static final int pull_to_refresh_sub_text = 0x7f090088; public static final int pull_to_refresh_text = 0x7f090085; public static final int rotate = 0x7f090019; public static final int scrollview = 0x7f09000c; public static final int webview = 0x7f090010; } public static final class layout { public static final int pull_to_refresh_header_horizontal = 0x7f030019; public static final int pull_to_refresh_header_vertical = 0x7f03001a; } public static final class string { public static final int pull_to_refresh_from_bottom_pull_label = 0x7f0b002d; public static final int pull_to_refresh_from_bottom_refreshing_label = 0x7f0b002e; public static final int pull_to_refresh_from_bottom_release_label = 0x7f0b002f; public static final int pull_to_refresh_pull_label = 0x7f0b0030; public static final int pull_to_refresh_refreshing_label = 0x7f0b0031; public static final int pull_to_refresh_release_label = 0x7f0b0032; } public static final class styleable { public static final int[] PullToRefresh = { 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01001e, 0x7f01001f }; public static final int PullToRefresh_ptrAdapterViewBackground = 16; public static final int PullToRefresh_ptrAnimationStyle = 12; public static final int PullToRefresh_ptrDrawable = 6; public static final int PullToRefresh_ptrDrawableBottom = 18; public static final int PullToRefresh_ptrDrawableEnd = 8; public static final int PullToRefresh_ptrDrawableStart = 7; public static final int PullToRefresh_ptrDrawableTop = 17; public static final int PullToRefresh_ptrHeaderBackground = 1; public static final int PullToRefresh_ptrHeaderSubTextColor = 3; public static final int PullToRefresh_ptrHeaderTextAppearance = 10; public static final int PullToRefresh_ptrHeaderTextColor = 2; public static final int PullToRefresh_ptrListViewExtrasEnabled = 14; public static final int PullToRefresh_ptrMode = 4; public static final int PullToRefresh_ptrOverScroll = 9; public static final int PullToRefresh_ptrRefreshableViewBackground = 0; public static final int PullToRefresh_ptrRotateDrawableWhilePulling = 15; public static final int PullToRefresh_ptrScrollingWhileRefreshingEnabled = 13; public static final int PullToRefresh_ptrShowIndicator = 5; public static final int PullToRefresh_ptrSubHeaderTextAppearance = 11; } }
aea8795c31b5fc979f69864a94ffa1e9132bea57
e4653a80a387958a71fcfedd21a4830fd2d726b6
/app/src/main/java/com/sport/fragment/notification_fragment/SportSelectNotiFragment.java
acf82775b9a196c51263edc1c0431a3fc2bc2041
[]
no_license
xuxw666/Sport
853915688f65e8aa389b84c59df9a037d9865cfd
d7e67b2402387d4030ca5cb67960d7fadb3545df
refs/heads/master
2021-01-11T18:18:14.968715
2016-10-04T05:41:13
2016-10-04T05:41:13
69,339,121
0
0
null
null
null
null
UTF-8
Java
false
false
1,286
java
package com.sport.fragment.notification_fragment; import android.os.Bundle; import android.view.GestureDetector; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import android.widget.TextView; import com.sport.R; import com.sport.util.LogUtil; /** * Created by xxw on 2016/9/25. */ public class SportSelectNotiFragment extends BaseNotiFragment { private View rootView; public View onCreateView(LayoutInflater layoutInflater,ViewGroup container,Bundle savedInstanceState){ rootView = layoutInflater.inflate(R.layout.paobu_noti_select_sport_fragment,container,false); setBackButton((TextView)rootView.findViewById(R.id.back_to_fragment)); setDefault(); LogUtil.debug(this.getClass(), "SportSelect fragment is created"); return rootView; } private GestureDetector mGestureDetector; private RelativeLayout root; private void setDefault(){ root = (RelativeLayout)rootView.findViewById(R.id.root); root.setOnTouchListener(this); root.setLongClickable(true); mGestureDetector = new GestureDetector((GestureDetector.OnGestureListener) this); super.setmGestureDetector(mGestureDetector); } }
3cd1322e4ca6a99330524dfcd7db1e25e37119ac
6226f629c02cd357ad423b8414520fe1533b33f5
/00_framework/core/src/main/java/com/bizzan/bitrade/entity/WebsiteInformation.java
bea8b2de3124cb3220aa55905c30945037ec59e9
[ "Apache-2.0" ]
permissive
weixuefeng/CoinExchange
e915d38fe5b77b8546273a03a0331964ff251c99
42ac6457f3fb0351beebe1478b0db4f1ac0f8d70
refs/heads/master
2023-01-13T06:24:58.827013
2020-11-21T18:48:29
2020-11-21T18:48:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
972
java
package com.bizzan.bitrade.entity; import lombok.Data; import javax.persistence.*; /** * @author Hevin QQ:390330302 E-mail:[email protected] * @description * @date 2018/1/25 17:19 */ @Entity @Data @Table(name = "website_information") public class WebsiteInformation { @Id private Long id; /** * 名称 */ private String name; /** * logo */ private String logo; /** * 地址栏图标 */ private String addressIcon; /** * 网站网址 */ private String url; /** * 关键词 */ private String keywords; /** * 描述 */ private String description; /** * 版权信息 */ private String copyright; /** * 邮编 */ private String postcode; /** * 联系方式 */ private String contact; /** * 其他信息 */ @Column(columnDefinition = "TEXT") private String otherInformation; }
a337e03679217faac76ce313cb3e93e526f9293a
41ed21f7980a258b2fc89f32adebcf34ad5ccf2c
/boecshopejb2-ejb/src/java/entities/Electronic.java
b002652d952f6709551d85f23c99e5c7770a082c
[]
no_license
ITWall/boecshopejb
f4fce2c564494b518f6cceba897acd23b60f06a4
82979c92ff7dea8893f305a7fbb435681ca6ec53
refs/heads/master
2020-03-11T00:49:21.869830
2018-04-16T02:25:26
2018-04-16T02:25:26
129,672,834
0
0
null
null
null
null
UTF-8
Java
false
false
3,091
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 entities; import java.io.Serializable; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; /** * * @author nguye */ @Entity @Table(name = "electronic") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Electronic.findAll", query = "SELECT e FROM Electronic e") , @NamedQuery(name = "Electronic.findById", query = "SELECT e FROM Electronic e WHERE e.id = :id") , @NamedQuery(name = "Electronic.findByDiscriminator", query = "SELECT e FROM Electronic e WHERE e.discriminator = :discriminator")}) public class Electronic implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "ID") private Integer id; @Basic(optional = false) @NotNull @Size(min = 1, max = 255) @Column(name = "Discriminator") private String discriminator; @JoinColumn(name = "ProductID", referencedColumnName = "ID") @ManyToOne(optional = false) private Product productID; public Electronic() { } public Electronic(Integer id) { this.id = id; } public Electronic(Integer id, String discriminator) { this.id = id; this.discriminator = discriminator; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getDiscriminator() { return discriminator; } public void setDiscriminator(String discriminator) { this.discriminator = discriminator; } public Product getProductID() { return productID; } public void setProductID(Product productID) { this.productID = productID; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Electronic)) { return false; } Electronic other = (Electronic) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "entities.Electronic[ id=" + id + " ]"; } }
b2e97a551712f115deb6d9f06f55373b684c21ec
269afbb6ee62399139879232e84bc63b3653f4b9
/login/src/main/java/com/tona/login/service/MyAppUserDetailsService.java
04726e11dd21c1ed88b7f012639e69f641924484
[]
no_license
tonabarrera/java
452ea46f9d23203d9c2c0bfd9f3d30264e8af834
794e1e96fb2ec3dc2b11aefaa132f68bf7c5bc24
refs/heads/master
2021-03-30T18:06:54.122595
2018-05-12T20:22:58
2018-05-12T20:22:58
123,817,867
0
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package com.tona.login.service; import com.tona.login.entity.Login; import com.tona.login.repository.LoginRepository; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import java.util.HashSet; import java.util.Set; @Service("userService") public class MyAppUserDetailsService implements UserDetailsService { public static final Log LOG = LogFactory.getLog(MyAppUserDetailsService.class); @Autowired @Qualifier("loginRepository") private LoginRepository loginRepository; @Override public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { LOG.info("loadUserByUsername() email = " + s); Login login = loginRepository.findByCorreo(s); Set<GrantedAuthority> grantedAuthorities = new HashSet<>(); if (login != null) grantedAuthorities.add(new SimpleGrantedAuthority(login.getPersonal().getTipo())); return new User(login.getCorreo(), login.getPasswordhash(), grantedAuthorities); } }
4e3b191f14c3377b1240ca14f7edbea11f0d2294
50140c77c5133b894b57765469d11bdf84004057
/FailedGUI/Obj2.java
4579c257f4fa95e921cc65c52038502d17a3c0eb
[]
no_license
hanewton35/Death-and-Faxes
8f54f8fb66b2a03dbfc37786802b325c7a80e87a
1a48fb03f85011d056db0bf88a9a9802a357967e
refs/heads/master
2020-03-18T18:43:41.216632
2018-05-29T10:20:46
2018-05-29T10:20:46
134,979,662
0
0
null
null
null
null
UTF-8
Java
false
false
13,419
java
public class Obj2 { boolean yVis; boolean eVis; public Board2 board; public int row; public int col; public Obj2(Board2 board, int row, int col) { this.board = board; this.row = row; this.col = col; } public void check() { yVis = false; try { if(board.get(row-2, col-1) instanceof You2 && board.get(row-1, col-1) instanceof EmpOrGla2 && board.get(row-1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-2, col) instanceof You2 && board.get(row-1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-2, col+1) instanceof You2 && board.get(row-1, col+1) instanceof EmpOrGla2 && board.get(row-1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-2) instanceof You2 && board.get(row, col-1) instanceof EmpOrGla2 && board.get(row-1, col-1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+2) instanceof You2 && board.get(row, col+1) instanceof EmpOrGla2 && board.get(row-1, col+1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col-2) instanceof You2 && board.get(row, col-1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col-1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col+1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col+2) instanceof You2 && board.get(row, col+1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-2) instanceof You2 && board.get(row+1, col-1) instanceof EmpOrGla2 && board.get(row, col-1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+1) instanceof You2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+2) instanceof You2 && board.get(row+1, col+1) instanceof EmpOrGla2 && board.get(row, col+1) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col-1) instanceof You2 && board.get(row+1, col-1) instanceof EmpOrGla2 && board.get(row+1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col) instanceof You2 && board.get(row+1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col+1) instanceof You2 && board.get(row+1, col+1) instanceof EmpOrGla2 && board.get(row+1, col) instanceof EmpOrGla2) yVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-1) instanceof You2 && board.get(row+1, col) instanceof Wall2 && board.get(row, col-1) instanceof Wall2) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+1) instanceof You2 && board.get(row+1, col) instanceof Wall2 && board.get(row, col+1) instanceof Wall2) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+1) instanceof You2 && board.get(row-1, col) instanceof Wall2 && board.get(row, col+1) instanceof Wall2) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-1) instanceof You2 && board.get(row-1, col) instanceof Wall2 && board.get(row, col-1) instanceof Wall2) yVis = false; } catch(IndexOutOfBoundsException e){} eVis = false; try { if(board.get(row-2, col-1) instanceof Enemy2 && board.get(row-1, col-1) instanceof Empty2 && board.get(row-1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-2, col) instanceof Enemy2 && board.get(row-1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-2, col+1) instanceof Enemy2 && board.get(row-1, col+1) instanceof Empty2 && board.get(row-1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-2) instanceof Enemy2 && board.get(row, col-1) instanceof Empty2 && board.get(row-1, col-1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+2) instanceof Enemy2 && board.get(row, col+1) instanceof Empty2 && board.get(row-1, col+1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col-2) instanceof Enemy2 && board.get(row, col-1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col-1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col+1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row, col+2) instanceof Enemy2 && board.get(row, col+1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-2) instanceof Enemy2 && board.get(row+1, col-1) instanceof Empty2 && board.get(row, col-1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+1) instanceof Enemy2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+2) instanceof Enemy2 && board.get(row+1, col+1) instanceof Empty2 && board.get(row, col+1) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col-1) instanceof Enemy2 && board.get(row+1, col-1) instanceof Empty2 && board.get(row+1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col) instanceof Enemy2 && board.get(row+1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+2, col+1) instanceof Enemy2 && board.get(row+1, col+1) instanceof Empty2 && board.get(row+1, col) instanceof Empty2) eVis = true; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-1) instanceof Enemy2 && (board.get(row+1, col) instanceof Wall2 || board.get(row+1, col) instanceof Glass2 || board.get(row+1, col) instanceof You2) && (board.get(row, col-1) instanceof Wall2 || board.get(row, col-1) instanceof Glass2 || board.get(row, col-1) instanceof You2)) eVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+1) instanceof Enemy2 && (board.get(row+1, col) instanceof Wall2 || board.get(row+1, col) instanceof Glass2 || board.get(row+1, col) instanceof You2) && (board.get(row, col+1) instanceof Wall2 || board.get(row, col+1) instanceof Glass2 || board.get(row, col+1) instanceof You2)) eVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+1) instanceof Enemy2 && (board.get(row-1, col) instanceof Wall2 || board.get(row-1, col) instanceof Glass2 || board.get(row-1, col) instanceof You2) && (board.get(row, col+1) instanceof Wall2 || board.get(row, col+1) instanceof Wall2 || board.get(row, col+1) instanceof You2)) eVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-1) instanceof Enemy2 && (board.get(row-1, col) instanceof Wall2 || board.get(row-1, col) instanceof Glass2 || board.get(row-1, col) instanceof You2) && (board.get(row, col-1) instanceof Wall2 || board.get(row, col-1) instanceof Glass2 || board.get(row, col-1) instanceof You2)) eVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col-1) instanceof You2 && (board.get(row+1, col) instanceof Wall2 || board.get(row+1, col) instanceof Enemy2) && (board.get(row, col-1) instanceof Wall2 || board.get(row, col-1) instanceof Enemy2)) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row+1, col+1) instanceof You2 && (board.get(row+1, col) instanceof Wall2 || board.get(row+1, col) instanceof Enemy2) && (board.get(row, col+1) instanceof Wall2 || board.get(row, col+1) instanceof Enemy2)) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col+1) instanceof You2 && (board.get(row-1, col) instanceof Wall2 || board.get(row-1, col) instanceof Enemy2) && (board.get(row, col+1) instanceof Wall2 || board.get(row, col+1) instanceof Enemy2)) yVis = false; } catch(IndexOutOfBoundsException e){} try { if(board.get(row-1, col-1) instanceof You2 && (board.get(row-1, col) instanceof Wall2 || board.get(row-1, col) instanceof Enemy2) && (board.get(row, col-1) instanceof Wall2 || board.get(row, col-1) instanceof Enemy2)) yVis = false; } catch(IndexOutOfBoundsException e){} } public void setRow(int r) { row = r; } public int getRow() { return row; } public void setCol(int c) { col = c; } public int getCol() { return col; } }
740f4df25f662ad02b384125c6041f7c37adc443
525bdc9b421d9cb9dc40b3a03cd435c100b706b2
/app/src/main/java/com/example/roman/calculator/fragments/PairsFragment.java
41bae2178f37c4ce7fca623ab9826c8d2b5f822a
[]
no_license
Roma-Za/Calculator
db5f94c288977dc545c0fe3c7d71a3df6014e55a
5c813e7543a2c8602a97a5309d4e1d563efd6964
refs/heads/master
2021-01-20T15:36:26.254515
2016-08-08T06:21:44
2016-08-08T06:21:44
64,928,221
0
0
null
null
null
null
UTF-8
Java
false
false
2,269
java
package com.example.roman.calculator.fragments; import android.app.Fragment; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.TextView; import com.example.roman.calculator.calculations.Pairs; import com.example.roman.calculator.R; public class PairsFragment extends Fragment { public PairsFragment() { // Required empty public constructor } public static PairsFragment newInstance() { PairsFragment fragment = new PairsFragment(); return fragment; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_tab_pairs, container, false); final TextView tvResult = (TextView) rootView.findViewById(R.id.tab_pairs_result); final EditText editText = (EditText) rootView.findViewById(R.id.tab_pairs_input); rootView.findViewById(R.id.btn_calculate_pairs).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String strNumber = editText.getText().toString(); if(validate(strNumber)){ Pairs pairs = new Pairs(getArr(strNumber)); tvResult.setText(pairs.getSubList()); }else{ tvResult.setText("Enter the correct pairs."); } } }); return rootView; } private int[] getArr(String strNumber) { String [] strArr = strNumber.split(" "); int [] intArr = new int [strArr.length]; for (int i = 0; i<strArr.length; i++){ try { intArr[i] = Integer.parseInt(strArr[i]); } catch (NumberFormatException e) { Log.e("Error", e.getMessage()); } } return intArr; } private boolean validate(String strNumber) { if(strNumber.isEmpty())return false; String [] strArr = strNumber.split(" "); if((strArr.length % 2)==0)return true; else return false; } }
0689cf144393a26ce3837b09da595292a4e544e6
5bc47f9595b7474f654b0c208f71ae54bb07dd3e
/app/src/main/java/com/hadIt/doorstep/address/SelectAddress.java
76a8c67151dcbfbcaef0e7f111b1ae91ca9c0d55
[]
no_license
aakashe502/DoorStep
4a10f8714172260c72851694717bffcd7e4eee59
a1d913a5592ac10c096b26931d52f2cc7fdd2c94
refs/heads/master
2023-07-16T11:27:11.851287
2021-07-30T17:12:49
2021-07-30T17:12:49
342,653,801
0
0
null
null
null
null
UTF-8
Java
false
false
5,000
java
package com.hadIt.doorstep.address; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.Observer; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.Task; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.QuerySnapshot; import com.hadIt.doorstep.Adapter.SelectAddressAdapter; import com.hadIt.doorstep.R; import com.hadIt.doorstep.cache.model.Users; import com.hadIt.doorstep.dao.PaperDb; import com.hadIt.doorstep.roomDatabase.address.AddressDataTransfer; import com.hadIt.doorstep.roomDatabase.address.AddressRepository; import com.hadIt.doorstep.roomDatabase.address.AddressViewModel; import com.hadIt.doorstep.roomDatabase.address.model.AddressModel; import java.util.ArrayList; import java.util.List; import static java.lang.Thread.sleep; public class SelectAddress extends AppCompatActivity implements AddressDataTransfer { private ImageButton addNewAddress, backBtn; private RecyclerView recyclerView; private SelectAddressAdapter selectAddressAdapter; private List<AddressModel> addressModelClassList; private FirebaseFirestore firebaseFirestore; private Users usersData; private PaperDb paperDb; private AddressViewModel addressViewModel; private AddressRepository addressRepository; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_address); backBtn = findViewById(R.id.backBtn); addNewAddress = findViewById(R.id.addNewAddress); addNewAddress.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(SelectAddress.this, AddNewAddress.class)); } }); backBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); recyclerView=findViewById(R.id.recycler); recyclerView.setLayoutManager(new LinearLayoutManager(this)); addressModelClassList = new ArrayList<>(); selectAddressAdapter = new SelectAddressAdapter(this, addressModelClassList, getApplication()); firebaseFirestore = FirebaseFirestore.getInstance(); paperDb = new PaperDb(); addressViewModel = new AddressViewModel(getApplication()); addressRepository = new AddressRepository(getApplication()); usersData = paperDb.getUserFromPaperDb(); getUserAddress(); selectAddressAdapter.setDataList(addressModelClassList); recyclerView.setAdapter(selectAddressAdapter); } private void getUserAddress() { addressViewModel.getAllAddress().observe(this, new Observer<List<AddressModel>>() { @Override public void onChanged(List<AddressModel> addressModels) { addressModelClassList.clear(); addressModelClassList.addAll(addressModels); if(addressModelClassList.size() == 0) storeInRoomDb(); selectAddressAdapter.notifyDataSetChanged(); } }); } private void storeInRoomDb() { firebaseFirestore.collection("users").document(usersData.emailId).collection("address") .get() .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if(task.isSuccessful()){ for(DocumentSnapshot dpc:task.getResult().getDocuments()){ AddressModel addressModelClass=dpc.toObject(AddressModel.class); onSetValues(addressModelClass); } } } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(SelectAddress.this, ""+e.getStackTrace(), Toast.LENGTH_SHORT).show(); } }); } @Override public void onSetValues(AddressModel addressModel) { addressRepository.insert(addressModel); } @Override public void onDelete(AddressModel addressModel) { addressRepository.delete(addressModel.getAddressUid()); } }
362e1d06037f3ba77e720c96d6625adf7e66a70d
ad5011a9be70c0742b317eee6dfd0aa063fd248f
/Test cases/src/com/comp6231/project/testCases/SequencerTest.java
e5ed9caca6b78e0ddde01eb56beaed820c409cd3
[]
no_license
karandeepbhardwaj/DLMS
1fabc1d70098eb2ea0808d35604f36d710c9579f
a540138b02ff65fbe39fad7009e7ad611b9644c8
refs/heads/master
2022-12-08T00:00:17.649594
2020-08-23T19:21:53
2020-08-23T19:21:53
180,244,301
3
0
null
null
null
null
UTF-8
Java
false
false
4,881
java
package com.comp6231.project.testCases; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import com.comp6231.project.frontend.FrontEndImpl; import com.comp6231.project.impl.ConcordiaLibraryImpl; import com.comp6231.project.impl.McgillLibraryImpl; import com.comp6231.project.impl.MontrealLibraryImpl; import com.comp6231.project.model.MessageData; import com.comp6231.project.sequencerImpl.CreateSequence; public class SequencerTest { CreateSequence createSequence; ConcordiaLibraryImpl concordiaImpl; McgillLibraryImpl mcgillImpl; MontrealLibraryImpl montrealImpl; @Before public void beforeEachRun() { concordiaImpl=new ConcordiaLibraryImpl(); mcgillImpl=new McgillLibraryImpl(); montrealImpl = new MontrealLibraryImpl(); MessageData messageData = new MessageData(); messageData.setItemId("CON1111"); messageData.setItemName("DS"); messageData.setUserId("CONM1111"); messageData.setQuantity(2); messageData.setErrorCounter(0); messageData.setSequenceCounter(0); messageData.setMethodName(com.comp6231.project.constants.LibraryManagementConstants.ADD_ITEM); FrontEndImpl feImpl=new FrontEndImpl(); createSequence=new CreateSequence(); feImpl.sendMessageToSequencer(messageData); } @Test public void addItemThreadTest() { Runnable addItemImplConc = () ->{ mcgillImpl.addItem("MCGM1111", "MCG6231", "Distributed", 1); assertEquals(1, mcgillImpl.getMcgillBooksData().get("MCG6231").getQuantity()); }; new Thread(addItemImplConc).start(); Runnable addItemImplMcg = () ->{ montrealImpl.addItem("MONM1111", "MON6231", "Distributed", 5); assertEquals(1, montrealImpl.getMontrealBooksData().get("MON6231").getQuantity()); }; new Thread(addItemImplMcg).start(); Runnable addItemImplMon = () ->{ concordiaImpl.addItem("CONM1111", "CON6441", "APP", 1); assertEquals(1, concordiaImpl.getConcordiaBooksData().get("CON6231").getQuantity()); }; new Thread(addItemImplMon).start(); } @Test public void listItemThreadTest() { Runnable listItemImplConc = () ->{ mcgillImpl.listItemAvailability("MCGM1111"); }; new Thread(listItemImplConc).start(); Runnable listItemImplMcg = () ->{ montrealImpl.listItemAvailability("MONM1111"); }; new Thread(listItemImplMcg).start(); Runnable listItemImplMon = () ->{ concordiaImpl.listItemAvailability("CONM1111"); }; new Thread(listItemImplMon).start(); } @Test public void removeItemThreadTest() { Runnable removeItemImplConc = () ->{ mcgillImpl.removeItem("MCGM1111", "MCG6231", 1); }; new Thread(removeItemImplConc).start(); Runnable removeItemImplMcg = () ->{ montrealImpl.removeItem("MONM1111", "MON6231", 1); }; new Thread(removeItemImplMcg).start(); Runnable removeItemImplMon = () ->{ concordiaImpl.removeItem("CONM1111", "CON6231", 1); }; new Thread(removeItemImplMon).start(); } @Test public void borrowItemList() { Runnable borrowItemImplConc = () ->{ concordiaImpl.borrowItem("CONM1111", "CON6231"); }; new Thread(borrowItemImplConc).start(); Runnable borrowItemImplMcg = () ->{ mcgillImpl.borrowItem("MCGM1111","MCG6231"); }; new Thread(borrowItemImplMcg).start(); Runnable borrowItemImplMon = () ->{ montrealImpl.borrowItem("MONM1111", "MON6231"); }; new Thread(borrowItemImplMon).start(); } @Test public void returnItemThreadTest() { Runnable returnItemImplConc = () ->{ concordiaImpl.returnItem("CONM1111", "CON6231"); }; new Thread(returnItemImplConc).start(); Runnable returnItemImplMcg = () ->{ mcgillImpl.returnItem("MCG1111", "MCG6231"); }; new Thread(returnItemImplConc).start(); Runnable returnItemImplMon = () ->{ montrealImpl.returnItem("MONM1111", "MON6231"); }; new Thread(returnItemImplMon).start(); } @Test public void findItemThreadTest() { Runnable findItemImplConc = () ->{ concordiaImpl.findItem("CONM1111", "DISTRIBUTED",true); }; new Thread(findItemImplConc).start(); Runnable findItemImplMcg = () ->{ mcgillImpl.findItem("MCG1111","DISTRIBUTED",true); }; new Thread(findItemImplMcg).start(); Runnable findItemImplMon = () ->{ montrealImpl.findItem("MONM1111", "DISTRIBUTED",true); }; new Thread(findItemImplMon).start(); } @Test public void exchangeItemThreadTest() { Runnable exchangeItemImplConc = () ->{ concordiaImpl.exchangeItem("CONM1111", "CON6441", "CON6231"); }; new Thread(exchangeItemImplConc).start(); Runnable exchangeItemImplMcg = () ->{ mcgillImpl.exchangeItem("MCGM1111", "MCG6440", "MCG6231"); }; new Thread(exchangeItemImplMcg).start(); Runnable exchangeItemImplMon = () ->{ montrealImpl.exchangeItem("MONM1111", "MON6441", "MON6231"); }; new Thread(exchangeItemImplMon).start(); } }
370d8c560c7299ad01617be3884141a363b73caa
48ae3f779eee5936fd0acc67f11ae7d80e268a10
/src/nutz/daostudy/OneToOneRun.java
f23aced34ad3ece44f2df11fd0f1b0795765b248
[]
no_license
16892434/nutzstudy
215bdac396b7dc7b5702c5a03f4b58450927e870
5adebd4f6cbede5ed2766e53292b58a1002be6c0
refs/heads/master
2021-01-19T16:24:58.447684
2011-05-20T07:46:46
2011-05-20T07:46:46
1,770,463
0
0
null
null
null
null
GB18030
Java
false
false
1,587
java
package nutz.daostudy; import static java.lang.System.out; import nutz.test.pojo.Master; import nutz.test.pojo.Pet; public class OneToOneRun extends Run { public static void main(String [] args) throws Exception { // testInsertWith(); // testInsertLinks(); testFetch(); } /** * 同新插入关联对象 */ public static void testInsertWith() throws Exception { Pet pet = new Pet(); pet.setName("小白"); Master master = new Master(); master.setName("小新"); pet.setMaster(master); out.println(dao.insertWith(pet, "master")); } /** * 仅仅插入被关联的对象 */ public static void testInsertLinks() throws Exception { Pet pet = new Pet(); pet.setName("小小白"); Master master = new Master(); master.setName("小小新"); pet.setMaster(master); out.println(dao.insertLinks(pet, "master")); } /** * 仅fetch被关联的对象 */ public static void testFetch() throws Exception { Pet pet = dao.fetch(Pet.class, "小白"); dao.fetchLinks(pet, "master"); out.println(pet.getMaster().getName()); } /** * 更新 */ public static void testUpdate() throws Exception { // 同时更新pet和master // dao.updateWith(pet, "master"); // 仅仅更新master // dao.updateLinks(pet, "master"); } /** * 删除 */ public static void testDelete() throws Exception { // 同时删除pet和master // dao.deleteWith(pet, "master"); // 仅仅删除master(每个一条SQL) // dao.deleteLinks(pet, "master"); // 清除master(一条SQL) // dao.clearLinks(pet, "master"); } }
8af6b1592916156f32c69021d8f1b4e58d6cf033
0124e565b2ca5d223fddd10dd9d851437ab59dc2
/myjdk/src/com/sun/corba/se/PortableActivationIDL/ServerProxyHelper.java
1675381d22c9de6908a3636a23f55ddb0cc945a6
[]
no_license
lvcs123456/syncMore
331db4092017ba17b38ead80ab47fc4c6615683e
43074b41851cf6514e4b28037e2465fb806b46b1
refs/heads/master
2023-01-23T11:29:02.755417
2020-11-04T12:14:37
2020-11-04T12:14:37
309,552,899
0
0
null
null
null
null
UTF-8
Java
false
false
3,137
java
package com.sun.corba.se.PortableActivationIDL; /** * com/sun/corba/se/PortableActivationIDL/ServerProxyHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/ade/jenkins/workspace/8-2-build-windows-i586-cygwin/jdk8u241/331/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl * Wednesday, December 11, 2019 10:25:11 AM UTC */ /** Server callback interface, passed to Activator in registerServer method. */ abstract public class ServerProxyHelper { private static String _id = "IDL:PortableActivationIDL/ServerProxy:1.0"; public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.PortableActivationIDL.ServerProxy that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static com.sun.corba.se.PortableActivationIDL.ServerProxy extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (com.sun.corba.se.PortableActivationIDL.ServerProxyHelper.id (), "ServerProxy"); } return __typeCode; } public static String id () { return _id; } public static com.sun.corba.se.PortableActivationIDL.ServerProxy read (org.omg.CORBA.portable.InputStream istream) { return narrow (istream.read_Object (_ServerProxyStub.class)); } public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.PortableActivationIDL.ServerProxy value) { ostream.write_Object ((org.omg.CORBA.Object) value); } public static com.sun.corba.se.PortableActivationIDL.ServerProxy narrow (org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof com.sun.corba.se.PortableActivationIDL.ServerProxy) return (com.sun.corba.se.PortableActivationIDL.ServerProxy)obj; else if (!obj._is_a (id ())) throw new org.omg.CORBA.BAD_PARAM (); else { org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); com.sun.corba.se.PortableActivationIDL._ServerProxyStub stub = new com.sun.corba.se.PortableActivationIDL._ServerProxyStub (); stub._set_delegate(delegate); return stub; } } public static com.sun.corba.se.PortableActivationIDL.ServerProxy unchecked_narrow (org.omg.CORBA.Object obj) { if (obj == null) return null; else if (obj instanceof com.sun.corba.se.PortableActivationIDL.ServerProxy) return (com.sun.corba.se.PortableActivationIDL.ServerProxy)obj; else { org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); com.sun.corba.se.PortableActivationIDL._ServerProxyStub stub = new com.sun.corba.se.PortableActivationIDL._ServerProxyStub (); stub._set_delegate(delegate); return stub; } } }
8460b34916fcaa3eae27b7d7f56e5e793c2422d6
f8b9b71c8fe09298bda3690d0170cb2549738bcc
/algorithm/src/main/java/com/example/algorithm/learnnetty/MyServerInitializer.java
7466dfde590dc62e4a007711410c9efb230cb2bb
[]
no_license
crab21/learn_data
c282873eb16331d0b26d3575e209a8a92f8d598a
743edea630d30ce6c7a1ef923aa848a73132035d
refs/heads/master
2022-12-22T15:52:09.834383
2019-07-07T14:35:15
2019-07-07T14:35:15
82,946,652
0
0
null
2022-12-10T04:36:47
2017-02-23T16:25:23
HTML
UTF-8
Java
false
false
710
java
package com.example.algorithm.learnnetty; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; import io.netty.handler.timeout.IdleStateHandler; import java.util.concurrent.TimeUnit; public class MyServerInitializer extends ChannelInitializer<SocketChannel> { @Override protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); // 调用read函数的时间 写入通道时间 所有的时间 时间的格式 pipeline.addLast(new IdleStateHandler(50000, 0, 0, TimeUnit.SECONDS)); pipeline.addLast(new HeartChannelAdpter()); } }
1959fd2115309457a093f3f46ced569d23340fcf
b1c1f87e19dec3e06b66b60ea32943ca9fceba81
/spring-test/src/test/java/org/springframework/mock/http/server/reactive/MockServerHttpResponseTests.java
df4d43a9c98abb677b985f07e8f4b6f036a75ee6
[ "Apache-2.0" ]
permissive
JunMi/SpringFramework-SourceCode
d50751f79803690301def6478e198693e2ff7348
4918e0e6a0676a62fd2a9d95acf6eb4fa5edb82b
refs/heads/master
2020-06-19T10:55:34.451834
2019-07-13T04:32:14
2019-07-13T13:11:54
196,678,387
1
0
null
null
null
null
UTF-8
Java
false
false
1,746
java
/* * Copyright 2002-2017 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.mock.http.server.reactive; import java.util.Arrays; import org.junit.Test; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseCookie; import static org.junit.Assert.assertEquals; /** * Unit tests for {@link MockServerHttpResponse}. * @author Rossen Stoyanchev */ public class MockServerHttpResponseTests { @Test public void cookieHeaderSet() throws Exception { ResponseCookie foo11 = ResponseCookie.from("foo1", "bar1").build(); ResponseCookie foo12 = ResponseCookie.from("foo1", "bar2").build(); ResponseCookie foo21 = ResponseCookie.from("foo2", "baz1").build(); ResponseCookie foo22 = ResponseCookie.from("foo2", "baz2").build(); MockServerHttpResponse response = new MockServerHttpResponse(); response.addCookie(foo11); response.addCookie(foo12); response.addCookie(foo21); response.addCookie(foo22); response.applyCookies(); assertEquals(Arrays.asList("foo1=bar1", "foo1=bar2", "foo2=baz1", "foo2=baz2"), response.getHeaders().get(HttpHeaders.SET_COOKIE)); } }
65d97d46bed8ac6aa66ed46584dbe0c01b6801c1
fc139fae14576c02ccb471a6d758bec63c8a2fd1
/app/src/main/java/com/example/mist/vehiclemonitoringsystem/SignUp.java
d3a1a375eba86ff3aa57c0abba132c029a9169d8
[]
no_license
akiljawad976/VehicleMonitoringSystem
03f307080b6eda55a2eb686fd21d1686c31e1c02
ae743f5138c2ec4dcc12f296c82b48f8f2dfcc09
refs/heads/master
2020-05-25T19:46:45.369131
2019-05-22T04:05:17
2019-05-22T04:05:17
187,960,208
0
0
null
null
null
null
UTF-8
Java
false
false
5,162
java
package com.example.mist.vehiclemonitoringsystem; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuthUserCollisionException; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; public class SignUp extends AppCompatActivity { private EditText email,pass,conpass,phn,id; private Button signup; private TextView logtv; private Context context; private ProgressBar progressBar; DatabaseReference databaseArtists; private FirebaseAuth firebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sign_up); context = this; databaseArtists = FirebaseDatabase.getInstance().getReference("user"); firebaseAuth = FirebaseAuth.getInstance(); email = (EditText)findViewById(R.id.tEmail); id = (EditText)findViewById(R.id.deviceID); pass = (EditText)findViewById(R.id.etPassword); conpass = (EditText)findViewById(R.id.ConfPass); phn = (EditText)findViewById(R.id.PhnNumb); signup = (Button)findViewById(R.id.bsignup); logtv = (TextView)findViewById(R.id.tlogin); progressBar = (ProgressBar) findViewById(R.id.progressBar); logtv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getApplicationContext(),SignUp.class); startActivity(intent); } }); signup.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String checkPass1 = pass.getText().toString().trim(); String checkPass2 = conpass.getText().toString().trim(); if(checkPass1.contentEquals(checkPass2)){ registerUser(); }else{ AppConstant.showAlertMessage(context,"Password Didn't Match"); } } }); } private void registerUser(){ String Email = email.getText().toString().trim(); String password = pass.getText().toString().trim(); //validation if (TextUtils.isEmpty(Email)){ AppConstant.showAlertMessage(context,"PLease Enter Email"); return; } if (TextUtils.isEmpty(password)){ AppConstant.showAlertMessage(context,"Please Enter Password"); return; } if (password.length() <= 6){ AppConstant.showAlertMessage(context,"Password too Small,Must be more than 6 Characters"); return; } progressBar.setVisibility(View.VISIBLE); // progressDialog.setMessage("Registering, Please Wait..."); // progressDialog.show(); //now we can create the user firebaseAuth.createUserWithEmailAndPassword(Email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { progressBar.setVisibility(View.GONE); if(task.isSuccessful()){ Toast.makeText(SignUp.this, "Successfully Registered", Toast.LENGTH_SHORT).show(); //progressDialog.hide(); adduser(); Intent home = new Intent(SignUp.this,MainActivity.class); startActivity(home); finish(); } else { if (task.getException() instanceof FirebaseAuthUserCollisionException) { Toast.makeText(SignUp.this, "Email already exists!", Toast.LENGTH_SHORT).show(); } Toast.makeText(SignUp.this, "Something went terrible wrong!", Toast.LENGTH_SHORT).show(); // progressDialog.hide(); } } }); } private void adduser(){ String email1 = email.getText().toString().trim(); String password1 = pass.getText().toString().trim(); String phone = phn.getText().toString().trim(); String deviceId = id.getText().toString().trim(); User user = new User(email1,password1,phone,deviceId); databaseArtists.child(deviceId).setValue(user); } }
e479eaf22f590177b31bae896e6dc6c2c0fa741a
c4352bde96e74d997be29e31517aa5f1f54e9795
/JavaWeb_SpringMVC_2019/02_SpringEssentioals_ExodiaExam/src/main/java/exodia2/domain/entities/BaseEntity.java
53fd93aa8ac9f3d786a7cd7a460de457de204828
[]
no_license
chmitkov/SoftUni
b0f4ec10bb89a7dc350c063a02a3535ef9e901b4
52fd6f85718e07ff492c67d8166ed5cfaf5a58ff
refs/heads/master
2022-11-29T01:06:51.947775
2019-10-12T12:29:03
2019-10-12T12:29:03
138,323,012
1
0
null
2022-11-24T09:42:25
2018-06-22T16:09:50
Java
UTF-8
Java
false
false
684
java
package exodia2.domain.entities; import org.hibernate.annotations.GenericGenerator; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.MappedSuperclass; @MappedSuperclass public abstract class BaseEntity { private String id; public BaseEntity() { } @Id @GeneratedValue(generator = "uuid-string") @GenericGenerator(name = "uuid-string", strategy = "org.hibernate.id.UUIDGenerator") @Column(name = "id", nullable = false, unique = true, updatable = false) public String getId() { return id; } public void setId(String id) { this.id = id; } }
ddd593e5b4d556f85a705bd47362eff52597392b
0477a6904d42a76b331c9c322f43b397e8a2ffc0
/src/main/java/com/comlanka/blog/domain/Country.java
277ca51156092432a82f712eba49adcc12c2d38a
[]
no_license
ishara/Jhibstart-example
005bb3b7facd97dcbd5f54e2f2a76b53ede8a01c
fa042c4a5c5b9bc938fd8487f147aa66fd171320
refs/heads/master
2020-04-03T22:48:35.663922
2018-10-31T19:14:41
2018-10-31T19:14:43
155,610,262
0
0
null
null
null
null
UTF-8
Java
false
false
2,188
java
package com.comlanka.blog.domain; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.*; import java.io.Serializable; import java.util.Objects; /** * A Country. */ @Entity @Table(name = "country") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Country implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "country_name") private String countryName; @OneToOne @JoinColumn(unique = true) private Region region; // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCountryName() { return countryName; } public Country countryName(String countryName) { this.countryName = countryName; return this; } public void setCountryName(String countryName) { this.countryName = countryName; } public Region getRegion() { return region; } public Country region(Region region) { this.region = region; return this; } public void setRegion(Region region) { this.region = region; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Country country = (Country) o; if (country.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), country.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "Country{" + "id=" + getId() + ", countryName='" + getCountryName() + "'" + "}"; } }
327787018c212de93c9556207ce63ac75344d8d6
baca97413c444d2e7a36096f552482be472dc858
/jsoup/src/test/java/org/jsoup/UncheckedIOException_ESTest_scaffolding.java
622d9ca1c04099117549bc85c7436b28fa4fa75e
[ "MIT" ]
permissive
agudek/STRE-FinalProject
5aa2a54aff96e06e1158ed9fe9a5b5456cff4ae1
cca6641f033fde7daf0dacdbe42c191361bf3e19
refs/heads/master
2020-03-11T10:04:16.945595
2018-04-24T11:05:38
2018-04-24T11:05:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,220
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 23 09:07:00 GMT 2018 */ package org.jsoup; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class UncheckedIOException_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.jsoup.UncheckedIOException"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("file.encoding", "Cp1252"); java.lang.System.setProperty("java.awt.headless", "true"); java.lang.System.setProperty("java.io.tmpdir", "C:\\Users\\Maiko\\AppData\\Local\\Temp\\"); java.lang.System.setProperty("user.country", "US"); java.lang.System.setProperty("user.dir", "D:\\GitHub\\jsoup"); java.lang.System.setProperty("user.home", "C:\\Users\\Maiko"); java.lang.System.setProperty("user.language", "en"); java.lang.System.setProperty("user.name", "Maiko"); java.lang.System.setProperty("user.timezone", "Europe/Berlin"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(UncheckedIOException_ESTest_scaffolding.class.getClassLoader() , "org.jsoup.UncheckedIOException" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(UncheckedIOException_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.jsoup.UncheckedIOException" ); } }
b0593297fb7ec1e74dbc2af566d32ae166ae1432
4cd86fe306490d60bbf250d0ac4f83dee38d64f6
/app/src/main/java/com/learnshare/coats/screens/SearchResultActivity.java
b5b588a282b3f15c7ef3b7f3b7eda19d3f8c2358
[]
no_license
LearnShareKnowledge/Coats
66c6c0ff08ed7c5d3ae79688bad9ad3f922311c1
69010c7c44fd256b28816c78ffec152c3b1c7f4a
refs/heads/master
2021-01-21T11:30:22.579773
2017-05-20T02:12:49
2017-05-20T02:12:49
91,743,070
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.learnshare.coats.screens; import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.learnshare.coats.R; public class SearchResultActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search_result); } }
30c231ee2dd99021e4967caa0b0fe13c639e062b
d6dcd17b8fadbef0d7affda5e3862e67ce5c253e
/wms-app/app/src/main/java/com/teeny/wms/model/InventoryGoodsWrapperEntity.java
3b4f5a36debdf83101df981bb505bbb807a6e3e5
[]
no_license
zp253908058/2018
0a7fdb2a98b7c1b470aa936d662d2336965f0f1b
81ab254bd9e4f0615953ad307e3f54b7b9e23b87
refs/heads/master
2021-05-13T15:16:40.455243
2019-03-13T07:51:18
2019-03-13T07:51:18
116,761,918
1
0
null
null
null
null
UTF-8
Java
false
false
880
java
package com.teeny.wms.model; import java.util.List; /** * Class description: * * @author zp * @version 1.0 * @see InventoryGoodsWrapperEntity * @since 2017/12/28 */ public class InventoryGoodsWrapperEntity { private List<InventoryGoodsEntity> list; private int unfinishedNumber; private int finishedNumber; public List<InventoryGoodsEntity> getList() { return list; } public void setList(List<InventoryGoodsEntity> list) { this.list = list; } public int getUnfinishedNumber() { return unfinishedNumber; } public void setUnfinishedNumber(int unfinishedNumber) { this.unfinishedNumber = unfinishedNumber; } public int getFinishedNumber() { return finishedNumber; } public void setFinishedNumber(int finishedNumber) { this.finishedNumber = finishedNumber; } }
523b8b06f93c551f1d5f913b8fd9361f196f1804
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/google/android/exoplayer2/trackselection/TrackSelectionParameters.java
d1411d51a24cdd0c830f2036f4ba42ec6510f491
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
7,303
java
package com.google.android.exoplayer2.trackselection; import android.content.Context; import android.os.Looper; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import android.text.TextUtils; import android.view.accessibility.CaptioningManager; import com.google.android.exoplayer2.util.Util; import java.util.Locale; public class TrackSelectionParameters implements Parcelable { public static final Creator<TrackSelectionParameters> CREATOR = new Creator<TrackSelectionParameters>() { public TrackSelectionParameters createFromParcel(Parcel parcel) { return new TrackSelectionParameters(parcel); } public TrackSelectionParameters[] newArray(int i) { return new TrackSelectionParameters[i]; } }; @Deprecated public static final TrackSelectionParameters DEFAULT = DEFAULT_WITHOUT_CONTEXT; public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT = new Builder().build(); public final int disabledTextTrackSelectionFlags; public final String preferredAudioLanguage; public final String preferredTextLanguage; public final int preferredTextRoleFlags; public final boolean selectUndeterminedTextLanguage; public static class Builder { int disabledTextTrackSelectionFlags; String preferredAudioLanguage; String preferredTextLanguage; int preferredTextRoleFlags; boolean selectUndeterminedTextLanguage; public Builder(Context context) { this(); setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(context); } @Deprecated public Builder() { this.preferredAudioLanguage = null; this.preferredTextLanguage = null; this.preferredTextRoleFlags = 0; this.selectUndeterminedTextLanguage = false; this.disabledTextTrackSelectionFlags = 0; } Builder(TrackSelectionParameters trackSelectionParameters) { this.preferredAudioLanguage = trackSelectionParameters.preferredAudioLanguage; this.preferredTextLanguage = trackSelectionParameters.preferredTextLanguage; this.preferredTextRoleFlags = trackSelectionParameters.preferredTextRoleFlags; this.selectUndeterminedTextLanguage = trackSelectionParameters.selectUndeterminedTextLanguage; this.disabledTextTrackSelectionFlags = trackSelectionParameters.disabledTextTrackSelectionFlags; } public Builder setPreferredAudioLanguage(String str) { this.preferredAudioLanguage = str; return this; } public Builder setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(Context context) { if (Util.SDK_INT >= 19) { m1388x58dbf263(context); } return this; } public Builder setPreferredTextLanguage(String str) { this.preferredTextLanguage = str; return this; } public Builder setPreferredTextRoleFlags(int i) { this.preferredTextRoleFlags = i; return this; } public Builder setSelectUndeterminedTextLanguage(boolean z) { this.selectUndeterminedTextLanguage = z; return this; } public Builder setDisabledTextTrackSelectionFlags(int i) { this.disabledTextTrackSelectionFlags = i; return this; } public TrackSelectionParameters build() { TrackSelectionParameters trackSelectionParameters = new TrackSelectionParameters(this.preferredAudioLanguage, this.preferredTextLanguage, this.preferredTextRoleFlags, this.selectUndeterminedTextLanguage, this.disabledTextTrackSelectionFlags); return trackSelectionParameters; } /* renamed from: setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettingsV19 */ private void m1388x58dbf263(Context context) { if (Util.SDK_INT >= 23 || Looper.myLooper() != null) { CaptioningManager captioningManager = (CaptioningManager) context.getSystemService("captioning"); if (captioningManager != null && captioningManager.isEnabled()) { this.preferredTextRoleFlags = 1088; Locale locale = captioningManager.getLocale(); if (locale != null) { this.preferredTextLanguage = Util.getLocaleLanguageTag(locale); } } } } } public int describeContents() { return 0; } public static TrackSelectionParameters getDefaults(Context context) { return new Builder(context).build(); } TrackSelectionParameters(String str, String str2, int i, boolean z, int i2) { this.preferredAudioLanguage = Util.normalizeLanguageCode(str); this.preferredTextLanguage = Util.normalizeLanguageCode(str2); this.preferredTextRoleFlags = i; this.selectUndeterminedTextLanguage = z; this.disabledTextTrackSelectionFlags = i2; } TrackSelectionParameters(Parcel parcel) { this.preferredAudioLanguage = parcel.readString(); this.preferredTextLanguage = parcel.readString(); this.preferredTextRoleFlags = parcel.readInt(); this.selectUndeterminedTextLanguage = Util.readBoolean(parcel); this.disabledTextTrackSelectionFlags = parcel.readInt(); } public Builder buildUpon() { return new Builder(this); } public boolean equals(Object obj) { boolean z = true; if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } TrackSelectionParameters trackSelectionParameters = (TrackSelectionParameters) obj; if (!(TextUtils.equals(this.preferredAudioLanguage, trackSelectionParameters.preferredAudioLanguage) && TextUtils.equals(this.preferredTextLanguage, trackSelectionParameters.preferredTextLanguage) && this.preferredTextRoleFlags == trackSelectionParameters.preferredTextRoleFlags && this.selectUndeterminedTextLanguage == trackSelectionParameters.selectUndeterminedTextLanguage && this.disabledTextTrackSelectionFlags == trackSelectionParameters.disabledTextTrackSelectionFlags)) { z = false; } return z; } public int hashCode() { String str = this.preferredAudioLanguage; int i = 0; int hashCode = ((str == null ? 0 : str.hashCode()) + 31) * 31; String str2 = this.preferredTextLanguage; if (str2 != null) { i = str2.hashCode(); } return ((((((hashCode + i) * 31) + this.preferredTextRoleFlags) * 31) + (this.selectUndeterminedTextLanguage ? 1 : 0)) * 31) + this.disabledTextTrackSelectionFlags; } public void writeToParcel(Parcel parcel, int i) { parcel.writeString(this.preferredAudioLanguage); parcel.writeString(this.preferredTextLanguage); parcel.writeInt(this.preferredTextRoleFlags); Util.writeBoolean(parcel, this.selectUndeterminedTextLanguage); parcel.writeInt(this.disabledTextTrackSelectionFlags); } }
db4b0148de8d754a216120ae427483fbf1f4ec55
31e6c535fd8755a88bbc6d8201290773d56249cb
/app/src/main/java/csc472/depaul/edu/metalcrawler/GameComponents/DoorFactory.java
a162a5885acf3f03bb59840e7751bbf15f6500d9
[]
no_license
anPerez4120/MetalCrawler
6dbb4ba418fec7d5288d5010bde23d48b444cb7c
23b0662d644b19f7b299ef5bae40b89e71391ebd
refs/heads/master
2020-04-02T12:26:13.313400
2018-12-02T20:49:13
2018-12-02T20:49:13
154,432,027
0
0
null
null
null
null
UTF-8
Java
false
false
1,045
java
package csc472.depaul.edu.metalcrawler.GameComponents; import java.util.Stack; public class DoorFactory { Stack<Door> doors; private static DoorFactory instance; public static DoorFactory Instance() { if (instance == null) { instance = new DoorFactory(); instance.doors = new Stack<Door>(); } return instance; } public Door GetDoor(int x, int y) { if (doors.empty()) { Door door = new Door(GameManager.Instance().GetView(),x,y); GameManager.Instance().AddEntity(door); return door; } else { Door door= doors.pop(); GameManager.Instance().AddSprite(door); GameManager.Instance().AddEntity(door); door.SetPosition(x,y); return door; } } public void ReturnDoor(Door door) { GameManager.Instance().RemoveSprite(door); GameManager.Instance().RemoveEntity(door); doors.push(door); } }
360d0cae0ef06c9a429e73be47f0777206de8a7e
43fff8a2957f8c710f62d761cd815544b9195221
/ExampleLife/app/src/main/java/com/example/examplelife/MainActivity.java
f266b5e203a3f282441c4c59407fb9da76d3b556
[]
no_license
sathvikchandu/AndroidInternship2k21
5d67822c6d33f1f785bcbd89a23b0e45a68bc723
ae192f0c63279aea741e9b584134ebe8ccc0835c
refs/heads/master
2023-06-22T23:58:32.062824
2021-07-15T06:16:38
2021-07-15T06:16:38
372,444,909
0
0
null
null
null
null
UTF-8
Java
false
false
1,288
java
package com.example.examplelife; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.i("APSSDC","Activity Created"); } @Override protected void onStart() { super.onStart(); Log.i("APSSDC","Activity Created"); } @Override protected void onResume() { super.onResume(); Log.i("APSSDC","Activity Resumed"); } @Override protected void onPause() { super.onPause(); Log.i("APSSDC","Activity Paused"); } protected void onStop() { super.onStop(); Log.i("APSSDC","Activity stopped"); } @Override protected void onRestart() { super.onRestart(); Log.i("APSSDC","Activity restarted"); } @Override protected void onDestroy() { super.onDestroy(); Log.i("APSSDC","Activity Destroyed"); } public void next(View view) { startActivity(new Intent(this,SecondActivity.class)); } }
f1744f2edac9ed9760d3c71934ae9030db96f138
4f7d674142fcf473be819374215794f6e36b7c70
/autoMATE_protocol/src/com/automate/protocol/client/messages/ClientNodeListMessage.java
6610f4bb9f87547ee8b0a8eca5dd1dcefedbead0
[]
no_license
jhbertra/autoMATE_protocol
d52a4a3dc317fa7f846f2e507786a85c658d67c3
2d9ed698ecee5d510af788018fad69a2e5a7d45d
refs/heads/master
2021-01-22T02:28:25.903639
2014-04-08T13:05:45
2014-04-08T13:05:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
795
java
package com.automate.protocol.client.messages; import com.automate.protocol.Message; import com.automate.protocol.client.ClientProtocolParameters; /** * Represents a node-list message sent from a client * @author jamie.bertram * */ public class ClientNodeListMessage extends Message <ClientProtocolParameters> { /** * Created a new {@link ClientNodeListMessage} * @param parameters */ public ClientNodeListMessage(ClientProtocolParameters parameters) { super(parameters); } @Override protected void addContent() { addElement("node-list", true); } @Override public MessageType getMessageType() { return MessageType.NODE_LIST; } @Override public String toString() { return super.toString() + "\nClientNodeListMessage"; } }
2ec520d150055b30d65dc237f76613a187758e26
c8688db388a2c5ac494447bac90d44b34fa4132c
/sources/com/google/firebase/remoteconfig/C3509a.java
3da8fd2159b6b149df8fe930875f97b0b6c7dcfc
[]
no_license
mred312/apk-source
98dacfda41848e508a0c9db2c395fec1ae33afa1
d3ca7c46cb8bf701703468ddc88f25ba4fb9d975
refs/heads/master
2023-03-06T05:53:50.863721
2021-02-23T13:34:20
2021-02-23T13:34:20
341,481,669
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package com.google.firebase.remoteconfig; import com.google.android.gms.tasks.SuccessContinuation; import com.google.android.gms.tasks.Task; import com.google.android.gms.tasks.Tasks; /* renamed from: com.google.firebase.remoteconfig.a */ /* compiled from: FirebaseRemoteConfig */ final /* synthetic */ class C3509a implements SuccessContinuation { /* renamed from: a */ private static final C3509a f19699a = new C3509a(); private C3509a() { } /* renamed from: a */ public static SuccessContinuation m11876a() { return f19699a; } public Task then(Object obj) { return Tasks.forResult(null); } }
b509ae69b02a8693b790b1464c84468bd88d5cf1
5bb4a4b0364ec05ffb422d8b2e76374e81c8c979
/sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/SecurityGroupViewResultImpl.java
db66aaed1553bb5dab9f44600911736c5b9665f1
[ "MIT", "LicenseRef-scancode-generic-cla", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
FabianMeiswinkel/azure-sdk-for-java
bd14579af2f7bc63e5c27c319e2653db990056f1
41d99a9945a527b6d3cc7e1366e1d9696941dbe3
refs/heads/main
2023-08-04T20:38:27.012783
2020-07-15T21:56:57
2020-07-15T21:56:57
251,590,939
3
1
MIT
2023-09-02T00:50:23
2020-03-31T12:05:12
Java
UTF-8
Java
false
false
1,116
java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.network.v2019_11_01.implementation; import com.microsoft.azure.management.network.v2019_11_01.SecurityGroupViewResult; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import java.util.List; import com.microsoft.azure.management.network.v2019_11_01.SecurityGroupNetworkInterface; class SecurityGroupViewResultImpl extends WrapperImpl<SecurityGroupViewResultInner> implements SecurityGroupViewResult { private final NetworkManager manager; SecurityGroupViewResultImpl(SecurityGroupViewResultInner inner, NetworkManager manager) { super(inner); this.manager = manager; } @Override public NetworkManager manager() { return this.manager; } @Override public List<SecurityGroupNetworkInterface> networkInterfaces() { return this.inner().networkInterfaces(); } }
901612be65223405a4d161a9b0f6669f7b9ddc5f
4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d
/src/main/java/com/alipay/api/domain/AlipaySocialBaseChatGinvSendModel.java
b051e99364d86fb3188fd76e3827fa835c030a05
[ "Apache-2.0" ]
permissive
weizai118/payment-alipay
042898e172ce7f1162a69c1dc445e69e53a1899c
e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1
refs/heads/master
2020-04-05T06:29:57.113650
2018-11-06T11:03:05
2018-11-06T11:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 支付宝社交邀请好友进群 * * @author auto create * @since 1.0, 2018-03-15 14:15:26 */ public class AlipaySocialBaseChatGinvSendModel extends AlipayObject { private static final long serialVersionUID = 4479655121313198384L; /** * 群id */ @ApiField("group_id") private String groupId; /** * 邀请的好友id列表,最多50人 */ @ApiListField("uids") @ApiField("string") private List<String> uids; /** * Gets group id. * * @return the group id */ public String getGroupId() { return this.groupId; } /** * Sets group id. * * @param groupId the group id */ public void setGroupId(String groupId) { this.groupId = groupId; } /** * Gets uids. * * @return the uids */ public List<String> getUids() { return this.uids; } /** * Sets uids. * * @param uids the uids */ public void setUids(List<String> uids) { this.uids = uids; } }
1782be1381afd9813a5d6150379eff03df77c888
0d932b659e1de3ed3cea7cf27ae9fec8485167aa
/SpaceArcaders/src/net/awhipple/spacearcaders/views/View.java
deaed3134ef625e3c2809f238c1abe6ac13cf9c3
[]
no_license
SquashSoft/SpaceArcaders
815b4eb47605a68836399f35d80818a72a3a5323
4e5f80449a767872bc7a6d3b70147f42c693c077
refs/heads/master
2020-12-24T16:23:54.828673
2016-05-12T17:17:12
2016-05-12T17:17:12
12,332,897
0
0
null
null
null
null
UTF-8
Java
false
false
542
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package net.awhipple.spacearcaders.views; import java.util.List; import net.awhipple.spacearcaders.utils.GameGlobals; import org.newdawn.slick.Input; /** * * @author Aaron */ public abstract class View { protected GameGlobals globals; public abstract List<ViewInstruction> update(Input input); public abstract void render(); public void setGlobals(GameGlobals globals) { this.globals = globals; } }
0df40c82c86a260962d32959418f21abfc33d713
1ff33ddd6a3e0f87b4a51039df360e4b20a32348
/Day18/src/api/util/arrays/ArraySearch.java
73cd9159b650c138e0f0c78e8346f6f3ac49895c
[]
no_license
jdsaeyqo/Java-Study-Code
b098b051faa3eba8e34c71b7e3447954a051d116
21c04eba0475dfd786cf22b098b00e8ce31b5d0d
refs/heads/master
2022-12-10T07:42:07.011983
2020-08-31T05:38:53
2020-08-31T05:38:53
290,108,142
0
0
null
null
null
null
UTF-8
Java
false
false
809
java
package api.util.arrays; import java.util.Arrays; public class ArraySearch { public static void main(String[] args) { int[] scores = {75,47,23,56,89}; int[] scores2 = Arrays.copyOf(scores, scores.length); Arrays.sort(scores2); System.out.println(Arrays.toString(scores)); System.out.println(Arrays.toString(scores2)); //배열 내부데이터의 인덱스번호를 탐색하는 메서드 binarySearch() int index = Arrays.binarySearch(scores2, 75); System.out.println("75가 저장된 인덱스 : " + index); //배열 비교 equals(배열1, 배열2) int[] arr1 = {1,3,5,7,9}; int[] arr2 = {1,3,5,7,9}; if(Arrays.equals(arr1, arr2)) { System.out.println("배열의 각 항목 일치"); }else { System.out.println("배열의 각 항목 불일치"); } } }
44a35f43089a19efb8d5ba93b0b846c7cb46e62a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/22/22_7cc8b98c6cb3b7857057b99ccb893f887af7fb94/PureDataActivity/22_7cc8b98c6cb3b7857057b99ccb893f887af7fb94_PureDataActivity_s.java
6cefd384fdfd094c49c6317c23d88bf10d9e1f87
[]
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
672
java
package com.example.pdp5test; import java.io.File; import java.io.IOException; import org.puredata.android.io.AudioParameters; import org.puredata.android.io.PdAudio; import org.puredata.android.utils.PdUiDispatcher; import org.puredata.core.PdBase; import org.puredata.core.PdListener; import org.puredata.core.utils.IoUtils; import android.app.Activity; import android.os.Bundle; import android.util.Log; public class PureDataActivity extends Activity { /* ---- GLOBAL VARS ----*/ private PdUiDispatcher dispatcher; private static final String TAG = "PDP5"; // Constructor PureDataActivity() { Log.e(TAG, "Contructed"); } }
7db4d14ae1dd7ef072458f6b08dc692bdf8b2b1a
bf3e4ac5039cfcc9045e91d62a47023bdbc14d69
/CD.java
346571cb31e03cf965a67d714728c59d540ae5ef
[]
no_license
Rebekita26Reyes/POO
6b502550458817d5555dcc016baa08aeaa5cda16
7f0851203efc6627e680c7564edf7ae9222757b6
refs/heads/master
2021-05-22T00:34:45.769324
2020-04-05T15:07:22
2020-04-05T15:07:22
252,886,823
0
0
null
null
null
null
UTF-8
Java
false
false
549
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 pkginterface; /** * * @author Cesia */ public class CD { int x ,y; public CD(int x,int y){ this.setX(x); this.setY(y); } public CD(){this(0,0);} public final void setX(int x){this.x =x;} public final void setY(int y){this.y =y;} public int suma() { return this.x+this.y; } }
dadfdf9b430581bd7876eaa0ebced7db3dddd6f1
4d95d2833cb51fee7bb4d8296a3b821912290e44
/app/src/main/java/mksn/simple_money/fragments/TransactListFragment.java
3cd51e589707c9c2c13d31fa7a2833f4a4cf88fa
[]
no_license
Meosit/Simple_Money
61ecd7a043ec785d282aaefd14bc39442b316a3e
f7626c11aac29d299acdcdc963298981b5774e0b
refs/heads/master
2021-01-17T06:04:18.992734
2018-05-20T13:27:12
2018-05-20T13:27:12
48,069,360
0
0
null
null
null
null
UTF-8
Java
false
false
7,635
java
package mksn.simple_money.fragments; import android.content.Intent; import android.os.Bundle; import android.view.ContextMenu; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ExpandableListView; import mksn.simple_money.ActAddActivity; import mksn.simple_money.R; import mksn.simple_money.adapters.TransactListItemAdapter; import mksn.simple_money.logics.AllData; import mksn.simple_money.logics.DataBaseHelper; import mksn.simple_money.logics.Transaction; /** * Created by Mike on 07.11.2015. */ public class TransactListFragment extends android.support.v4.app.Fragment { /** * The fragment argument representing the section number for this * fragment. */ public static final String ARG_SECTION_NUMBER = "section_number"; public static final String ARG_DATA = "data_object"; Transaction editedTransaction; private TransactListItemAdapter adapter = null; private DataBaseHelper mDataBase; private ExpandableListView transactListView; private AllData data = AllData.getInstance(); public TransactListFragment() { } /** * Returns a new instance of this fragment for the given section * number. */ public static TransactListFragment newInstance(int sectionNumber) { TransactListFragment fragment = new TransactListFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { if (v.getId() == R.id.transactListView) { ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) menuInfo; int type = ExpandableListView.getPackedPositionType(info.packedPosition); String[] menuItems = getResources().getStringArray(R.array.context_menu_items); if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) { menu.setHeaderTitle("Транзакция"); for (int i = 0; i < menuItems.length; i++) { menu.add(AllData.CONTEXT_MENU_TRANSACTIONS_GROUP_ID, i, i, menuItems[i]); } } } } @Override public boolean onContextItemSelected(MenuItem item) { if (item.getGroupId() == AllData.CONTEXT_MENU_TRANSACTIONS_GROUP_ID) { ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) item .getMenuInfo(); int type = ExpandableListView.getPackedPositionType(info.packedPosition); int groupPosition = ExpandableListView.getPackedPositionGroup(info.packedPosition); int childPosition = ExpandableListView.getPackedPositionChild(info.packedPosition); if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) { return false; } else if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) { if (item.getItemId() == 1) { // удаление транзакции mDataBase.deleteTransaction(data.getTransaction(data.getIndexFirstActInDay(groupPosition) + childPosition)); data.removeTransaction(data.getTransaction(data.getIndexFirstActInDay(groupPosition) + childPosition)); adapter.notifyDataSetChanged(); final WalletListFragment updatingWalFragment = (WalletListFragment) getActivity().getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.container + ":1"); if (updatingWalFragment != null) { updatingWalFragment.notifyFragment(); } } else { // изменение транзакции Intent intent = new Intent(getActivity(), ActAddActivity.class); intent.putExtra("requestCode", AllData.EDIT_TRANSACTION_REQUEST); editedTransaction = data.getTransaction(data.getIndexFirstActInDay(groupPosition) + childPosition); intent.putExtra(AllData.TAG_WAL_ID, data.indexOfWallet(editedTransaction.getWallet())); intent.putExtra(AllData.TAG_CAT_ID, data.indexOfCategory(editedTransaction.getCategory())); intent.putExtra(AllData.TAG_SUM, editedTransaction.getSum()); intent.putExtra(AllData.TAG_DATE, editedTransaction.getFormattedDate()); intent.putExtra(AllData.TAG_ACT, editedTransaction.getType()); intent.putExtra(AllData.TAG_CURR, editedTransaction.getWallet().getCurrency()); getActivity().startActivityForResult(intent, AllData.EDIT_TRANSACTION_REQUEST); } } return true; } return super.onContextItemSelected(item); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { getActivity(); if (requestCode == AllData.EDIT_TRANSACTION_REQUEST) { Transaction newTransaction = new Transaction( editedTransaction.getId(), data.getStringExtra(AllData.TAG_DATE), data.getIntExtra(AllData.TAG_ACT, AllData.ACT_OUTGO), data.getIntExtra(AllData.TAG_SUM, 0), data.getStringExtra(AllData.TAG_CURR), this.data.getWalletByID(data.getIntExtra(AllData.TAG_WAL_ID, 0)), this.data.getCategoryByID(data.getIntExtra(AllData.TAG_CAT_ID, 0))); mDataBase.updateTransaction(newTransaction, editedTransaction); this.data.updateTransaction(newTransaction, editedTransaction); ((WalletListFragment) getActivity().getSupportFragmentManager() .findFragmentByTag("android:switcher:" + R.id.container + ":1")) .notifyFragment(); CategoryListFragment updatingFragment = ((CategoryListFragment) getActivity().getSupportFragmentManager() .findFragmentByTag("android:switcher:" + R.id.container + ":2")); if (updatingFragment != null) { updatingFragment.notifyFragment(); } adapter.notifyDataSetChanged(); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.transact_tab, container, false); transactListView = (ExpandableListView) rootView.findViewById(R.id.transactListView); adapter = new TransactListItemAdapter(getContext()); mDataBase = new DataBaseHelper(getActivity().getApplicationContext()); transactListView.setAdapter(adapter); registerForContextMenu(transactListView); for (int i = 0; i < data.getDayCount(); i++) { transactListView.expandGroup(i); } return rootView; } public void addTransaction(Transaction transaction) { data.addTransaction(transaction); transactListView.expandGroup(data.getDayCount() - 1); adapter.notifyDataSetChanged(); } public void removeTransaction(Transaction transaction) { data.removeTransaction(transaction); adapter.notifyDataSetChanged(); } }
78ac076aefcf9eadde2fcc4452c6641031be8c64
e6dda304775813cc2b3a725e002a1abe4e143e33
/coupon-service/src/main/java/com/patrycja/springsecurity/coupon/model/Coupon.java
0611a22081029775f22c6c586a4da1b3d4e0c6f3
[]
no_license
pbeat8/spring-security-project
cc54940ad7aacd9c179734dc3cbf75f817ca11b9
1c447a82bf3640720bb831f4c02ac5e882d9b074
refs/heads/master
2023-08-22T16:21:06.373034
2021-08-26T07:56:04
2021-08-26T07:56:04
400,087,313
0
0
null
null
null
null
UTF-8
Java
false
false
983
java
package com.patrycja.springsecurity.coupon.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.math.BigDecimal; @Entity public class Coupon { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String code; private BigDecimal discount; private String expDate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public BigDecimal getDiscount() { return discount; } public void setDiscount(BigDecimal discount) { this.discount = discount; } public String getExpDate() { return expDate; } public void setExpDate(String expDate) { this.expDate = expDate; } }
c1ebbca978fa6bc3d24029728002089dc12d9660
8484e94ac6ad9d3e9b452367942ae2f6fd6fa3ff
/ParseStarterProject/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/google/android/gms/R.java
c812764335bb17df870871a0202026a21892790d
[]
no_license
ekrako/Parse-Server-Starter-Project
f0b73d64045b7aa986a3770ed811b91c7b68292c
1f960e20bb733d8c3ecae717fb7e68c4df34edec
refs/heads/master
2020-04-20T16:37:16.264439
2019-02-10T22:30:38
2019-02-10T22:30:39
168,964,052
0
0
null
null
null
null
UTF-8
Java
false
false
48,968
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 com.google.android.gms; public final class R { private R() {} public static final class array { private array() {} public static final int cast_expanded_controller_default_control_buttons = 0x7f020000; public static final int cast_mini_controller_default_control_buttons = 0x7f020001; } public static final class attr { private attr() {} public static final int adSize = 0x7f030022; public static final int adSizes = 0x7f030023; public static final int adUnitId = 0x7f030024; public static final int allowShortcuts = 0x7f030029; public static final int ambientEnabled = 0x7f03002b; public static final int appTheme = 0x7f03002c; public static final int buttonSize = 0x7f03003f; public static final int buyButtonAppearance = 0x7f030044; public static final int buyButtonHeight = 0x7f030045; public static final int buyButtonText = 0x7f030046; public static final int buyButtonWidth = 0x7f030047; public static final int cameraBearing = 0x7f030048; public static final int cameraMaxZoomPreference = 0x7f030049; public static final int cameraMinZoomPreference = 0x7f03004a; public static final int cameraTargetLat = 0x7f03004b; public static final int cameraTargetLng = 0x7f03004c; public static final int cameraTilt = 0x7f03004d; public static final int cameraZoom = 0x7f03004e; public static final int castBackgroundColor = 0x7f03004f; public static final int castButtonBackgroundColor = 0x7f030050; public static final int castButtonText = 0x7f030051; public static final int castButtonTextAppearance = 0x7f030052; public static final int castControlButtons = 0x7f030053; public static final int castExpandedControllerStyle = 0x7f030054; public static final int castExpandedControllerToolbarStyle = 0x7f030055; public static final int castFocusRadius = 0x7f030056; public static final int castIntroOverlayStyle = 0x7f030057; public static final int castMiniControllerStyle = 0x7f030058; public static final int castShowImageThumbnail = 0x7f030059; public static final int castSubtitleTextAppearance = 0x7f03005a; public static final int castTitleTextAppearance = 0x7f03005b; public static final int circleCrop = 0x7f03005f; public static final int colorScheme = 0x7f03006c; public static final int contentProviderUri = 0x7f030076; public static final int corpusId = 0x7f030078; public static final int corpusVersion = 0x7f030079; public static final int defaultIntentAction = 0x7f03007b; public static final int defaultIntentActivity = 0x7f03007c; public static final int defaultIntentData = 0x7f03007d; public static final int documentMaxAgeSecs = 0x7f030086; public static final int environment = 0x7f030090; public static final int featureType = 0x7f030093; public static final int fragmentMode = 0x7f030094; public static final int fragmentStyle = 0x7f030095; public static final int imageAspectRatio = 0x7f03009e; public static final int imageAspectRatioAdjust = 0x7f03009f; public static final int indexPrefixes = 0x7f0300a2; public static final int inputEnabled = 0x7f0300a4; public static final int latLngBoundsNorthEastLatitude = 0x7f0300a7; public static final int latLngBoundsNorthEastLongitude = 0x7f0300a8; public static final int latLngBoundsSouthWestLatitude = 0x7f0300a9; public static final int latLngBoundsSouthWestLongitude = 0x7f0300aa; public static final int liteMode = 0x7f0300e8; public static final int mapType = 0x7f0300eb; public static final int maskedWalletDetailsBackground = 0x7f0300ec; public static final int maskedWalletDetailsButtonBackground = 0x7f0300ed; public static final int maskedWalletDetailsButtonTextAppearance = 0x7f0300ee; public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f0300ef; public static final int maskedWalletDetailsLogoImageType = 0x7f0300f0; public static final int maskedWalletDetailsLogoTextColor = 0x7f0300f1; public static final int maskedWalletDetailsTextAppearance = 0x7f0300f2; public static final int noIndex = 0x7f030101; public static final int paramName = 0x7f030108; public static final int paramValue = 0x7f030109; public static final int perAccountTemplate = 0x7f03010a; public static final int schemaOrgProperty = 0x7f030117; public static final int schemaOrgType = 0x7f030118; public static final int scopeUris = 0x7f030119; public static final int searchEnabled = 0x7f03011a; public static final int searchLabel = 0x7f03011d; public static final int sectionContent = 0x7f03011f; public static final int sectionFormat = 0x7f030120; public static final int sectionId = 0x7f030121; public static final int sectionType = 0x7f030122; public static final int sectionWeight = 0x7f030123; public static final int semanticallySearchable = 0x7f030127; public static final int settingsDescription = 0x7f030128; public static final int sourceClass = 0x7f03012d; public static final int subsectionSeparator = 0x7f030135; public static final int toAddressesSection = 0x7f030154; public static final int toolbarTextColorStyle = 0x7f030157; public static final int trimmable = 0x7f030159; public static final int uiCompass = 0x7f03015a; public static final int uiMapToolbar = 0x7f03015b; public static final int uiRotateGestures = 0x7f03015c; public static final int uiScrollGestures = 0x7f03015d; public static final int uiTiltGestures = 0x7f03015e; public static final int uiZoomControls = 0x7f03015f; public static final int uiZoomGestures = 0x7f030160; public static final int useViewLifecycle = 0x7f030161; public static final int userInputSection = 0x7f030162; public static final int userInputTag = 0x7f030163; public static final int userInputValue = 0x7f030164; public static final int windowTransitionStyle = 0x7f030170; public static final int zOrderOnTop = 0x7f030171; } public static final class color { private color() {} public static final int cast_expanded_controller_background_color = 0x7f05001c; public static final int cast_expanded_controller_progress_text_color = 0x7f05001d; public static final int cast_expanded_controller_text_color = 0x7f05001e; public static final int cast_intro_overlay_background_color = 0x7f05001f; public static final int cast_intro_overlay_button_background_color = 0x7f050020; public static final int cast_libraries_material_featurehighlight_outer_highlight_default_color = 0x7f050021; public static final int cast_libraries_material_featurehighlight_text_body_color = 0x7f050022; public static final int cast_libraries_material_featurehighlight_text_header_color = 0x7f050023; public static final int common_google_signin_btn_text_dark = 0x7f050024; public static final int common_google_signin_btn_text_dark_default = 0x7f050025; public static final int common_google_signin_btn_text_dark_disabled = 0x7f050026; public static final int common_google_signin_btn_text_dark_focused = 0x7f050027; public static final int common_google_signin_btn_text_dark_pressed = 0x7f050028; public static final int common_google_signin_btn_text_light = 0x7f050029; public static final int common_google_signin_btn_text_light_default = 0x7f05002a; public static final int common_google_signin_btn_text_light_disabled = 0x7f05002b; public static final int common_google_signin_btn_text_light_focused = 0x7f05002c; public static final int common_google_signin_btn_text_light_pressed = 0x7f05002d; public static final int common_plus_signin_btn_text_dark = 0x7f05002e; public static final int common_plus_signin_btn_text_dark_default = 0x7f05002f; public static final int common_plus_signin_btn_text_dark_disabled = 0x7f050030; public static final int common_plus_signin_btn_text_dark_focused = 0x7f050031; public static final int common_plus_signin_btn_text_dark_pressed = 0x7f050032; public static final int common_plus_signin_btn_text_light = 0x7f050033; public static final int common_plus_signin_btn_text_light_default = 0x7f050034; public static final int common_plus_signin_btn_text_light_disabled = 0x7f050035; public static final int common_plus_signin_btn_text_light_focused = 0x7f050036; public static final int common_plus_signin_btn_text_light_pressed = 0x7f050037; public static final int place_autocomplete_prediction_primary_text = 0x7f05004e; public static final int place_autocomplete_prediction_primary_text_highlight = 0x7f05004f; public static final int place_autocomplete_prediction_secondary_text = 0x7f050050; public static final int place_autocomplete_search_hint = 0x7f050051; public static final int place_autocomplete_search_text = 0x7f050052; public static final int place_autocomplete_separator = 0x7f050053; public static final int wallet_bright_foreground_disabled_holo_light = 0x7f050068; public static final int wallet_bright_foreground_holo_dark = 0x7f050069; public static final int wallet_bright_foreground_holo_light = 0x7f05006a; public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f05006b; public static final int wallet_dim_foreground_holo_dark = 0x7f05006c; public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f05006d; public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f05006e; public static final int wallet_highlighted_text_holo_dark = 0x7f05006f; public static final int wallet_highlighted_text_holo_light = 0x7f050070; public static final int wallet_hint_foreground_holo_dark = 0x7f050071; public static final int wallet_hint_foreground_holo_light = 0x7f050072; public static final int wallet_holo_blue_light = 0x7f050073; public static final int wallet_link_text_light = 0x7f050074; public static final int wallet_primary_text_holo_light = 0x7f050075; public static final int wallet_secondary_text_holo_dark = 0x7f050076; } public static final class dimen { private dimen() {} public static final int cast_expanded_controller_control_button_margin = 0x7f060045; public static final int cast_intro_overlay_button_margin_bottom = 0x7f060046; public static final int cast_intro_overlay_focus_radius = 0x7f060047; public static final int cast_intro_overlay_title_margin_top = 0x7f060048; public static final int cast_libraries_material_featurehighlight_center_horizontal_offset = 0x7f060049; public static final int cast_libraries_material_featurehighlight_center_threshold = 0x7f06004a; public static final int cast_libraries_material_featurehighlight_inner_margin = 0x7f06004b; public static final int cast_libraries_material_featurehighlight_inner_radius = 0x7f06004c; public static final int cast_libraries_material_featurehighlight_outer_padding = 0x7f06004d; public static final int cast_libraries_material_featurehighlight_text_body_size = 0x7f06004e; public static final int cast_libraries_material_featurehighlight_text_header_size = 0x7f06004f; public static final int cast_libraries_material_featurehighlight_text_horizontal_margin = 0x7f060050; public static final int cast_libraries_material_featurehighlight_text_horizontal_offset = 0x7f060051; public static final int cast_libraries_material_featurehighlight_text_max_width = 0x7f060052; public static final int cast_libraries_material_featurehighlight_text_vertical_space = 0x7f060053; public static final int cast_mini_controller_control_button_margin = 0x7f060054; public static final int cast_mini_controller_font_size_line1 = 0x7f060055; public static final int cast_mini_controller_font_size_line2 = 0x7f060056; public static final int cast_mini_controller_icon_height = 0x7f060057; public static final int cast_mini_controller_icon_width = 0x7f060058; public static final int cast_notification_image_size = 0x7f060059; public static final int cast_tracks_chooser_dialog_no_message_text_size = 0x7f06005a; public static final int cast_tracks_chooser_dialog_row_text_size = 0x7f06005b; public static final int place_autocomplete_button_padding = 0x7f060065; public static final int place_autocomplete_powered_by_google_height = 0x7f060066; public static final int place_autocomplete_powered_by_google_start = 0x7f060067; public static final int place_autocomplete_prediction_height = 0x7f060068; public static final int place_autocomplete_prediction_horizontal_margin = 0x7f060069; public static final int place_autocomplete_prediction_primary_text = 0x7f06006a; public static final int place_autocomplete_prediction_secondary_text = 0x7f06006b; public static final int place_autocomplete_progress_horizontal_margin = 0x7f06006c; public static final int place_autocomplete_progress_size = 0x7f06006d; public static final int place_autocomplete_separator_start = 0x7f06006e; } public static final class drawable { private drawable() {} public static final int cast_album_art_placeholder = 0x7f07004b; public static final int cast_album_art_placeholder_large = 0x7f07004c; public static final int cast_expanded_controller_actionbar_bg_gradient_light = 0x7f07004d; public static final int cast_expanded_controller_bg_gradient_light = 0x7f07004e; public static final int cast_ic_expanded_controller_closed_caption = 0x7f07004f; public static final int cast_ic_expanded_controller_forward30 = 0x7f070050; public static final int cast_ic_expanded_controller_mute = 0x7f070051; public static final int cast_ic_expanded_controller_pause = 0x7f070052; public static final int cast_ic_expanded_controller_play = 0x7f070053; public static final int cast_ic_expanded_controller_rewind30 = 0x7f070054; public static final int cast_ic_expanded_controller_skip_next = 0x7f070055; public static final int cast_ic_expanded_controller_skip_previous = 0x7f070056; public static final int cast_ic_mini_controller_closed_caption = 0x7f070057; public static final int cast_ic_mini_controller_forward30 = 0x7f070058; public static final int cast_ic_mini_controller_mute = 0x7f070059; public static final int cast_ic_mini_controller_pause = 0x7f07005a; public static final int cast_ic_mini_controller_pause_large = 0x7f07005b; public static final int cast_ic_mini_controller_play = 0x7f07005c; public static final int cast_ic_mini_controller_play_large = 0x7f07005d; public static final int cast_ic_mini_controller_rewind30 = 0x7f07005e; public static final int cast_ic_mini_controller_skip_next = 0x7f07005f; public static final int cast_ic_mini_controller_skip_prev = 0x7f070060; public static final int cast_ic_mini_controller_stop = 0x7f070061; public static final int cast_ic_mini_controller_stop_large = 0x7f070062; public static final int cast_ic_notification_0 = 0x7f070063; public static final int cast_ic_notification_1 = 0x7f070064; public static final int cast_ic_notification_2 = 0x7f070065; public static final int cast_ic_notification_connecting = 0x7f070066; public static final int cast_ic_notification_disconnect = 0x7f070067; public static final int cast_ic_notification_forward = 0x7f070068; public static final int cast_ic_notification_forward10 = 0x7f070069; public static final int cast_ic_notification_forward30 = 0x7f07006a; public static final int cast_ic_notification_on = 0x7f07006b; public static final int cast_ic_notification_pause = 0x7f07006c; public static final int cast_ic_notification_play = 0x7f07006d; public static final int cast_ic_notification_rewind = 0x7f07006e; public static final int cast_ic_notification_rewind10 = 0x7f07006f; public static final int cast_ic_notification_rewind30 = 0x7f070070; public static final int cast_ic_notification_skip_next = 0x7f070071; public static final int cast_ic_notification_skip_prev = 0x7f070072; public static final int cast_ic_notification_small_icon = 0x7f070073; public static final int cast_ic_notification_stop_live_stream = 0x7f070074; public static final int cast_mini_controller_gradient_light = 0x7f070075; public static final int cast_mini_controller_img_placeholder = 0x7f070076; public static final int cast_mini_controller_progress_drawable = 0x7f070077; public static final int common_full_open_on_phone = 0x7f070078; public static final int common_google_signin_btn_icon_dark = 0x7f070079; public static final int common_google_signin_btn_icon_dark_disabled = 0x7f07007a; public static final int common_google_signin_btn_icon_dark_focused = 0x7f07007b; public static final int common_google_signin_btn_icon_dark_normal = 0x7f07007c; public static final int common_google_signin_btn_icon_dark_pressed = 0x7f07007d; public static final int common_google_signin_btn_icon_light = 0x7f07007e; public static final int common_google_signin_btn_icon_light_disabled = 0x7f07007f; public static final int common_google_signin_btn_icon_light_focused = 0x7f070080; public static final int common_google_signin_btn_icon_light_normal = 0x7f070081; public static final int common_google_signin_btn_icon_light_pressed = 0x7f070082; public static final int common_google_signin_btn_text_dark = 0x7f070083; public static final int common_google_signin_btn_text_dark_disabled = 0x7f070084; public static final int common_google_signin_btn_text_dark_focused = 0x7f070085; public static final int common_google_signin_btn_text_dark_normal = 0x7f070086; public static final int common_google_signin_btn_text_dark_pressed = 0x7f070087; public static final int common_google_signin_btn_text_light = 0x7f070088; public static final int common_google_signin_btn_text_light_disabled = 0x7f070089; public static final int common_google_signin_btn_text_light_focused = 0x7f07008a; public static final int common_google_signin_btn_text_light_normal = 0x7f07008b; public static final int common_google_signin_btn_text_light_pressed = 0x7f07008c; public static final int common_ic_googleplayservices = 0x7f07008d; public static final int common_plus_signin_btn_icon_dark = 0x7f07008e; public static final int common_plus_signin_btn_icon_dark_disabled = 0x7f07008f; public static final int common_plus_signin_btn_icon_dark_focused = 0x7f070090; public static final int common_plus_signin_btn_icon_dark_normal = 0x7f070091; public static final int common_plus_signin_btn_icon_dark_pressed = 0x7f070092; public static final int common_plus_signin_btn_icon_light = 0x7f070093; public static final int common_plus_signin_btn_icon_light_disabled = 0x7f070094; public static final int common_plus_signin_btn_icon_light_focused = 0x7f070095; public static final int common_plus_signin_btn_icon_light_normal = 0x7f070096; public static final int common_plus_signin_btn_icon_light_pressed = 0x7f070097; public static final int common_plus_signin_btn_text_dark = 0x7f070098; public static final int common_plus_signin_btn_text_dark_disabled = 0x7f070099; public static final int common_plus_signin_btn_text_dark_focused = 0x7f07009a; public static final int common_plus_signin_btn_text_dark_normal = 0x7f07009b; public static final int common_plus_signin_btn_text_dark_pressed = 0x7f07009c; public static final int common_plus_signin_btn_text_light = 0x7f07009d; public static final int common_plus_signin_btn_text_light_disabled = 0x7f07009e; public static final int common_plus_signin_btn_text_light_focused = 0x7f07009f; public static final int common_plus_signin_btn_text_light_normal = 0x7f0700a0; public static final int common_plus_signin_btn_text_light_pressed = 0x7f0700a1; public static final int ic_plusone_medium_off_client = 0x7f0700b6; public static final int ic_plusone_small_off_client = 0x7f0700b7; public static final int ic_plusone_standard_off_client = 0x7f0700b8; public static final int ic_plusone_tall_off_client = 0x7f0700b9; public static final int places_ic_clear = 0x7f0700ca; public static final int places_ic_search = 0x7f0700cb; public static final int powered_by_google_dark = 0x7f0700cc; public static final int powered_by_google_light = 0x7f0700cd; public static final int quantum_ic_art_track_grey600_48 = 0x7f0700ce; public static final int quantum_ic_cast_connected_white_24 = 0x7f0700cf; public static final int quantum_ic_cast_white_36 = 0x7f0700d0; public static final int quantum_ic_clear_white_24 = 0x7f0700d1; public static final int quantum_ic_closed_caption_grey600_36 = 0x7f0700d2; public static final int quantum_ic_closed_caption_white_36 = 0x7f0700d3; public static final int quantum_ic_forward_10_white_24 = 0x7f0700d4; public static final int quantum_ic_forward_30_grey600_36 = 0x7f0700d5; public static final int quantum_ic_forward_30_white_24 = 0x7f0700d6; public static final int quantum_ic_forward_30_white_36 = 0x7f0700d7; public static final int quantum_ic_keyboard_arrow_down_white_36 = 0x7f0700d8; public static final int quantum_ic_pause_circle_filled_grey600_36 = 0x7f0700d9; public static final int quantum_ic_pause_circle_filled_white_36 = 0x7f0700da; public static final int quantum_ic_pause_grey600_36 = 0x7f0700db; public static final int quantum_ic_pause_grey600_48 = 0x7f0700dc; public static final int quantum_ic_pause_white_24 = 0x7f0700dd; public static final int quantum_ic_play_arrow_grey600_36 = 0x7f0700de; public static final int quantum_ic_play_arrow_grey600_48 = 0x7f0700df; public static final int quantum_ic_play_arrow_white_24 = 0x7f0700e0; public static final int quantum_ic_play_circle_filled_grey600_36 = 0x7f0700e1; public static final int quantum_ic_play_circle_filled_white_36 = 0x7f0700e2; public static final int quantum_ic_refresh_white_24 = 0x7f0700e3; public static final int quantum_ic_replay_10_white_24 = 0x7f0700e4; public static final int quantum_ic_replay_30_grey600_36 = 0x7f0700e5; public static final int quantum_ic_replay_30_white_24 = 0x7f0700e6; public static final int quantum_ic_replay_30_white_36 = 0x7f0700e7; public static final int quantum_ic_replay_white_24 = 0x7f0700e8; public static final int quantum_ic_skip_next_grey600_36 = 0x7f0700e9; public static final int quantum_ic_skip_next_white_24 = 0x7f0700ea; public static final int quantum_ic_skip_next_white_36 = 0x7f0700eb; public static final int quantum_ic_skip_previous_grey600_36 = 0x7f0700ec; public static final int quantum_ic_skip_previous_white_24 = 0x7f0700ed; public static final int quantum_ic_skip_previous_white_36 = 0x7f0700ee; public static final int quantum_ic_stop_grey600_36 = 0x7f0700ef; public static final int quantum_ic_stop_grey600_48 = 0x7f0700f0; public static final int quantum_ic_stop_white_24 = 0x7f0700f1; public static final int quantum_ic_volume_mute_grey600_36 = 0x7f0700f2; public static final int quantum_ic_volume_mute_white_36 = 0x7f0700f3; public static final int quantum_ic_volume_off_grey600_36 = 0x7f0700f4; public static final int quantum_ic_volume_off_white_36 = 0x7f0700f5; } public static final class id { private id() {} public static final int adjust_height = 0x7f080010; public static final int adjust_width = 0x7f080011; public static final int android_pay = 0x7f080014; public static final int android_pay_dark = 0x7f080015; public static final int android_pay_light = 0x7f080016; public static final int android_pay_light_with_border = 0x7f080017; public static final int audio_empty_message = 0x7f080019; public static final int audio_list_view = 0x7f08001a; public static final int auto = 0x7f08001b; public static final int background_image_view = 0x7f08001c; public static final int background_place_holder_image_view = 0x7f08001d; public static final int book_now = 0x7f080020; public static final int button = 0x7f080022; public static final int button_0 = 0x7f080024; public static final int button_1 = 0x7f080025; public static final int button_2 = 0x7f080026; public static final int button_3 = 0x7f080027; public static final int button_play_pause_toggle = 0x7f080028; public static final int buyButton = 0x7f08002a; public static final int buy_now = 0x7f08002b; public static final int buy_with = 0x7f08002c; public static final int buy_with_google = 0x7f08002d; public static final int cast_button_type_closed_caption = 0x7f08002f; public static final int cast_button_type_custom = 0x7f080030; public static final int cast_button_type_empty = 0x7f080031; public static final int cast_button_type_forward_30_seconds = 0x7f080032; public static final int cast_button_type_mute_toggle = 0x7f080033; public static final int cast_button_type_play_pause_toggle = 0x7f080034; public static final int cast_button_type_rewind_30_seconds = 0x7f080035; public static final int cast_button_type_skip_next = 0x7f080036; public static final int cast_button_type_skip_previous = 0x7f080037; public static final int cast_featurehighlight_help_text_body_view = 0x7f080038; public static final int cast_featurehighlight_help_text_header_view = 0x7f080039; public static final int cast_featurehighlight_view = 0x7f08003a; public static final int cast_notification_id = 0x7f08003b; public static final int center = 0x7f08003c; public static final int classic = 0x7f080040; public static final int contact = 0x7f080042; public static final int container_all = 0x7f080043; public static final int container_current = 0x7f080044; public static final int controllers = 0x7f080046; public static final int crash_reporting_present = 0x7f080047; public static final int dark = 0x7f08004a; public static final int demote_common_words = 0x7f08004e; public static final int demote_rfc822_hostnames = 0x7f08004f; public static final int donate_with = 0x7f080054; public static final int donate_with_google = 0x7f080055; public static final int email = 0x7f080057; public static final int end_text = 0x7f08005a; public static final int google_wallet_classic = 0x7f08005e; public static final int google_wallet_grayscale = 0x7f08005f; public static final int google_wallet_monochrome = 0x7f080060; public static final int grayscale = 0x7f080061; public static final int holo_dark = 0x7f080063; public static final int holo_light = 0x7f080064; public static final int html = 0x7f080067; public static final int hybrid = 0x7f080068; public static final int icon_only = 0x7f08006a; public static final int icon_uri = 0x7f08006b; public static final int icon_view = 0x7f08006c; public static final int index_entity_types = 0x7f08006f; public static final int instant_message = 0x7f080071; public static final int intent_action = 0x7f080072; public static final int intent_activity = 0x7f080073; public static final int intent_data = 0x7f080074; public static final int intent_data_id = 0x7f080075; public static final int intent_extra_data = 0x7f080076; public static final int large_icon_uri = 0x7f080078; public static final int light = 0x7f08007a; public static final int loading_indicator = 0x7f080080; public static final int logo_only = 0x7f080082; public static final int main_container = 0x7f080084; public static final int match_global_nicknames = 0x7f080085; public static final int match_parent = 0x7f080086; public static final int monochrome = 0x7f08008d; public static final int none = 0x7f080090; public static final int normal = 0x7f080091; public static final int omnibox_title_section = 0x7f080092; public static final int omnibox_url_section = 0x7f080093; public static final int place_autocomplete_clear_button = 0x7f080099; public static final int place_autocomplete_powered_by_google = 0x7f08009a; public static final int place_autocomplete_prediction_primary_text = 0x7f08009b; public static final int place_autocomplete_prediction_secondary_text = 0x7f08009c; public static final int place_autocomplete_progress = 0x7f08009d; public static final int place_autocomplete_search_button = 0x7f08009e; public static final int place_autocomplete_search_input = 0x7f08009f; public static final int place_autocomplete_separator = 0x7f0800a0; public static final int plain = 0x7f0800a1; public static final int production = 0x7f0800a3; public static final int progressBar = 0x7f0800a4; public static final int radio = 0x7f0800a7; public static final int rfc822 = 0x7f0800a8; public static final int sandbox = 0x7f0800ab; public static final int satellite = 0x7f0800ac; public static final int seek_bar = 0x7f0800bb; public static final int seek_bar_controls = 0x7f0800bc; public static final int selectionDetails = 0x7f0800be; public static final int slide = 0x7f0800c5; public static final int standard = 0x7f0800cd; public static final int start_text = 0x7f0800cf; public static final int status_text = 0x7f0800d1; public static final int strict_sandbox = 0x7f0800d3; public static final int subtitle_view = 0x7f0800d6; public static final int tab_host = 0x7f0800d9; public static final int terrain = 0x7f0800da; public static final int test = 0x7f0800db; public static final int text = 0x7f0800dc; public static final int text1 = 0x7f0800dd; public static final int text2 = 0x7f0800de; public static final int textTitle = 0x7f0800e0; public static final int text_empty_message = 0x7f0800e1; public static final int text_list_view = 0x7f0800e2; public static final int thing_proto = 0x7f0800e3; public static final int title_view = 0x7f0800e8; public static final int toolbar = 0x7f0800e9; public static final int url = 0x7f0800ed; public static final int wide = 0x7f0800f1; public static final int wrap_content = 0x7f0800f4; } public static final class integer { private integer() {} public static final int cast_libraries_material_featurehighlight_pulse_base_alpha = 0x7f090004; public static final int google_play_services_version = 0x7f090005; } public static final class layout { private layout() {} public static final int cast_expanded_controller_activity = 0x7f0a001c; public static final int cast_help_text = 0x7f0a001d; public static final int cast_intro_overlay = 0x7f0a001e; public static final int cast_mini_controller = 0x7f0a001f; public static final int cast_tracks_chooser_dialog_layout = 0x7f0a0020; public static final int cast_tracks_chooser_dialog_row_layout = 0x7f0a0021; public static final int place_autocomplete_fragment = 0x7f0a002d; public static final int place_autocomplete_item_powered_by_google = 0x7f0a002e; public static final int place_autocomplete_item_prediction = 0x7f0a002f; public static final int place_autocomplete_progress = 0x7f0a0030; } public static final class raw { private raw() {} public static final int gtm_analytics = 0x7f0d0000; } public static final class string { private string() {} public static final int accept = 0x7f0e0013; public static final int cast_casting_to_device = 0x7f0e0016; public static final int cast_closed_captions = 0x7f0e0017; public static final int cast_closed_captions_unavailable = 0x7f0e0018; public static final int cast_disconnect = 0x7f0e0019; public static final int cast_expanded_controller_background_image = 0x7f0e001a; public static final int cast_expanded_controller_loading = 0x7f0e001b; public static final int cast_forward = 0x7f0e001c; public static final int cast_forward_10 = 0x7f0e001d; public static final int cast_forward_30 = 0x7f0e001e; public static final int cast_intro_overlay_button_text = 0x7f0e001f; public static final int cast_invalid_stream_duration_text = 0x7f0e0020; public static final int cast_invalid_stream_position_text = 0x7f0e0021; public static final int cast_mute = 0x7f0e0022; public static final int cast_notification_connected_message = 0x7f0e0023; public static final int cast_notification_connecting_message = 0x7f0e0024; public static final int cast_notification_disconnect = 0x7f0e0025; public static final int cast_pause = 0x7f0e0026; public static final int cast_play = 0x7f0e0027; public static final int cast_rewind = 0x7f0e0028; public static final int cast_rewind_10 = 0x7f0e0029; public static final int cast_rewind_30 = 0x7f0e002a; public static final int cast_seek_bar = 0x7f0e002b; public static final int cast_skip_next = 0x7f0e002c; public static final int cast_skip_prev = 0x7f0e002d; public static final int cast_stop = 0x7f0e002e; public static final int cast_stop_live_stream = 0x7f0e002f; public static final int cast_tracks_chooser_dialog_audio = 0x7f0e0030; public static final int cast_tracks_chooser_dialog_cancel = 0x7f0e0031; public static final int cast_tracks_chooser_dialog_default_track_name = 0x7f0e0032; public static final int cast_tracks_chooser_dialog_no_audio_tracks = 0x7f0e0033; public static final int cast_tracks_chooser_dialog_no_text_tracks = 0x7f0e0034; public static final int cast_tracks_chooser_dialog_no_tracks_available = 0x7f0e0035; public static final int cast_tracks_chooser_dialog_none = 0x7f0e0036; public static final int cast_tracks_chooser_dialog_ok = 0x7f0e0037; public static final int cast_tracks_chooser_dialog_subtitles = 0x7f0e0038; public static final int cast_unmute = 0x7f0e0039; public static final int common_google_play_services_enable_button = 0x7f0e003a; public static final int common_google_play_services_enable_text = 0x7f0e003b; public static final int common_google_play_services_enable_title = 0x7f0e003c; public static final int common_google_play_services_install_button = 0x7f0e003d; public static final int common_google_play_services_install_text_phone = 0x7f0e003e; public static final int common_google_play_services_install_text_tablet = 0x7f0e003f; public static final int common_google_play_services_install_title = 0x7f0e0040; public static final int common_google_play_services_notification_ticker = 0x7f0e0041; public static final int common_google_play_services_unknown_issue = 0x7f0e0042; public static final int common_google_play_services_unsupported_text = 0x7f0e0043; public static final int common_google_play_services_unsupported_title = 0x7f0e0044; public static final int common_google_play_services_update_button = 0x7f0e0045; public static final int common_google_play_services_update_text = 0x7f0e0046; public static final int common_google_play_services_update_title = 0x7f0e0047; public static final int common_google_play_services_updating_text = 0x7f0e0048; public static final int common_google_play_services_updating_title = 0x7f0e0049; public static final int common_google_play_services_wear_update_text = 0x7f0e004a; public static final int common_open_on_phone = 0x7f0e004b; public static final int common_signin_button_text = 0x7f0e004c; public static final int common_signin_button_text_long = 0x7f0e004d; public static final int create_calendar_message = 0x7f0e004e; public static final int create_calendar_title = 0x7f0e004f; public static final int decline = 0x7f0e0050; public static final int place_autocomplete_clear_button = 0x7f0e005f; public static final int place_autocomplete_search_hint = 0x7f0e0060; public static final int store_picture_message = 0x7f0e0062; public static final int store_picture_title = 0x7f0e0063; public static final int tagmanager_preview_dialog_button = 0x7f0e0064; public static final int tagmanager_preview_dialog_message = 0x7f0e0065; public static final int tagmanager_preview_dialog_title = 0x7f0e0066; public static final int wallet_buy_button_place_holder = 0x7f0e0069; } public static final class style { private style() {} public static final int CastExpandedController = 0x7f0f0093; public static final int CastIntroOverlay = 0x7f0f0094; public static final int CastMiniController = 0x7f0f0095; public static final int CustomCastTheme = 0x7f0f0096; public static final int TextAppearance_CastIntroOverlay_Button = 0x7f0f00db; public static final int TextAppearance_CastIntroOverlay_Title = 0x7f0f00dc; public static final int TextAppearance_CastMiniController_Subtitle = 0x7f0f00dd; public static final int TextAppearance_CastMiniController_Title = 0x7f0f00de; public static final int Theme_AppInvite_Preview = 0x7f0f00fc; public static final int Theme_AppInvite_Preview_Base = 0x7f0f00fd; public static final int Theme_IAPTheme = 0x7f0f00fe; public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f0f0106; public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f0f0107; public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f0f0108; public static final int WalletFragmentDefaultStyle = 0x7f0f0109; } public static final class styleable { private styleable() {} public static final int[] AdsAttrs = { 0x7f030022, 0x7f030023, 0x7f030024 }; public static final int AdsAttrs_adSize = 0; public static final int AdsAttrs_adSizes = 1; public static final int AdsAttrs_adUnitId = 2; public static final int[] AppDataSearch = { }; public static final int[] CastExpandedController = { 0x7f030053 }; public static final int CastExpandedController_castControlButtons = 0; public static final int[] CastIntroOverlay = { 0x7f03004f, 0x7f030050, 0x7f030051, 0x7f030052, 0x7f030056, 0x7f03005b }; public static final int CastIntroOverlay_castBackgroundColor = 0; public static final int CastIntroOverlay_castButtonBackgroundColor = 1; public static final int CastIntroOverlay_castButtonText = 2; public static final int CastIntroOverlay_castButtonTextAppearance = 3; public static final int CastIntroOverlay_castFocusRadius = 4; public static final int CastIntroOverlay_castTitleTextAppearance = 5; public static final int[] CastMiniController = { 0x7f030053, 0x7f030059, 0x7f03005a, 0x7f03005b }; public static final int CastMiniController_castControlButtons = 0; public static final int CastMiniController_castShowImageThumbnail = 1; public static final int CastMiniController_castSubtitleTextAppearance = 2; public static final int CastMiniController_castTitleTextAppearance = 3; public static final int[] Corpus = { 0x7f030076, 0x7f030078, 0x7f030079, 0x7f030086, 0x7f03010a, 0x7f030118, 0x7f030127, 0x7f030159 }; public static final int Corpus_contentProviderUri = 0; public static final int Corpus_corpusId = 1; public static final int Corpus_corpusVersion = 2; public static final int Corpus_documentMaxAgeSecs = 3; public static final int Corpus_perAccountTemplate = 4; public static final int Corpus_schemaOrgType = 5; public static final int Corpus_semanticallySearchable = 6; public static final int Corpus_trimmable = 7; public static final int[] CustomCastTheme = { 0x7f030054, 0x7f030057, 0x7f030058 }; public static final int CustomCastTheme_castExpandedControllerStyle = 0; public static final int CustomCastTheme_castIntroOverlayStyle = 1; public static final int CustomCastTheme_castMiniControllerStyle = 2; public static final int[] CustomWalletTheme = { 0x7f030157, 0x7f030170 }; public static final int CustomWalletTheme_toolbarTextColorStyle = 0; public static final int CustomWalletTheme_windowTransitionStyle = 1; public static final int[] FeatureParam = { 0x7f030108, 0x7f030109 }; public static final int FeatureParam_paramName = 0; public static final int FeatureParam_paramValue = 1; public static final int[] GlobalSearch = { 0x7f03007b, 0x7f03007c, 0x7f03007d, 0x7f03011a, 0x7f03011d, 0x7f030128 }; public static final int GlobalSearch_defaultIntentAction = 0; public static final int GlobalSearch_defaultIntentActivity = 1; public static final int GlobalSearch_defaultIntentData = 2; public static final int GlobalSearch_searchEnabled = 3; public static final int GlobalSearch_searchLabel = 4; public static final int GlobalSearch_settingsDescription = 5; public static final int[] GlobalSearchCorpus = { 0x7f030029 }; public static final int GlobalSearchCorpus_allowShortcuts = 0; public static final int[] GlobalSearchSection = { 0x7f03011f, 0x7f030122 }; public static final int GlobalSearchSection_sectionContent = 0; public static final int GlobalSearchSection_sectionType = 1; public static final int[] IMECorpus = { 0x7f0300a4, 0x7f03012d, 0x7f030154, 0x7f030162, 0x7f030163, 0x7f030164 }; public static final int IMECorpus_inputEnabled = 0; public static final int IMECorpus_sourceClass = 1; public static final int IMECorpus_toAddressesSection = 2; public static final int IMECorpus_userInputSection = 3; public static final int IMECorpus_userInputTag = 4; public static final int IMECorpus_userInputValue = 5; public static final int[] LoadingImageView = { 0x7f03005f, 0x7f03009e, 0x7f03009f }; public static final int LoadingImageView_circleCrop = 0; public static final int LoadingImageView_imageAspectRatio = 1; public static final int LoadingImageView_imageAspectRatioAdjust = 2; public static final int[] MapAttrs = { 0x7f03002b, 0x7f030048, 0x7f030049, 0x7f03004a, 0x7f03004b, 0x7f03004c, 0x7f03004d, 0x7f03004e, 0x7f0300a7, 0x7f0300a8, 0x7f0300a9, 0x7f0300aa, 0x7f0300e8, 0x7f0300eb, 0x7f03015a, 0x7f03015b, 0x7f03015c, 0x7f03015d, 0x7f03015e, 0x7f03015f, 0x7f030160, 0x7f030161, 0x7f030171 }; public static final int MapAttrs_ambientEnabled = 0; public static final int MapAttrs_cameraBearing = 1; public static final int MapAttrs_cameraMaxZoomPreference = 2; public static final int MapAttrs_cameraMinZoomPreference = 3; public static final int MapAttrs_cameraTargetLat = 4; public static final int MapAttrs_cameraTargetLng = 5; public static final int MapAttrs_cameraTilt = 6; public static final int MapAttrs_cameraZoom = 7; public static final int MapAttrs_latLngBoundsNorthEastLatitude = 8; public static final int MapAttrs_latLngBoundsNorthEastLongitude = 9; public static final int MapAttrs_latLngBoundsSouthWestLatitude = 10; public static final int MapAttrs_latLngBoundsSouthWestLongitude = 11; public static final int MapAttrs_liteMode = 12; public static final int MapAttrs_mapType = 13; public static final int MapAttrs_uiCompass = 14; public static final int MapAttrs_uiMapToolbar = 15; public static final int MapAttrs_uiRotateGestures = 16; public static final int MapAttrs_uiScrollGestures = 17; public static final int MapAttrs_uiTiltGestures = 18; public static final int MapAttrs_uiZoomControls = 19; public static final int MapAttrs_uiZoomGestures = 20; public static final int MapAttrs_useViewLifecycle = 21; public static final int MapAttrs_zOrderOnTop = 22; public static final int[] Section = { 0x7f0300a2, 0x7f030101, 0x7f030117, 0x7f030120, 0x7f030121, 0x7f030123, 0x7f030135 }; public static final int Section_indexPrefixes = 0; public static final int Section_noIndex = 1; public static final int Section_schemaOrgProperty = 2; public static final int Section_sectionFormat = 3; public static final int Section_sectionId = 4; public static final int Section_sectionWeight = 5; public static final int Section_subsectionSeparator = 6; public static final int[] SectionFeature = { 0x7f030093 }; public static final int SectionFeature_featureType = 0; public static final int[] SignInButton = { 0x7f03003f, 0x7f03006c, 0x7f030119 }; public static final int SignInButton_buttonSize = 0; public static final int SignInButton_colorScheme = 1; public static final int SignInButton_scopeUris = 2; public static final int[] WalletFragmentOptions = { 0x7f03002c, 0x7f030090, 0x7f030094, 0x7f030095 }; public static final int WalletFragmentOptions_appTheme = 0; public static final int WalletFragmentOptions_environment = 1; public static final int WalletFragmentOptions_fragmentMode = 2; public static final int WalletFragmentOptions_fragmentStyle = 3; public static final int[] WalletFragmentStyle = { 0x7f030044, 0x7f030045, 0x7f030046, 0x7f030047, 0x7f0300ec, 0x7f0300ed, 0x7f0300ee, 0x7f0300ef, 0x7f0300f0, 0x7f0300f1, 0x7f0300f2 }; public static final int WalletFragmentStyle_buyButtonAppearance = 0; public static final int WalletFragmentStyle_buyButtonHeight = 1; public static final int WalletFragmentStyle_buyButtonText = 2; public static final int WalletFragmentStyle_buyButtonWidth = 3; public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 4; public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 5; public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 6; public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 7; public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 8; public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9; public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 10; } }
77b862226875bc3c6754c791695d74b6a3745ba0
14d8935736995464fcb60fefdbe242340af32cda
/WesternacherProject/src/test/java/westernachertests/PersonalLeaveTests.java
0f04c66b06f82a2a8f13e9fcc5cad5c6d8e3f741
[]
no_license
HristinkaMineva91/WesternacherTestProject
dc86e05954ae18c9fb15e99bb420be7731ca6e67
ecafa0389cc537f5c78603f7ba8159dfd20684a0
refs/heads/master
2022-07-02T23:13:15.233562
2020-05-15T13:42:05
2020-05-15T13:42:05
264,203,314
0
0
null
null
null
null
UTF-8
Java
false
false
6,846
java
package westernachertests; import org.junit.*; import org.junit.runners.MethodSorters; import org.openqa.selenium.WebDriver; import westernachertests.pageobject.CommonActions; import westernachertests.pageobject.PersonalLeavesPage; import java.text.ParseException; import static westernachertests.pageobject.ChromeDriverUtility.*; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class PersonalLeaveTests { private static WebDriver driver; @Before public void setUp() throws InterruptedException { driver = setupAndGetDriver(); CommonActions.login(driver); PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.deleteOrExportAllPersonalLeaveForms("Delete"); } @Test public void verifyThatAllCreatedPersonalLeaveFormsCanBeDeleted() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.createMoreThanOnePersonalLeave(); personalLeavePage.deleteOrExportAllPersonalLeaveForms("Delete"); personalLeavePage.verifyThatHaveNoPlannedLeaves("No planned leaves"); } @Test public void verifyThatPersonalLeaveDaysAreShownCorrectly() throws ParseException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("12/21/2020", "01/02/2021"); personalLeavePage.verifyPersonalLeaveDays("12/21/2020", "01/02/2021"); } @Test public void verifyThatPersonalLeaveDaysCanBeSaved() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("12/21/2020", "01/02/2021"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Dec 21, 2020", "Jan 2, 2021", "13", "6"); } @Test public void verifyThatPersonalLeaveDaysCanBeCancelledAndEdited() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("01/05/2020", "01/10/2020"); personalLeavePage.cancelPersonalLeaveForm(); personalLeavePage.verifyThatPastPersonalLeaveDaysAreNotAdded("Personal leave days form is not cancelled!"); personalLeavePage.fillPersonalLeaveForm("01/06/2020", "01/07/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Jan 6, 2020", "Jan 7, 2020", "2", "2"); } @Test public void verifyThatPastPersonalLeaveDaysCannotBeAdded() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("01/05/202020", "01/10/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyThatPastPersonalLeaveDaysAreNotAdded("The application allows past leave days to be added!"); } @Test public void verifyThatPersonalLeaveDaysCanBeEdited() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("12/21/2020", "01/02/2021"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.editPersonalLeaveForm("10/07/2020", "10/17/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Oct 7, 2020", "Oct 17, 2020", "11", "8"); } @Test public void verifyThatPersonalLeaveDaysCanBeDeleted() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("10/05/2020", "10/09/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeAdded("leave successfully added."); personalLeavePage.deletePersonalLeaveForm(); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeDeleted("No planned leaves"); } @Test public void verifyThatPersonalLeaveDaysCanBeRequested() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("10/05/2020", "10/09/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Oct 5, 2020", "Oct 9, 2020", "5", "5"); personalLeavePage.requestPersonalLeaveForm(); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeRequested("Accepted"); personalLeavePage.deleteOrExportAllPersonalLeaveForms("Delete"); } @Test public void verifyThatMoreThanOnePersonalLeaveDaysCanBeRequested() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("10/05/2020", "10/09/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Oct 5, 2020", "Oct 9, 2020", "5", "5"); personalLeavePage.requestPersonalLeaveForm(); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeRequested("Accepted"); personalLeavePage.fillPersonalLeaveForm("11/02/2020", "11/06/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.requestAllPersonalLeaveForms("Request"); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeRequested("Accepted"); } @Test public void verifyThatPersonalLeaveDaysCanBeExported() throws InterruptedException { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.fillPersonalLeaveForm("10/05/2020", "10/09/2020"); personalLeavePage.savePersonalLeaveInfo(); personalLeavePage.verifyPersonalLeaveDaysCanBeSaved("Oct 5, 2020", "Oct 9, 2020", "5", "5"); personalLeavePage.requestPersonalLeaveForm(); personalLeavePage.exportPersonalLeaveForm(); personalLeavePage.verifyThatPersonalLeaveDaysFormCanBeExported("Export"); } @Test public void verifyThatTheSiteSupportsDifferentLanguages() { PersonalLeavesPage personalLeavePage = new PersonalLeavesPage(driver); personalLeavePage.switchLanguageTo("English"); personalLeavePage.verifyThatTheLanguageIsChanged("Personal leaves"); personalLeavePage.switchLanguageTo("Deutsch"); personalLeavePage.verifyThatTheLanguageIsChanged("Persönliche Blätter"); personalLeavePage.switchLanguageTo("Bulgarian"); personalLeavePage.verifyThatTheLanguageIsChanged("Личен отпуск"); } @After public void tearDown() { quitDriver(driver); } }
4fb33f529ed296a3a01f7edcb418e473c35b18fc
fefa3e7bb23cbd0fa2793a375b1d5ec3819d031d
/target/generated-sources/protobuf/java/org/tensorflow/distruntime/CreateSessionRequest.java
1cc0585189c644c5982a38261abb044bbbf88cdb
[]
no_license
beijinggao/tensorflow-serving-client-java
e16dafbf3354760c5d239d365102f14ec005937f
6dc557e97e4246c880eeb53a223b11713d515b1b
refs/heads/master
2022-12-29T19:12:41.493011
2019-11-27T10:03:19
2019-11-27T10:03:19
null
0
0
null
null
null
null
UTF-8
Java
false
true
31,473
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/protobuf/master.proto package org.tensorflow.distruntime; /** * Protobuf type {@code tensorflow.CreateSessionRequest} */ public final class CreateSessionRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tensorflow.CreateSessionRequest) CreateSessionRequestOrBuilder { private static final long serialVersionUID = 0L; // Use CreateSessionRequest.newBuilder() to construct. private CreateSessionRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private CreateSessionRequest() { target_ = ""; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private CreateSessionRequest( 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: { org.tensorflow.framework.GraphDef.Builder subBuilder = null; if (graphDef_ != null) { subBuilder = graphDef_.toBuilder(); } graphDef_ = input.readMessage(org.tensorflow.framework.GraphDef.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(graphDef_); graphDef_ = subBuilder.buildPartial(); } break; } case 18: { org.tensorflow.framework.ConfigProto.Builder subBuilder = null; if (config_ != null) { subBuilder = config_.toBuilder(); } config_ = input.readMessage(org.tensorflow.framework.ConfigProto.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(config_); config_ = subBuilder.buildPartial(); } break; } case 26: { java.lang.String s = input.readStringRequireUtf8(); target_ = s; 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 org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_CreateSessionRequest_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_CreateSessionRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( org.tensorflow.distruntime.CreateSessionRequest.class, org.tensorflow.distruntime.CreateSessionRequest.Builder.class); } public static final int GRAPH_DEF_FIELD_NUMBER = 1; private org.tensorflow.framework.GraphDef graphDef_; /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public boolean hasGraphDef() { return graphDef_ != null; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public org.tensorflow.framework.GraphDef getGraphDef() { return graphDef_ == null ? org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public org.tensorflow.framework.GraphDefOrBuilder getGraphDefOrBuilder() { return getGraphDef(); } public static final int CONFIG_FIELD_NUMBER = 2; private org.tensorflow.framework.ConfigProto config_; /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public boolean hasConfig() { return config_ != null; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public org.tensorflow.framework.ConfigProto getConfig() { return config_ == null ? org.tensorflow.framework.ConfigProto.getDefaultInstance() : config_; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public org.tensorflow.framework.ConfigProtoOrBuilder getConfigOrBuilder() { return getConfig(); } public static final int TARGET_FIELD_NUMBER = 3; private volatile java.lang.Object target_; /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public java.lang.String getTarget() { java.lang.Object ref = target_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); target_ = s; return s; } } /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public com.google.protobuf.ByteString getTargetBytes() { java.lang.Object ref = target_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); target_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } 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 (graphDef_ != null) { output.writeMessage(1, getGraphDef()); } if (config_ != null) { output.writeMessage(2, getConfig()); } if (!getTargetBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (graphDef_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getGraphDef()); } if (config_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getConfig()); } if (!getTargetBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); } 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 org.tensorflow.distruntime.CreateSessionRequest)) { return super.equals(obj); } org.tensorflow.distruntime.CreateSessionRequest other = (org.tensorflow.distruntime.CreateSessionRequest) obj; boolean result = true; result = result && (hasGraphDef() == other.hasGraphDef()); if (hasGraphDef()) { result = result && getGraphDef() .equals(other.getGraphDef()); } result = result && (hasConfig() == other.hasConfig()); if (hasConfig()) { result = result && getConfig() .equals(other.getConfig()); } result = result && getTarget() .equals(other.getTarget()); 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 (hasGraphDef()) { hash = (37 * hash) + GRAPH_DEF_FIELD_NUMBER; hash = (53 * hash) + getGraphDef().hashCode(); } if (hasConfig()) { hash = (37 * hash) + CONFIG_FIELD_NUMBER; hash = (53 * hash) + getConfig().hashCode(); } hash = (37 * hash) + TARGET_FIELD_NUMBER; hash = (53 * hash) + getTarget().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.distruntime.CreateSessionRequest parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.tensorflow.distruntime.CreateSessionRequest 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 org.tensorflow.distruntime.CreateSessionRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.tensorflow.distruntime.CreateSessionRequest 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 org.tensorflow.distruntime.CreateSessionRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.tensorflow.distruntime.CreateSessionRequest 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(org.tensorflow.distruntime.CreateSessionRequest 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; } /** * Protobuf type {@code tensorflow.CreateSessionRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:tensorflow.CreateSessionRequest) org.tensorflow.distruntime.CreateSessionRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_CreateSessionRequest_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_CreateSessionRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( org.tensorflow.distruntime.CreateSessionRequest.class, org.tensorflow.distruntime.CreateSessionRequest.Builder.class); } // Construct using org.tensorflow.distruntime.CreateSessionRequest.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 (graphDefBuilder_ == null) { graphDef_ = null; } else { graphDef_ = null; graphDefBuilder_ = null; } if (configBuilder_ == null) { config_ = null; } else { config_ = null; configBuilder_ = null; } target_ = ""; return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_CreateSessionRequest_descriptor; } public org.tensorflow.distruntime.CreateSessionRequest getDefaultInstanceForType() { return org.tensorflow.distruntime.CreateSessionRequest.getDefaultInstance(); } public org.tensorflow.distruntime.CreateSessionRequest build() { org.tensorflow.distruntime.CreateSessionRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public org.tensorflow.distruntime.CreateSessionRequest buildPartial() { org.tensorflow.distruntime.CreateSessionRequest result = new org.tensorflow.distruntime.CreateSessionRequest(this); if (graphDefBuilder_ == null) { result.graphDef_ = graphDef_; } else { result.graphDef_ = graphDefBuilder_.build(); } if (configBuilder_ == null) { result.config_ = config_; } else { result.config_ = configBuilder_.build(); } result.target_ = target_; 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 org.tensorflow.distruntime.CreateSessionRequest) { return mergeFrom((org.tensorflow.distruntime.CreateSessionRequest)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.tensorflow.distruntime.CreateSessionRequest other) { if (other == org.tensorflow.distruntime.CreateSessionRequest.getDefaultInstance()) return this; if (other.hasGraphDef()) { mergeGraphDef(other.getGraphDef()); } if (other.hasConfig()) { mergeConfig(other.getConfig()); } if (!other.getTarget().isEmpty()) { target_ = other.target_; onChanged(); } 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 { org.tensorflow.distruntime.CreateSessionRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.tensorflow.distruntime.CreateSessionRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private org.tensorflow.framework.GraphDef graphDef_ = null; private com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder> graphDefBuilder_; /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public boolean hasGraphDef() { return graphDefBuilder_ != null || graphDef_ != null; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public org.tensorflow.framework.GraphDef getGraphDef() { if (graphDefBuilder_ == null) { return graphDef_ == null ? org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_; } else { return graphDefBuilder_.getMessage(); } } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public Builder setGraphDef(org.tensorflow.framework.GraphDef value) { if (graphDefBuilder_ == null) { if (value == null) { throw new NullPointerException(); } graphDef_ = value; onChanged(); } else { graphDefBuilder_.setMessage(value); } return this; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public Builder setGraphDef( org.tensorflow.framework.GraphDef.Builder builderForValue) { if (graphDefBuilder_ == null) { graphDef_ = builderForValue.build(); onChanged(); } else { graphDefBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public Builder mergeGraphDef(org.tensorflow.framework.GraphDef value) { if (graphDefBuilder_ == null) { if (graphDef_ != null) { graphDef_ = org.tensorflow.framework.GraphDef.newBuilder(graphDef_).mergeFrom(value).buildPartial(); } else { graphDef_ = value; } onChanged(); } else { graphDefBuilder_.mergeFrom(value); } return this; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public Builder clearGraphDef() { if (graphDefBuilder_ == null) { graphDef_ = null; onChanged(); } else { graphDef_ = null; graphDefBuilder_ = null; } return this; } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public org.tensorflow.framework.GraphDef.Builder getGraphDefBuilder() { onChanged(); return getGraphDefFieldBuilder().getBuilder(); } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ public org.tensorflow.framework.GraphDefOrBuilder getGraphDefOrBuilder() { if (graphDefBuilder_ != null) { return graphDefBuilder_.getMessageOrBuilder(); } else { return graphDef_ == null ? org.tensorflow.framework.GraphDef.getDefaultInstance() : graphDef_; } } /** * <pre> * The initial graph definition. * </pre> * * <code>.tensorflow.GraphDef graph_def = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder> getGraphDefFieldBuilder() { if (graphDefBuilder_ == null) { graphDefBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder>( getGraphDef(), getParentForChildren(), isClean()); graphDef_ = null; } return graphDefBuilder_; } private org.tensorflow.framework.ConfigProto config_ = null; private com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.ConfigProto, org.tensorflow.framework.ConfigProto.Builder, org.tensorflow.framework.ConfigProtoOrBuilder> configBuilder_; /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public boolean hasConfig() { return configBuilder_ != null || config_ != null; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public org.tensorflow.framework.ConfigProto getConfig() { if (configBuilder_ == null) { return config_ == null ? org.tensorflow.framework.ConfigProto.getDefaultInstance() : config_; } else { return configBuilder_.getMessage(); } } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public Builder setConfig(org.tensorflow.framework.ConfigProto value) { if (configBuilder_ == null) { if (value == null) { throw new NullPointerException(); } config_ = value; onChanged(); } else { configBuilder_.setMessage(value); } return this; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public Builder setConfig( org.tensorflow.framework.ConfigProto.Builder builderForValue) { if (configBuilder_ == null) { config_ = builderForValue.build(); onChanged(); } else { configBuilder_.setMessage(builderForValue.build()); } return this; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public Builder mergeConfig(org.tensorflow.framework.ConfigProto value) { if (configBuilder_ == null) { if (config_ != null) { config_ = org.tensorflow.framework.ConfigProto.newBuilder(config_).mergeFrom(value).buildPartial(); } else { config_ = value; } onChanged(); } else { configBuilder_.mergeFrom(value); } return this; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public Builder clearConfig() { if (configBuilder_ == null) { config_ = null; onChanged(); } else { config_ = null; configBuilder_ = null; } return this; } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public org.tensorflow.framework.ConfigProto.Builder getConfigBuilder() { onChanged(); return getConfigFieldBuilder().getBuilder(); } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ public org.tensorflow.framework.ConfigProtoOrBuilder getConfigOrBuilder() { if (configBuilder_ != null) { return configBuilder_.getMessageOrBuilder(); } else { return config_ == null ? org.tensorflow.framework.ConfigProto.getDefaultInstance() : config_; } } /** * <pre> * Configuration options. * </pre> * * <code>.tensorflow.ConfigProto config = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.ConfigProto, org.tensorflow.framework.ConfigProto.Builder, org.tensorflow.framework.ConfigProtoOrBuilder> getConfigFieldBuilder() { if (configBuilder_ == null) { configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.ConfigProto, org.tensorflow.framework.ConfigProto.Builder, org.tensorflow.framework.ConfigProtoOrBuilder>( getConfig(), getParentForChildren(), isClean()); config_ = null; } return configBuilder_; } private java.lang.Object target_ = ""; /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public java.lang.String getTarget() { java.lang.Object ref = target_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); target_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public com.google.protobuf.ByteString getTargetBytes() { java.lang.Object ref = target_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); target_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public Builder setTarget( java.lang.String value) { if (value == null) { throw new NullPointerException(); } target_ = value; onChanged(); return this; } /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public Builder clearTarget() { target_ = getDefaultInstance().getTarget(); onChanged(); return this; } /** * <pre> * The target string used from the client's perspective. * </pre> * * <code>string target = 3;</code> */ public Builder setTargetBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); target_ = value; 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:tensorflow.CreateSessionRequest) } // @@protoc_insertion_point(class_scope:tensorflow.CreateSessionRequest) private static final org.tensorflow.distruntime.CreateSessionRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.tensorflow.distruntime.CreateSessionRequest(); } public static org.tensorflow.distruntime.CreateSessionRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<CreateSessionRequest> PARSER = new com.google.protobuf.AbstractParser<CreateSessionRequest>() { public CreateSessionRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new CreateSessionRequest(input, extensionRegistry); } }; public static com.google.protobuf.Parser<CreateSessionRequest> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<CreateSessionRequest> getParserForType() { return PARSER; } public org.tensorflow.distruntime.CreateSessionRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
554c327259a01c87b186be1512e6046038cc3eb5
e30c4afc46877c937a58a001c0edeaab07579887
/src/MoveByOffset.java
ed5efeba361879f940b2bf9dc4b11ba79c11c8b7
[]
no_license
lohithadarisa/Myfirstrepository
84a337344bcae4db49dfd9bbc97a1006a66d0a9d
6b82514f223126296bc3fea212ae154ea149d832
refs/heads/master
2020-05-07T08:45:52.742391
2019-04-10T06:28:03
2019-04-10T06:28:03
180,345,295
0
0
null
null
null
null
UTF-8
Java
false
false
835
java
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.ie.*; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Action; import org.openqa.selenium.interactions.Actions; public class MoveByOffset { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver","C:\\Users\\Admin\\Downloads\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("http://www.uitestpractice.com/students/actions"); driver.manage().window().maximize(); Actions actions=new Actions(driver); actions.moveByOffset(100, 100) .contextClick() .build() .perform(); Thread.sleep(5000); driver.quit(); } }