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
e7acbce969287f6d633a1416f97bc4aacc8fd466
7fce9d9992cb57c8f0761ac0bee1005e141be021
/lib_src/src/com/sap/spe/condmgnt/finding/ITracerAccessAttributes.java
ffdb53ca0350ca8a7a50423711f770cabbb651e6
[]
no_license
mjj55409/cintas-pricing
3e10cb68101858f56a1c1b2f40577a0ee5b3e0e0
037513a983f86cfd98a0abbe04fb448a2d1c7bea
refs/heads/master
2020-04-02T03:28:54.953342
2016-06-27T19:18:34
2016-06-27T19:18:34
60,651,882
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
/* Copyright (c) 2005 by SAP AG All rights to both implementation and design are reserved. Use and copying of this software and preparation of derivative works based upon this software are not permitted. Distribution of this software is restricted. SAP does not make any warranty about the software, its performance or its conformity to any specification. */ package com.sap.spe.condmgnt.finding; import java.util.Iterator; /** * @author d036612 * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public interface ITracerAccessAttributes { public Iterator getTraceAccessIterator(); public String getConditonRecordId(); public String getUsageSpecificData(); public Iterator getAccessAttributesIterator(); public boolean wasSuccessful(); public String getText(); }
87b3016b97dd1a1032a0bfcefe23e6d979b4ff51
d57d8067d2a17c6b67674ebfebd361dcab717d60
/Design-and-Analysis-of-Algorithms/MultiGraph.java
19ad50eebb658e24abd65692ee9a23e5f37c5cf7
[]
no_license
aksharp95/Design-and-Analysis-of-Algorithms
1b9d72f1578ed8262bbc2f8b5b04f62ab7c84cf6
1f8fdba4fa0f0bcceaa0021ffcc7862ac3a8cdd5
refs/heads/master
2022-04-14T19:26:34.565938
2020-04-09T01:03:49
2020-04-09T01:03:49
224,361,726
1
0
null
null
null
null
UTF-8
Java
false
false
2,730
java
// Question 6 import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; public class MultiGraph { private int V; private LinkedList<Integer> [] adjacency; private HashSet<Integer> [] answer; MultiGraph(int V){ this.V = V; adjacency = new LinkedList[V]; for(int i=0;i<V;i++) adjacency[i] = new LinkedList<Integer>(); answer = new HashSet[V]; for(int i=0;i<V;i++) answer[i] = new HashSet<>(); } public void addEdge(int start, int end){ adjacency[start].add(end); } public void BFS(int s){ boolean [] visited = new boolean[V]; Queue<Integer> queue = new LinkedList<>(); visited[s] = true; queue.add(s); while(!queue.isEmpty()){ int element = queue.poll(); //System.out.print(element+" "); LinkedList<Integer> childrens = adjacency[element]; for(Integer i: childrens){ if(element!=i) answer[element].add(i); if(!visited[i]){ queue.add(i); visited[i]= true; } } } } public void printAdjacencyList(){ for(int i=0;i<V;i++){ LinkedList<Integer> child = adjacency[i]; System.out.print("\nFor Node "+i+" : "); for(Integer n: child){ System.out.print(n+" "); } } } public void printNewAdjacencyList(){ for(int i=0;i<V;i++){ HashSet<Integer> child = answer[i]; System.out.print("\nFor Node "+i+" : "); for(Integer n: child){ System.out.print(n+" "); } } } public static void main(String[]args){ MultiGraph g = new MultiGraph(8); g.addEdge(0,2); g.addEdge(0,2); g.addEdge(0,3); g.addEdge(0,3); g.addEdge(1,2); g.addEdge(1,5); g.addEdge(1,5); g.addEdge(1,6); g.addEdge(2,0); g.addEdge(2,0); g.addEdge(2,1); g.addEdge(2,4); g.addEdge(3,0); g.addEdge(3,0); g.addEdge(3,7); g.addEdge(4,2); g.addEdge(4,6); g.addEdge(4,6); g.addEdge(5,1); g.addEdge(5,6); g.addEdge(5,6); g.addEdge(6,1); g.addEdge(6,4); g.addEdge(6,4); g.addEdge(6,5); g.addEdge(7,3); g.addEdge(7,3); System.out.println("Adjacency list before sorting"); g.printAdjacencyList(); g.BFS(0); System.out.println("\n\nAdjacency list after sorting"); g.printNewAdjacencyList(); } }
05db1eb68e59c0b2b421620c0c0b743767afaa8f
035c5b0fee4313d3583d3e05ecb77f5976e54053
/app/src/test/java/com/example/administrator/shopcardemo/ExampleUnitTest.java
cdb3427a0e8a864f4feb1a71d1db235ed8b323ca
[]
no_license
androidjiasheng/ShopCarDemo
a36a542f183af0e1264aeac47353ba9695ac6fda
883efbc1c756e6c975aacfd5e9c16c4ad466c90e
refs/heads/master
2021-01-19T04:43:30.125555
2017-04-06T05:13:03
2017-04-06T05:13:03
87,388,582
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.example.administrator.shopcardemo; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
9510f4e7cf3f4b0a379f58972a03c1ccdfd5e88c
f070bc719e870678f39cf4daaa87edac9e58de20
/docroot/WEB-INF/src/mylocalization/JavaText.java
1efce627047f9fd584d1923c1b15383f4dff8388
[]
no_license
YueRongLee/Questionnaire
6ccb7e597562aef548185c8a28920298cced1405
4184fb6d35912487b86c3d0304cb1bd23f87e7af
refs/heads/master
2020-03-09T10:52:32.459242
2018-04-19T06:21:43
2018-04-19T06:21:43
128,747,276
0
0
null
null
null
null
UTF-8
Java
false
false
2,199
java
package mylocalization; import myutil.TextUtil;; /** * Java端訊息本地化. * @author Jason */ public enum JavaText { /** * 非常满意. */ VERY_SATISFIED("very-satisfied"), /** * 满意. */ SATISFIED("satisfied"), /** * 比较满意. */ SO_SO("so-so"), /** * 不满意. */ NOT_SATISFIED("not-satisfied"), /** * 很差. */ SO_BAD("so-bad"), /** * 1.产品的打印质量,是否满意?. */ QUESTION_1("question1"), /** * 2.系统资料处理(如:模板修改或临时需求),是否满意?. */ QUESTION_2("question2"), /** * 3.生产时效,是否满意?. */ QUESTION_3("question3"), /** * 4.生产异常状况的处理结果,是否满意?. */ QUESTION_4("question4"), /** * 5.抱怨或投诉后处理的品质,是否满意?. */ QUESTION_5("question5"), /** * 6.产品外包装的完整性,是否满意?. */ QUESTION_6("question6"), /** * 7.物流配送时效,是否满意?. */ QUESTION_7("question7"), /** * 8.现场工作人员的服务态度和协调能力,是否满意?. */ QUESTION_8("question8"), /** * 9.打印设备的稳定姓(故障叫修率),是否满意?. */ QUESTION_9("question9"), /** * 10.设备维修人员的服务态度和维修水平,是否满意?. */ QUESTION_10("question10"), /** * 11.您的意见和建议(不满意事项可简述):. */ QUESTION_11("question11"), /** * 公司名称:. */ COMPANY_NAME("company-name"), /** * 联系人:. */ CONTACT_PERSON("contact-person"), /** * 联系方式:. */ CONTACT_METHOD("contact-method"), /** * 填表日期:. */ FILL_DATE("fill-date"), /** * 提交答卷. */ SUBMIT_BUTTON("submit-button"); //-------------properties key and return function-----------------// /** * properties key. */ private String propKey; /** * constructor. * @param str key name */ JavaText(String str) { this.propKey = str; } /** * get message in properties. * @return message */ public String value() { return TextUtil.getText(propKey); } }
eed0022aa7c18132b504f9683c8c2408b0e19a59
23ff493b8800c3c43bb37303c7c7886bef34ba82
/src/hpu/zyf/service/impl/ProductServiceImpl.java
61cf11bddd3155cd1e50b861ef6cc6c4124145d9
[]
no_license
hpulzl/snackShop
223c381fd368ba207c4e7ea7f9cf56e2476974ff
74566253173b4abba569bfb44c5492a9254a473f
refs/heads/master
2021-01-01T05:29:03.445658
2017-04-13T06:53:34
2017-04-13T06:53:34
59,088,502
1
0
null
null
null
null
GB18030
Java
false
false
3,290
java
package hpu.zyf.service.impl; import hpu.zyf.entity.Discountproduct; import hpu.zyf.entity.ProductType; import hpu.zyf.entity.Productdetail; import hpu.zyf.entity.ProductdetailExample; import hpu.zyf.entity.ProductdetailExample.Criteria; import hpu.zyf.exception.CustomException; import hpu.zyf.mapper.DiscountproductMapper; import hpu.zyf.mapper.ProductTypeMapper; import hpu.zyf.mapper.ProductdetailMapper; import hpu.zyf.service.ProductService; import hpu.zyf.util.MyRowBounds; import hpu.zyf.util.UUIDUtil; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * 商品接口的实现类 * @author admin * */ public class ProductServiceImpl implements ProductService{ //设置每页显示10条数据 public final int pageCount = 10; //设置数据库中总记录数 public int totalCount = 0; @Autowired private ProductdetailMapper pdm; @Autowired private DiscountproductMapper dpm; @Autowired private ProductTypeMapper ptm; /** * 添加商品 */ @Override public boolean inserProduct(Productdetail pd) throws Exception { if(pd==null){ throw new CustomException("插入-->商品信息不能为空"); } pd.setPdid(UUIDUtil.getUUId()); pd.setCreatetime(new Date()); if(pdm.insert(pd)>0){ return true; } return false; } @Override public boolean updateProduct(Productdetail pd) throws Exception { if(pd==null){ throw new CustomException("更新--->商品信息不能为空"); } //如果某个属性为空,你们就不用更新 if(pdm.updateByPrimaryKeySelective(pd)>0){ return true; } return false; } @Override public boolean deleteProduct(String pdid) throws Exception { if(pdm.deleteByPrimaryKey(pdid)>0){ dpm.deleteByPdid(pdid); return true; } return false; } @Override public Productdetail selectByPdid(String pdid) throws Exception { Productdetail pd = pdm.selectByPrimaryKey(pdid); if(pd == null){ throw new CustomException("查询的商品为空"); } return pd; } @Override public List<Productdetail> selectByPdExample(String example, int pageNo) throws Exception { ProductdetailExample pdExample = new ProductdetailExample(); //设置分页限制 pdExample.setRowBounds(new MyRowBounds(pageNo, pageCount)); if(example !=null){ //接下来是类别查询 Criteria critetia = pdExample.createCriteria(); critetia.andPdtypeLike("%"+example+"%"); totalCount = pdm.countByExample(pdExample); } //如果查询条件为空,设置为查询全部 return pdm.selectByExample(pdExample); } @Override public int pageTotal(String example) throws Exception { ProductdetailExample pdExample = new ProductdetailExample(); int total = 0; if(example ==null || "".equals(example)){ //如果查询条件为空,设置为查询全部 total = pdm.countByExample(pdExample); }else{ //接下来是类别查询 Criteria critetia = pdExample.createCriteria(); critetia.andPdtypeLike("%"+example+"%"); total = pdm.countByExample(pdExample); } return MyRowBounds.pageTotal(total, pageCount); } @Override public List<ProductType> selectAllType() throws Exception { return ptm.selectAllPtType(); } }
2b4f00e9d60b49ef165578279f370309958f387e
9b0ce2a6ee915fc276406f8a0e7b4dd7b11c5d48
/worker/src/main/java/com/bot/worker/config/ConfigLoader.java
b24f3d510198759e1843049575e8191be67e0029
[ "Apache-2.0" ]
permissive
oleshkoa/Bot
a374a17b507b1bf96b7fc97bba331a0b8d17199f
8b23f43a0d3ff6f48fb3d5ec902a412e744bd929
refs/heads/master
2021-01-21T22:09:42.308999
2017-01-30T20:42:24
2017-01-30T20:42:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,751
java
package com.bot.worker.config; import com.bot.worker.EventBusComponent; import com.bot.worker.common.Annotations.TaskConfigFile; import com.bot.worker.common.Constants; import com.bot.worker.common.events.AppInitEvent; import com.bot.worker.common.events.GetStatusRequest; import com.bot.worker.common.events.TaskConfigLoadedResponse; import com.bot.worker.common.events.TaskConfigReloadRequest; import com.bot.worker.common.events.TaskHoldRequest; import com.bot.worker.config.XmlConfig.XmlTaskConfig; import com.google.common.eventbus.Subscribe; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.IOException; import javax.inject.Inject; import javax.inject.Singleton; import javax.xml.bind.JAXB; import javax.xml.bind.JAXBException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Loads task configs from configuration file * Initial config loading happens on receiving {@link AppInitEvent} * * <p> * Config example * {@code * * <config> * <group id="GitHub.com"> * <task id="gitHubPing" executor="PING"> * <run>10</run> * <deadline>3</deadline> * </task> * <task id="gitHubTrace" executor="TRACE"> * <run>30</run> * <deadline>10</deadline> * </task> * </group> * <task id="Java.com" executor="CUSTOM_EX"> * <run>2</run> * <deadline>1</deadline> * <executorConfig> * <property key="key">value</property> * </executorConfig> * </task> * <task id="runOnce" executor="CUSTOM_ONE_RUN"> * <run>-1</run> * </task> * </config> * } * * <p> * All communication with other app components goes though event bus, * look {@link EventBusComponent} for more info * * @author Aleks */ @Singleton public class ConfigLoader extends EventBusComponent { private static final Logger logger = LoggerFactory.getLogger(ConfigLoader.class); private final String pathToConfigFile; @Inject ConfigLoader(@TaskConfigFile String pathToConfigFile) { this.pathToConfigFile = pathToConfigFile; } private static boolean isValidTaskConfig(String taskName, XmlTaskConfig config) { return Constants.ALL.equals(taskName) || taskName.equals(config .getTaskName()); } /** * Initial config loading on app init event * @param event app init event * @throws JAXBException in case of config parse exception * @throws IOException in case of config file IO exception */ @Subscribe void onInit(AppInitEvent event) throws JAXBException, IOException { loadTaskConfigs(Constants.ALL); } /** * Handler for task config reload requests * * @see TaskConfigReloadRequest * @param reloadEvent events with task name to reload * @throws JAXBException in case of config parse exception * @throws IOException in case of config file IO exception */ @Subscribe void onConfigReload(TaskConfigReloadRequest reloadEvent) throws JAXBException, IOException { String taskName = reloadEvent.getTaskName(); post(TaskHoldRequest.create(taskName)); loadTaskConfigs(taskName); post(GetStatusRequest.create(taskName)); } private void loadTaskConfigs(String taskName) throws JAXBException, IOException { XmlConfig config = parseConfig(); logger.info("Total group confings: {}", config.getGroups()); logger.info("Total non-grouped configs : {}", config.getTasks()); config.getGroups() .forEach(group -> group.getTasks() .stream() .filter((c) -> isValidTaskConfig(taskName, c)) .forEach((task) -> { processTaskConfig(group.getGroupName(), task); } ) ); //process un-grouped configs config.getTasks() .stream() .filter(c -> isValidTaskConfig(taskName, c)) .forEach(task -> processTaskConfig(Constants.NO_GROUP, task)); logger.info("All configs loaded"); } private void processTaskConfig(String groupName, XmlTaskConfig task) { logger.info("Loading config {}", task); post(TaskConfigLoadedResponse.create(groupName, task)); } private XmlConfig parseConfig() throws JAXBException, IOException { try (BufferedInputStream configStream = new BufferedInputStream(new FileInputStream(pathToConfigFile))) { return JAXB.unmarshal(configStream, XmlConfig.class); } } }
f623a6c3b8c23f2c79a286142e31800fe1c70d95
1770a422e9d78009777608357b892d8c01e9d990
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/v7/cardview/R.java
1116c892ac31ca5e481fc31fb5ffa4cc02802f7c
[]
no_license
jar00t/Inharmonia
d27fd7b69952c016ad8246b6d264bd15ec5810bb
40210f996dfac3a136f4d1a41ae75d27092d68e5
refs/heads/master
2021-10-10T17:47:49.667974
2019-01-14T11:04:32
2019-01-14T11:04:32
158,631,052
0
0
null
null
null
null
UTF-8
Java
false
false
3,195
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.v7.cardview; public final class R { private R() {} public static final class attr { private attr() {} public static final int cardBackgroundColor = 0x7f030065; public static final int cardCornerRadius = 0x7f030066; public static final int cardElevation = 0x7f030067; public static final int cardMaxElevation = 0x7f030068; public static final int cardPreventCornerOverlap = 0x7f030069; public static final int cardUseCompatPadding = 0x7f03006a; public static final int cardViewStyle = 0x7f03006b; public static final int contentPadding = 0x7f0300ab; public static final int contentPaddingBottom = 0x7f0300ac; public static final int contentPaddingLeft = 0x7f0300ad; public static final int contentPaddingRight = 0x7f0300ae; public static final int contentPaddingTop = 0x7f0300af; } public static final class color { private color() {} public static final int cardview_dark_background = 0x7f050027; public static final int cardview_light_background = 0x7f050028; public static final int cardview_shadow_end_color = 0x7f050029; public static final int cardview_shadow_start_color = 0x7f05002a; } public static final class dimen { private dimen() {} public static final int cardview_compat_inset_shadow = 0x7f06004d; public static final int cardview_default_elevation = 0x7f06004e; public static final int cardview_default_radius = 0x7f06004f; } public static final class style { private style() {} public static final int Base_CardView = 0x7f10000e; public static final int CardView = 0x7f1000c5; public static final int CardView_Dark = 0x7f1000c6; public static final int CardView_Light = 0x7f1000c7; } public static final class styleable { private styleable() {} public static final int[] CardView = { 0x101013f, 0x1010140, 0x7f030065, 0x7f030066, 0x7f030067, 0x7f030068, 0x7f030069, 0x7f03006a, 0x7f0300ab, 0x7f0300ac, 0x7f0300ad, 0x7f0300ae, 0x7f0300af }; public static final int CardView_android_minWidth = 0; public static final int CardView_android_minHeight = 1; public static final int CardView_cardBackgroundColor = 2; public static final int CardView_cardCornerRadius = 3; public static final int CardView_cardElevation = 4; public static final int CardView_cardMaxElevation = 5; public static final int CardView_cardPreventCornerOverlap = 6; public static final int CardView_cardUseCompatPadding = 7; public static final int CardView_contentPadding = 8; public static final int CardView_contentPaddingBottom = 9; public static final int CardView_contentPaddingLeft = 10; public static final int CardView_contentPaddingRight = 11; public static final int CardView_contentPaddingTop = 12; } }
68fa73e4d8e3c1baa91cd6e8777638658ed03a16
f03eb5b6adbd7b9bcf1e0d3689f7339b36c400b8
/app/src/main/java/org/zeniafrik/helper/BottomNavigationHelper.java
800a635db104d092e148fc3511e024b04ae677cc
[]
no_license
code-fi/zeni_app
ee7dd38eb3f31d925a20f326b9a6c3ceec084cf5
8ed99ed5b76ad4c62f1eb90b589cb4a3827dff87
refs/heads/master
2020-09-16T04:32:55.698203
2019-11-23T21:20:01
2019-11-23T21:20:01
223,654,300
0
0
null
null
null
null
UTF-8
Java
false
false
1,457
java
package org.zeniafrik.helper; import android.support.design.internal.BottomNavigationItemView; import android.support.design.internal.BottomNavigationMenuView; import android.support.design.widget.BottomNavigationView; import android.util.Log; import java.lang.reflect.Field; public class BottomNavigationHelper { public static void disableShiftMode(BottomNavigationView view) { BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0); try { Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode"); shiftingMode.setAccessible(true); shiftingMode.setBoolean(menuView, false); shiftingMode.setAccessible(false); for (int i = 0; i < menuView.getChildCount(); i++) { BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i); //noinspection RestrictedApi item.setShiftingMode(false); // set once again checked value, so view will be updated //noinspection RestrictedApi item.setChecked(item.getItemData().isChecked()); } } catch (NoSuchFieldException e) { Log.e("BNVHelper", "Unable to get shift mode field", e); } catch (IllegalAccessException e) { Log.e("BNVHelper", "Unable to change value of shift mode", e); } } }
57bee2a8a0de6a427e08940607bce9097aa9b76f
73f1645de3ab5472ea2a22d13e5f3e66a7737bc4
/src/com/hung/controller/giaovien/ExportThiLaiController.java
4a32becdf5eb14e7a129eae5adc26f8853722ece
[]
no_license
HaTrongHoang/QuanLyDiem
6451e5faef9a3996eebc5a539c1cef4e3a536141
e48e56200cce28b5e0545d0d60f974729b68a426
refs/heads/master
2023-06-06T16:54:19.571388
2021-06-21T02:47:27
2021-06-21T02:47:27
323,518,290
0
0
null
null
null
null
UTF-8
Java
false
false
4,833
java
package com.hung.controller.giaovien; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; 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 org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import com.hung.Dao.DiemDao; import com.hung.Dao.MonDao; import com.hung.Dao.Impl.DiemDaoImpl; import com.hung.Dao.Impl.MonDaoImpl; import com.hung.model.Diem; import com.hung.model.Mon; @WebServlet(urlPatterns = "/giaovien/exportThiLai") public class ExportThiLaiController extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { int id_mon = Integer.parseInt(req.getParameter("id_mon")); DiemDao diemDao = new DiemDaoImpl(); List<Diem> listDiem = diemDao.getThiLai(id_mon); MonDao mondao=new MonDaoImpl(); Mon mon=mondao.getMonId(id_mon); String url = "E:\\Java\\QuanLyDiem\\WebContent\\upload\\file\\"; // ghi file Workbook workbook = new XSSFWorkbook(); Sheet sheet = workbook.createSheet("Diem"); Font font = sheet.getWorkbook().createFont(); font.setFontName("Times New Roman"); font.setBold(true); font.setFontHeightInPoints((short) 14); CellStyle cellStyle = sheet.getWorkbook().createCellStyle(); cellStyle.setFont(font); int rownum = 3; Cell cell; Row row; row = sheet.createRow(0); cell = row.createCell(0, CellType.STRING); cell.setCellStyle(cellStyle); cell.setCellValue("Danh sách thi lại"); row = sheet.createRow(1); cell = row.createCell(0, CellType.STRING); cell.setCellStyle(cellStyle); cell.setCellValue("Môn:"+mon.getTenmon()); // row = sheet.createRow(2); // msc cell = row.createCell(0, CellType.STRING); cell.setCellValue("MSV"); // hoten cell = row.createCell(1, CellType.STRING); cell.setCellValue("Họ tên"); // lop cell = row.createCell(2, CellType.STRING); cell.setCellValue("Lớp"); // chuyencan cell = row.createCell(3, CellType.STRING); cell.setCellValue("Chuyên cần"); // kta gk cell = row.createCell(4, CellType.STRING); cell.setCellValue("Kiểm tra GK"); // ket thuc 1 cell = row.createCell(5, CellType.STRING); cell.setCellValue("Kết thúc lần 1"); // ket thuc 2 cell = row.createCell(6, CellType.STRING); cell.setCellValue("Kết thúc lần 2"); // tong ket cell = row.createCell(7, CellType.STRING); cell.setCellValue("Tổng kết"); // danh gia cell = row.createCell(8, CellType.STRING); cell.setCellValue("Đánh giá"); // điểm chữ cell = row.createCell(9, CellType.STRING); cell.setCellValue("Điểm chữ"); for (Diem diem : listDiem) { rownum++; row = sheet.createRow(rownum); cell = row.createCell(0, CellType.STRING); cell.setCellValue(diem.getSinhvien().getMsv()); cell = row.createCell(1, CellType.STRING); cell.setCellValue(diem.getSinhvien().getHoten()); cell = row.createCell(2, CellType.STRING); cell.setCellValue(diem.getSinhvien().getLop().getTenlop()); cell = row.createCell(3, CellType.NUMERIC); cell.setCellValue(diem.getChuyencan()); cell = row.createCell(4, CellType.NUMERIC); cell.setCellValue(diem.getKiemtragk()); cell = row.createCell(5, CellType.NUMERIC); cell.setCellValue(diem.getKetthuc1()); cell = row.createCell(6, CellType.NUMERIC); cell.setCellValue(diem.getKetthuc2()); cell = row.createCell(7, CellType.NUMERIC); cell.setCellValue(diem.getTongket()); cell = row.createCell(8, CellType.STRING); cell.setCellValue(diem.getDanhgia()); cell = row.createCell(9, CellType.STRING); cell.setCellValue(diem.getDiemchu()); } File file = new File(url); if (!file.exists()) { file.mkdir(); } File f = File.createTempFile("thilai", ".xlsx", file); FileOutputStream outFile = new FileOutputStream(f); workbook.write(outFile); File input = f.getAbsoluteFile(); FileInputStream is = new FileInputStream(input); resp.setContentType("application/vnd.ms-excel"); byte[] bytes = new byte[1024]; int bytesRead; while ((bytesRead = is.read(bytes)) != -1) { resp.getOutputStream().write(bytes, 0, bytesRead); } is.close(); File[] fileList = file.listFiles(); for (File fileD : fileList) { fileD.delete(); System.out.println(fileD.getName()); } } }
cae39f1318faf45af296714a4958c6cb3cb844b0
2d3073bb785ea1fa630c22993f282263b5236c27
/src/main/java/com/univ/action/FileDownload.java
963de1ea7335219580a516b83583fb5c25394c8d
[]
no_license
jssgsy/struts2
4366e2c90b746e3f4b466b081823bad4598ebb44
f57922f02f712be976743adeddba57c420cd2609
refs/heads/master
2021-01-10T17:45:48.614009
2018-11-07T06:52:54
2018-11-07T06:52:54
39,761,394
0
0
null
null
null
null
UTF-8
Java
false
false
997
java
package com.univ.action; import java.io.InputStream; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionSupport; /** * @author: liuml * @date: 2015年8月28日 上午10:38:06 * @version: 1.0 * @description: */ public class FileDownload extends ActionSupport { //获取下载的文件名,便于在文件下载框中显示,有且只需要有get方法 private String fileName; public String getFileName() { return fileName; } public InputStream getDownloadFile() throws Exception { //含有中文的文件名需要转码 this.fileName = new String("上大小伙伴.jpg".getBytes(), "ISO8859-1"); //获取资源路径 return ServletActionContext.getServletContext().getResourceAsStream("upload/上大小伙伴.jpg") ; } @Override public String execute() throws Exception { System.out.println("success"); return SUCCESS; } }
84d34b8ee844803dc9e4b41749ec2ae4889a9772
7f9e44a5f3137f2830fb8b0c3c0dd5ea5ca39aa2
/src/main/java/std/wlj/dan/SearchForPlaceReps.java
09f6c4bfaccc311ee49709bfa39f342c6b9af3c7
[]
no_license
wjohnson000/wlj-place-test
042398f3b6f3472638e2c6d263419eb4670a5dde
d23ece28efe4f79b9f5343a75b1a85e8567d3021
refs/heads/master
2021-08-03T22:42:30.127330
2021-04-29T21:19:27
2021-04-29T21:19:27
18,767,871
0
0
null
2021-08-03T12:18:26
2014-04-14T16:30:20
Java
UTF-8
Java
false
false
1,325
java
package std.wlj.dan; import org.familysearch.standards.place.data.PlaceRepBridge; import org.familysearch.standards.place.data.PlaceSearchResults; import org.familysearch.standards.place.data.SearchParameter; import org.familysearch.standards.place.data.SearchParameters; import org.familysearch.standards.place.data.solr.SolrService; import org.familysearch.standards.place.exceptions.PlaceDataException; import std.wlj.util.SolrManager; public class SearchForPlaceReps { public static void main(String... args) throws PlaceDataException { SolrService solrService = SolrManager.awsProdService(false); SearchParameters params = new SearchParameters(); params.addParam( SearchParameter.PlaceParam.createParam( 1941217 ) ); params.addParam( SearchParameter.FilterDeleteParam.createParam( true ) ); PlaceSearchResults results = solrService.search(params); System.out.println("PlaceReps: " + results.getReturnedCount()); for (PlaceRepBridge repB : results.getResults()) { System.out.println("PR: " + repB.getRepId() + " . " + repB.getDefaultLocale() + " . " + repB.getAllDisplayNames().get(repB.getDefaultLocale())); System.out.println(" D: " + repB.isDeleted() + " --> " + repB.getRevision()); } System.exit(0); } }
6b400717674907d607e5cd5fe0edbaa671de549c
7d1df492699a1d2e5e1ab0fdb91e92ef1c3b41b8
/distr_manage/src/com/xwtech/uomp/base/dao/business/BusinessExattrDzMapper.java
873efdd7a57f3ff3816acfb3a373f736662a949e
[]
no_license
5391667/xwtec
ab492d6eeb4c00a2fac74ba0adc965932a4e4c5f
ca6c4f0011d5b1dbbfaa19468e5b5989c308496d
refs/heads/master
2020-05-31T16:06:18.102976
2014-04-30T08:39:05
2014-04-30T08:39:05
190,374,043
0
0
null
2019-06-05T10:21:40
2019-06-05T10:21:40
null
UTF-8
Java
false
false
523
java
package com.xwtech.uomp.base.dao.business; import java.util.List; import com.xwtech.uomp.base.pojo.business.BusinessExattrDzBean; /** * * This class is used for ... * @author zhangel * @version * 1.0, 2013-11-6 下午02:53:06 */ public interface BusinessExattrDzMapper { List<BusinessExattrDzBean> queryBusiExtraDzByAttrKey(String attrKey); void deleteBusiExtraDzByAttrKey(String attrKey); void insert(BusinessExattrDzBean businessExattrDzBean); void deleteByBusiNum(String busiNum); }
23776939c71159c5639be502cdffb64dfb8722f2
6fa09a2331910a8fb54a8c654da641638bf3d1c0
/bbstats-backend/src/test/java/at/basketballsalzburg/bbstats/services/impl/AgeGroupServiceTest.java
11a6f5fea3d51ba6c0649c56418962434877710a
[]
no_license
martinschneider/bbstats
0f08ec4ba58c84b54134772a3c6f2c6629636bf2
61aa1d669af1e26e0daad91a15f56c5426f33e33
refs/heads/master
2021-01-20T04:58:36.946427
2017-03-03T22:43:14
2017-03-03T22:43:14
83,848,272
0
0
null
null
null
null
UTF-8
Java
false
false
1,497
java
package at.basketballsalzburg.bbstats.services.impl; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; import org.testng.annotations.Test; import at.basketballsalzburg.bbstats.dto.AgeGroupDTO; import at.basketballsalzburg.bbstats.services.AgeGroupService; @ContextConfiguration("classpath:META-INF/db-test.xml") @Transactional @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) public class AgeGroupServiceTest extends AbstractTransactionalTestNGSpringContextTests { private static final String AGEGROUP_NAME = "test"; @Autowired private AgeGroupService ageGroupService; @Test public void addAgeGroup() { int size = ageGroupService.findAll().size(); AgeGroupDTO ageGroup = new AgeGroupDTO(); ageGroup.setName(AGEGROUP_NAME); ageGroupService.save(ageGroup); assertEquals(size + 1, ageGroupService.findAll().size()); ageGroup = ageGroupService.findByName(AGEGROUP_NAME); assertNotNull(ageGroup); assertEquals(ageGroup.getName(), AGEGROUP_NAME); } }
36159dc4ceb00231719810649aebd74e9793097f
e3c9f7397802a76557c6783f3d8d839f2ccda27e
/src/Presentacion/Licencias/pnlDiasLic.java
d4dcfb7ee9c88e30e10c2efc9faed46fd5a78ef0
[]
no_license
patricioattun/SistemaDeSueldos
04fec6a8e7b4cf2457fdfbe8a283b05f85ad2a02
704669ab59ae0961c6eefcafbb6529a74df114c3
refs/heads/master
2021-05-12T01:54:17.406601
2018-01-15T17:30:33
2018-01-15T17:30:33
117,570,747
0
0
null
null
null
null
UTF-8
Java
false
false
12,055
java
package Presentacion.Licencias; import Dominio.Licencia; import Logica.LogFuncionario; import Presentacion.frmPrin; import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.sql.SQLException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; public class pnlDiasLic extends javax.swing.JPanel { private LogFuncionario log; private frmPrin frm; public pnlDiasLic(frmPrin fr) throws ClassNotFoundException, SQLException { initComponents(); this.frm=fr; this.log=new LogFuncionario(); Date d=new Date(); this.fecha.setDate(d); //this.jScrollPane1.setVisible(false); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); tablaLic = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); txtCod = new org.edisoncor.gui.textField.TextFieldRound(); btnListar = new org.edisoncor.gui.button.ButtonIcon(); fecha = new com.toedter.calendar.JDateChooser(); jLabel2 = new javax.swing.JLabel(); lblMsg = new javax.swing.JLabel(); setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Calcular Licencia Individual", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Ebrima", 1, 18))); // NOI18N setPreferredSize(new java.awt.Dimension(1000, 700)); tablaLic.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "CodFunc", "Fecha de Ingreso", "Dias Generados", "Año", "Fecha Generado", "Nombre1", "Nombre2", "Apellido1", "Apellido2" } ) { Class[] types = new Class [] { java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(tablaLic); jLabel1.setFont(new java.awt.Font("Ebrima", 1, 12)); // NOI18N jLabel1.setText("Número de Funcionario"); txtCod.setBackground(new java.awt.Color(102, 153, 255)); txtCod.setForeground(new java.awt.Color(255, 255, 255)); txtCod.setCaretColor(new java.awt.Color(255, 255, 255)); txtCod.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N txtCod.setSelectionColor(new java.awt.Color(255, 255, 255)); txtCod.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { txtCodKeyTyped(evt); } }); btnListar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/tabla.png"))); // NOI18N btnListar.setText("buttonIcon1"); btnListar.setToolTipText("Listar"); btnListar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnListarActionPerformed(evt); } }); fecha.setDateFormatString("dd/MM/yyyy"); jLabel2.setFont(new java.awt.Font("Ebrima", 1, 12)); // NOI18N jLabel2.setText("Fecha de cálculo"); lblMsg.setFont(new java.awt.Font("Ebrima", 1, 14)); // NOI18N lblMsg.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtCod, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(fecha, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)) .addGap(44, 44, 44) .addComponent(btnListar, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 857, Short.MAX_VALUE) .addComponent(lblMsg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(29, 29, 29) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2))) .addGroup(layout.createSequentialGroup() .addGap(41, 41, 41) .addComponent(btnListar, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(lblMsg, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 457, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); }// </editor-fold>//GEN-END:initComponents private void txtCodKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCodKeyTyped this.LimpiarTabla(); this.lblMsg.setText(""); //this.jScrollPane1.setVisible(false); char c=evt.getKeyChar(); if(!Character.isDigit(c)) { evt.consume(); } if(evt.getKeyChar()==10){ this.btnListar.doClick(); } }//GEN-LAST:event_txtCodKeyTyped private void btnListarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListarActionPerformed this.LimpiarTabla(); String cod=this.txtCod.getText(); Date fecha=this.fecha.getDate(); if(cod!=""){ Integer codigo=Integer.valueOf(cod); try { Licencia lic=this.log.calculaLicenciaIndividual(codigo, fecha); if(lic!=null){ this.cargarTabla(lic,fecha); this.lblMsg.setText(lic.getFuncionario().getNomCompleto()); } else{ this.lblMsg.setText("Este funcionario no existe"); } } catch (ParseException ex) { Logger.getLogger(pnlDiasLic.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex) { Logger.getLogger(pnlDiasLic.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(pnlDiasLic.class.getName()).log(Level.SEVERE, null, ex); } } }//GEN-LAST:event_btnListarActionPerformed private void LimpiarTabla() { DefaultTableModel modelo=(DefaultTableModel) tablaLic.getModel(); //primero limpio todas las filas for (int i = 0; i < tablaLic.getRowCount(); i++) { modelo.removeRow(i); i-=1; } } private String convierteFecha(Date fecha){ DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); String reportDate = df.format(fecha); // Print what date is today! return reportDate; } private void cargarTabla(Licencia f, Date fecha) throws ClassNotFoundException, SQLException{ DefaultTableModel modelo = (DefaultTableModel)tablaLic.getModel(); String fech=this.convierteFecha(fecha); this.jScrollPane1.setVisible(true); Object[] filas=new Object[modelo.getColumnCount()]; filas[0]=f.getFuncionario().getCodFunc(); filas[1]=f.getFuncionario().getFechaIngreso(); filas[2]=f.getDiasGenerados(); filas[3]=f.getAño(); filas[4]=fech; filas[5]=f.getFuncionario().getNombre1(); filas[6]=f.getFuncionario().getNombre2(); filas[7]=f.getFuncionario().getApellido1(); filas[8]=f.getFuncionario().getApellido2(); modelo.addRow(filas); this.resizeColumnWidth(tablaLic); JTableHeader th; th = tablaLic.getTableHeader(); Font fuente = new Font("Ebrima", Font.BOLD, 14); th.setBackground(Color.LIGHT_GRAY); th.setFont(fuente); } //MANEJO TAMAÑO COLUMNAS public void resizeColumnWidth(JTable table) { final TableColumnModel columnModel = table.getColumnModel(); for (int column = 0; column < table.getColumnCount(); column++) { int width = 150; // Min width for (int row = 0; row < table.getRowCount(); row++) { TableCellRenderer renderer = table.getCellRenderer(row, column); Component comp = table.prepareRenderer(renderer, row, column); width = Math.max(comp.getPreferredSize().width +1 , width); } if(width > 300) width=300; columnModel.getColumn(column).setPreferredWidth(width); } } // Variables declaration - do not modify//GEN-BEGIN:variables private org.edisoncor.gui.button.ButtonIcon btnListar; private com.toedter.calendar.JDateChooser fecha; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblMsg; private javax.swing.JTable tablaLic; private org.edisoncor.gui.textField.TextFieldRound txtCod; // End of variables declaration//GEN-END:variables }
89f7cd9ba2f24019da68beb25cf0f63b3d78fcf4
326b2d92e2369145df079fb9c528e2a857d2c11a
/src/java/com/felix/interview/leetcode/medium/dfs/PacificAtlanticWaterFlow.java
fe22b6b14a5022cdba8c3850890da2813e8c3b0b
[]
no_license
felixgao/interview
1df414f21344e02219f16b1ca7966e61fe6cba77
0593fa2a3dff759f93a379cee34a29ab80711cc2
refs/heads/master
2021-01-18T16:50:11.641731
2019-02-05T16:59:43
2019-02-05T16:59:43
86,773,709
0
0
null
null
null
null
UTF-8
Java
false
false
3,486
java
package com.felix.interview.leetcode.medium.dfs; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Created by felix on 3/18/17. * 417 * https://leetcode.com/problems/pacific-atlantic-water-flow/#/description * Given the following 5x5 matrix: * <p> * Pacific ~ ~ ~ ~ ~ * ~ 1 2 2 3 (5) * * ~ 3 2 3 (4) (4) * * ~ 2 4 (5) 3 1 * * ~ (6) (7) 1 4 5 * * ~ (5) 1 1 2 4 * * * * * * Atlantic * <p> * Return: * [[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix). */ public class PacificAtlanticWaterFlow { public List<int[]> pacificAtlantic(int[][] matrix) { List<int[]> result = new ArrayList<>(); for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix.length; j++) { if (pacificFlow(matrix, i, j, matrix[i][j]) && atlanticFlow(matrix, i, j, matrix[i][j]) ) { result.add(new int[]{i, j}); } } } return result; } private boolean pacificFlow(int[][] matrix, int row, int col, int from) { if ((row <= 0 && col <= matrix[0].length) || (col <= 0 && row <= matrix.length)) { return true; } if (matrix[row][col] <= from) { return pacificFlow(matrix, row - 1, col, matrix[row][col]) || pacificFlow(matrix, row, col - 1, matrix[row][col]); } else { return false; } } private boolean atlanticFlow(int[][] matrix, int row, int col, int from) { if ((row >= matrix.length && col <= matrix[0].length) || (col >= matrix[0].length && row <= matrix.length)) { return true; } if (matrix[row][col] <= from) { return atlanticFlow(matrix, row + 1, col, matrix[row][col]) || atlanticFlow(matrix, row, col + 1, matrix[row][col]); } else { return false; } } /******* public List<int[]> pacificAtlantic(int[][] matrix) { List<int[]> res = new LinkedList<>(); if (matrix == null || matrix.length == 0 || matrix[0].length == 0) { return res; } int n = matrix.length, m = matrix[0].length; boolean[][] pacific = new boolean[n][m]; boolean[][] atlantic = new boolean[n][m]; for (int i = 0; i < n; i++) { dfs(matrix, pacific, Integer.MIN_VALUE, i, 0); dfs(matrix, atlantic, Integer.MIN_VALUE, i, m - 1); } for (int i = 0; i < m; i++) { dfs(matrix, pacific, Integer.MIN_VALUE, 0, i); dfs(matrix, atlantic, Integer.MIN_VALUE, n - 1, i); } for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) if (pacific[i][j] && atlantic[i][j]) res.add(new int[]{i, j}); return res; } int[][] dir = new int[][]{{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; public void dfs(int[][] matrix, boolean[][] visited, int height, int x, int y) { int n = matrix.length, m = matrix[0].length; if (x < 0 || x >= n || y < 0 || y >= m || visited[x][y] || matrix[x][y] < height) return; visited[x][y] = true; for (int[] d : dir) { dfs(matrix, visited, matrix[x][y], x + d[0], y + d[1]); } } */ }
6a2f13a384bbb3320d56d3ffbb142e312522fc90
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project287/src/test/java/org/gradle/test/performance/largejavamultiproject/project287/p1436/Test28721.java
a07b621dc3ba2c080bea77a007dc1a6ddea008f8
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,113
java
package org.gradle.test.performance.largejavamultiproject.project287.p1436; import org.junit.Test; import static org.junit.Assert.*; public class Test28721 { Production28721 objectUnderTest = new Production28721(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
f607d89bba2f4b86927fc65d7df0111d535028a7
725c08af771bbbb431ade39f2e0af98415befe0e
/android/app/src/main/java/com/nda/MainActivity.java
4657a25884ea0a2aa605128fa1ac2f99e3bd3b2d
[]
no_license
FlyingPollo12/NDAapp
b3df37430125e203a6b1c8903efac45a00ee2b85
49b457c0f8694b3fad7df39554d50c9e0f7ab6c0
refs/heads/master
2023-03-26T00:20:02.483951
2021-03-20T16:30:19
2021-03-20T16:30:19
309,541,750
0
0
null
2020-12-23T19:07:17
2020-11-03T01:42:13
Java
UTF-8
Java
false
false
333
java
package com.nda; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "NDA"; } }
2c8dd74e90336eedaffc722b0b55fd8f8447809b
859fd744f586b6ee2c5631c028478840fd49fdb4
/src/main/java/com/awb/controller/ShareConttroller.java
098434f776beaf8ef301911a9b3515b605bd12ec
[]
no_license
itachihq/awb
0d02ec5742400bde5a13f53263bf26a635f47253
e7e2176364439faa5fd016249f91ed77b060c422
refs/heads/master
2022-07-12T20:10:51.989289
2019-11-26T02:51:26
2019-11-26T02:51:26
210,282,242
0
0
null
2022-06-29T17:48:16
2019-09-23T06:39:44
Java
UTF-8
Java
false
false
3,351
java
package com.awb.controller; import com.awb.entity.param.ShoporderParam; import com.awb.entity.vo.Result; import com.awb.service.LoginService; import com.awb.service.OtherService; import com.awb.service.UserService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * Created by Administrator on 2019/10/21. */ @RestController @RequestMapping("/other") public class ShareConttroller { @Autowired private LoginService loginService ; @Autowired private UserService userService; @Autowired private OtherService otherService; @ApiOperation(value = "分享注册", httpMethod = "POST", response = Result.class,notes = "") @ApiImplicitParams({ @ApiImplicitParam(name = "phone", value = "用户名", required = true, paramType = "form"), @ApiImplicitParam(name = "tgm", value = "推广码", required = true, paramType = "form"), // @ApiImplicitParam(name = "name", value = "姓名", required = false, paramType = "form") }) // @ApiImplicitParam(name = "code", value = "验证码", required = true, paramType = "form"), @PostMapping("/sharegist") public Result regist(String phone ,String name,String code,String tgm){ if (StringUtils.isEmpty(phone)){ throw new RuntimeException("用户名为空"); } if (StringUtils.isEmpty(tgm)){ throw new RuntimeException("推广码为空"); } if (StringUtils.isEmpty(code)){ throw new RuntimeException("验证码为空"); } loginService.shareRegist(phone,name,tgm,code); return new Result("注册成功"); } @RequestMapping("/selectuser") public Result selectByPhone(String phone){ Result result=new Result(); if (StringUtils.isEmpty(phone)){ throw new RuntimeException("手机号为空"); } result.setData(userService.selectOneUser(phone)); return result; } @RequestMapping("/updateuser") public Result updateUser(String id){ if (StringUtils.isEmpty(id)){ throw new RuntimeException("参数错误"); } userService.update(id); return new Result("更新成功"); } @RequestMapping("/insertorder") public Result insertorder(String phone, Integer num, String address, String handPhone, String shopid,String name){ if (StringUtils.isEmpty(phone)||StringUtils.isEmpty(address)||StringUtils.isEmpty(handPhone)||StringUtils.isEmpty(shopid)){ throw new RuntimeException("参数错误"); } if(null==num||num<=0){ throw new RuntimeException("参数错误"); } otherService.insertShoporderHand(phone,num,address,handPhone,shopid,name); return new Result("下单成功"); } // @RequestMapping("/registtest") // public Result list(String id){ // // loginService.registTest(); // return new Result("更新成功"); // } }
fb6b97b16e8fc05fbe7740a2c1dc27bed485e9cf
d6707a11f0c8e0c9f3430045f78e5a17e932eec8
/Droid/obj/Debug/android/src/android/support/mediacompat/R.java
e378642e8875370aa110ef566161a2b745074561
[]
no_license
JeisonSalda/PlatziTrips
edf9cad5a3b205240ad991c8a4da02100c8c76bb
dca1e60a26e8546e5142684a281f54b8c5fe1cda
refs/heads/master
2020-03-23T02:34:16.840654
2018-07-14T22:00:33
2018-07-14T22:00:33
140,980,629
0
0
null
null
null
null
UTF-8
Java
false
false
21,197
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 android.support.mediacompat; public final class R { public static final class attr { /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static int font=0x7f010007; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static int fontProviderAuthority=0x7f010000; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static int fontProviderCerts=0x7f010003; /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>blocking</code></td><td>0</td><td></td></tr> <tr><td><code>async</code></td><td>1</td><td></td></tr> </table> */ public static int fontProviderFetchStrategy=0x7f010004; /** <p>May be an integer value, such as "<code>100</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>May be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>forever</code></td><td>-1</td><td></td></tr> </table> */ public static int fontProviderFetchTimeout=0x7f010005; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static int fontProviderPackage=0x7f010001; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static int fontProviderQuery=0x7f010002; /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>normal</code></td><td>0</td><td></td></tr> <tr><td><code>italic</code></td><td>1</td><td></td></tr> </table> */ public static int fontStyle=0x7f010006; /** <p>Must be an integer value, such as "<code>100</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static int fontWeight=0x7f010008; } public static final class bool { public static int abc_action_bar_embed_tabs=0x7f090000; } public static final class color { public static int notification_action_color_filter=0x7f060003; public static int notification_icon_bg_color=0x7f060004; public static int notification_material_background_media_default_color=0x7f060000; public static int primary_text_default_material_dark=0x7f060001; public static int ripple_material_light=0x7f060005; public static int secondary_text_default_material_dark=0x7f060002; public static int secondary_text_default_material_light=0x7f060006; } public static final class dimen { public static int compat_button_inset_horizontal_material=0x7f0a0004; public static int compat_button_inset_vertical_material=0x7f0a0005; public static int compat_button_padding_horizontal_material=0x7f0a0006; public static int compat_button_padding_vertical_material=0x7f0a0007; public static int compat_control_corner_material=0x7f0a0008; public static int notification_action_icon_size=0x7f0a0009; public static int notification_action_text_size=0x7f0a000a; public static int notification_big_circle_margin=0x7f0a000b; public static int notification_content_margin_start=0x7f0a0001; public static int notification_large_icon_height=0x7f0a000c; public static int notification_large_icon_width=0x7f0a000d; public static int notification_main_column_padding_top=0x7f0a0002; public static int notification_media_narrow_margin=0x7f0a0003; public static int notification_right_icon_size=0x7f0a000e; public static int notification_right_side_padding_top=0x7f0a0000; public static int notification_small_icon_background_padding=0x7f0a000f; public static int notification_small_icon_size_as_large=0x7f0a0010; public static int notification_subtext_size=0x7f0a0011; public static int notification_top_pad=0x7f0a0012; public static int notification_top_pad_large_text=0x7f0a0013; } public static final class drawable { public static int notification_action_background=0x7f020000; public static int notification_bg=0x7f020001; public static int notification_bg_low=0x7f020002; public static int notification_bg_low_normal=0x7f020003; public static int notification_bg_low_pressed=0x7f020004; public static int notification_bg_normal=0x7f020005; public static int notification_bg_normal_pressed=0x7f020006; public static int notification_icon_background=0x7f020007; public static int notification_template_icon_bg=0x7f02000a; public static int notification_template_icon_low_bg=0x7f02000b; public static int notification_tile_bg=0x7f020008; public static int notify_panel_notification_icon_bg=0x7f020009; } public static final class id { public static int action0=0x7f0b0018; public static int action_container=0x7f0b0015; public static int action_divider=0x7f0b001c; public static int action_image=0x7f0b0016; public static int action_text=0x7f0b0017; public static int actions=0x7f0b0026; public static int async=0x7f0b0006; public static int blocking=0x7f0b0007; public static int cancel_action=0x7f0b0019; public static int categoriasSpinner=0x7f0b002b; public static int chronometer=0x7f0b0021; public static int ciudadTextView=0x7f0b000d; public static int detalleToolbar=0x7f0b000b; public static int detallesListView=0x7f0b000e; public static int end_padder=0x7f0b0028; public static int fechaTextView=0x7f0b000c; public static int filtroEditText=0x7f0b002a; public static int forever=0x7f0b0008; public static int guardarButton=0x7f0b0030; public static int icon=0x7f0b0023; public static int icon_group=0x7f0b0027; public static int idaDatePicker=0x7f0b002e; public static int info=0x7f0b0022; public static int italic=0x7f0b0009; public static int line1=0x7f0b0000; public static int line3=0x7f0b0001; public static int loginButton=0x7f0b0013; public static int lugarEditText=0x7f0b002d; public static int mapa=0x7f0b0014; public static int media_actions=0x7f0b001b; public static int menu_agregar=0x7f0b0031; public static int menu_guardar=0x7f0b0032; public static int normal=0x7f0b000a; public static int notification_background=0x7f0b0025; public static int notification_main_column=0x7f0b001e; public static int notification_main_column_container=0x7f0b001d; public static int nuevoLugarToolbar=0x7f0b0029; public static int passwordEditText=0x7f0b0012; public static int regresoDatePicker=0x7f0b002f; public static int right_icon=0x7f0b0024; public static int right_side=0x7f0b001f; public static int status_bar_latest_event_content=0x7f0b001a; public static int tag_transition_group=0x7f0b0002; public static int text=0x7f0b0003; public static int text2=0x7f0b0004; public static int time=0x7f0b0020; public static int title=0x7f0b0005; public static int usuarioEditText=0x7f0b0011; public static int venuesListView=0x7f0b002c; public static int viajesListView=0x7f0b0010; public static int viajesToolbar=0x7f0b000f; } public static final class integer { public static int cancel_button_image_alpha=0x7f070000; public static int status_bar_notification_info_maxnum=0x7f070001; } public static final class layout { public static int detallesviaje=0x7f040000; public static int listaviajes=0x7f040001; public static int main=0x7f040002; public static int mapa=0x7f040003; public static int notification_action=0x7f040004; public static int notification_action_tombstone=0x7f040005; public static int notification_media_action=0x7f040006; public static int notification_media_cancel_action=0x7f040007; public static int notification_template_big_media=0x7f040008; public static int notification_template_big_media_custom=0x7f040009; public static int notification_template_big_media_narrow=0x7f04000a; public static int notification_template_big_media_narrow_custom=0x7f04000b; public static int notification_template_custom_big=0x7f04000c; public static int notification_template_icon_group=0x7f04000d; public static int notification_template_lines_media=0x7f04000e; public static int notification_template_media=0x7f04000f; public static int notification_template_media_custom=0x7f040010; public static int notification_template_part_chronometer=0x7f040011; public static int notification_template_part_time=0x7f040012; public static int nuevolugar=0x7f040013; public static int nuevoviaje=0x7f040014; } public static final class menu { public static int agregar=0x7f0c0000; public static int guardar=0x7f0c0001; } public static final class mipmap { public static int ic_add=0x7f030000; public static int ic_save=0x7f030001; public static int icon=0x7f030002; } public static final class string { public static int GoogleMapsAPI=0x7f080003; public static int app_name=0x7f080002; public static int hello=0x7f080001; public static int status_bar_notification_info_overflow=0x7f080000; } public static final class style { public static int AppTheme=0x7f05000c; public static int TextAppearance_Compat_Notification=0x7f050005; public static int TextAppearance_Compat_Notification_Info=0x7f050006; public static int TextAppearance_Compat_Notification_Info_Media=0x7f050000; public static int TextAppearance_Compat_Notification_Line2=0x7f05000b; public static int TextAppearance_Compat_Notification_Line2_Media=0x7f050004; public static int TextAppearance_Compat_Notification_Media=0x7f050001; public static int TextAppearance_Compat_Notification_Time=0x7f050007; public static int TextAppearance_Compat_Notification_Time_Media=0x7f050002; public static int TextAppearance_Compat_Notification_Title=0x7f050008; public static int TextAppearance_Compat_Notification_Title_Media=0x7f050003; public static int Widget_Compat_NotificationActionContainer=0x7f050009; public static int Widget_Compat_NotificationActionText=0x7f05000a; } public static final class styleable { /** Attributes that can be used with a FontFamily. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #FontFamily_fontProviderAuthority android.support.mediacompat:fontProviderAuthority}</code></td><td></td></tr> <tr><td><code>{@link #FontFamily_fontProviderCerts android.support.mediacompat:fontProviderCerts}</code></td><td></td></tr> <tr><td><code>{@link #FontFamily_fontProviderFetchStrategy android.support.mediacompat:fontProviderFetchStrategy}</code></td><td></td></tr> <tr><td><code>{@link #FontFamily_fontProviderFetchTimeout android.support.mediacompat:fontProviderFetchTimeout}</code></td><td></td></tr> <tr><td><code>{@link #FontFamily_fontProviderPackage android.support.mediacompat:fontProviderPackage}</code></td><td></td></tr> <tr><td><code>{@link #FontFamily_fontProviderQuery android.support.mediacompat:fontProviderQuery}</code></td><td></td></tr> </table> @see #FontFamily_fontProviderAuthority @see #FontFamily_fontProviderCerts @see #FontFamily_fontProviderFetchStrategy @see #FontFamily_fontProviderFetchTimeout @see #FontFamily_fontProviderPackage @see #FontFamily_fontProviderQuery */ public static final int[] FontFamily = { 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, 0x7f010004, 0x7f010005 }; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderAuthority} attribute's value can be found in the {@link #FontFamily} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android.support.mediacompat:fontProviderAuthority */ public static int FontFamily_fontProviderAuthority = 0; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderCerts} attribute's value can be found in the {@link #FontFamily} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name android.support.mediacompat:fontProviderCerts */ public static int FontFamily_fontProviderCerts = 3; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderFetchStrategy} attribute's value can be found in the {@link #FontFamily} array. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>blocking</code></td><td>0</td><td></td></tr> <tr><td><code>async</code></td><td>1</td><td></td></tr> </table> @attr name android.support.mediacompat:fontProviderFetchStrategy */ public static int FontFamily_fontProviderFetchStrategy = 4; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderFetchTimeout} attribute's value can be found in the {@link #FontFamily} array. <p>May be an integer value, such as "<code>100</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. <p>May be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>forever</code></td><td>-1</td><td></td></tr> </table> @attr name android.support.mediacompat:fontProviderFetchTimeout */ public static int FontFamily_fontProviderFetchTimeout = 5; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderPackage} attribute's value can be found in the {@link #FontFamily} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android.support.mediacompat:fontProviderPackage */ public static int FontFamily_fontProviderPackage = 1; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#fontProviderQuery} attribute's value can be found in the {@link #FontFamily} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name android.support.mediacompat:fontProviderQuery */ public static int FontFamily_fontProviderQuery = 2; /** Attributes that can be used with a FontFamilyFont. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #FontFamilyFont_android_font android:font}</code></td><td></td></tr> <tr><td><code>{@link #FontFamilyFont_android_fontStyle android:fontStyle}</code></td><td></td></tr> <tr><td><code>{@link #FontFamilyFont_android_fontWeight android:fontWeight}</code></td><td></td></tr> <tr><td><code>{@link #FontFamilyFont_font android.support.mediacompat:font}</code></td><td></td></tr> </table> @see #FontFamilyFont_android_font @see #FontFamilyFont_android_fontStyle @see #FontFamilyFont_android_fontWeight @see #FontFamilyFont_font */ public static final int[] FontFamilyFont = { 0x00000000, 0x7f010006, 0x7f010007, 0x7f010008 }; /** <p>This symbol is the offset where the {@link android.R.attr#font} attribute's value can be found in the {@link #FontFamilyFont} array. @attr name android:font */ public static int FontFamilyFont_android_font = 0; /** <p>This symbol is the offset where the {@link android.R.attr#fontStyle} attribute's value can be found in the {@link #FontFamilyFont} array. @attr name android:fontStyle */ public static int FontFamilyFont_android_fontStyle = 0; /** <p>This symbol is the offset where the {@link android.R.attr#fontWeight} attribute's value can be found in the {@link #FontFamilyFont} array. @attr name android:fontWeight */ public static int FontFamilyFont_android_fontWeight = 0; /** <p>This symbol is the offset where the {@link android.support.mediacompat.R.attr#font} attribute's value can be found in the {@link #FontFamilyFont} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name android.support.mediacompat:font */ public static int FontFamilyFont_font = 2; };
1c6827329734bd6ca20db2fafe624d3c84ee946d
8d5b60eda732ff2333c45b682c37cb54cf2bf31f
/src/main/java/mx/com/gseguros/portal/general/dao/MenuDAO.java
d7b76833fd307d3015cbe444d5c3f7adad620fed
[]
no_license
dbrandtb/gsc
aaa1bf78a149d89c51f943006eb103147a4eb5ae
cd11940a89b2a61fd017f366d7505e1495809e35
refs/heads/master
2021-07-05T21:37:37.232642
2017-09-28T15:47:41
2017-09-28T15:47:41
105,169,627
0
0
null
null
null
null
UTF-8
Java
false
false
865
java
package mx.com.gseguros.portal.general.dao; import java.util.List; import java.util.Map; public interface MenuDAO { public List<Map<String, String>> obtieneOpcionesLiga(Map params) throws Exception; public List<Map<String, String>> obtieneMenusPorRol(Map params) throws Exception; public List<Map<String, String>> obtieneOpcionesMenu(Map params) throws Exception; public List<Map<String, String>> obtieneOpcionesSubMenu(Map params) throws Exception; public String guardaOpcionLiga(Map params) throws Exception; public String guardaMenu(Map params) throws Exception; public String guardaOpcionMenu(Map params) throws Exception; public String eliminaOpcionLiga(Map params) throws Exception; public String eliminaMenu(Map params) throws Exception; public String eliminaOpcionMenu(Map params) throws Exception; }
f7692d0de891b80a86883976142cee98136482c0
2e796fed07b32120adb91354d9763be7979d98ba
/src/main/java/ExcelDemo/Nongkeyuan.java
5203d5c80a502b6e278c6d39adee45d3c8a9e07b
[]
no_license
shenqiangbin/javademo
b52fb72763daf11981bd1db24257c720dd1d7d00
3d23716160ce497699b4185116415a425c99eb46
refs/heads/master
2023-05-24T04:41:15.809555
2023-04-14T07:31:23
2023-04-14T07:31:23
162,777,741
3
0
null
2023-01-08T06:10:34
2018-12-22T03:15:40
Java
UTF-8
Java
false
false
15,596
java
package ExcelDemo; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.zaxxer.hikari.HikariDataSource; import dbmgr.mySqlAccess.MySqlHelper; import fileDemo.FileHelper; import org.apache.commons.lang.StringUtils; import org.apache.poi.ss.usermodel.*; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import java.io.*; import java.util.ArrayList; import java.util.List; import static fileDemo.FileHelper.findFile; public class Nongkeyuan { static WebDriver driver; public static void main(String[] args) throws Exception { //sonbin(); //sonbin2(); //handleTwo(); handleTwosonbin2(); System.out.println("over"); } /** * 在处理的基础上进行二次处理 * 获取【作者】是【英文】的文献集合 */ private static void handleTwo() throws Exception { String filePath = "E:\\指标标引\\2022年维护总结\\问题数据项-700多条.xlsx"; InputStream stream = new FileInputStream(filePath); Workbook wb = WorkbookFactory.create(stream); Sheet sheet = wb.getSheetAt(0); Row row = null; int totalRow = sheet.getLastRowNum(); List<String> cells = new ArrayList<>(); String[] titles = null; short minColIx = 0; short maxColIx = 0; List<Model> list = new ArrayList<>(); int needPdfCount = 0; int notNeedPdfCount = 0; System.out.println("全英文的作者有:"); for (int r = 1; r <= sheet.getLastRowNum(); r++) { cells = new ArrayList<>(); row = sheet.getRow(r); minColIx = row.getFirstCellNum(); maxColIx = row.getLastCellNum(); String title = getCellVal(row.getCell(1)); String author = getCellVal(row.getCell(4)); String teacher = getCellVal(row.getCell(5)); String abs = getCellVal(row.getCell(2)); String pdf = getCellVal(row.getCell(21)); if (!StrHelper.isContainChinese(author)) { JSONObject object = new JSONObject(); object.put("title", title); object.put("author", author); object.put("teacher", teacher); System.out.println(object.toString()); } } } public static void handleTwosonbin2() throws Exception { //driver = initChrome(); List<String> nameList = new ArrayList<>(); // 基于上一次处理结果,继续处理 String filePath = "E:\\指标标引\\2022年维护总结\\问题数据项-700多条-new.xlsx"; String newfilePath = "E:\\指标标引\\2022年维护总结\\问题数据项-700多条-new2.xlsx"; String resultfilePath = "E:\\指标标引\\2022年维护总结\\sta2023_01_16_10_50_12_english.txt"; String fileContent = FileHelper.readTxtFile(resultfilePath); InputStream stream = new FileInputStream(filePath); Workbook wb = WorkbookFactory.create(stream); Sheet sheet = wb.getSheetAt(0); Row row = null; int totalRow = sheet.getLastRowNum(); List<String> cells = new ArrayList<>(); String[] titles = null; short minColIx = 0; short maxColIx = 0; List<Model> list = new ArrayList<>(); int needPdfCount = 0; int notNeedPdfCount = 0; System.out.println("excel标题和匹配到的标题人工对比一下:"); for (int r = 1; r <= sheet.getLastRowNum(); r++) { cells = new ArrayList<>(); row = sheet.getRow(r); minColIx = row.getFirstCellNum(); maxColIx = row.getLastCellNum(); String title = getCellVal(row.getCell(1)); String author = getCellVal(row.getCell(4)); String teacher = getCellVal(row.getCell(5)); String abs = getCellVal(row.getCell(2)); String pdf = getCellVal(row.getCell(21)); JSONObject jsonObject = getBy(fileContent, title); if (jsonObject == null) { continue; } if (jsonObject.get("文献名字匹配").equals("1")) { Cell cell = row.createCell(26); cell.setCellValue("有数据_导师匹配"); boolean allSame = jsonObject.get("title").equals(jsonObject.get("title_db")); //System.out.println(jsonObject.get("title") + ":" + jsonObject.get("title_db") + ":完成相同" + allSame); CellStyle cellHeadStyle = createCellHeadStyle(wb); if (StringUtils.isBlank(abs)) { row.getCell(2).setCellStyle(cellHeadStyle); row.getCell(2).setCellValue(jsonObject.getString("zval")); } if (StringUtils.isBlank(pdf)) { needPdfCount++; cell = row.createCell(21); cell.setCellStyle(cellHeadStyle); //cell.setCellValue(jsonObject.getString("zfile")); String name = findFileMostLike("E:\\指标标引\\2022年维护总结\\topdf-english", title, author); cell.setCellValue(name); if(nameList.contains(name)){ System.out.println("包含了name:" + name); }else{ nameList.add(name); } // //下载文献 // System.out.println(title + ":" + author); //downloadFile(title); } else { notNeedPdfCount++; } } //System.out.println(r); //System.out.println(Arrays.deepToString(cells.toArray())); } OutputStream ops = new FileOutputStream(newfilePath); wb.write(ops); ops.flush(); ops.close(); wb.close(); System.out.println("需要处理的pdf:" + needPdfCount + " 已经有的pdf:" + notNeedPdfCount); } public static void sonbin2() throws Exception { //driver = initChrome(); List<String> nameList = new ArrayList<>(); String filePath = "E:\\指标标引\\2022年维护总结\\问题数据项-700多条.xlsx"; String newfilePath = "E:\\指标标引\\2022年维护总结\\问题数据项-700多条-new.xlsx"; //String resultfilePath = "E:\\指标标引\\2022年维护总结\\sta2023_01_13_10_12_07.txt"; String resultfilePath = "E:\\指标标引\\2022年维护总结\\sta2023_01_13_16_32_22.txt"; String fileContent = FileHelper.readTxtFile(resultfilePath); InputStream stream = new FileInputStream(filePath); Workbook wb = WorkbookFactory.create(stream); Sheet sheet = wb.getSheetAt(0); Row row = null; int totalRow = sheet.getLastRowNum(); List<String> cells = new ArrayList<>(); String[] titles = null; short minColIx = 0; short maxColIx = 0; List<Model> list = new ArrayList<>(); int needPdfCount = 0; int notNeedPdfCount = 0; for (int r = 1; r <= sheet.getLastRowNum(); r++) { cells = new ArrayList<>(); row = sheet.getRow(r); minColIx = row.getFirstCellNum(); maxColIx = row.getLastCellNum(); String title = getCellVal(row.getCell(1)); String author = getCellVal(row.getCell(4)); String teacher = getCellVal(row.getCell(5)); String abs = getCellVal(row.getCell(2)); String pdf = getCellVal(row.getCell(21)); JSONObject jsonObject = getBy(fileContent, title); if (jsonObject.get("文献名字匹配").equals("1")) { Cell cell = row.createCell(26); cell.setCellValue("有数据"); CellStyle cellHeadStyle = createCellHeadStyle(wb); if (StringUtils.isBlank(abs)) { row.getCell(2).setCellStyle(cellHeadStyle); row.getCell(2).setCellValue(jsonObject.getString("zval")); } if (StringUtils.isBlank(pdf)) { needPdfCount++; cell = row.createCell(21); cell.setCellStyle(cellHeadStyle); //cell.setCellValue(jsonObject.getString("zfile")); String name = findFileMostLike("E:\\指标标引\\2022年维护总结\\Downloads", title, author); cell.setCellValue(name); if (nameList.contains(name)) { System.out.println("包含了name:" + name); } else { nameList.add(name); } System.out.println(title + ":" + author + ":" + name); //downloadFile(title); } else { notNeedPdfCount++; } } //System.out.println(r); //System.out.println(Arrays.deepToString(cells.toArray())); } OutputStream ops = new FileOutputStream(newfilePath); wb.write(ops); ops.flush(); ops.close(); wb.close(); System.out.println("需要处理的pdf:" + needPdfCount + " 已经有的pdf:" + notNeedPdfCount); } public static String findFileMostLike(String dir, String name, String author) throws IOException { File file = new File(dir); if (!file.exists()) { throw new FileNotFoundException("目录不存在"); } File[] files = file.listFiles(); float topLike = 0; File topLikeFile = null; for (int i = 0; i < files.length; i++) { String filename = files[i].getName(); float socre = StrHelper.getSimilarityRatio(filename, name + "_" + author); if (socre > topLike) { topLike = socre; topLikeFile = files[i]; } } // if (!topLikeFile.getName().contains(author)) { // throw new RuntimeException("不包含作者信息"); // } String newPath = "E:\\指标标引\\2022年维护总结\\toPdf\\" + topLikeFile.getName(); FileHelper.copyFile(topLikeFile, new File(newPath)); return topLikeFile.getName().replace(".caj", ".pdf"); } public static JSONObject getBy(String content, String title) { for (String line : content.split("\r\n")) { JSONObject obj = JSON.parseObject(line); if (obj.get("title").equals(title)) { return obj; } } return null; } static boolean okStart = false; static void downloadFile(String title) throws InterruptedException { // if (!okStart) { // // if (title.equals("城乡一体化下空间农业关键技术研究与应用探索")) { // okStart = true; // } // // return; // } String path = "https://kns.cnki.net/kns8/DefaultResult/Index?dbcode=CFLS&kw=123&korder=SU"; path = path.replace("123", title); driver.get(path); Thread.sleep(60000); List<WebElement> imgs = driver.findElements(By.className("downloadlink")); for (WebElement img : imgs) { String s = img.toString(); img.click(); } //$(".result-table-list tr td.operat a.downloadlink").attr('href') } static WebDriver initChrome() { /* https://chromedriver.storage.googleapis.com/index.html?path=73.0.3683.68/ * */ System.setProperty("webdriver.chrome.driver", "c:/chromedriver_win32/chromedriver.exe"); ChromeOptions chromeOptions = new ChromeOptions(); //chromeOptions.addArguments("--headless"); //chromeOptions.addArguments("--window-size=1280,768"); WebDriver driver = new ChromeDriver(chromeOptions); driver.get("http://www.sqber.com"); //driver.get("http://10.170.2.161:8161/models"); //driver.get("http://www.baidu.com"); driver.manage().window().maximize(); return driver; } private static CellStyle createCellHeadStyle(Workbook workbook) { CellStyle style = workbook.createCellStyle(); // 设置边框样式 // style.setBorderBottom(BorderStyle.THIN); // style.setBorderLeft(BorderStyle.THIN); // style.setBorderRight(BorderStyle.THIN); // style.setBorderTop(BorderStyle.THIN); //设置对齐样式 // style.setAlignment(HorizontalAlignment.CENTER); // style.setVerticalAlignment(VerticalAlignment.CENTER); // 生成字体 // Font font = workbook.createFont(); // 表头样式 style.setFillPattern(FillPatternType.SOLID_FOREGROUND); style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); // font.setFontHeightInPoints((short) 12); // font.setBold(true); // 把字体应用到当前的样式 //style.setFont(font); return style; } public static void sonbin() throws Exception { String filePath = "E:\\指标标引\\2022 年维护总结\\问题数据项-700多条.xlsx"; InputStream stream = new FileInputStream(filePath); Workbook wb = WorkbookFactory.create(stream); Sheet sheet = wb.getSheetAt(0); Row row = null; int totalRow = sheet.getLastRowNum(); List<String> cells = new ArrayList<>(); String[] titles = null; short minColIx = 0; short maxColIx = 0; List<Model> list = new ArrayList<>(); for (int r = 1; r <= sheet.getLastRowNum(); r++) { cells = new ArrayList<>(); row = sheet.getRow(r); minColIx = row.getFirstCellNum(); maxColIx = row.getLastCellNum(); String title = getCellVal(row.getCell(1)); String author = getCellVal(row.getCell(4)); String teacher = getCellVal(row.getCell(5)); JSONObject object = new JSONObject(); object.put("title", title); object.put("author", author); object.put("teacher", teacher); System.out.println(object.toString()); //System.out.println(r); //System.out.println(Arrays.deepToString(cells.toArray())); } } private static String getCellVal(Cell cell) { String cellVal = ""; if (cell == null) { return cellVal; } if (cell.getCellTypeEnum() == CellType.NUMERIC) { java.text.DecimalFormat formatter = new java.text.DecimalFormat("########.####"); cellVal = formatter.format(cell.getNumericCellValue()); } else if (cell.getCellTypeEnum() == CellType.BOOLEAN) { cellVal = String.valueOf(cell.getBooleanCellValue()); } else if (cell.getCellTypeEnum() == CellType.FORMULA) { try { cellVal = cell.getStringCellValue(); } catch (IllegalStateException e) { cellVal = String.valueOf(cell.getNumericCellValue()); } System.out.println(cellVal); } else { cellVal = cell.getStringCellValue(); } return cellVal; } }
2f27f7ababc4429034175d715ad5cb615a61e4a5
37d1d73ec78f69e395dbb921002fa439d90e7450
/HeadFirstJava/src/main/java/patterns/factory/factory_method/NYVeggiePizza.java
4c0118c3e122a33b872d2549ef5f6160b04a3e52
[]
no_license
SChepinog/CodeExamples
ad891d84329be75f571e5b280380e26e85323f26
3997dd73d6953c029879b8916ba45e1ee41555b6
refs/heads/master
2023-03-08T12:36:14.181317
2023-02-25T11:40:29
2023-02-25T11:40:29
241,859,007
0
0
null
null
null
null
UTF-8
Java
false
false
87
java
package patterns.factory.factory_method; public class NYVeggiePizza extends Pizza { }
4fe8220c986c1aa24bde54f169821b505acd5426
b2137dd5421e19449237b733cfe2000d1158a833
/src/main/java/cn/sys/entity/UserExample.java
b8e19efea7d8dac6254acec75e4c421e463d1d85
[]
no_license
zerasi/manager_sys
959201369dc438fc50d92089857a970b37926f3b
d7d8a85149406a9697a5b7eac094ebdef09a3107
refs/heads/master
2022-12-24T22:51:56.854244
2020-04-19T10:51:50
2020-04-19T10:51:50
248,885,394
0
0
null
2022-12-16T07:17:11
2020-03-21T01:30:29
JavaScript
UTF-8
Java
false
false
21,251
java
package cn.sys.entity; import java.util.ArrayList; import java.util.List; public class UserExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public UserExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * * * @author wcyong * * @date 2020-03-20 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andUsernameIsNull() { addCriterion("username is null"); return (Criteria) this; } public Criteria andUsernameIsNotNull() { addCriterion("username is not null"); return (Criteria) this; } public Criteria andUsernameEqualTo(String value) { addCriterion("username =", value, "username"); return (Criteria) this; } public Criteria andUsernameNotEqualTo(String value) { addCriterion("username <>", value, "username"); return (Criteria) this; } public Criteria andUsernameGreaterThan(String value) { addCriterion("username >", value, "username"); return (Criteria) this; } public Criteria andUsernameGreaterThanOrEqualTo(String value) { addCriterion("username >=", value, "username"); return (Criteria) this; } public Criteria andUsernameLessThan(String value) { addCriterion("username <", value, "username"); return (Criteria) this; } public Criteria andUsernameLessThanOrEqualTo(String value) { addCriterion("username <=", value, "username"); return (Criteria) this; } public Criteria andUsernameLike(String value) { addCriterion("username like", value, "username"); return (Criteria) this; } public Criteria andUsernameNotLike(String value) { addCriterion("username not like", value, "username"); return (Criteria) this; } public Criteria andUsernameIn(List<String> values) { addCriterion("username in", values, "username"); return (Criteria) this; } public Criteria andUsernameNotIn(List<String> values) { addCriterion("username not in", values, "username"); return (Criteria) this; } public Criteria andUsernameBetween(String value1, String value2) { addCriterion("username between", value1, value2, "username"); return (Criteria) this; } public Criteria andUsernameNotBetween(String value1, String value2) { addCriterion("username not between", value1, value2, "username"); return (Criteria) this; } public Criteria andAdresIsNull() { addCriterion("adres is null"); return (Criteria) this; } public Criteria andAdresIsNotNull() { addCriterion("adres is not null"); return (Criteria) this; } public Criteria andAdresEqualTo(String value) { addCriterion("adres =", value, "adres"); return (Criteria) this; } public Criteria andAdresNotEqualTo(String value) { addCriterion("adres <>", value, "adres"); return (Criteria) this; } public Criteria andAdresGreaterThan(String value) { addCriterion("adres >", value, "adres"); return (Criteria) this; } public Criteria andAdresGreaterThanOrEqualTo(String value) { addCriterion("adres >=", value, "adres"); return (Criteria) this; } public Criteria andAdresLessThan(String value) { addCriterion("adres <", value, "adres"); return (Criteria) this; } public Criteria andAdresLessThanOrEqualTo(String value) { addCriterion("adres <=", value, "adres"); return (Criteria) this; } public Criteria andAdresLike(String value) { addCriterion("adres like", value, "adres"); return (Criteria) this; } public Criteria andAdresNotLike(String value) { addCriterion("adres not like", value, "adres"); return (Criteria) this; } public Criteria andAdresIn(List<String> values) { addCriterion("adres in", values, "adres"); return (Criteria) this; } public Criteria andAdresNotIn(List<String> values) { addCriterion("adres not in", values, "adres"); return (Criteria) this; } public Criteria andAdresBetween(String value1, String value2) { addCriterion("adres between", value1, value2, "adres"); return (Criteria) this; } public Criteria andAdresNotBetween(String value1, String value2) { addCriterion("adres not between", value1, value2, "adres"); return (Criteria) this; } public Criteria andLink_personIsNull() { addCriterion("link_person is null"); return (Criteria) this; } public Criteria andLink_personIsNotNull() { addCriterion("link_person is not null"); return (Criteria) this; } public Criteria andLink_personEqualTo(String value) { addCriterion("link_person =", value, "link_person"); return (Criteria) this; } public Criteria andLink_personNotEqualTo(String value) { addCriterion("link_person <>", value, "link_person"); return (Criteria) this; } public Criteria andLink_personGreaterThan(String value) { addCriterion("link_person >", value, "link_person"); return (Criteria) this; } public Criteria andLink_personGreaterThanOrEqualTo(String value) { addCriterion("link_person >=", value, "link_person"); return (Criteria) this; } public Criteria andLink_personLessThan(String value) { addCriterion("link_person <", value, "link_person"); return (Criteria) this; } public Criteria andLink_personLessThanOrEqualTo(String value) { addCriterion("link_person <=", value, "link_person"); return (Criteria) this; } public Criteria andLink_personLike(String value) { addCriterion("link_person like", value, "link_person"); return (Criteria) this; } public Criteria andLink_personNotLike(String value) { addCriterion("link_person not like", value, "link_person"); return (Criteria) this; } public Criteria andLink_personIn(List<String> values) { addCriterion("link_person in", values, "link_person"); return (Criteria) this; } public Criteria andLink_personNotIn(List<String> values) { addCriterion("link_person not in", values, "link_person"); return (Criteria) this; } public Criteria andLink_personBetween(String value1, String value2) { addCriterion("link_person between", value1, value2, "link_person"); return (Criteria) this; } public Criteria andLink_personNotBetween(String value1, String value2) { addCriterion("link_person not between", value1, value2, "link_person"); return (Criteria) this; } public Criteria andRealnameIsNull() { addCriterion("realname is null"); return (Criteria) this; } public Criteria andRealnameIsNotNull() { addCriterion("realname is not null"); return (Criteria) this; } public Criteria andRealnameEqualTo(String value) { addCriterion("realname =", value, "realname"); return (Criteria) this; } public Criteria andRealnameNotEqualTo(String value) { addCriterion("realname <>", value, "realname"); return (Criteria) this; } public Criteria andRealnameGreaterThan(String value) { addCriterion("realname >", value, "realname"); return (Criteria) this; } public Criteria andRealnameGreaterThanOrEqualTo(String value) { addCriterion("realname >=", value, "realname"); return (Criteria) this; } public Criteria andRealnameLessThan(String value) { addCriterion("realname <", value, "realname"); return (Criteria) this; } public Criteria andRealnameLessThanOrEqualTo(String value) { addCriterion("realname <=", value, "realname"); return (Criteria) this; } public Criteria andRealnameLike(String value) { addCriterion("realname like", value, "realname"); return (Criteria) this; } public Criteria andRealnameNotLike(String value) { addCriterion("realname not like", value, "realname"); return (Criteria) this; } public Criteria andRealnameIn(List<String> values) { addCriterion("realname in", values, "realname"); return (Criteria) this; } public Criteria andRealnameNotIn(List<String> values) { addCriterion("realname not in", values, "realname"); return (Criteria) this; } public Criteria andRealnameBetween(String value1, String value2) { addCriterion("realname between", value1, value2, "realname"); return (Criteria) this; } public Criteria andRealnameNotBetween(String value1, String value2) { addCriterion("realname not between", value1, value2, "realname"); return (Criteria) this; } public Criteria andAccNbrIsNull() { addCriterion("accNbr is null"); return (Criteria) this; } public Criteria andAccNbrIsNotNull() { addCriterion("accNbr is not null"); return (Criteria) this; } public Criteria andAccNbrEqualTo(String value) { addCriterion("accNbr =", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrNotEqualTo(String value) { addCriterion("accNbr <>", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrGreaterThan(String value) { addCriterion("accNbr >", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrGreaterThanOrEqualTo(String value) { addCriterion("accNbr >=", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrLessThan(String value) { addCriterion("accNbr <", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrLessThanOrEqualTo(String value) { addCriterion("accNbr <=", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrLike(String value) { addCriterion("accNbr like", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrNotLike(String value) { addCriterion("accNbr not like", value, "accNbr"); return (Criteria) this; } public Criteria andAccNbrIn(List<String> values) { addCriterion("accNbr in", values, "accNbr"); return (Criteria) this; } public Criteria andAccNbrNotIn(List<String> values) { addCriterion("accNbr not in", values, "accNbr"); return (Criteria) this; } public Criteria andAccNbrBetween(String value1, String value2) { addCriterion("accNbr between", value1, value2, "accNbr"); return (Criteria) this; } public Criteria andAccNbrNotBetween(String value1, String value2) { addCriterion("accNbr not between", value1, value2, "accNbr"); return (Criteria) this; } public Criteria andEmailIsNull() { addCriterion("email is null"); return (Criteria) this; } public Criteria andEmailIsNotNull() { addCriterion("email is not null"); return (Criteria) this; } public Criteria andEmailEqualTo(String value) { addCriterion("email =", value, "email"); return (Criteria) this; } public Criteria andEmailNotEqualTo(String value) { addCriterion("email <>", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThan(String value) { addCriterion("email >", value, "email"); return (Criteria) this; } public Criteria andEmailGreaterThanOrEqualTo(String value) { addCriterion("email >=", value, "email"); return (Criteria) this; } public Criteria andEmailLessThan(String value) { addCriterion("email <", value, "email"); return (Criteria) this; } public Criteria andEmailLessThanOrEqualTo(String value) { addCriterion("email <=", value, "email"); return (Criteria) this; } public Criteria andEmailLike(String value) { addCriterion("email like", value, "email"); return (Criteria) this; } public Criteria andEmailNotLike(String value) { addCriterion("email not like", value, "email"); return (Criteria) this; } public Criteria andEmailIn(List<String> values) { addCriterion("email in", values, "email"); return (Criteria) this; } public Criteria andEmailNotIn(List<String> values) { addCriterion("email not in", values, "email"); return (Criteria) this; } public Criteria andEmailBetween(String value1, String value2) { addCriterion("email between", value1, value2, "email"); return (Criteria) this; } public Criteria andEmailNotBetween(String value1, String value2) { addCriterion("email not between", value1, value2, "email"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } /** * * * @author wcyong * * @date 2020-03-20 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
b6351542bfa6f80ffe23d0b476d00aabc138dd2c
a840ad11c5313a362827e2f50788ef0a14561fed
/9.Polymorphism/src/Wind.java
f1c7caa2505471f04d94a21b20d89ab1ebe9cc58
[]
no_license
denglitong/thingking_in_java
4f3d5cc4341877978b21b3123b57b45f0f157c0c
76addcb8758e6d5f720760ab58b9db6cf5c1ef46
refs/heads/master
2023-05-04T13:43:07.119064
2021-05-27T09:59:45
2021-05-27T09:59:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
345
java
/** * @autor denglitong * @date 2019/7/27 */ public class Wind extends Instrument { @Override public void play(Note note) { System.out.println("Wind.play() " + note); } @Override String what() { return "Wind"; } @Override void adjust() { System.out.println("Adjusting Wind"); } }
d4c5a0fea51fa3d9199c0a0ce83e59197671ad1c
d819e5c4a020fc2c7027d2cf1d527e3e7d1b164b
/src/main/java/com/nsf/traqtion/business/config/ClientConfigManagerImpl.java
9c0ab9d2317a323775a875da7cec9c1ca317e771
[]
no_license
btirumalesh/traqtest
66970a4e84536ce712712b961f61c736d22edf03
22693b1226e29a056ae81ddd57796481e3635e7c
refs/heads/master
2020-06-28T13:37:19.825426
2016-09-06T16:58:47
2016-09-06T16:58:47
67,522,567
0
0
null
null
null
null
UTF-8
Java
false
false
14,884
java
package com.nsf.traqtion.business.config; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.nsf.traqtion.data.dao.ClientConfigurationDao; import com.nsf.traqtion.data.entity.ClientBusiness; import com.nsf.traqtion.data.entity.ClientCategory; import com.nsf.traqtion.data.entity.ClientSite; import com.nsf.traqtion.data.entity.CompanyType; import com.nsf.traqtion.data.entity.JobTitle; import com.nsf.traqtion.data.entity.Language; import com.nsf.traqtion.data.entity.Role; import com.nsf.traqtion.data.entity.SecurityQuestion; import com.nsf.traqtion.data.entity.ServiceProvider; import com.nsf.traqtion.data.entity.ServiceProviderType; import com.nsf.traqtion.data.entity.Supplier; import com.nsf.traqtion.data.entity.SupplierSite; import com.nsf.traqtion.model.common.LookupDTO; import com.nsf.traqtion.model.usermgmt.SecurityQuestionsDTO; import com.nsf.traqtion.util.NSFCommon; @Service("clientConfigBusiness") public class ClientConfigManagerImpl implements ClientConfigManager { private static final Logger log = LogManager.getLogger(ClientConfigManagerImpl.class); @Autowired private ClientConfigurationDao clientConfigDao; /** * getServiceTypesByServiceProviderId method fetches list of service * provider type detail records and maps DTO objects from entity objects. * * @param servProviderId * @return List<LookUpDTO> */ public List<LookupDTO> getServiceTypesByServiceProviderId(BigInteger servProviderId) { log.info(":: getServiceTypesByServiceProviderId"); List<LookupDTO> lookUpDtoList = new ArrayList<LookupDTO>(); List<ServiceProviderType> srvPrvdrTypeList = clientConfigDao.getServiceTypesByServiceProviderId(servProviderId); for (ServiceProviderType srvPrdType : srvPrvdrTypeList) { LookupDTO lookUpDTO = new LookupDTO(); lookUpDTO.setId(srvPrdType.getServiceProviderTypeId().longValue()); lookUpDTO.setCode(srvPrdType.getCode()); lookUpDTO.setDescription(srvPrdType.getDescription()); lookUpDtoList.add(lookUpDTO); } // List<Ser> lookUpDtoList= // clientConfigDao.getServiceTypesByServiceProviderId(servProviderId); return lookUpDtoList; } /** * getServiceTypesByServiceProviderId method fetches list of service * provider names and maps DTO objects from entity objects. * * @param clientId * @return List<LookUpDTO> */ public List<LookupDTO> getServiceProviderNamesByClientId(BigInteger clientId) { log.info(":: getServiceProviderNamesByClientId"); List<LookupDTO> lookUpDtoList = new ArrayList<LookupDTO>(); List<ServiceProvider> srvPrvdrTypeList = clientConfigDao.getServiceProviderNamesByClientId(clientId); for (ServiceProvider srvPrvdr : srvPrvdrTypeList) { LookupDTO lookUpDTO = new LookupDTO(); lookUpDTO.setId(srvPrvdr.getServiceProvidersId()); lookUpDTO.setCode(srvPrvdr.getServiceProviderCode()); lookUpDTO.setName(srvPrvdr.getCompanyName()); // lookUpDTO.setDescription(srvPrvdr.getDescription()); lookUpDtoList.add(lookUpDTO); } return lookUpDtoList; } /** * getSupplierNamesByClientId method fetches list of suppliers and maps DTO * objects from entity objects. * * @param clientId * @return List<LookUpDTO> */ public List<LookupDTO> getSupplierNamesByClientId(BigInteger clientId) { log.info(":: getSupplierNamesByClientId"); List<LookupDTO> lookUpDtoList = new ArrayList<LookupDTO>(); List<Supplier> suplyrList = clientConfigDao.getSupplierNamesByClientId(clientId); for (Supplier suplyr : suplyrList) { LookupDTO lookUpDTO = new LookupDTO(); lookUpDTO.setId(suplyr.getSupplierId()); lookUpDTO.setCode(suplyr.getNsfSupplierCode()); lookUpDTO.setName(suplyr.getSupplierName()); // lookUpDTO.setDescription(suplyr.getDescription()); lookUpDtoList.add(lookUpDTO); } return lookUpDtoList; } @Override public List<LookupDTO> geCompanyType() { log.info(" :: getCompanyTypes"); List<CompanyType> userEntityList = (List<CompanyType>) clientConfigDao.geCompanyType(); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); if (userEntityList != null) { LookupDTO dto = null; for (CompanyType cmpType : userEntityList) { dto = new LookupDTO(); dto.setCode(cmpType.getCode()); dto.setDescription(cmpType.getDescription()); dto.setId(cmpType.getCompanyTypeId()); lookupDTOList.add(dto); } } return lookupDTOList; } @Override public List<LookupDTO> geRoleList(Integer clientId) { log.info(" :: geRoleList"); List<Role> userEntityList = (List<Role>) clientConfigDao.geRoleList(clientId); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); if (userEntityList != null) { LookupDTO dto = null; for (Role cmpType : userEntityList) { dto = new LookupDTO(); dto.setDescription(cmpType.getRoleDesctiption()); dto.setName(cmpType.getRoleName()); dto.setId(cmpType.getRoleId()); /* * dto.setId(cmpType.getRoleId()); * dto.setName(cmpType.getRoleName()); */ lookupDTOList.add(dto); } } return lookupDTOList; } @Override public List<LookupDTO> getCategoryList(Integer clientId) { log.info(" :: getCategoryList"); List<ClientCategory> userEntityList = (List<ClientCategory>) clientConfigDao.getCategoryList(clientId); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); if (userEntityList != null) { LookupDTO dto = null; for (ClientCategory cmpType : userEntityList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); dto.setId(cmpType.getClientCategoryId()); dto.setName(cmpType.getCategoryName()); dto.setDescription(cmpType.getDescription()); lookupDTOList.add(dto); } } return lookupDTOList; } /** * getFacilitiesBySupplierTypeId method fetches list of service provider * type detail records and maps DTO objects from entity objects. * * @param servProviderId * @return List<LookUpDTO> */ @Override public List<LookupDTO> getFacilitiesBySupplierTypeId(BigInteger suplirTypeId) { log.info(" :: getFacilitiesBySupplierTypeId"); List<SupplierSite> splirEntityList = clientConfigDao.getFacilitiesBySupplierTypeId(suplirTypeId); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (SupplierSite supirSite : splirEntityList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); dto.setId(supirSite.getSupplierSitesId()); dto.setName(supirSite.getSiteName()); // dto.setDescription(supirSite.getDescription()); dto.setCode(supirSite.getSiteCode()); lookupDTOList.add(dto); } return lookupDTOList; } /** * getJobTitleOptionsByClientId method fetches list of job title records and * maps DTO objects from entity objects. * * @param servProviderId * @return List<LookUpDTO> */ @Override public List<LookupDTO> getJobTitleOptionsByClientId(BigInteger clientId) { log.info(" :: getJobTitleOptionsByClientId"); List<JobTitle> jobTitleList = (List<JobTitle>) clientConfigDao.getJobTitleOptionsByClientId(clientId); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (JobTitle jobTitle : jobTitleList) { dto = new LookupDTO(); dto.setId(jobTitle.getJobTitleId()); dto.setName(jobTitle.getJobName()); dto.setDescription(jobTitle.getDescription()); lookupDTOList.add(dto); } return lookupDTOList; } /** * getLanguageOptionsByClientId method fetches list of language records and * maps DTO objects from entity objects. * * @param clientId * @return List<LookUpDTO> */ @Override public List<LookupDTO> getLanguageOptionsByClientId(BigInteger clientId) { log.info(" :: getLanguageOptionsByClientId"); List<Language> jobTitleList = (List<Language>) clientConfigDao.getLanguageOptionsByClientId(clientId); List<LookupDTO> trqLangLookupList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (Language jobTitle : jobTitleList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); dto.setId(jobTitle.getLanguagesId()); dto.setName(jobTitle.getLanguageName()); // dto.setDescription(jobTitle.getDescription()); dto.setCode(jobTitle.getLanguageCode()); trqLangLookupList.add(dto); } return trqLangLookupList; } /** * getSecurityQuestions method returns All security Questions list . * * @param * @return List<SecurityQuestionsDTO> */ public List<SecurityQuestionsDTO> getSecurityQuestions() { List<SecurityQuestion> questionList = clientConfigDao.getSecurityQuestions(); List<SecurityQuestionsDTO> securityQuestionsDtoList = null; // mapping from Entiry to DTO if (questionList != null) { securityQuestionsDtoList = new ArrayList<SecurityQuestionsDTO>(); for (SecurityQuestion sq : questionList) { SecurityQuestionsDTO securityQuestionsDto = new SecurityQuestionsDTO(); securityQuestionsDto.setSecurityQuestionId(sq.getSecurityQuestionId()); securityQuestionsDto.setQuestionCode(sq.getQuestionCode()); securityQuestionsDto.setQuestion(sq.getQuestionName()); securityQuestionsDtoList.add(securityQuestionsDto); } } return securityQuestionsDtoList; } @Override public List<LookupDTO> getSitesByClientId(BigInteger clientId) { log.info(" :: getSitesByClientId"); List<ClientSite> jobTitleList = (List<ClientSite>) clientConfigDao.getSitesByClientId(clientId); List<LookupDTO> trqSiteLookupList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (ClientSite jobTitle : jobTitleList) { dto = new LookupDTO(); dto.setId(jobTitle.getClientSitesId()); dto.setCode(jobTitle.getSiteCode()); dto.setName(jobTitle.getSiteName()); trqSiteLookupList.add(dto); } return trqSiteLookupList; } @Override public List<LookupDTO> getSupplierBySupplierId(BigInteger supplierId) { log.info(" :: getSitesByClientId"); List<SupplierSite> jobTitleList = (List<SupplierSite>) clientConfigDao.getSupplierBySupplierId(supplierId); List<LookupDTO> trqSiteLookupList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (SupplierSite jobTitle : jobTitleList) { dto = new LookupDTO(); dto.setId(jobTitle.getSupplierSitesId()); dto.setCode(jobTitle.getSiteCode()); dto.setName(jobTitle.getSiteName()); trqSiteLookupList.add(dto); } return trqSiteLookupList; } /** * getCategoryOptionsByBusinessId method fetches list of categories records * and maps DTO objects from entity objects. * * @param clientId, * businessId * @return List<Business> */ @Override public List<LookupDTO> getCategoryOptionsByBusinessId(BigInteger clientId, BigInteger businessId) { log.info(" :: getCategoryList"); List<ClientCategory> catgryList = (List<ClientCategory>) clientConfigDao .getCategoryOptionsByBusinessId(clientId, businessId); List<LookupDTO> lookupDTOList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (ClientCategory cmpType : catgryList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); // dto.setId(NSFCommon.string2Long(cmpType.getClient().getClientId())); // dto.setName(cmpType.getCategoryName()); dto.setId(cmpType.getClientCategoryId()); dto.setName(cmpType.getCategoryName()); dto.setDescription(cmpType.getDescription()); lookupDTOList.add(dto); } return lookupDTOList; } @Override public List<LookupDTO> getSitesBySupplierId(BigInteger supplierId) { log.info(" :: getSitesByClientId"); List<SupplierSite> jobTitleList = (List<SupplierSite>) clientConfigDao.getSitesBySupplierId(supplierId); List<LookupDTO> trqSiteLookupList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (SupplierSite jobTitle : jobTitleList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); dto.setCode(jobTitle.getSiteCode()); dto.setName(jobTitle.getSiteName()); trqSiteLookupList.add(dto); } return trqSiteLookupList; } @Override public List<LookupDTO> getbusinessByClientId(BigInteger clientId) { log.info(" :: getSitesByClientId"); List<ClientBusiness> jobTitleList = (List<ClientBusiness>) clientConfigDao.getbusinessByClientId(clientId); List<LookupDTO> trqSiteLookupList = new ArrayList<LookupDTO>(); LookupDTO dto = null; for (ClientBusiness jobTitle : jobTitleList) { dto = new LookupDTO(); // dto.setId(cmpType.getCategory_Id()); dto.setCode(jobTitle.getBusinessCode()); dto.setName(jobTitle.getBusinessCode()); trqSiteLookupList.add(dto); } return trqSiteLookupList; } /** * getClientPrivilege method making calls to Data access classes. * * @param clientId * @return String */ @Override public String getClientPrivilegeByClientId(Integer clientId) { return clientConfigDao.getClientPrivilegeByClientId(clientId); } }
70dfe870b9996b3f7a8b2702244c7350834b6791
87e3d71ad952f6b495592a0dd7bb696ed999bb3d
/web/src/main/java/crd/student/api/controller/WxApiController.java
933b3304906174e61171ccb83e7208f7a3b310f6
[]
no_license
chenrongda/student_api
8b4bdeb0f95cb8169aa4a20e5806ff9fb2b58a29
c0203d98842bde34f1b5ed58b269aa59da624085
refs/heads/master
2020-04-22T08:21:31.907465
2019-02-12T03:14:42
2019-02-12T03:14:42
170,240,577
1
0
null
null
null
null
UTF-8
Java
false
false
2,392
java
package crd.student.api.controller; import crd.student.api.common.DefaultValue; import crd.student.api.model.Score; import crd.student.api.model.Student; import crd.student.api.reponse.Result; import crd.student.api.reponse.StudentExam; import crd.student.api.service.IScoreService; import crd.student.api.service.IStudentService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import java.util.List; @Controller @RequestMapping(value = "wxApi") public class WxApiController { @Autowired private IStudentService iStudentService; @Autowired private IScoreService iScoreService; @RequestMapping(value = "/wxLogin") @ResponseBody public Result wxLogin(String studentName,String phone) { if (studentName != "" && phone != "") { Student requestStudent = new Student(); requestStudent.setName(studentName); requestStudent.setPhone(phone); Student student = iStudentService.findStudent(requestStudent); if (student != null) { return new Result(DefaultValue.REPONSE_SUCCESS_CODE, "验证通过", student); } else { return new Result(DefaultValue.REPONSE_FAIL_CODE, "信息不正确"); } } else { return new Result(DefaultValue.REPONSE_FAIL_CODE, "学生姓名及电话不能为空"); } } @RequestMapping(value = "/getExamList") @ResponseBody public Result getExamList(@RequestBody Student student) { if (student.getId() != null) { List<StudentExam> studentExamList = iStudentService.getExamList(student); return new Result(DefaultValue.REPONSE_SUCCESS_CODE,"成功",studentExamList); } else { return new Result(DefaultValue.REPONSE_FAIL_CODE, "参数错误"); } } @RequestMapping(value = "/getStudentScore") @ResponseBody public Result getStudentScore(Integer examId,Integer studentId){ if(examId != null & studentId != null){ Score score = iScoreService.getStudentScore(examId,studentId); return new Result(DefaultValue.REPONSE_SUCCESS_CODE,"成功",score); }else{ return new Result(DefaultValue.REPONSE_FAIL_CODE,"参数错误"); } } }
18287405dffacc55f4436696f308eb91cbf8f502
717b154999c74a505ad4a2bf11221856230158ba
/src/main/java/com/spring/demo/filter/RestFilter.java
b10a8eba1f41f711f31aade30af5cbcbb36bdf82
[]
no_license
HerrAgner/movie_night
3ee4cbc4e7f8ef6f4ad0b7d93f4612f8e5a17177
16a1df2e9381fbc31176edeee84c18021525a277
refs/heads/master
2023-01-13T14:50:39.816243
2019-12-19T10:10:08
2019-12-19T10:10:08
225,610,891
1
0
null
2023-01-05T02:14:37
2019-12-03T12:09:31
Java
UTF-8
Java
false
false
1,723
java
package com.spring.demo.filter; import com.spring.demo.db.RestInfoRepository; import com.spring.demo.entities.RestInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.time.Instant; @Configuration @Order(Ordered.HIGHEST_PRECEDENCE) public class RestFilter implements Filter { private static final Logger LOGGER = LoggerFactory.getLogger(RestFilter.class); @Autowired RestInfoRepository restInfoRepository; @Override public void init(FilterConfig filterConfig) { LOGGER.info("Initiating REST filter"); } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; filterChain.doFilter(request, response); RestInfo restInfo = new RestInfo( request.getRequestURI(), request.getQueryString(), request.getRemoteAddr(), Instant.now().toString(), request.getMethod(), response.getContentType(), response.getStatus()); restInfoRepository.insert(restInfo); } @Override public void destroy() { } }
1a47ef157be50c24014db075212ef2ff8bbb23eb
0f1f7332b8b06d3c9f61870eb2caed00aa529aaa
/ebean/tags/v2.6.0/src/main/java/com/avaje/ebeaninternal/server/type/ScalarTypeBase.java
9f7467969b5cbc90df7203d800d242e5fa44c28b
[]
no_license
rbygrave/sourceforge-ebean
7e52e3ef439ed64eaf5ce48e0311e2625f7ee5ed
694274581a188be664614135baa3e4697d52d6fb
refs/heads/master
2020-06-19T10:29:37.011676
2019-12-17T22:09:29
2019-12-17T22:09:29
196,677,514
1
0
null
2019-12-17T22:07:13
2019-07-13T04:21:16
Java
UTF-8
Java
false
false
2,793
java
/** * Copyright (C) 2006 Robin Bygrave * * This file is part of Ebean. * * Ebean is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * Ebean 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Ebean; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package com.avaje.ebeaninternal.server.type; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import com.avaje.ebean.text.json.JsonValueAdapter; /** * Base ScalarType object. */ public abstract class ScalarTypeBase<T> implements ScalarType<T> { protected final Class<T> type; protected final boolean jdbcNative; protected final int jdbcType; public ScalarTypeBase(Class<T> type, boolean jdbcNative, int jdbcType) { this.type = type; this.jdbcNative = jdbcNative; this.jdbcType = jdbcType; } public Object readData(DataInput dataInput) throws IOException { String s = dataInput.readUTF(); return parse(s); } public void writeData(DataOutput dataOutput, Object v) throws IOException { String s = format(v); dataOutput.writeUTF(s); } /** * Just return 0. */ public int getLength() { return 0; } public boolean isJdbcNative() { return jdbcNative; } public int getJdbcType() { return jdbcType; } public Class<T> getType() { return type; } @SuppressWarnings("unchecked") public String format(Object v) { return formatValue((T)v); } /** * Return true if the value is null. */ public boolean isDbNull(Object value) { return value == null; } /** * Returns the value that was passed in. */ public Object getDbNullValue(Object value) { return value; } public void loadIgnore(DataReader dataReader) { dataReader.incrementPos(1); } public void accumulateScalarTypes(String propName, CtCompoundTypeScalarList list) { list.addScalarType(propName, this); } public String jsonToString(T value, JsonValueAdapter ctx) { return formatValue(value); } public T jsonFromString(String value, JsonValueAdapter ctx) { return parse(value); } }
fdf0255e33b223692b5e2ff1d053c127ff74dd00
4365604e3579b526d473c250853548aed38ecb2a
/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/v202011/CreativeTemplateOperationErrorReason.java
b2539091a3bbddb9ddbf90cf21db8413f8cf3349
[ "Apache-2.0" ]
permissive
lmaeda/googleads-java-lib
6e73572b94b6dcc46926f72dd4e1a33a895dae61
cc5b2fc8ef76082b72f021c11ff9b7e4d9326aca
refs/heads/master
2023-08-12T19:03:46.808180
2021-09-28T16:48:04
2021-09-28T16:48:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,835
java
// Copyright 2020 Google LLC // // 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. /** * CreativeTemplateOperationErrorReason.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.admanager.axis.v202011; public class CreativeTemplateOperationErrorReason implements java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected CreativeTemplateOperationErrorReason(java.lang.String value) { _value_ = value; _table_.put(_value_,this); } public static final java.lang.String _NOT_ALLOWED = "NOT_ALLOWED"; public static final java.lang.String _NOT_APPLICABLE = "NOT_APPLICABLE"; public static final java.lang.String _UNKNOWN = "UNKNOWN"; public static final CreativeTemplateOperationErrorReason NOT_ALLOWED = new CreativeTemplateOperationErrorReason(_NOT_ALLOWED); public static final CreativeTemplateOperationErrorReason NOT_APPLICABLE = new CreativeTemplateOperationErrorReason(_NOT_APPLICABLE); public static final CreativeTemplateOperationErrorReason UNKNOWN = new CreativeTemplateOperationErrorReason(_UNKNOWN); public java.lang.String getValue() { return _value_;} public static CreativeTemplateOperationErrorReason fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { CreativeTemplateOperationErrorReason enumeration = (CreativeTemplateOperationErrorReason) _table_.get(value); if (enumeration==null) throw new java.lang.IllegalArgumentException(); return enumeration; } public static CreativeTemplateOperationErrorReason fromString(java.lang.String value) throws java.lang.IllegalArgumentException { return fromValue(value); } public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return _value_;} public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumSerializer( _javaType, _xmlType); } public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumDeserializer( _javaType, _xmlType); } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(CreativeTemplateOperationErrorReason.class); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202011", "CreativeTemplateOperationError.Reason")); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } }
0ffc1b8be179eeecff53cf37b8adf6705f26f6e3
56e87f1d1ea499318c5fcdb4594f0efd9cfceebb
/repository/src/main/java/oasis/names/tc/emergency/EDXL/TEP/_1/SpecialClassificationDefaultValues.java
8ebb1290b8e5dedab6e832954fb3aae8c081a415
[]
no_license
vergetid/impress
7da9353b65bc324bb58c6694747925ab92bac104
dd207cabeff4af8449245d96d276ceb7a71ba14d
refs/heads/master
2020-05-21T12:34:54.412796
2017-06-20T13:28:14
2017-06-20T13:28:14
55,222,896
0
0
null
2017-03-31T13:00:22
2016-04-01T10:06:44
Java
UTF-8
Java
false
false
1,842
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.04.01 at 06:03:54 PM EEST // package oasis.names.tc.emergency.EDXL.TEP._1; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for SpecialClassificationDefaultValues. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="SpecialClassificationDefaultValues"> * &lt;restriction base="{urn:oasis:names:tc:emergency:edxl:ct:1.0}EDXLStringType"> * &lt;enumeration value="SecuritySupervisionNeeds"/> * &lt;enumeration value="NDMSPatient"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "SpecialClassificationDefaultValues", namespace = "urn:oasis:names:tc:emergency:EDXL:TEP:1.0") @XmlEnum public enum SpecialClassificationDefaultValues { @XmlEnumValue("SecuritySupervisionNeeds") SECURITY_SUPERVISION_NEEDS("SecuritySupervisionNeeds"), @XmlEnumValue("NDMSPatient") NDMS_PATIENT("NDMSPatient"); private final String value; SpecialClassificationDefaultValues(String v) { value = v; } public String value() { return value; } public static SpecialClassificationDefaultValues fromValue(String v) { for (SpecialClassificationDefaultValues c: SpecialClassificationDefaultValues.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
51d26acddb085266de3abe01d0a29c6c2dc72df4
00e5475b5093288e65b2c1090745d2a1ae7e5579
/app/src/main/java/com/example/mantraapp/ui/share/ShareFragment.java
c20100c6450bb84fdcbd55edc1dcfaf9b8047ecc
[]
no_license
Brejesh1234/E-commerce_app
0664894b4157fb813c9c4b648546b49ecf5ac194
a8f82295db7a0822e4323f85e6e9b018f85ce166
refs/heads/master
2023-07-02T07:28:05.997872
2021-08-09T08:18:30
2021-08-09T08:18:30
348,821,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
package com.example.mantraapp.ui.share; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.Nullable; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.example.mantraapp.R; public class ShareFragment extends Fragment { private ShareViewModel shareViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { shareViewModel = ViewModelProviders.of(this).get(ShareViewModel.class); View root = inflater.inflate(R.layout.fragment_share, container, false); final TextView textView = root.findViewById(R.id.text_share); shareViewModel.getText().observe(this, new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } }); return root; } }
7b74ead188aa9d1b38bd6d0043c5388652d082df
a66a4d91639836e97637790b28b0632ba8d0a4f9
/src/generators/sorting/StoogeSortHL.java
897c7411eb9cf7aff8f4be1e9e7b5b14176bb1f3
[]
no_license
roessling/animal-av
7d0ba53dda899b052a6ed19992fbdfbbc62cf1c9
043110cadf91757b984747750aa61924a869819f
refs/heads/master
2021-07-13T05:31:42.223775
2020-02-26T14:47:31
2020-02-26T14:47:31
206,062,707
0
2
null
2020-10-13T15:46:14
2019-09-03T11:37:11
Java
UTF-8
Java
false
false
13,505
java
package generators.sorting; import generators.framework.Generator; import generators.framework.GeneratorType; import generators.framework.properties.AnimationPropertiesContainer; import java.awt.Color; import java.awt.Font; import java.util.Hashtable; import java.util.Locale; import algoanim.animalscript.AnimalScript; import algoanim.primitives.ArrayMarker; import algoanim.primitives.IntArray; import algoanim.primitives.SourceCode; import algoanim.primitives.Text; import algoanim.primitives.generators.Language; import algoanim.properties.AnimationPropertiesKeys; import algoanim.properties.ArrayMarkerProperties; import algoanim.properties.ArrayProperties; import algoanim.properties.RectProperties; import algoanim.properties.SourceCodeProperties; import algoanim.properties.TextProperties; import algoanim.util.Coordinates; import algoanim.util.MsTiming; import algoanim.util.Offset; public class StoogeSortHL implements Generator { private Language lang; private int[] arrayData; private IntArray arr; private ArrayProperties arrayProperties; private ArrayMarkerProperties leftProperties, rightProperties; private ArrayMarker leftMarker, rightMarker; private SourceCodeProperties codeProperties; private SourceCode code; public StoogeSortHL() { // Parameterloser Konstruktor } @Override public String generate(AnimationPropertiesContainer props, Hashtable<String, Object> primitives) { arrayData = (int[]) primitives.get("array"); init(); // ArrayProperties uebernehmen arrayProperties = new ArrayProperties(); arrayProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, props.get("array", AnimationPropertiesKeys.COLOR_PROPERTY)); arrayProperties.set(AnimationPropertiesKeys.FILL_PROPERTY, props.get("array", AnimationPropertiesKeys.FILL_PROPERTY)); arrayProperties.set(AnimationPropertiesKeys.FILLED_PROPERTY, props.get("array", AnimationPropertiesKeys.FILLED_PROPERTY)); arrayProperties.set(AnimationPropertiesKeys.ELEMENTCOLOR_PROPERTY, props.get("array", AnimationPropertiesKeys.ELEMENTCOLOR_PROPERTY)); arrayProperties.set(AnimationPropertiesKeys.ELEMHIGHLIGHT_PROPERTY, props.get("array", AnimationPropertiesKeys.ELEMHIGHLIGHT_PROPERTY)); arrayProperties.set(AnimationPropertiesKeys.CELLHIGHLIGHT_PROPERTY, props.get("array", AnimationPropertiesKeys.CELLHIGHLIGHT_PROPERTY)); arr = lang.newIntArray(new Coordinates(20, 140), arrayData, "arr", null, arrayProperties); lang.nextStep(); // leftMarkerProperties uebernehmen leftProperties = new ArrayMarkerProperties(); leftProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, props.get("left", AnimationPropertiesKeys.COLOR_PROPERTY)); leftProperties.set(AnimationPropertiesKeys.LABEL_PROPERTY, props.get("left", AnimationPropertiesKeys.LABEL_PROPERTY)); leftProperties.set(AnimationPropertiesKeys.HIDDEN_PROPERTY, true); leftMarker = lang.newArrayMarker(arr, 0, "left", null, leftProperties); leftMarker.hide(); // rightMarkerProperties uebernehmen rightProperties = new ArrayMarkerProperties(); rightProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, props.get("right", AnimationPropertiesKeys.COLOR_PROPERTY)); rightProperties.set(AnimationPropertiesKeys.LABEL_PROPERTY, props.get("right", AnimationPropertiesKeys.LABEL_PROPERTY)); rightProperties.set(AnimationPropertiesKeys.HIDDEN_PROPERTY, true); // diese // Eigentschaft // ist // fest // kodiert rightMarker = lang.newArrayMarker(arr, 0, "right", null, rightProperties); rightMarker.hide(); // codeProperties uebernehmen codeProperties = new SourceCodeProperties(); codeProperties.set(AnimationPropertiesKeys.BOLD_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.BOLD_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.COLOR_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.COLOR_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY, props .get("sourceCode", AnimationPropertiesKeys.HIGHLIGHTCOLOR_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.FONT_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.CONTEXTCOLOR_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.ITALIC_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.ITALIC_PROPERTY)); codeProperties.set(AnimationPropertiesKeys.SIZE_PROPERTY, props.get("sourceCode", AnimationPropertiesKeys.SIZE_PROPERTY)); code = lang.newSourceCode(new Coordinates(20, 190), "sourceCode", null, codeProperties); makeCode(); lang.nextStep(); arr.highlightCell(0, arrayData.length - 1, null, null); lang.nextStep(); stoogeSort(arr, 0, arr.getLength()); return lang.toString(); } @Override public void init() { lang = new AnimalScript(getName(), getAnimationAuthor(), 640, 480); lang.setStepMode(true); // Header RectProperties rectProperties = new RectProperties(); rectProperties.set(AnimationPropertiesKeys.FILLED_PROPERTY, true); rectProperties.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.ORANGE); rectProperties.set(AnimationPropertiesKeys.DEPTH_PROPERTY, 2); TextProperties headerProperties = new TextProperties(); headerProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font( "SansSerif", Font.BOLD, 24)); Text header = lang.newText(new Coordinates(20, 30), "StoogeSort", "header", null, headerProperties); lang.newRect(new Offset(-5, -5, header, AnimalScript.DIRECTION_NW), new Offset(5, 5, header, AnimalScript.DIRECTION_SE), "hRect", null, rectProperties); lang.nextStep(); TextProperties textProperties = new TextProperties(); textProperties.set(AnimationPropertiesKeys.FONT_PROPERTY, new Font( "SansSerif", Font.BOLD, 14)); Text text1 = lang .newText( new Coordinates(20, 90), "1. Sind das erste und das letzte Element nicht in der richtigen Reihenfolge, so werden sie vertauscht.", "descr", null, textProperties); Text text2 = lang .newText( new Coordinates(20, 130), "2. Sind mehr als zwei Elemente in der Liste - fortsetzen, sonst abbrechen.", "descr1", null, textProperties); Text text3 = lang.newText(new Coordinates(20, 160), "3. Sortiere die ersten zwei Drittel der Liste.", "descr3", null, textProperties); Text text4 = lang.newText(new Coordinates(20, 190), "4. Sortiere die letzten zwei Drittel der Liste.", "descr4", null, textProperties); Text text5 = lang.newText(new Coordinates(20, 220), "5. Sortiere die ersten zwei Drittel der Liste.", "descr5", null, textProperties); Text text6 = lang .newText( new Coordinates(20, 280), "Komplexitaet: O(n^2.71) [Bemerkung: StoogeSort zaehlt eher zu unpraktischen Algorithmen]", "descr6", null, textProperties); lang.nextStep(); text1.hide(); text2.hide(); text3.hide(); text4.hide(); text5.hide(); text6.hide(); } public void makeCode() { code.addCodeLine("public static void sort(int[] a, int left, int right) {", null, 0, null); code.addCodeLine("if (a[right-1] < a[left]){", null, 1, null); code.addCodeLine("int temp = a[left];", null, 2, null); code.addCodeLine("a[left] = a[right-1];", null, 2, null); code.addCodeLine("a[right-1] = temp;", null, 2, null); code.addCodeLine("}", null, 1, null); code.addCodeLine("int len = right-left;", null, 1, null); code.addCodeLine("if (len > 2) {", null, 1, null); code.addCodeLine("int third=len/3;", null, 2, null); code.addCodeLine( "stoogeSort(a, left, right-third); // sortiere die ersten 2/3", null, 2, null); code.addCodeLine( "stoogeSort(a, left+third, right); // sortiere die letzten 2/3", null, 2, null); code.addCodeLine( "stoogeSort(a, left, right-third); // sortiere die ersten 2/3", null, 2, null); code.addCodeLine("}", null, 1, null); code.addCodeLine("}", null, 0, null); } public void goToFunk() { code.highlight(0, 0, true); code.highlight(13, 0, true); } public void goFromFunk() { code.unhighlight(0); code.unhighlight(13); } public void goToIf1() { code.highlight(1, 0, true); code.highlight(5, 0, true); } public void goFromIf1() { code.unhighlight(1); code.unhighlight(5); } public void goToIf2() { code.highlight(7, 0, true); code.highlight(12, 0, true); } public void goFromIf2() { code.unhighlight(7); code.unhighlight(12); } public void unhightLightAll() { for (int i = 0; i < 14; i++) code.unhighlight(i); } public void stoogeSort(IntArray a, int left, int right) { unhightLightAll(); code.highlight(0); lang.nextStep(); code.unhighlight(0); code.highlight(1); lang.nextStep(); leftMarker.move(left, null, null); leftMarker.show(); rightMarker.move(right - 1, null, null); rightMarker.show(); lang.nextStep(); a.highlightElem(left, null, null); a.highlightElem(right - 1, null, null); lang.nextStep(); if (a.getData(right - 1) < a.getData(left)) { code.unhighlight(1); goToIf1(); code.highlight(2); code.highlight(3); code.highlight(4); lang.nextStep(); arr.swap(left, right - 1, null, new MsTiming(1000)); lang.nextStep(); code.unhighlight(2); code.unhighlight(3); code.unhighlight(4); } goFromIf1(); a.unhighlightElem(left, null, null); a.unhighlightElem(right - 1, null, null); leftMarker.hide(); rightMarker.hide(); int len = right - left; code.highlight(6); lang.nextStep(); code.unhighlight(6); code.highlight(7); lang.nextStep(); if (len > 2) { goToIf2(); code.highlight(8); int third = len / 3; // abgerundene Integer-Division lang.nextStep(); // erster rekursiver Aufrunf code.unhighlight(8); code.highlight(9); lang.nextStep(); arr.unhighlightCell(0, a.getLength() - 1, null, null); arr.highlightCell(left, right - third - 1, null, null); lang.nextStep(); stoogeSort(a, left, right - third); // sortiere die ersten 2/3 // zweiter rekursiver Aufrunf unhightLightAll(); code.highlight(10); lang.nextStep(); arr.unhighlightCell(0, a.getLength() - 1, null, null); arr.highlightCell(left + third, right - 1, null, null); lang.nextStep(); stoogeSort(a, left + third, right); // sortiere die letzten 2/3 // dritter rekursiver Aufrunf unhightLightAll(); code.highlight(11); lang.nextStep(); arr.unhighlightCell(0, a.getLength() - 1, null, null); arr.highlightCell(left, right - third - 1, null, null); lang.nextStep(); stoogeSort(a, left, right - third); // sortiere die ersten 2/3 } goFromIf2(); arr.unhighlightCell(0, arr.getLength() - 1, null, null); } @Override public String getAlgorithmName() { return "Stooge Sort"; } @Override public String getAnimationAuthor() { return "Hlib Levitin"; } @Override public String getCodeExample() { String code = "public void stoogeSort(int[] a, int left, int right) {\n" + " if (a[right-1] &lt; a[left]) {\n" + " int temp = a[left];\n" + " a[left] = a[right-1];\n" + " a[right-1] = temp;\n" + " }\n" + " int len = right-left;\n" + " if (len &gt; 2) {\n" + " int third = len/3;\n" + " stoogeSort(a, left, right-third);\n" + " stoogeSort(a, left+third, right);\n" + " stoogeSort(a, left, right-third);\n" + " }\n" + "}\n"; return code; } @Override public Locale getContentLocale() { return Locale.GERMANY; } @Override public String getDescription() { return "Stooge sort (auch Trippelsort) ist ein rekursiver Sortieralgorithmus nach dem Prinzip Teile und herrsche (divide and conquer)."; } @Override public String getFileExtension() { return Generator.ANIMALSCRIPT_FORMAT_EXTENSION; } @Override public GeneratorType getGeneratorType() { return new GeneratorType(GeneratorType.GENERATOR_TYPE_SORT); } @Override public String getName() { return "StoogeSort (DE)"; } @Override public String getOutputLanguage() { return Generator.JAVA_OUTPUT; } }
26b8a2c50cbf0a80004bf261fcd43965a468b51e
611e0544ff871e5df58f13a5f2898102f521ec8e
/clients/src/main/java/org/apache/kafka/server/quota/ClientQuotaType.java
5b0828a08211f017bbf75e8b1604e68189b5df7c
[ "Apache-2.0", "GPL-2.0-only", "LicenseRef-scancode-public-domain", "W3C", "CC0-1.0", "GPL-1.0-or-later", "CPL-1.0", "GPL-2.0-or-later", "LicenseRef-scancode-generic-export-compliance", "LicenseRef-scancode-other-permissive", "CC-PDDC", "BSD-3-Clause", "APSL-2.0", "LicenseRef-scancode-free-unknown", "EPL-2.0", "CDDL-1.0", "MIT", "LicenseRef-scancode-unknown-license-reference", "EPL-1.0", "Classpath-exception-2.0", "CDDL-1.1", "BSD-2-Clause", "WTFPL" ]
permissive
confluentinc/kafka
3b0830c0afd81bc84ff409fa9eff61418636d697
cae0baef40b0d5d97af32256800492cb9d6471df
refs/heads/master
2023-09-03T12:54:24.118935
2023-08-31T18:05:22
2023-08-31T18:05:22
37,555,321
216
235
Apache-2.0
2023-09-14T12:05:20
2015-06-16T20:48:28
Java
UTF-8
Java
false
false
1,014
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.server.quota; /** * Types of quotas that may be configured on brokers for client requests. */ public enum ClientQuotaType { PRODUCE, FETCH, REQUEST, CONTROLLER_MUTATION }
bc1df20e55a9e7c6b97787aee2ffe2e9e98d1486
e569fc1404ebe258c3296115cddfad9dd255c921
/src/main/java/com/digitalinovationone/gft/util/BundleUtil.java
dd7b6599be5f9fcefe56b03341467d972c77543c
[]
no_license
mbgarcia/dio-gft
50f423dd0d5707e3960110fb86634193ab67d352
8019338c0afd197e68aada6c02bb915a3a72dc65
refs/heads/master
2023-08-29T05:56:55.260028
2021-10-13T22:04:27
2021-10-13T22:04:27
413,930,562
0
0
null
null
null
null
UTF-8
Java
false
false
970
java
package com.digitalinovationone.gft.util; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.text.MessageFormat; import java.util.Locale; import java.util.ResourceBundle; public class BundleUtil { public static String getText(String key, Object... args) { ResourceBundle bundle = ResourceBundle.getBundle("bundle",new Locale("pt","BR")); try { return MessageFormat.format(bundle.getString(key), args); } catch( Exception e) { return key; } } public static String ISOtoUF8(String str) { Charset utf8charset = Charset.forName("UTF-8"); Charset iso88591charset = Charset.forName("ISO-8859-1"); ByteBuffer inputBuffer = ByteBuffer.wrap(str.getBytes()); // decode UTF-8 CharBuffer data = iso88591charset.decode(inputBuffer); // encode ISO-8559-1 ByteBuffer outputBuffer = utf8charset.encode(data); byte[] outputData = outputBuffer.array(); return new String(outputData); } }
da5f6e2b41016235e9ff6cfb9473475e8af706d1
bfba3b96cd5d8706ff3238c6ce9bf10967af89cf
/src/main/java/com/robertx22/age_of_exile/saveclasses/unit/Unit.java
5921a9310e2a07b71e381ec967c29bc6c9f33ae1
[]
no_license
panbanann/Age-of-Exile
e6077d89a5ab8f2389e9926e279aa8360960c65a
cc54a9aa573dec42660b0684fffbf653015406cf
refs/heads/master
2023-04-12T14:16:56.379334
2021-05-04T21:13:19
2021-05-04T21:13:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,729
java
package com.robertx22.age_of_exile.saveclasses.unit; import com.robertx22.age_of_exile.capability.entity.EntityCap.UnitData; import com.robertx22.age_of_exile.config.forge.ModConfig; import com.robertx22.age_of_exile.damage_hooks.util.AttackInformation; import com.robertx22.age_of_exile.database.data.game_balance_config.GameBalanceConfig; import com.robertx22.age_of_exile.database.data.rarities.MobRarity; import com.robertx22.age_of_exile.database.data.set.GearSet; import com.robertx22.age_of_exile.database.data.skill_gem.SkillGemData; import com.robertx22.age_of_exile.database.data.stats.Stat; import com.robertx22.age_of_exile.database.data.stats.datapacks.stats.AttributeStat; import com.robertx22.age_of_exile.database.data.stats.types.core_stats.base.ICoreStat; import com.robertx22.age_of_exile.database.data.stats.types.core_stats.base.ITransferToOtherStats; import com.robertx22.age_of_exile.database.data.stats.types.resources.blood.Blood; import com.robertx22.age_of_exile.database.data.stats.types.resources.blood.BloodUser; import com.robertx22.age_of_exile.database.data.stats.types.resources.health.Health; import com.robertx22.age_of_exile.database.data.stats.types.resources.mana.Mana; import com.robertx22.age_of_exile.database.data.unique_items.UniqueGear; import com.robertx22.age_of_exile.database.registry.Database; import com.robertx22.age_of_exile.event_hooks.my_events.CollectGearEvent; import com.robertx22.age_of_exile.saveclasses.ExactStatData; import com.robertx22.age_of_exile.saveclasses.unit.stat_ctx.GearStatCtx; import com.robertx22.age_of_exile.saveclasses.unit.stat_ctx.StatContext; import com.robertx22.age_of_exile.uncommon.datasaving.Load; import com.robertx22.age_of_exile.uncommon.interfaces.IAffectsStats; import com.robertx22.age_of_exile.uncommon.interfaces.data_items.IRarity; import com.robertx22.age_of_exile.uncommon.stat_calculation.CommonStatUtils; import com.robertx22.age_of_exile.uncommon.stat_calculation.ExtraMobRarityAttributes; import com.robertx22.age_of_exile.uncommon.stat_calculation.MobStatUtils; import com.robertx22.age_of_exile.uncommon.stat_calculation.PlayerStatUtils; import com.robertx22.age_of_exile.uncommon.utilityclasses.RandomUtils; import com.robertx22.age_of_exile.vanilla_mc.packets.EfficientMobUnitPacket; import com.robertx22.age_of_exile.vanilla_mc.packets.EntityUnitPacket; import com.robertx22.library_of_exile.main.MyPacket; import com.robertx22.library_of_exile.main.Packets; import info.loenwind.autosave.annotations.Storable; import info.loenwind.autosave.annotations.Store; import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; import net.minecraft.util.registry.Registry; import java.util.*; import java.util.stream.Collectors; // this stores data that can be lost without issue, stats that are recalculated all the time // and mob status effects. @Storable public class Unit { @Store private HashMap<StatContainerType, StatContainer> stats = new HashMap<>(); @Store public String GUID = UUID.randomUUID() .toString(); public InCalcStatData getStatInCalculation(Stat stat) { return getStats().getStatInCalculation(stat); } public InCalcStatData getStatInCalculation(String stat) { return getStats().getStatInCalculation(stat); } public enum StatContainerType { NORMAL(-1), SPELL1(0), SPELL2(1), SPELL3(2), SPELL4(3); StatContainerType(int place) { this.place = place; } public int place; } public boolean isBloodMage() { return getCalculatedStat(BloodUser.getInstance()) .getAverageValue() > 0; } public StatContainer getStats() { return getStats(StatContainerType.NORMAL); } public StatContainer getStats(StatContainerType type) { if (!stats.containsKey(type)) { stats.put(type, new StatContainer()); } return stats.get(type); } public StatData getCalculatedStat(Stat stat) { return getCalculatedStat(stat.GUID()); } public StatData getCalculatedStat(String guid) { if (getStats().stats == null) { this.initStats(); } return getStats().stats.getOrDefault(guid, StatData.empty()); } public Unit() { } public void initStats() { getStats().stats = new HashMap<String, StatData>(); } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj instanceof Unit) { return ((Unit) obj).GUID.equals(this.GUID); // todo this bugfix sounds big, might mess with things!!! } return false; } @Override public int hashCode() { return GUID.hashCode(); } // Stat shortcuts public Health health() { return Health.getInstance(); } public Mana mana() { return Mana.getInstance(); } public StatData healthData() { try { return getCalculatedStat(Health.GUID); } catch (Exception e) { } return StatData.empty(); } public StatData bloodData() { try { return getCalculatedStat(Blood.GUID); } catch (Exception e) { } return StatData.empty(); } public StatData manaData() { try { return getCalculatedStat(Mana.GUID); } catch (Exception e) { } return StatData.empty(); } public String randomRarity(LivingEntity entity, UnitData data) { List<MobRarity> rarities = Database.MobRarities() .getList() .stream() .filter(x -> data.getLevel() >= x.minMobLevelForRandomSpawns() || data.getLevel() >= GameBalanceConfig.get().MAX_LEVEL) .collect(Collectors.toList()); if (rarities.isEmpty()) { rarities.add(Database.MobRarities() .get(IRarity.COMMON_ID)); } MobRarity finalRarity = RandomUtils.weightedRandom(rarities); return finalRarity.GUID(); } private static class DirtyCheck { public int hp; public boolean isDirty(DirtyCheck newcheck) { if (newcheck.hp != hp) { return true; } return false; } } /** * @return checks if it should be synced to clients. Clients currently only see * health and status effects */ private DirtyCheck getDirtyCheck() { if (getStats().stats == null || getStats().stats.isEmpty()) { this.initStats(); } DirtyCheck check = new DirtyCheck(); check.hp = (int) getCalculatedStat(Health.GUID).getAverageValue(); return check; } @Store public HashMap<String, Integer> sets = new HashMap<>(); private void calcSets(List<GearData> gears) { sets.clear(); // todo possibly cache it? gears.forEach(x -> { if (x.gear != null) { if (x.gear.uniqueStats != null) { UniqueGear uniq = x.gear.uniqueStats.getUnique(x.gear); if (uniq != null) { if (uniq.hasSet()) { GearSet set = uniq.getSet(); String key = set .GUID(); int current = sets.getOrDefault(key, 0); sets.put(key, current + 1); } } } } }); } public void recalculateStats(LivingEntity entity, UnitData data, AttackInformation dmgData) { try { if (entity.world.isClient) { return; } //data.setEquipsChanged(false); if (data.getUnit() == null) { data.setUnit(this); } List<GearData> gears = new ArrayList<>(); new CollectGearEvent.CollectedGearStacks(entity, gears, dmgData); calcSets(gears); stats.values() .forEach(x -> x.stats.clear()); stats.values() .forEach(x -> x.statsInCalc.clear()); DirtyCheck old = getDirtyCheck(); List<StatContext> statContexts = new ArrayList<>(); statContexts.addAll(CommonStatUtils.addPotionStats(entity)); statContexts.addAll(CommonStatUtils.addExactCustomStats(entity)); if (entity instanceof PlayerEntity) { if (data.hasRace()) { data.getRace() .addStats((PlayerEntity) entity); } sets.entrySet() .forEach(x -> { GearSet set = Database.Sets() .get(x.getKey()); statContexts.add(set.getStats(data)); }); Load.statPoints((PlayerEntity) entity).data.addStats(data); statContexts.addAll(PlayerStatUtils.AddPlayerBaseStats(entity)); statContexts.addAll(Load.characters((PlayerEntity) entity) .getStats()); statContexts.addAll(Load.perks(entity) .getStatAndContext(entity)); statContexts.addAll(Load.playerSkills((PlayerEntity) entity) .getStatAndContext(entity)); statContexts.addAll(Load.spells(entity) .getStatAndContext(entity)); statContexts.add(data.getStatusEffectsData() .getStats(entity)); } else { statContexts.addAll(MobStatUtils.getMobBaseStats(data, entity)); statContexts.addAll(MobStatUtils.getAffixStats(entity)); statContexts.addAll(MobStatUtils.getWorldMultiplierStats(entity)); MobStatUtils.addMapStats(entity, data, this); statContexts.addAll(MobStatUtils.getMobConfigStats(entity, data)); ExtraMobRarityAttributes.add(entity, data); } statContexts.addAll(addGearStats(gears, entity, data)); HashMap<StatContext.StatCtxType, List<StatContext>> map = new HashMap<>(); for (StatContext.StatCtxType type : StatContext.StatCtxType.values()) { map.put(type, new ArrayList<>()); } statContexts.forEach(x -> { map.get(x.type) .add(x); }); map.forEach((key, value) -> value .forEach(v -> { v.stats.forEach(s -> { if (s.getStat().statContextModifier != null) { map.get(s.getStat().statContextModifier.getCtxTypeNeeded()) .forEach(c -> s.getStat().statContextModifier.modify(s, c)); } }); })); statContexts.forEach(x -> x.stats.forEach(s -> s.applyStats(data))); addVanillaHpToStats(entity, data); new HashMap<>(getStats().statsInCalc).entrySet() .forEach(x -> { InCalcStatData statdata = x.getValue(); Stat stat = x.getValue() .GetStat(); if (stat instanceof IAffectsStats) { IAffectsStats add = (IAffectsStats) stat; add.affectStats(data, statdata); } }); new HashMap<>(getStats().statsInCalc).entrySet() .forEach(x -> { InCalcStatData statdata = x.getValue(); Stat stat = x.getValue() .GetStat(); if (stat instanceof ITransferToOtherStats) { ITransferToOtherStats add = (ITransferToOtherStats) stat; add.transferStats(data, statdata); } }); new HashMap<>(getStats().statsInCalc).entrySet() .forEach(x -> { InCalcStatData statdata = x.getValue(); Stat stat = x.getValue() .GetStat(); if (stat instanceof ICoreStat) { ICoreStat add = (ICoreStat) stat; add.addToOtherStats(data, statdata); } }); if (entity instanceof PlayerEntity) { for (StatContainerType type : StatContainerType.values()) { // different stat containers for each spell with support gems. if (type == StatContainerType.NORMAL) { this.stats.put(type, getStats()); } else { StatContainer copy = getStats().cloneForSpellStats(); stats.put(type, copy); List<SkillGemData> supportGems = Load.spells(entity) .getSkillGemData() .getSupportGemsOf(type.place); List<SkillGemData> noGemDuplicateList = new ArrayList<>(); Set<String> gemIdSet = new HashSet<>(); supportGems.forEach(x -> { if (!gemIdSet.contains(x.id)) {// dont allow duplicate gems noGemDuplicateList.add(x); gemIdSet.add(x.id); } }); for (SkillGemData sd : noGemDuplicateList) { if (true || sd.canPlayerUse((PlayerEntity) entity)) { sd.getSkillGem() .getConstantStats(sd) .forEach(s -> { copy.getStatInCalculation(s.getStat()) .add(s, data); }); sd.getSkillGem() .getRandomStats(sd) .forEach(s -> { copy.getStatInCalculation(s.getStat()) .add(s, data); }); } } } } stats.values() .forEach(x -> x.calculate()); } else { stats.get(StatContainerType.NORMAL) .calculate(); } DirtyCheck aftercalc = getDirtyCheck(); this.getStats().stats.values() .forEach(x -> { if (x.GetStat() instanceof AttributeStat) { AttributeStat stat = (AttributeStat) x.GetStat(); stat.addToEntity(entity, x); } }); if (old.isDirty(aftercalc)) { if (!Unit.shouldSendUpdatePackets((LivingEntity) entity)) { return; } Packets.sendToTracking(getUpdatePacketFor(entity, data), entity); } if (entity instanceof PlayerEntity) { Packets.sendToClient((PlayerEntity) entity, new EntityUnitPacket(entity)); } } catch (Exception e) { e.printStackTrace(); } } private void addVanillaHpToStats(LivingEntity entity, UnitData data) { if (entity instanceof PlayerEntity) { float maxhp = MathHelper.clamp(entity.getMaxHealth(), 0, 500); // all increases after this would just reduce enviro damage getStats().getStatInCalculation(Health.getInstance()) .addAlreadyScaledFlat(maxhp); // add vanila hp to extra hp } } private List<StatContext> addGearStats(List<GearData> gears, LivingEntity entity, UnitData data) { List<StatContext> ctxs = new ArrayList<>(); gears.forEach(x -> { List<ExactStatData> stats = x.gear.GetAllStats(); if (x.percentStatUtilization != 100) { // multi stats like for offfhand weapons float multi = x.percentStatUtilization / 100F; stats.forEach(s -> s.multiplyBy(multi)); } ctxs.add(new GearStatCtx(x.gear, stats)); }); return ctxs; } private static HashMap<EntityType, Boolean> IGNORED_ENTITIES = null; public static HashMap<EntityType, Boolean> getIgnoredEntities() { if (IGNORED_ENTITIES == null) { IGNORED_ENTITIES = new HashMap<>(); ModConfig.get().Server.IGNORED_ENTITIES .stream() .filter(x -> Registry.ENTITY_TYPE.getOrEmpty(new Identifier(x)) .isPresent()) .map(x -> Registry.ENTITY_TYPE.get(new Identifier(x))) .forEach(x -> IGNORED_ENTITIES.put(x, true)); } return IGNORED_ENTITIES; } public static boolean shouldSendUpdatePackets(LivingEntity en) { return !getIgnoredEntities().containsKey(en.getType()); } public static MyPacket getUpdatePacketFor(LivingEntity en, UnitData data) { return new EfficientMobUnitPacket(en, data); } }
5616561a5995cc6c55762fa6caa3e93775c7e43f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_e4d8a80c639d59173672634a9acb90c9a4f55c1f/BoxAndWhiskerRenderer/5_e4d8a80c639d59173672634a9acb90c9a4f55c1f_BoxAndWhiskerRenderer_s.java
a8fefff22d8c72051c89cc7faf7d8d7e0db595d8
[]
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
42,171
java
/* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2009, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library 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 Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * -------------------------- * BoxAndWhiskerRenderer.java * -------------------------- * (C) Copyright 2003-2009, by David Browning and Contributors. * * Original Author: David Browning (for the Australian Institute of Marine * Science); * Contributor(s): David Gilbert (for Object Refinery Limited); * Tim Bardzil; * Rob Van der Sanden (patches 1866446 and 1888422); * Peter Becker (patches 2868585 and 2868608); * * Changes * ------- * 21-Aug-2003 : Version 1, contributed by David Browning (for the Australian * Institute of Marine Science); * 01-Sep-2003 : Incorporated outlier and farout symbols for low values * also (DG); * 08-Sep-2003 : Changed ValueAxis API (DG); * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG); * 07-Oct-2003 : Added renderer state (DG); * 12-Nov-2003 : Fixed casting bug reported by Tim Bardzil (DG); * 13-Nov-2003 : Added drawHorizontalItem() method contributed by Tim * Bardzil (DG); * 25-Apr-2004 : Added fillBox attribute, equals() method and added * serialization code (DG); * 29-Apr-2004 : Changed drawing of upper and lower shadows - see bug report * 944011 (DG); * 05-Nov-2004 : Modified drawItem() signature (DG); * 09-Mar-2005 : Override getLegendItem() method so that legend item shapes * are shown as blocks (DG); * 20-Apr-2005 : Generate legend labels, tooltips and URLs (DG); * 09-Jun-2005 : Updated equals() to handle GradientPaint (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 12-Oct-2006 : Source reformatting and API doc updates (DG); * 12-Oct-2006 : Fixed bug 1572478, potential NullPointerException (DG); * 05-Feb-2006 : Added event notifications to a couple of methods (DG); * 20-Apr-2007 : Updated getLegendItem() for renderer change (DG); * 11-May-2007 : Added check for visibility in getLegendItem() (DG); * 17-May-2007 : Set datasetIndex and seriesIndex in getLegendItem() (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 03-Jan-2008 : Check visibility of average marker before drawing it (DG); * 15-Jan-2008 : Add getMaximumBarWidth() and setMaximumBarWidth() * methods (RVdS); * 14-Feb-2008 : Fix bar position for horizontal chart, see patch * 1888422 (RVdS); * 27-Mar-2008 : Boxes should use outlinePaint/Stroke settings (DG); * 17-Jun-2008 : Apply legend shape, font and paint attributes (DG); * 02-Oct-2008 : Check item visibility in drawItem() method (DG); * 21-Jan-2009 : Added flags to control visibility of mean and median * indicators (DG); * 28-Sep-2009 : Added fireChangeEvent() to setMedianVisible (DG); * 28-Sep-2009 : Added useOutlinePaintForWhiskers flag, see patch 2868585 * by Peter Becker (DG); * 28-Sep-2009 : Added whiskerWidth attribute, see patch 2868608 by Peter * Becker (DG); * */ package org.jfree.chart.renderer.category; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import org.jfree.chart.LegendItem; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.renderer.Outlier; import org.jfree.chart.renderer.OutlierList; import org.jfree.chart.renderer.OutlierListCollection; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; import org.jfree.io.SerialUtilities; import org.jfree.ui.RectangleEdge; import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; /** * A box-and-whisker renderer. This renderer requires a * {@link BoxAndWhiskerCategoryDataset} and is for use with the * {@link CategoryPlot} class. The example shown here is generated * by the <code>BoxAndWhiskerChartDemo1.java</code> program included in the * JFreeChart Demo Collection: * <br><br> * <img src="../../../../../images/BoxAndWhiskerRendererSample.png" * alt="BoxAndWhiskerRendererSample.png" /> */ public class BoxAndWhiskerRenderer extends AbstractCategoryItemRenderer implements Cloneable, PublicCloneable, Serializable { /** For serialization. */ private static final long serialVersionUID = 632027470694481177L; /** The color used to paint the median line and average marker. */ private transient Paint artifactPaint; /** A flag that controls whether or not the box is filled. */ private boolean fillBox; /** The margin between items (boxes) within a category. */ private double itemMargin; /** * The maximum bar width as percentage of the available space in the plot. * Take care with the encoding - for example, 0.05 is five percent. */ private double maximumBarWidth; /** * A flag that controls whether or not the median indicator is drawn. * * @since 1.0.13 */ private boolean medianVisible; /** * A flag that controls whether or not the mean indicator is drawn. * * @since 1.0.13 */ private boolean meanVisible; /** * A flag that, if <code>true</code>, causes the whiskers to be drawn * using the outline paint for the series. The default value is * <code>false</code> and in that case the regular series paint is used. * * @since 1.0.14 */ private boolean useOutlinePaintForWhiskers; /** * The width of the whiskers as fraction of the bar width. * * @since 1.0.14 */ private double whiskerWidth; /** * Default constructor. */ public BoxAndWhiskerRenderer() { this.artifactPaint = Color.black; this.fillBox = true; this.itemMargin = 0.20; this.maximumBarWidth = 1.0; this.medianVisible = true; this.meanVisible = true; this.useOutlinePaintForWhiskers = false; this.whiskerWidth = 1.0; setBaseLegendShape(new Rectangle2D.Double(-4.0, -4.0, 8.0, 8.0)); } /** * Returns the paint used to color the median and average markers. * * @return The paint used to draw the median and average markers (never * <code>null</code>). * * @see #setArtifactPaint(Paint) */ public Paint getArtifactPaint() { return this.artifactPaint; } /** * Sets the paint used to color the median and average markers and sends * a {@link RendererChangeEvent} to all registered listeners. * * @param paint the paint (<code>null</code> not permitted). * * @see #getArtifactPaint() */ public void setArtifactPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.artifactPaint = paint; fireChangeEvent(); } /** * Returns the flag that controls whether or not the box is filled. * * @return A boolean. * * @see #setFillBox(boolean) */ public boolean getFillBox() { return this.fillBox; } /** * Sets the flag that controls whether or not the box is filled and sends a * {@link RendererChangeEvent} to all registered listeners. * * @param flag the flag. * * @see #getFillBox() */ public void setFillBox(boolean flag) { this.fillBox = flag; fireChangeEvent(); } /** * Returns the item margin. This is a percentage of the available space * that is allocated to the space between items in the chart. * * @return The margin. * * @see #setItemMargin(double) */ public double getItemMargin() { return this.itemMargin; } /** * Sets the item margin and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param margin the margin (a percentage). * * @see #getItemMargin() */ public void setItemMargin(double margin) { this.itemMargin = margin; fireChangeEvent(); } /** * Returns the maximum bar width as a percentage of the available drawing * space. Take care with the encoding, for example 0.10 is ten percent. * * @return The maximum bar width. * * @see #setMaximumBarWidth(double) * * @since 1.0.10 */ public double getMaximumBarWidth() { return this.maximumBarWidth; } /** * Sets the maximum bar width, which is specified as a percentage of the * available space for all bars, and sends a {@link RendererChangeEvent} * to all registered listeners. * * @param percent the maximum bar width (a percentage, where 0.10 is ten * percent). * * @see #getMaximumBarWidth() * * @since 1.0.10 */ public void setMaximumBarWidth(double percent) { this.maximumBarWidth = percent; fireChangeEvent(); } /** * Returns the flag that controls whether or not the mean indicator is * draw for each item. * * @return A boolean. * * @see #setMeanVisible(boolean) * * @since 1.0.13 */ public boolean isMeanVisible() { return this.meanVisible; } /** * Sets the flag that controls whether or not the mean indicator is drawn * for each item, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param visible the new flag value. * * @see #isMeanVisible() * * @since 1.0.13 */ public void setMeanVisible(boolean visible) { if (this.meanVisible == visible) { return; } this.meanVisible = visible; fireChangeEvent(); } /** * Returns the flag that controls whether or not the median indicator is * draw for each item. * * @return A boolean. * * @see #setMedianVisible(boolean) * * @since 1.0.13 */ public boolean isMedianVisible() { return this.medianVisible; } /** * Sets the flag that controls whether or not the median indicator is drawn * for each item, and sends a {@link RendererChangeEvent} to all * registered listeners. * * @param visible the new flag value. * * @see #isMedianVisible() * * @since 1.0.13 */ public void setMedianVisible(boolean visible) { if (this.medianVisible == visible) { return; } this.medianVisible = visible; fireChangeEvent(); } /** * Returns the flag that, if <code>true</code>, causes the whiskers to * be drawn using the series outline paint. * * @return A boolean. * * @since 1.0.14 */ public boolean getUseOutlinePaintForWhiskers() { return useOutlinePaintForWhiskers; } /** * Sets the flag that, if <code>true</code>, causes the whiskers to * be drawn using the series outline paint, and sends a * {@link RendererChangeEvent} to all registered listeners. * * @@param flag the new flag value. * * @since 1.0.14 */ public void setUseOutlinePaintForWhiskers(boolean flag) { if (this.useOutlinePaintForWhiskers == flag) { return; } this.useOutlinePaintForWhiskers = flag; fireChangeEvent(); } /** * Returns the width of the whiskers as fraction of the bar width. * * @return The width of the whiskers. * * @see #setWhiskerWidth(double) * * @since 1.0.14 */ public double getWhiskerWidth() { return this.whiskerWidth; } /** * Sets the width of the whiskers as a fraction of the bar width and sends * a {@link RendererChangeEvent} to all registered listeners. * * @param width a value between 0 and 1 indicating how wide the * whisker is supposed to be compared to the bar. * @see #getWhiskerWidth() * @see CategoryItemRendererState#getBarWidth() * * @since 1.0.14 */ public void setWhiskerWidth(double width) { if (width < 0 || width > 1) { throw new IllegalArgumentException( "Value for whisker width out of range"); } if (width == this.whiskerWidth) { return; } this.whiskerWidth = width; fireChangeEvent(); } /** * Returns a legend item for a series. * * @param datasetIndex the dataset index (zero-based). * @param series the series index (zero-based). * * @return The legend item (possibly <code>null</code>). */ public LegendItem getLegendItem(int datasetIndex, int series) { CategoryPlot cp = getPlot(); if (cp == null) { return null; } // check that a legend item needs to be displayed... if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series)) { return null; } CategoryDataset dataset = cp.getDataset(datasetIndex); String label = getLegendItemLabelGenerator().generateLabel(dataset, series); String description = label; String toolTipText = null; if (getLegendItemToolTipGenerator() != null) { toolTipText = getLegendItemToolTipGenerator().generateLabel( dataset, series); } String urlText = null; if (getLegendItemURLGenerator() != null) { urlText = getLegendItemURLGenerator().generateLabel(dataset, series); } Shape shape = lookupLegendShape(series); Paint paint = lookupSeriesPaint(series); Paint outlinePaint = lookupSeriesOutlinePaint(series); Stroke outlineStroke = lookupSeriesOutlineStroke(series); LegendItem result = new LegendItem(label, description, toolTipText, urlText, shape, paint, outlineStroke, outlinePaint); result.setLabelFont(lookupLegendTextFont(series)); Paint labelPaint = lookupLegendTextPaint(series); if (labelPaint != null) { result.setLabelPaint(labelPaint); } result.setDataset(dataset); result.setDatasetIndex(datasetIndex); result.setSeriesKey(dataset.getRowKey(series)); result.setSeriesIndex(series); return result; } /** * Returns the range of values from the specified dataset that the * renderer will require to display all the data. * * @param dataset the dataset. * * @return The range. */ public Range findRangeBounds(CategoryDataset dataset) { return super.findRangeBounds(dataset, true); } /** * Initialises the renderer. This method gets called once at the start of * the process of drawing a chart. * * @param g2 the graphics device. * @param dataArea the area in which the data is to be plotted. * @param plot the plot. * @param rendererIndex the renderer index. * @param info collects chart rendering information for return to caller. * * @return The renderer state. */ public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info) { CategoryItemRendererState state = super.initialise(g2, dataArea, plot, rendererIndex, info); // calculate the box width CategoryAxis domainAxis = getDomainAxis(plot, rendererIndex); CategoryDataset dataset = plot.getDataset(rendererIndex); if (dataset != null) { int columns = dataset.getColumnCount(); int rows = dataset.getRowCount(); double space = 0.0; PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.HORIZONTAL) { space = dataArea.getHeight(); } else if (orientation == PlotOrientation.VERTICAL) { space = dataArea.getWidth(); } double maxWidth = space * getMaximumBarWidth(); double categoryMargin = 0.0; double currentItemMargin = 0.0; if (columns > 1) { categoryMargin = domainAxis.getCategoryMargin(); } if (rows > 1) { currentItemMargin = getItemMargin(); } double used = space * (1 - domainAxis.getLowerMargin() - domainAxis.getUpperMargin() - categoryMargin - currentItemMargin); if ((rows * columns) > 0) { state.setBarWidth(Math.min(used / (dataset.getColumnCount() * dataset.getRowCount()), maxWidth)); } else { state.setBarWidth(Math.min(used, maxWidth)); } } return state; } /** * Draw a single data item. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area in which the data is drawn. * @param plot the plot. * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the data (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). * @param pass the pass index. */ public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) { // do nothing if item is not visible if (!getItemVisible(row, column)) { return; } if (!(dataset instanceof BoxAndWhiskerCategoryDataset)) { throw new IllegalArgumentException( "BoxAndWhiskerRenderer.drawItem() : the data should be " + "of type BoxAndWhiskerCategoryDataset only."); } PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.HORIZONTAL) { drawHorizontalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column); } else if (orientation == PlotOrientation.VERTICAL) { drawVerticalItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column); } } /** * Draws the visual representation of a single data item when the plot has * a horizontal orientation. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area within which the plot is being drawn. * @param plot the plot (can be used to obtain standard color * information etc). * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the dataset (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). */ public void drawHorizontalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column) { BoxAndWhiskerCategoryDataset bawDataset = (BoxAndWhiskerCategoryDataset) dataset; double categoryEnd = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryStart = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryWidth = Math.abs(categoryEnd - categoryStart); double yy = categoryStart; int seriesCount = getRowCount(); int categoryCount = getColumnCount(); if (seriesCount > 1) { double seriesGap = dataArea.getHeight() * getItemMargin() / (categoryCount * (seriesCount - 1)); double usedWidth = (state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1)); // offset the start of the boxes if the total width used is smaller // than the category width double offset = (categoryWidth - usedWidth) / 2; yy = yy + offset + (row * (state.getBarWidth() + seriesGap)); } else { // offset the start of the box if the box width is smaller than // the category width double offset = (categoryWidth - state.getBarWidth()) / 2; yy = yy + offset; } g2.setPaint(getItemPaint(row, column)); Stroke s = getItemStroke(row, column); g2.setStroke(s); RectangleEdge location = plot.getRangeAxisEdge(); Number xQ1 = bawDataset.getQ1Value(row, column); Number xQ3 = bawDataset.getQ3Value(row, column); Number xMax = bawDataset.getMaxRegularValue(row, column); Number xMin = bawDataset.getMinRegularValue(row, column); Shape box = null; if (xQ1 != null && xQ3 != null && xMax != null && xMin != null) { double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location); double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location); double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location); double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location); double yymid = yy + state.getBarWidth() / 2.0; double halfW = (state.getBarWidth() / 2.0) * this.whiskerWidth; // draw the box... box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth()); if (this.fillBox) { g2.fill(box); } Paint outlinePaint = getItemOutlinePaint(row, column); if (this.useOutlinePaintForWhiskers) { g2.setPaint(outlinePaint); } // draw the upper shadow... g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid)); g2.draw(new Line2D.Double(xxMax, yymid - halfW, xxMax, yymid + halfW)); // draw the lower shadow... g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid)); g2.draw(new Line2D.Double(xxMin, yymid - halfW, xxMin, yy + halfW)); g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(outlinePaint); g2.draw(box); } // draw mean - SPECIAL AIMS REQUIREMENT... g2.setPaint(this.artifactPaint); double aRadius = 0; // average radius if (this.meanVisible) { Number xMean = bawDataset.getMeanValue(row, column); if (xMean != null) { double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be // visible before drawing it... if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean - aRadius, yy + aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); } } } // draw median... if (this.medianVisible) { Number xMedian = bawDataset.getMedianValue(row, column); if (xMedian != null) { double xxMedian = rangeAxis.valueToJava2D(xMedian.doubleValue(), dataArea, location); g2.draw(new Line2D.Double(xxMedian, yy, xxMedian, yy + state.getBarWidth())); } } // collect entity and tool tip information... if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, row, column, box); } } } /** * Draws the visual representation of a single data item when the plot has * a vertical orientation. * * @param g2 the graphics device. * @param state the renderer state. * @param dataArea the area within which the plot is being drawn. * @param plot the plot (can be used to obtain standard color information * etc). * @param domainAxis the domain axis. * @param rangeAxis the range axis. * @param dataset the dataset (must be an instance of * {@link BoxAndWhiskerCategoryDataset}). * @param row the row index (zero-based). * @param column the column index (zero-based). */ public void drawVerticalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column) { BoxAndWhiskerCategoryDataset bawDataset = (BoxAndWhiskerCategoryDataset) dataset; double categoryEnd = domainAxis.getCategoryEnd(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryStart = domainAxis.getCategoryStart(column, getColumnCount(), dataArea, plot.getDomainAxisEdge()); double categoryWidth = categoryEnd - categoryStart; double xx = categoryStart; int seriesCount = getRowCount(); int categoryCount = getColumnCount(); if (seriesCount > 1) { double seriesGap = dataArea.getWidth() * getItemMargin() / (categoryCount * (seriesCount - 1)); double usedWidth = (state.getBarWidth() * seriesCount) + (seriesGap * (seriesCount - 1)); // offset the start of the boxes if the total width used is smaller // than the category width double offset = (categoryWidth - usedWidth) / 2; xx = xx + offset + (row * (state.getBarWidth() + seriesGap)); } else { // offset the start of the box if the box width is smaller than the // category width double offset = (categoryWidth - state.getBarWidth()) / 2; xx = xx + offset; } double yyAverage = 0.0; double yyOutlier; Paint itemPaint = getItemPaint(row, column); g2.setPaint(itemPaint); Stroke s = getItemStroke(row, column); g2.setStroke(s); double aRadius = 0; // average radius RectangleEdge location = plot.getRangeAxisEdge(); Number yQ1 = bawDataset.getQ1Value(row, column); Number yQ3 = bawDataset.getQ3Value(row, column); Number yMax = bawDataset.getMaxRegularValue(row, column); Number yMin = bawDataset.getMinRegularValue(row, column); Shape box = null; if (yQ1 != null && yQ3 != null && yMax != null && yMin != null) { double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location); double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location); double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location); double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location); double xxmid = xx + state.getBarWidth() / 2.0; double halfW = (state.getBarWidth() / 2.0) * this.whiskerWidth; // draw the body... box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3)); if (this.fillBox) { g2.fill(box); } Paint outlinePaint = getItemOutlinePaint(row, column); if (this.useOutlinePaintForWhiskers) { g2.setPaint(outlinePaint); } // draw the upper shadow... g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3)); g2.draw(new Line2D.Double(xx - halfW, yyMax, xx + halfW, yyMax)); // draw the lower shadow... g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1)); g2.draw(new Line2D.Double(xx - halfW, yyMin, xx + halfW, yyMin)); g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(outlinePaint); g2.draw(box); } g2.setPaint(this.artifactPaint); // draw mean - SPECIAL AIMS REQUIREMENT... if (this.meanVisible) { Number yMean = bawDataset.getMeanValue(row, column); if (yMean != null) { yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be // visible before drawing it... if ((yyAverage > (dataArea.getMinY() - aRadius)) && (yyAverage < (dataArea.getMaxY() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double( xx + aRadius, yyAverage - aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); } } } // draw median... if (this.medianVisible) { Number yMedian = bawDataset.getMedianValue(row, column); if (yMedian != null) { double yyMedian = rangeAxis.valueToJava2D( yMedian.doubleValue(), dataArea, location); g2.draw(new Line2D.Double(xx, yyMedian, xx + state.getBarWidth(), yyMedian)); } } // draw yOutliers... double maxAxisValue = rangeAxis.valueToJava2D( rangeAxis.getUpperBound(), dataArea, location) + aRadius; double minAxisValue = rangeAxis.valueToJava2D( rangeAxis.getLowerBound(), dataArea, location) - aRadius; g2.setPaint(itemPaint); // draw outliers double oRadius = state.getBarWidth() / 3; // outlier radius List outliers = new ArrayList(); OutlierListCollection outlierListCollection = new OutlierListCollection(); // From outlier array sort out which are outliers and put these into a // list If there are any farouts, set the flag on the // OutlierListCollection List yOutliers = bawDataset.getOutliers(row, column); if (yOutliers != null) { for (int i = 0; i < yOutliers.size(); i++) { double outlier = ((Number) yOutliers.get(i)).doubleValue(); Number minOutlier = bawDataset.getMinOutlier(row, column); Number maxOutlier = bawDataset.getMaxOutlier(row, column); Number minRegular = bawDataset.getMinRegularValue(row, column); Number maxRegular = bawDataset.getMaxRegularValue(row, column); if (outlier > maxOutlier.doubleValue()) { outlierListCollection.setHighFarOut(true); } else if (outlier < minOutlier.doubleValue()) { outlierListCollection.setLowFarOut(true); } else if (outlier > maxRegular.doubleValue()) { yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea, location); outliers.add(new Outlier(xx + state.getBarWidth() / 2.0, yyOutlier, oRadius)); } else if (outlier < minRegular.doubleValue()) { yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea, location); outliers.add(new Outlier(xx + state.getBarWidth() / 2.0, yyOutlier, oRadius)); } Collections.sort(outliers); } // Process outliers. Each outlier is either added to the // appropriate outlier list or a new outlier list is made for (Iterator iterator = outliers.iterator(); iterator.hasNext();) { Outlier outlier = (Outlier) iterator.next(); outlierListCollection.add(outlier); } for (Iterator iterator = outlierListCollection.iterator(); iterator.hasNext();) { OutlierList list = (OutlierList) iterator.next(); Outlier outlier = list.getAveragedOutlier(); Point2D point = outlier.getPoint(); if (list.isMultiple()) { drawMultipleEllipse(point, state.getBarWidth(), oRadius, g2); } else { drawEllipse(point, oRadius, g2); } } // draw farout indicators if (outlierListCollection.isHighFarOut()) { drawHighFarOut(aRadius / 2.0, g2, xx + state.getBarWidth() / 2.0, maxAxisValue); } if (outlierListCollection.isLowFarOut()) { drawLowFarOut(aRadius / 2.0, g2, xx + state.getBarWidth() / 2.0, minAxisValue); } } // collect entity and tool tip information... if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { addItemEntity(entities, dataset, row, column, box); } } } /** * Draws a dot to represent an outlier. * * @param point the location. * @param oRadius the radius. * @param g2 the graphics device. */ private void drawEllipse(Point2D point, double oRadius, Graphics2D g2) { Ellipse2D dot = new Ellipse2D.Double(point.getX() + oRadius / 2, point.getY(), oRadius, oRadius); g2.draw(dot); } /** * Draws two dots to represent the average value of more than one outlier. * * @param point the location * @param boxWidth the box width. * @param oRadius the radius. * @param g2 the graphics device. */ private void drawMultipleEllipse(Point2D point, double boxWidth, double oRadius, Graphics2D g2) { Ellipse2D dot1 = new Ellipse2D.Double(point.getX() - (boxWidth / 2) + oRadius, point.getY(), oRadius, oRadius); Ellipse2D dot2 = new Ellipse2D.Double(point.getX() + (boxWidth / 2), point.getY(), oRadius, oRadius); g2.draw(dot1); g2.draw(dot2); } /** * Draws a triangle to indicate the presence of far-out values. * * @param aRadius the radius. * @param g2 the graphics device. * @param xx the x coordinate. * @param m the y coordinate. */ private void drawHighFarOut(double aRadius, Graphics2D g2, double xx, double m) { double side = aRadius * 2; g2.draw(new Line2D.Double(xx - side, m + side, xx + side, m + side)); g2.draw(new Line2D.Double(xx - side, m + side, xx, m)); g2.draw(new Line2D.Double(xx + side, m + side, xx, m)); } /** * Draws a triangle to indicate the presence of far-out values. * * @param aRadius the radius. * @param g2 the graphics device. * @param xx the x coordinate. * @param m the y coordinate. */ private void drawLowFarOut(double aRadius, Graphics2D g2, double xx, double m) { double side = aRadius * 2; g2.draw(new Line2D.Double(xx - side, m - side, xx + side, m - side)); g2.draw(new Line2D.Double(xx - side, m - side, xx, m)); g2.draw(new Line2D.Double(xx + side, m - side, xx, m)); } /** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BoxAndWhiskerRenderer)) { return false; } BoxAndWhiskerRenderer that = (BoxAndWhiskerRenderer) obj; if (this.fillBox != that.fillBox) { return false; } if (this.itemMargin != that.itemMargin) { return false; } if (this.maximumBarWidth != that.maximumBarWidth) { return false; } if (this.meanVisible != that.meanVisible) { return false; } if (this.medianVisible != that.medianVisible) { return false; } if (this.useOutlinePaintForWhiskers != that.useOutlinePaintForWhiskers) { return false; } if (this.whiskerWidth != that.whiskerWidth) { return false; } if (!PaintUtilities.equal(this.artifactPaint, that.artifactPaint)) { return false; } return super.equals(obj); } /** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.artifactPaint, stream); } /** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.artifactPaint = SerialUtilities.readPaint(stream); } }
fb17435a260a1566e6a3d2479f601022f629cf62
7346901d3bd4beb3e19600671ea7a251aa219037
/PrejudgeGame/PrejudgeGameModule/src/multi/premier/demoo/version01/MultibuffException.java
07e1f6bb92985c64347f5782f5ef78a8ef7e14ec
[]
no_license
YiFan-Evan/strategic-game
7ace1d16dda6317e998d8566c1acfe59cf77dc53
45ba5904becca17ef2f2e22eae5b480c0cfc6ed4
refs/heads/main
2023-08-25T06:09:36.130521
2021-10-24T04:19:25
2021-10-24T04:19:25
344,667,480
1
0
null
null
null
null
UTF-8
Java
false
false
94
java
package multi.premier.demoo.version01; public class MultibuffException extends Exception { }
af3c605a7b5d7764c5643f021757a1958deb9a99
16a292ceef1df62ab31f0e6746a72b26c79c1d32
/src/main/java/mabaya/assignment/AssignmentApplication.java
b4db8d882922f435c64c5e7341ad101cc7ef91c2
[]
no_license
DavidRadchenko/mabayaExam
a2f42b2a24fa286062b3322928a18aeb675528e6
a4bb826b99d63f13dd07dc5bc7c5172e2d274611
refs/heads/master
2022-10-14T22:34:38.818708
2020-06-14T18:39:06
2020-06-14T18:39:06
272,256,398
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package mabaya.assignment; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class AssignmentApplication { public static void main(String[] args) { SpringApplication.run(AssignmentApplication.class, args); System.out.println("Server Started!"); } }
e626f4243b63aecd5f288e7f5be375a208bc57ab
eae5e01cfcfadcd52954e52d96f5bbbba929be4e
/src/com/tust/tools/db/JZData.java
c6287cc93c1e630a2e5128132c690de0575c09e0
[]
no_license
yanghuiyang/LiCai
ab351d82716b777cde55c5152353dc3106c0a56c
cb02420db9e7050168b5bd98e3d01f17e298cc6e
refs/heads/master
2021-01-21T12:59:10.506239
2016-05-29T05:01:11
2016-05-29T05:01:11
55,654,631
2
0
null
null
null
null
UTF-8
Java
false
false
9,723
java
package com.tust.tools.db; import java.util.ArrayList; import java.util.List; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.tust.tools.bean.JZshouru; import com.tust.tools.bean.JZzhichu; import com.tust.tools.service.GetTime; //记账数据库操作 public class JZData { private SQLiteDatabase db; private DBOpenHelper dbHelper;// 创建DBOpenHelper对象 private Context context; public JZData(Context context){ this.context = context; dbHelper = new DBOpenHelper(context);// 初始化DBOpenHelper对象 db= dbHelper.getWritableDatabase(); } public void close(){ db.close(); dbHelper.close(); } /* * 获取某月某类型支出总额 * */ public int getTypeMonthSpend(String userName,String typeName,Integer year,Integer month){ int total=0; Cursor cursor = db.rawQuery("select ZC_COUNT from zhichu where ZC_USER=? and ZC_ITEM=? And ZC_YEAR = ? and ZC_MONTH=?", new String[]{String.valueOf(userName),String.valueOf(typeName), String.valueOf(year), String.valueOf(month) } ); while (cursor.moveToNext()) { total +=Integer.parseInt(cursor.getString(cursor.getColumnIndex("ZC_COUNT"))); } return total; } /* * 获取某月支出总额 * */ public int getMonthSpend(String userName,Integer year,Integer month){ int total=0; // Cursor cursor = db.rawQuery("select SUM(ZC_COUNT) from zhichu where ZC_USER=? And ZC_YEAR = ? and ZC_MONTH=?", Cursor cursor = db.rawQuery("select ZC_COUNT from zhichu where ZC_USER=? And ZC_YEAR = ? AND ZC_MONTH=?", new String[]{String.valueOf(userName), String.valueOf(year), String.valueOf(month) } ); while (cursor.moveToNext()) { // total = cursor.getInt(0); total +=Integer.parseInt(cursor.getString(cursor.getColumnIndex("ZC_COUNT"))); } return total; } /* * 获取支出表中的所有数据 * */ public ArrayList<JZzhichu> GetZhiChuList(String selection){ ArrayList<JZzhichu> zhichulist=new ArrayList<JZzhichu>(); Cursor cursor=db.query("zhichu", null, selection, null, null, null, "ID DESC"); cursor.moveToFirst(); while(!cursor.isAfterLast()&&(cursor.getString(1)!=null)){ JZzhichu zhichu=new JZzhichu(); zhichu.setZc_Id(cursor.getInt(0)); zhichu.setZc_Item(cursor.getString(1)); zhichu.setZc_SubItem(cursor.getString(2)); zhichu.setZc_Year(cursor.getInt(3)); zhichu.setZc_Month(cursor.getInt(4)); zhichu.setZc_Week(cursor.getInt(5)); zhichu.setZc_Day(cursor.getInt(6)); zhichu.setZc_Time(cursor.getString(7)); zhichu.setZc_Pic(cursor.getString(8)); zhichu.setZc_Count(cursor.getDouble(9)); zhichu.setZc_Beizhu(cursor.getString(10)); zhichu.setZc_User(cursor.getString(11));//add zhichulist.add(zhichu); cursor.moveToNext(); } cursor.close(); return zhichulist; } /* * 获取收入表中的所有数据 * */ public ArrayList<JZshouru> GetShouRuList(String selection){ ArrayList<JZshouru>shourulist=new ArrayList<JZshouru>(); Cursor cursor=db.query("shouru", null, selection, null, null, null, "ID DESC"); cursor.moveToFirst(); while(!cursor.isAfterLast()&&(cursor.getString(1)!=null)){ JZshouru shouru=new JZshouru(); shouru.setSr_Id(cursor.getInt(0)); shouru.setSr_Item(cursor.getString(1)); shouru.setSr_Year(cursor.getInt(2)); shouru.setSr_Month(cursor.getInt(3)); shouru.setSr_Week(cursor.getInt(4)); shouru.setSr_Day(cursor.getInt(5)); shouru.setSr_Time(cursor.getString(6)); shouru.setSr_Count(cursor.getDouble(7)); shouru.setSr_Beizhu(cursor.getString(8)); shouru.setSr_User(cursor.getString(9)); //add shourulist.add(shouru); cursor.moveToNext(); } cursor.close(); return shourulist; } /* * 更新支出表的记录 * */ public int UpdateZhiChuInfo(JZzhichu zhichu,int id){ ContentValues values = new ContentValues(); values.put(JZzhichu.ZC_ITEM, zhichu.getZc_Item()); values.put(JZzhichu.ZC_SUBITEM, zhichu.getZc_SubItem()); values.put(JZzhichu.ZC_YEAR, zhichu.getZc_Year()); values.put(JZzhichu.ZC_MONTH, zhichu.getZc_Month()); values.put(JZzhichu.ZC_WEEK, zhichu.getZc_Week()); values.put(JZzhichu.ZC_DAY, zhichu.getZc_Day()); values.put(JZzhichu.ZC_TIME, zhichu.getZc_Time()); values.put(JZzhichu.ZC_PIC, zhichu.getZc_Pic()); values.put(JZzhichu.ZC_COUNT, zhichu.getZc_Count()); values.put(JZzhichu.ZC_BEIZHU, zhichu.getZc_Beizhu()); values.put(JZzhichu.ZC_USER, zhichu.getZc_User());//add int idupdate= db.update("zhichu", values, "ID ='"+id+"'", null); this.close(); return idupdate; } /* * 更新收入表的记录 * */ public int UpdateShouRuInfo(JZshouru shouru,int id){ ContentValues values = new ContentValues(); values.put(JZshouru.SR_ITEM, shouru.getSr_Item()); values.put(JZshouru.SR_YEAR, shouru.getSr_Year()); values.put(JZshouru.SR_MONTH, shouru.getSr_Month()); values.put(JZshouru.SR_WEEK, shouru.getSr_Week()); values.put(JZshouru.SR_DAY, shouru.getSr_Day()); values.put(JZshouru.SR_TIME, shouru.getSr_Time()); values.put(JZshouru.SR_COUNT, shouru.getSr_Count()); values.put(JZshouru.SR_BEIZHU, shouru.getSr_Beizhu()); values.put(JZshouru.SR_USER, shouru.getSr_User());//add int idupdate= db.update("shouru", values, "ID ='"+id+"'", null); this.close(); return idupdate; } /* * 添加支出记录 * */ public Long SaveZhiChuInfo(JZzhichu zhichu){ ContentValues values = new ContentValues(); values.put(JZzhichu.ZC_ITEM, zhichu.getZc_Item()); values.put(JZzhichu.ZC_SUBITEM, zhichu.getZc_SubItem()); values.put(JZzhichu.ZC_YEAR, zhichu.getZc_Year()); values.put(JZzhichu.ZC_MONTH, zhichu.getZc_Month()); values.put(JZzhichu.ZC_WEEK, zhichu.getZc_Week()); values.put(JZzhichu.ZC_DAY, zhichu.getZc_Day()); values.put(JZzhichu.ZC_TIME, zhichu.getZc_Time()); values.put(JZzhichu.ZC_PIC, zhichu.getZc_Pic()); values.put(JZzhichu.ZC_COUNT, zhichu.getZc_Count()); values.put(JZzhichu.ZC_BEIZHU, zhichu.getZc_Beizhu()); values.put(JZzhichu.ZC_USER, zhichu.getZc_User());//add Long uid = db.insert("zhichu", JZzhichu.ZC_YEAR, values); this.close(); return uid; } /* * 添加收入记录 * */ public Long SaveShouRuInfo(JZshouru shouru){ ContentValues values = new ContentValues(); values.put(JZshouru.SR_ITEM, shouru.getSr_Item()); values.put(JZshouru.SR_YEAR, shouru.getSr_Year()); values.put(JZshouru.SR_MONTH, shouru.getSr_Month()); values.put(JZshouru.SR_WEEK, shouru.getSr_Week()); values.put(JZshouru.SR_DAY, shouru.getSr_Day()); values.put(JZshouru.SR_TIME, shouru.getSr_Time()); values.put(JZshouru.SR_COUNT, shouru.getSr_Count()); values.put(JZshouru.SR_BEIZHU, shouru.getSr_Beizhu()); values.put(JZshouru.SR_USER, shouru.getSr_User()); Long uid = db.insert("shouru", JZshouru.SR_YEAR, values); this.close(); return uid; } /* * 删除支出表的记录 * */ public int DelZhiChuInfo(int id){ int iddel= db.delete("zhichu", "ID ="+id, null); this.close(); return iddel; } /* * 删除所有记录 * */ public void delAll(String userName){ db.delete("zhichu","ZC_USER ="+"'"+userName+"'", null); db.delete("shouru", "SR_USER ="+"'"+userName+"'", null); } /* * 删除收入表的记录 * */ public int DelShouRuInfo(int id){ int iddel= db.delete("shouru", "ID ="+id, null); this.close(); return iddel; } /* * 用于判断当月记账是否连续3天超出平均值 * */ public boolean isBeyond(JZzhichu zhichu, int budget) { // boolean flag = false; int flag = 0; int average=0;//平均值 if(GetTime.getMonth()!= zhichu.getZc_Month()||zhichu.getZc_Day()<3){ //不在当前月份的记账不考虑 当月前记账两天不考虑 return false; } average=(int)Math.floor(budget/30);//假设一个月30天吧 int dayCount =0; for(int i=2;i>=0;i--) { String selectionMonth = JZzhichu.ZC_USER + "='" + zhichu.getZc_User() + "'" + " and " + JZzhichu.ZC_YEAR + "=" + GetTime.getYear() + " and " + JZzhichu.ZC_MONTH + "=" + GetTime.getMonth() + " and " + JZzhichu.ZC_DAY + "=" + (zhichu.getZc_Day() - i); List<JZzhichu> zhichuMonthList = GetZhiChuList(selectionMonth); if (zhichuMonthList != null) { for (JZzhichu zhichu2 : zhichuMonthList) { dayCount += zhichu2.getZc_Count(); } if (i == 0) { dayCount += zhichu.getZc_Count();//加上今天这次记账 } if (dayCount > average) { // flag = flag & true; flag ++; } dayCount = 0; } } if (flag==3){ return true; } return false; } }
72cfb492ab39f59ca89333b619e3aa6490772a9f
995f73d30450a6dce6bc7145d89344b4ad6e0622
/P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/android/hardware/radio/V1_2/VoiceRegStateResult.java
f53faabf90994ad0ef8077d83bd7d98a2f611e36
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,484
java
package android.hardware.radio.V1_2; import android.hardware.radio.V1_0.RegState; import android.os.HidlSupport; import android.os.HwBlob; import android.os.HwParcel; import java.util.ArrayList; import java.util.Objects; public final class VoiceRegStateResult { public CellIdentity cellIdentity = new CellIdentity(); public boolean cssSupported; public int defaultRoamingIndicator; public int rat; public int reasonForDenial; public int regState; public int roamingIndicator; public int systemIsInPrl; public final boolean equals(Object otherObject) { if (this == otherObject) { return true; } if (otherObject == null || otherObject.getClass() != VoiceRegStateResult.class) { return false; } VoiceRegStateResult other = (VoiceRegStateResult) otherObject; if (this.regState == other.regState && this.rat == other.rat && this.cssSupported == other.cssSupported && this.roamingIndicator == other.roamingIndicator && this.systemIsInPrl == other.systemIsInPrl && this.defaultRoamingIndicator == other.defaultRoamingIndicator && this.reasonForDenial == other.reasonForDenial && HidlSupport.deepEquals(this.cellIdentity, other.cellIdentity)) { return true; } return false; } public final int hashCode() { return Objects.hash(Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.regState))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.rat))), Integer.valueOf(HidlSupport.deepHashCode(Boolean.valueOf(this.cssSupported))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.roamingIndicator))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.systemIsInPrl))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.defaultRoamingIndicator))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.reasonForDenial))), Integer.valueOf(HidlSupport.deepHashCode(this.cellIdentity))); } public final String toString() { return "{.regState = " + RegState.toString(this.regState) + ", .rat = " + this.rat + ", .cssSupported = " + this.cssSupported + ", .roamingIndicator = " + this.roamingIndicator + ", .systemIsInPrl = " + this.systemIsInPrl + ", .defaultRoamingIndicator = " + this.defaultRoamingIndicator + ", .reasonForDenial = " + this.reasonForDenial + ", .cellIdentity = " + this.cellIdentity + "}"; } public final void readFromParcel(HwParcel parcel) { readEmbeddedFromParcel(parcel, parcel.readBuffer(120), 0); } public static final ArrayList<VoiceRegStateResult> readVectorFromParcel(HwParcel parcel) { ArrayList<VoiceRegStateResult> _hidl_vec = new ArrayList<>(); HwBlob _hidl_blob = parcel.readBuffer(16); int _hidl_vec_size = _hidl_blob.getInt32(8); HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 120), _hidl_blob.handle(), 0, true); _hidl_vec.clear(); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { VoiceRegStateResult _hidl_vec_element = new VoiceRegStateResult(); _hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 120)); _hidl_vec.add(_hidl_vec_element); } return _hidl_vec; } public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) { this.regState = _hidl_blob.getInt32(0 + _hidl_offset); this.rat = _hidl_blob.getInt32(4 + _hidl_offset); this.cssSupported = _hidl_blob.getBool(8 + _hidl_offset); this.roamingIndicator = _hidl_blob.getInt32(12 + _hidl_offset); this.systemIsInPrl = _hidl_blob.getInt32(16 + _hidl_offset); this.defaultRoamingIndicator = _hidl_blob.getInt32(20 + _hidl_offset); this.reasonForDenial = _hidl_blob.getInt32(24 + _hidl_offset); this.cellIdentity.readEmbeddedFromParcel(parcel, _hidl_blob, 32 + _hidl_offset); } public final void writeToParcel(HwParcel parcel) { HwBlob _hidl_blob = new HwBlob(120); writeEmbeddedToBlob(_hidl_blob, 0); parcel.writeBuffer(_hidl_blob); } public static final void writeVectorToParcel(HwParcel parcel, ArrayList<VoiceRegStateResult> _hidl_vec) { HwBlob _hidl_blob = new HwBlob(16); int _hidl_vec_size = _hidl_vec.size(); _hidl_blob.putInt32(8, _hidl_vec_size); _hidl_blob.putBool(12, false); HwBlob childBlob = new HwBlob(_hidl_vec_size * 120); for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) { _hidl_vec.get(_hidl_index_0).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 120)); } _hidl_blob.putBlob(0, childBlob); parcel.writeBuffer(_hidl_blob); } public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) { _hidl_blob.putInt32(0 + _hidl_offset, this.regState); _hidl_blob.putInt32(4 + _hidl_offset, this.rat); _hidl_blob.putBool(8 + _hidl_offset, this.cssSupported); _hidl_blob.putInt32(12 + _hidl_offset, this.roamingIndicator); _hidl_blob.putInt32(16 + _hidl_offset, this.systemIsInPrl); _hidl_blob.putInt32(20 + _hidl_offset, this.defaultRoamingIndicator); _hidl_blob.putInt32(24 + _hidl_offset, this.reasonForDenial); this.cellIdentity.writeEmbeddedToBlob(_hidl_blob, 32 + _hidl_offset); } }
3b1559d4ba694220a91e7382a3437828dd97460a
c1e4dd152ada287a824dbf0b1aa8d5384e585dcf
/src/maximumareahistrogram/MaximumHistrogramAreaTest.java
12f13306f027f2abf737c5da8384cb578322de0f
[]
no_license
ajanac/HistrogramProblem
12b58218dd790bcb4f222705e6a3f1d443bb70f3
1c369487b52820455eec79e989f9f1bf8e68958c
refs/heads/master
2021-01-19T03:51:08.473182
2017-04-05T17:22:46
2017-04-05T17:22:46
87,334,984
0
0
null
null
null
null
UTF-8
Java
false
false
318
java
package maximumareahistrogram; import static org.junit.Assert.*; import org.junit.Test; public class MaximumHistrogramAreaTest { @Test public void test() { MaximumHistrogramArea obj=new MaximumHistrogramArea(); int input[]={1,2,4}; int maxArea=obj.maximumHistaArea(input); assertEquals(4,maxArea); } }
1d56493ef8ff2dcc4a1567305c848bc26608686c
a2c651af55d69301d5d4aadcbb7eb445f87c4167
/nuls-switch-manage/src/main/java/io/nuls/nulsswitch/common/dao/LogDao.java
93141e158bf3f84b1a04c80d47f4b69ef761ae75
[ "MIT", "Apache-2.0" ]
permissive
CCC-NULS/nuls_switch
085700160b353640cfeb6c7908e3dfdd91f89ea7
a5a19841044de7f28b4498e06a9eca2262f3be10
refs/heads/master
2022-12-22T05:53:09.319091
2020-02-05T03:16:07
2020-02-05T03:16:07
195,358,468
2
3
MIT
2022-12-11T23:20:23
2019-07-05T07:15:23
JavaScript
UTF-8
Java
false
false
287
java
package io.nuls.nulsswitch.common.dao; import io.nuls.nulsswitch.common.base.BaseDao; import io.nuls.nulsswitch.common.domain.LogDO; /** * 系统日志 * * @author chglee * @email [email protected] * @date 2017-10-03 15:45:42 */ public interface LogDao extends BaseDao<LogDO> { }
b0c6cb495a586b58603227f18a67e1c31d1731b7
d99b9eb522758208f9d0b8d860a9c6c186555c8d
/src/pastYear2018_1/Q5.java
358cc55ee6e5d7d61319f3b868550409db097d51
[]
no_license
TINGWEIJING/FOP-LAB-GROUP2-2020
a4f0b071b192633c2edd098f55fc55656e813969
8d6a60e07d3a546a78392498d19701353b2940fd
refs/heads/main
2023-02-19T00:35:25.377427
2021-01-21T05:21:54
2021-01-21T05:21:54
318,084,808
0
1
null
null
null
null
UTF-8
Java
false
false
714
java
package pastYear2018_1; /** * * @author TING WEI JING */ public class Q5 { public static void main(String[] args) { Fruit[] fruits = new Fruit[4]; fruits[0] = new Apple("Red", 8); fruits[1] = new Apple("Green", 11); fruits[2] = new Watermelon("Local", 7.6); fruits[3] = new Watermelon("Imported", 4); Fruit cheapFruit = fruits[0]; for(Fruit fruit : fruits) { System.out.println(fruit); if(cheapFruit.totalPrice() > fruit.totalPrice()) { cheapFruit = fruit; } } System.out.println("The cheapest item is"); System.out.println(cheapFruit); } }
72082cfcf637c310aecbc3b6357e54609d016447
72d02201a0cfe57885ef3ce31f6c5df176c537b3
/src/chapter13/FileStreamDemo.java
9b47d066dab48620c4612d4ecb107ec83e75e185
[]
no_license
yuniler/beautifulDay
21ec1e50a070d77798ba9d9312fd0af2a86809c6
33b171e7025c3612f89f5ae428a5d78c54dca627
refs/heads/master
2020-12-11T11:13:42.728823
2020-02-12T15:22:08
2020-02-12T15:22:08
233,832,587
1
0
null
null
null
null
GB18030
Java
false
false
1,663
java
package chapter13; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.File; import java.io.InputStream; import java.io.OutputStream; /** * 演示文件输入。输出流的基本用法 * 注意,目前的读写方式比较元素,在这里熟悉InputStrean/OutputStream的一些方法 * 会有高级方法在后面 * @author sunguangyu * */ public class FileStreamDemo { private static final String FilePath = "src/chapter13/FileDemo.java"; public static void main(String[] args) throws IOException { ReadFile(); } public static void writeFile() throws IOException{ final String FilePath1 = "src/chapter13/FileDemo1.java"; OutputStream outStream = new FileOutputStream(FilePath1); String content = "public static void main(String[] args){\n"; content += "System.out.println(\"Hello World!\");\n}"; outStream.write(content.getBytes());//核心语句,将字符串转换成字节数组,写入到文件中 //写完一定要记得关闭打开的资源 outStream.close(); } public static void ReadFile() throws IOException{ File file = new File(FilePath); InputStream inputStream = new FileInputStream(file); //inputStream.available()获取输入流可以读取的文件大小 //读取文件的基本操作 byte[] bytes = new byte[20000]; int count = 0; inputStream.read(bytes); // while((bytes[count] = (byte)inputStream.read()) != -1){ // count++; // } String content = new String(bytes);//将读取出的字节数组转换成字符串,以便打印 System.out.println(content); inputStream.close(); } }
27c7d143f8b785fde35a1edada62e5f98e011179
7f261a1e2bafd1cdd98d58f00a2937303c0dc942
/src/ANXCamera/sources/com/bumptech/glide/load/engine/bitmap_recycle/g.java
f6ed2f5b8213149c2ab9dff9f7a2d525fcd57354
[]
no_license
xyzuan/ANXCamera
7614ddcb4bcacdf972d67c2ba17702a8e9795c95
b9805e5197258e7b980e76a97f7f16de3a4f951a
refs/heads/master
2022-04-23T16:58:09.592633
2019-05-31T17:18:34
2019-05-31T17:26:48
259,555,505
3
0
null
2020-04-28T06:49:57
2020-04-28T06:49:57
null
UTF-8
Java
false
false
3,251
java
package com.bumptech.glide.load.engine.bitmap_recycle; import android.support.annotation.Nullable; import com.bumptech.glide.load.engine.bitmap_recycle.l; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /* compiled from: GroupedLinkedMap */ class g<K extends l, V> { private final a<K, V> hi = new a<>(); private final Map<K, a<K, V>> hj = new HashMap(); /* compiled from: GroupedLinkedMap */ private static class a<K, V> { a<K, V> hk; a<K, V> hl; final K key; private List<V> values; a() { this(null); } a(K k) { this.hl = this; this.hk = this; this.key = k; } public void add(V v) { if (this.values == null) { this.values = new ArrayList(); } this.values.add(v); } @Nullable public V removeLast() { int size = size(); if (size > 0) { return this.values.remove(size - 1); } return null; } public int size() { if (this.values != null) { return this.values.size(); } return 0; } } g() { } private void a(a<K, V> aVar) { d(aVar); aVar.hl = this.hi; aVar.hk = this.hi.hk; c(aVar); } private void b(a<K, V> aVar) { d(aVar); aVar.hl = this.hi.hl; aVar.hk = this.hi; c(aVar); } private static <K, V> void c(a<K, V> aVar) { aVar.hk.hl = aVar; aVar.hl.hk = aVar; } private static <K, V> void d(a<K, V> aVar) { aVar.hl.hk = aVar.hk; aVar.hk.hl = aVar.hl; } public void a(K k, V v) { a aVar = (a) this.hj.get(k); if (aVar == null) { aVar = new a(k); b(aVar); this.hj.put(k, aVar); } else { k.bm(); } aVar.add(v); } @Nullable public V b(K k) { a aVar = (a) this.hj.get(k); if (aVar == null) { aVar = new a(k); this.hj.put(k, aVar); } else { k.bm(); } a(aVar); return aVar.removeLast(); } @Nullable public V removeLast() { for (a<K, V> aVar = this.hi.hl; !aVar.equals(this.hi); aVar = aVar.hl) { V removeLast = aVar.removeLast(); if (removeLast != null) { return removeLast; } d(aVar); this.hj.remove(aVar.key); ((l) aVar.key).bm(); } return null; } public String toString() { StringBuilder sb = new StringBuilder("GroupedLinkedMap( "); boolean z = false; for (a<K, V> aVar = this.hi.hk; !aVar.equals(this.hi); aVar = aVar.hk) { z = true; sb.append('{'); sb.append(aVar.key); sb.append(':'); sb.append(aVar.size()); sb.append("}, "); } if (z) { sb.delete(sb.length() - 2, sb.length()); } sb.append(" )"); return sb.toString(); } }
eb1d24b5b314341cbf86ce07f0a4fe9a8d94f439
8650ce09a3d571f2b64ba93f6083eb031c22db05
/BistuTalk/app/src/main/java/com/example/bistutalk/MainActivity.java
64e3d996275f284332cf00c8741b6b305b521cbb
[]
no_license
chenwwwwww/bistumlson
885c7924aaea59622f519e027b76582ec36e1ff3
5e990ec4e54295017551be1bd2bb7eb2a82dcb4d
refs/heads/master
2020-05-24T13:48:08.588461
2020-04-16T10:22:10
2020-04-16T10:22:10
187,297,475
0
1
null
null
null
null
UTF-8
Java
false
false
6,324
java
package com.example.bistutalk; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.os.StrictMode; 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.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import java.util.Map; import android.os.Handler; import android.os.Message; public class MainActivity extends AppCompatActivity { public static LinearLayout li1, li2, li3, li4; public static Button button, button2, button3, button4, button5; public ImageView imageView, imageView2, imageView3, imageView4,imageView5,imageView6,imageView7,imageView8; public static Map<String, View> map = new HashMap<>(); String url1 = ""; String url2 = ""; String url3 = ""; HttpURLConnection httpURLConnection; LinearLayout linearLayout,linearLayout2; String string = "http://webcal123.top/shen1.jpg"; String string2 = "http://webcal123.top/shen2.jpg"; String string3 = "http://webcal123.top/shen3.jpg"; String string4 = "http://webcal123.top/shen4.jpg"; String string5 = "http://webcal123.top/xue1.jpg"; String string6 = "http://webcal123.top/xue2.jpg"; String string7 = "http://webcal123.top/xue3.jpg"; String string8 = "http://webcal123.top/shen.jpg"; TextView textView2 ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); StrictMode.setThreadPolicy(//必须要的线程对象管理策略 new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build() ); li4 = (LinearLayout) findViewById(R.id.Li4); li3 = (LinearLayout) findViewById(R.id.Li); li2 = (LinearLayout) findViewById(R.id.Li2); li1 = (LinearLayout) findViewById(R.id.Li3); textView2=(TextView)findViewById(R.id.text2); linearLayout=(LinearLayout)findViewById(R.id.Lin); linearLayout.setVisibility(View.GONE); linearLayout2=(LinearLayout)findViewById(R.id.Lin2); linearLayout2.setVisibility(View.GONE); button = (Button) findViewById(R.id.button); button2 = (Button) findViewById(R.id.button2); button3 = (Button) findViewById(R.id.button3); button4 = (Button) findViewById(R.id.button4); button5=(Button)findViewById(R.id.button5); Button lbutton = (Button)findViewById(R.id.load); imageView = (ImageView) findViewById(R.id.images); imageView2 = (ImageView) findViewById(R.id.images2); imageView3 = (ImageView) findViewById(R.id.images3); imageView4=(ImageView)findViewById(R.id.images4); imageView5=(ImageView)findViewById(R.id.images5); imageView6=(ImageView)findViewById(R.id.images6); imageView7=(ImageView)findViewById(R.id.images7); imageView8=(ImageView)findViewById(R.id.images8); button.setOnClickListener(new ClickView()); button2.setOnClickListener(new ClickView()); button3.setOnClickListener(new ClickView()); button4.setOnClickListener(new ClickView()); lbutton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { textView2.setVisibility(View.GONE); loadView(string,0); loadView(string2,1); // loadView(string3,2); // loadView(string4,3); loadView(string5,4); loadView(string6,5); // loadView(string7,6); linearLayout.setVisibility(View.VISIBLE); linearLayout2.setVisibility(View.VISIBLE); } }); button5.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,Login.class); startActivity(intent); } }); li1.setOnTouchListener(new MyTouch()); li2.setOnTouchListener(new MyTouch()); li3.setOnTouchListener(new MyTouch()); li4.setOnTouchListener(new MyTouch()); map.put("1", li1); map.put("2", li2); map.put("3", li3); map.put("4", li4); } public void loadView(String string, int i){ try { URL url = new URL(string); httpURLConnection = (HttpURLConnection) url.openConnection(); httpURLConnection.setRequestMethod("GET"); if (httpURLConnection.getResponseCode() == 200) { InputStream inputStream = httpURLConnection.getInputStream(); Bitmap bitmap = BitmapFactory.decodeStream(inputStream); MyHandler myHandler = new MyHandler(); myHandler.obtainMessage(i, bitmap).sendToTarget(); int result = inputStream.read(); while (result != -1) { result = inputStream.read(); } //inputStream.close(); } } catch (Exception e) { } } class MyHandler extends Handler { public void handleMessage(Message msg) { super.handleMessage(msg); if(msg.what==0) imageView.setImageBitmap((Bitmap) msg.obj); if(msg.what==1) imageView2.setImageBitmap((Bitmap) msg.obj); if(msg.what==2) imageView3.setImageBitmap((Bitmap) msg.obj); if(msg.what==3) imageView4.setImageBitmap((Bitmap) msg.obj); if(msg.what==4) imageView5.setImageBitmap((Bitmap) msg.obj); if(msg.what==5) imageView6.setImageBitmap((Bitmap) msg.obj); if(msg.what==6) imageView7.setImageBitmap((Bitmap) msg.obj); } } }
10df45ef89f665f037a139dbe7c3e15bfb03ccb5
48d379a69fb6a2021b8e6bce41f56c13477a95c6
/GeoPosUy/EJB/com/clases/Observacion.java
abb47e2ffa750f27ab429aa22314207cec131846
[]
no_license
juanipicart/UtecGrupoEAE
8793855745a1ddde5290947df159ae6b59c3ac7b
456b31dc292f60b91245284f22d0f6a98d0158c1
refs/heads/master
2022-11-06T19:29:24.221000
2020-04-29T03:45:29
2020-04-29T03:45:29
213,785,463
0
0
null
null
null
null
UTF-8
Java
false
false
1,590
java
package com.clases; import java.util.Date; import com.clases.relaciones.RelUbicacion; public class Observacion { long id_observacion; String descripcion; //max 100 not null String geolocalizacion; //max 150 not null Date fecha_hora; //not null private RelUbicacion ubicacion; //not null private Usuario usuario; //not null public long getId_observacion() { return id_observacion; } public void setId_observacion(long id_observacion) { this.id_observacion = id_observacion; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public String getGeolocalizacion() { return geolocalizacion; } public void setGeolocalizacion(String geolocalizacion) { this.geolocalizacion = geolocalizacion; } public Date getFecha_hora() { return fecha_hora; } public void setFecha_hora(Date fecha_hora) { this.fecha_hora = fecha_hora; } public RelUbicacion getUbicacion() { return ubicacion; } public void setUbicacion(RelUbicacion ubicacion) { this.ubicacion = ubicacion; } public Usuario getUsuario() { return usuario; } public void setUsuario(Usuario usuario) { this.usuario = usuario; } public Observacion(long id_observacion, String descripcion, String geolocalizacion, Date fecha_hora, RelUbicacion ubicacion, Usuario usuario) { super(); this.id_observacion = id_observacion; this.descripcion = descripcion; this.geolocalizacion = geolocalizacion; this.fecha_hora = fecha_hora; this.ubicacion = ubicacion; this.usuario = usuario; } }
f04869d78a79eec403f1a82781eedbefdce5dd2a
4465f015bdd33b7da92d273af1f7037d5fb758f0
/app/src/main/java/com/rbn/mynote/database/DatabaseHelper.java
de58e2732a46f74d30b1bbb6e92b9c155bf3f583
[]
no_license
RaihanBagasNugraha/MyNote
85075a5c8eaa4b66e093b1891a78eb89967995ba
8a44795b8d7339a0f22e5abe3938292b488ecd69
refs/heads/master
2020-04-30T21:45:35.787451
2019-03-22T08:32:37
2019-03-22T08:32:37
177,099,414
0
0
null
null
null
null
UTF-8
Java
false
false
4,415
java
package com.rbn.mynote.database; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.List; import com.rbn.mynote.database.model.Note; public class DatabaseHelper extends SQLiteOpenHelper { // Database Version private static final int DATABASE_VERSION = 1; // Database Name private static final String DATABASE_NAME = "notes_db"; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } // Creating Tables @Override public void onCreate(SQLiteDatabase db) { // create notes table db.execSQL(Note.CREATE_TABLE); } // Upgrading database @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // Drop older table if existed db.execSQL("DROP TABLE IF EXISTS " + Note.TABLE_NAME); // Create tables again onCreate(db); } public long insertNote(String note) { // get writable database as we want to write data SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); // `id` and `timestamp` will be inserted automatically. // no need to add them values.put(Note.COLUMN_NOTE, note); // insert row long id = db.insert(Note.TABLE_NAME, null, values); // close db connection db.close(); // return newly inserted row id return id; } public Note getNote(long id) { // get readable database as we are not inserting anything SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.query(Note.TABLE_NAME, new String[]{Note.COLUMN_ID, Note.COLUMN_NOTE, Note.COLUMN_TIMESTAMP}, Note.COLUMN_ID + "=?", new String[]{String.valueOf(id)}, null, null, null, null); if (cursor != null) cursor.moveToFirst(); // prepare note object Note note = new Note( cursor.getInt(cursor.getColumnIndex(Note.COLUMN_ID)), cursor.getString(cursor.getColumnIndex(Note.COLUMN_NOTE)), cursor.getString(cursor.getColumnIndex(Note.COLUMN_TIMESTAMP))); // close the db connection cursor.close(); return note; } public List<Note> getAllNotes() { List<Note> notes = new ArrayList<>(); // Select All Query String selectQuery = "SELECT * FROM " + Note.TABLE_NAME + " ORDER BY " + Note.COLUMN_TIMESTAMP + " DESC"; SQLiteDatabase db = this.getWritableDatabase(); Cursor cursor = db.rawQuery(selectQuery, null); // looping through all rows and adding to list if (cursor.moveToFirst()) { do { Note note = new Note(); note.setId(cursor.getInt(cursor.getColumnIndex(Note.COLUMN_ID))); note.setNote(cursor.getString(cursor.getColumnIndex(Note.COLUMN_NOTE))); note.setTimestamp(cursor.getString(cursor.getColumnIndex(Note.COLUMN_TIMESTAMP))); notes.add(note); } while (cursor.moveToNext()); } // close db connection db.close(); // return notes list return notes; } public int getNotesCount() { String countQuery = "SELECT * FROM " + Note.TABLE_NAME; SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor = db.rawQuery(countQuery, null); int count = cursor.getCount(); cursor.close(); // return count return count; } public int updateNote(Note note) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(Note.COLUMN_NOTE, note.getNote()); // updating row return db.update(Note.TABLE_NAME, values, Note.COLUMN_ID + " = ?", new String[]{String.valueOf(note.getId())}); } public void deleteNote(Note note) { SQLiteDatabase db = this.getWritableDatabase(); db.delete(Note.TABLE_NAME, Note.COLUMN_ID + " = ?", new String[]{String.valueOf(note.getId())}); db.close(); } }
b677289c497759fd5ceaa052080990fadac02af1
f5e6ccf907b3735ea0f0542cab86c6ca64eee4de
/TheRandomMod/screen/ChestScreen.java
fac546c18d1cabfbf676c594b61b0d2113a32d6e
[]
no_license
salemgeorge/TheRandomMod
4a196d28194c42a95eb3d71450c21b3b839e366c
7ffb0a04884b22c51ef79490868f29b40f6aa3f5
refs/heads/master
2022-11-22T21:51:57.481625
2020-07-30T05:19:29
2020-07-30T05:19:29
283,675,908
1
0
null
null
null
null
UTF-8
Java
false
false
2,475
java
package com.IslamicReligion.TheRandomMod.screen; import com.IslamicReligion.TheRandomMod.blocks.ChestTypes; import com.IslamicReligion.TheRandomMod.inventories.ChestBlockContainer; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.IHasContainer; import net.minecraft.client.gui.screen.inventory.ContainerScreen; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.text.ITextComponent; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @OnlyIn(Dist.CLIENT) public class ChestScreen extends ContainerScreen<ChestBlockContainer> implements IHasContainer<ChestBlockContainer> { private ChestTypes chestType; private int textureXSize; private int textureYSize; public ChestScreen(ChestBlockContainer container, PlayerInventory playerInventory, ITextComponent title) { super(container, playerInventory, title); this.chestType = container.getChestType(); this.xSize = container.getChestType().xSize; this.ySize = container.getChestType().ySize; this.textureXSize = container.getChestType().textureXSize; this.textureYSize = container.getChestType().textureYSize; this.passEvents = false; } @Override public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack); super.render(matrixStack, mouseX, mouseY, partialTicks); this.func_230459_a_(matrixStack, mouseX, mouseY); } @Override protected void drawGuiContainerForegroundLayer(MatrixStack matrixStack, int mouseX, int mouseY) { // this.font.func_238422_b_(matrixStack, this.title, 8.0F, 6.0F, 4210752); this.font.func_238422_b_(matrixStack, this.playerInventory.getDisplayName(), 8.0F, (float) (this.ySize - 96 + 2), 4210752); } @Override protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.minecraft.getTextureManager().bindTexture(this.chestType.guiTexture); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; blit(matrixStack, x, y, 0, 0, this.xSize, this.ySize, this.textureXSize, this.textureYSize); } }
929bed305354f4b9da01b439c327aad497982ca0
61f4bce6d63d39c03247c35cfc67e03c56e0b496
/src/dyno/swing/designer/properties/editors/accessibles/AccessibleListModelEditor.java
ca87b51764e8a2e138a6a1d1d4afd87b3b035b06
[]
no_license
phalex/swing_designer
570cff4a29304d52707c4fa373c9483bbdaa33b9
3e184408bcd0aab6dd5b4ba8ae2aaa3f846963ff
refs/heads/master
2021-01-01T20:38:49.845289
2012-12-17T06:50:11
2012-12-17T06:50:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,465
java
/* * AccessibleComboBoxModelEditor.java * * Created on 2007-8-28, 0:45:25 * * To change this template, choose Tools | Templates * and open the template in the editor. */ package dyno.swing.designer.properties.editors.accessibles; import dyno.swing.designer.properties.editors.*; import dyno.swing.designer.properties.wrappers.ListModelWrapper; import java.awt.Frame; import java.awt.Window; import javax.swing.ListModel; import javax.swing.SwingUtilities; /** * * @author William Chen */ public class AccessibleListModelEditor extends UneditableAccessibleEditor { private ListModelDialog dialog; /** Creates a new instance of AccessibleColorEditor */ public AccessibleListModelEditor() { super(new ListModelWrapper()); } protected void popupDialog() { if (dialog == null) { Frame frame; Window win = SwingUtilities.getWindowAncestor(this); if (win instanceof Frame) { frame = (Frame) win; } else { frame = new Frame(); } dialog = new ListModelDialog(frame, true); dialog.setElementWrapper(((ListModelWrapper) encoder).getElementWrapper()); dialog.setLocationRelativeTo(this); } dialog.setModel((ListModel) getValue()); dialog.setVisible(true); if(dialog.isOK()){ setValue(dialog.getModel()); fireStateChanged(); } } }
b2a3449466ddf10cd2e7871aed2d3afce74df81e
854e0a7dce78849b1d83ad9b1bbbc2235492f220
/src/main/java/guru/springframework/didemo/services/PrimaryItalianGreetingService.java
915613b73c5d4c3a595b577976f406f68c66a999
[]
no_license
annivajo/di-demo
9b1cc98d39d334a8078dfec3118f62fd2f3ab01b
a31ec766af255eae00f6cb24026d665fecf9b639
refs/heads/master
2020-03-26T22:05:59.523976
2018-08-20T14:55:10
2018-08-20T14:55:10
145,431,806
0
0
null
null
null
null
UTF-8
Java
false
false
392
java
package guru.springframework.didemo.services; import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; @Service @Profile("it") @Primary public class PrimaryItalianGreetingService implements GreetingService{ @Override public String sayGreetings() { return "ciao"; } }
1636c04c025c8a202454df14a84282f7ff2cd82e
149109a11ea36670a8b4146bf08611de34f7e4a9
/src/main/java/com/epam/alex/trainbooking/dao/jdbc/JdbcTrainTypeDao.java
129612d8b4927e7b5a1a85b336f9e5ce0d4b526e
[]
no_license
AlexandrSerebryakov/TrainBooking
d204834ec16e11e820d68e57b5d3deb5b6422f0d
32589ee917592ecf2d42c40c7440dff14682e6a9
refs/heads/master
2020-06-10T12:30:47.754523
2017-01-18T13:56:07
2017-01-18T13:56:07
75,961,828
0
0
null
null
null
null
UTF-8
Java
false
false
143
java
package com.epam.alex.trainbooking.dao.jdbc; /** * Created by ${AlexandrSerebryakov} on ${09.10.2016}. */ public class JdbcTrainTypeDao { }
e04a96d3334a0f9af522f3752bb14967e522a8b7
7123114243c9124a8aff87d1941a6c20e2cf07cb
/src/main/java/com/shivamrajput/finance/hw/shivamrajputhw/module/management/Core/NextDayMaxTrialPolicy.java
bf16ce5802bba81fa7edee7b3f4785cfee99ff02
[ "MIT" ]
permissive
Cyraz/4FIT_shivam_HW
3f023f4ae68e5fb52c59de4ecd572689d2ae7cc5
e5e561ffe78d8d30b4f127bc812b8c9fe9fcdb07
refs/heads/master
2021-05-05T15:17:28.156896
2018-01-14T05:39:11
2018-01-14T05:39:11
117,301,035
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package com.shivamrajput.finance.hw.shivamrajputhw.module.management.Core; import java.math.BigDecimal; import java.time.LocalDateTime; /** * This policy prevents users to take full amount of loan at 00:00 * this is extra step to block users who are blocked by MaxLoanApllicationPolicy */ public class NextDayMaxTrialPolicy implements Policy { @Override public void execute(PolicyDTO policyDTO) { if (process(policyDTO)) { policyDTO.setAllowed(false); policyDTO.addMessage("Max amount requested at 00:**"); }else { policyDTO.setAllowed(true); policyDTO.addMessage("NextDayMaxTrialPolicy:Passed"); } } boolean process(PolicyDTO policyDTO) { LocalDateTime time = LocalDateTime.now(); int h = time.getHour(); if (h == 0 && policyDTO.getOldAmount().compareTo(MaxLoanAmountPolicy.maxAllowed) >= 0) { return true; } else { return false; } } }
eb097a7eb26a9e6077f10beaf829bff2cf1721de
fb4287b54a3e771f5703d8c717b465f43c4f8970
/YBW3.0/src/com/scsy150/volley/net/UpLoadAvatar.java
fe6660b216ca34065d522e802c1d285e47525316
[]
no_license
chengchangmu/150
3a83a644a4aae43607aff86821234a49415d7ef0
ddd87080bc4a1c361a9899b86f98b0a041549da1
refs/heads/master
2016-08-11T17:24:07.836575
2015-10-24T03:04:12
2015-10-24T03:14:00
44,849,706
1
0
null
null
null
null
UTF-8
Java
false
false
3,915
java
package com.scsy150.volley.net; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; import android.content.Context; import android.content.SharedPreferences; import com.scsy150.consts.MzApi; import com.scsy150.consts.SystemConsts; import com.scsy150.util.MD5Util; import com.scsy150.util.TimeUtil; public class UpLoadAvatar { static Context context; public UpLoadAvatar() { } public UpLoadAvatar(Context context) { UpLoadAvatar.context = context; } /** * 上传头像,使用此方法时,需放在异步操作或者非主线程中 * * @param 需要上传的图像文件 * @return */ public String uploadImg(File file) { String url = uploadFile(MzApi.UPLOADAVATAR, file); return url; } /** * 上传相册照片,使用此方法时,需放在异步操作或者非主线程中 * * @param 需要上传的图像文件 * @return */ public String uploadPhoto(File file) { String url = uploadFile(MzApi.UPLOADPHOTOS, file); return url; } /** * 通过URI下载文件,保存到file文件里 * * @param URI * @param file * @return */ private static String uploadFile(String URI, File file) { try { return uploadFile(URI, new FileInputStream(file), file.getName()); } catch (FileNotFoundException e) { e.printStackTrace(); return ""; } } /** * 通过URI下载文件,保存到InputStream is里去 * * @param URI * @param is * @param fname * @return */ private static String uploadFile(String URI, InputStream is, String fname) { try { // LogUtils.d("TAG", "开始具体上传代码"); String cookies = LoadCookies(); // 以下3个字符串有必要在做urlconnection时做复杂的拼接吗?感觉好鸡肋 // String boundary = "*****" + System.currentTimeMillis(); // String twoHyphens = "--"; // String end = "\r\n"; URL url = new URL(URI); HttpURLConnection connection = (HttpURLConnection) url .openConnection(); connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); connection.setRequestMethod("POST"); connection.setRequestProperty("Cookie", cookies); connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Charset", "UTF-8"); byte[] buf = new byte[1024]; OutputStream osw = connection.getOutputStream(); while (is.read(buf) != -1) { osw.write(buf); } osw.flush(); osw.close(); is.close(); // Log.i("life!", connection.getResponseCode() + ""); String jsonObject = getResponseStr(connection); return jsonObject; } catch (Exception e) { // Log.i("result", "catch -------------" + e.getMessage()); e.printStackTrace(); return ""; } } private static String getResponseStr(HttpURLConnection connection) { try { int length; InputStream ins = connection.getInputStream(); byte[] result = new byte[1024]; StringBuffer sb = new StringBuffer(); while ((length = ins.read(result)) > 0) { String str = new String(result, 0, length); // Log.i("result",length+"test----"+str); sb.append(str); str = null; } String jsonObject = sb.toString().trim(); // LogUtils.d("TAG", "返回的json"+jsonObject); return jsonObject; } catch (Exception e) { e.printStackTrace(); return ""; } } /** 从SharedPreferences读取cookies **/ public static String LoadCookies() { SharedPreferences spf = context.getSharedPreferences( SystemConsts.COOKIES, 0); String cookies = spf.getString("cookies", ""); if (!"".equals(cookies)) { return cookies; } return ""; } }
[ "ZCAPP3@zengxin" ]
ZCAPP3@zengxin
75f36648d8c914e86d579ee958f3941fc964fb27
222c56bda708da134203560d979fb90ba1a9da8d
/uapunit测试框架/engine/src/public/uap/workflow/engine/mail/MailScanCmd.java
c6d69d9716c58a3080e500f1976ed3e6b17c7476
[]
no_license
langpf1/uapunit
7575b8a1da2ebed098d67a013c7342599ef10ced
c7f616bede32bdc1c667ea0744825e5b8b6a69da
refs/heads/master
2020-04-15T00:51:38.937211
2013-09-13T04:58:27
2013-09-13T04:58:27
12,448,060
0
1
null
null
null
null
UTF-8
Java
false
false
6,477
java
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package uap.workflow.engine.mail; import java.util.List; import java.util.Properties; import java.util.logging.Logger; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Store; import uap.workflow.engine.core.ITask; import uap.workflow.engine.db.DbSqlSession; import uap.workflow.engine.entity.AttachmentEntity; import uap.workflow.engine.entity.ByteArrayEntity; import uap.workflow.engine.entity.TaskEntity; import uap.workflow.engine.exception.WorkflowException; import uap.workflow.engine.identity.User; import uap.workflow.engine.interceptor.Command; import uap.workflow.engine.interceptor.CommandContext; import uap.workflow.engine.query.UserQueryImpl; /** * @author Tom Baeyens */ public class MailScanCmd implements Command<Object> { private static Logger log = Logger.getLogger(MailScanCmd.class.getName()); protected String userId; protected String imapUsername; protected String imapPassword; protected String imapHost; protected String imapProtocol; protected String toDoFolderName; protected String toDoInActivitiFolderName; public Object execute(CommandContext commandContext) { log.fine("scanning mail for user " + userId); Store store = null; Folder toDoFolder = null; Folder toDoInActivitiFolder = null; try { Session session = Session.getDefaultInstance(new Properties()); store = session.getStore(imapProtocol); log.fine("connecting to " + imapHost + " over " + imapProtocol + " for user " + imapUsername); store.connect(imapHost, imapUsername, imapPassword); toDoFolder = store.getFolder(toDoFolderName); toDoFolder.open(Folder.READ_WRITE); toDoInActivitiFolder = store.getFolder(toDoInActivitiFolderName); toDoInActivitiFolder.open(Folder.READ_WRITE); Message[] messages = toDoFolder.getMessages(); log.fine("getting messages from myToDoFolder"); DbSqlSession dbSqlSession = commandContext.getDbSqlSession(); for (Message message : messages) { log.fine("transforming mail into activiti task: " + message.getSubject()); MailTransformer mailTransformer = new MailTransformer(message); createTask(commandContext, dbSqlSession, mailTransformer); Message[] messagesToCopy = new Message[] { message }; toDoFolder.copyMessages(messagesToCopy, toDoInActivitiFolder); message.setFlag(Flags.Flag.DELETED, true); } } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new WorkflowException("couldn't scan mail for user " + userId + ": " + e.getMessage(), e); } finally { if (toDoInActivitiFolder != null && toDoInActivitiFolder.isOpen()) { try { toDoInActivitiFolder.close(false); } catch (MessagingException e) { e.printStackTrace(); } } if (toDoFolder != null && toDoFolder.isOpen()) { try { toDoFolder.close(true); // true means that all messages that // are flagged for deletion are // permanently removed } catch (Exception e) { e.printStackTrace(); } } if (store != null) { try { store.close(); } catch (Exception e) { e.printStackTrace(); } } } return null; } public void createTask(CommandContext commandContext, DbSqlSession dbSqlSession, MailTransformer mailTransformer) throws MessagingException { // distill the task description from the mail body content (without the // html tags) String taskDescription = mailTransformer.getHtml(); taskDescription = taskDescription.replaceAll("\\<.*?\\>", ""); taskDescription = taskDescription.replaceAll("\\s", " "); taskDescription = taskDescription.trim(); if (taskDescription.length() > 120) { taskDescription = taskDescription.substring(0, 117) + "..."; } // create and insert the task ITask task = new TaskEntity(); // task.setAssignee(userId); task.setName(mailTransformer.getMessage().getSubject()); task.setDescription(taskDescription); // dbSqlSession.insert((TaskEntity)task); String taskId = task.getTaskPk(); // add identity links for all the recipients for (String recipientEmailAddress : mailTransformer.getRecipients()) { User recipient = new UserQueryImpl(commandContext).userEmail(recipientEmailAddress).singleResult(); if (recipient != null) { // /task.addUserIdentityLink(recipient.getId(), "Recipient"); } } // attach the mail and other attachments to the task List<AttachmentEntity> attachments = mailTransformer.getAttachments(); for (AttachmentEntity attachment : attachments) { // insert the bytes as content ByteArrayEntity content = attachment.getContent(); dbSqlSession.insert(content); // insert the attachment attachment.setContentId(content.getId()); attachment.setTaskId(taskId); dbSqlSession.insert(attachment); } } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getImapUsername() { return imapUsername; } public void setImapUsername(String imapUsername) { this.imapUsername = imapUsername; } public String getImapPassword() { return imapPassword; } public void setImapPassword(String imapPassword) { this.imapPassword = imapPassword; } public String getImapHost() { return imapHost; } public void setImapHost(String imapHost) { this.imapHost = imapHost; } public String getImapProtocol() { return imapProtocol; } public void setImapProtocol(String imapProtocol) { this.imapProtocol = imapProtocol; } public String getToDoFolderName() { return toDoFolderName; } public void setToDoFolderName(String toDoFolderName) { this.toDoFolderName = toDoFolderName; } public String getToDoInActivitiFolderName() { return toDoInActivitiFolderName; } public void setToDoInActivitiFolderName(String toDoInActivitiFolderName) { this.toDoInActivitiFolderName = toDoInActivitiFolderName; } }
2e25caad4ecba02407de370330a69c1fea7baa98
0613bb6cf1c71b575419651fc20330edb9f916d2
/CheatBreaker/src/main/java/net/minecraft/network/play/server/S08PacketPlayerPosLook.java
abe7787829694d6aa2fa58524a2dc60c43bb6f1c
[]
no_license
Decencies/CheatBreaker
544fdae14e61c6e0b1f5c28d8c865e2bbd5169c2
0cf7154272c8884eee1e4b4c7c262590d9712d68
refs/heads/master
2023-09-04T04:45:16.790965
2023-03-17T09:51:10
2023-03-17T09:51:10
343,514,192
98
38
null
2023-08-21T03:54:20
2021-03-01T18:18:19
Java
UTF-8
Java
false
false
2,713
java
package net.minecraft.network.play.server; import java.io.IOException; import net.minecraft.network.INetHandler; import net.minecraft.network.Packet; import net.minecraft.network.PacketBuffer; import net.minecraft.network.play.INetHandlerPlayClient; public class S08PacketPlayerPosLook extends Packet { private double field_148940_a; private double field_148938_b; private double field_148939_c; private float field_148936_d; private float field_148937_e; private boolean field_148935_f; public S08PacketPlayerPosLook() {} public S08PacketPlayerPosLook(double p_i45164_1_, double p_i45164_3_, double p_i45164_5_, float p_i45164_7_, float p_i45164_8_, boolean p_i45164_9_) { this.field_148940_a = p_i45164_1_; this.field_148938_b = p_i45164_3_; this.field_148939_c = p_i45164_5_; this.field_148936_d = p_i45164_7_; this.field_148937_e = p_i45164_8_; this.field_148935_f = p_i45164_9_; } /** * Reads the raw packet data from the data stream. */ public void readPacketData(PacketBuffer p_148837_1_) throws IOException { this.field_148940_a = p_148837_1_.readDouble(); this.field_148938_b = p_148837_1_.readDouble(); this.field_148939_c = p_148837_1_.readDouble(); this.field_148936_d = p_148837_1_.readFloat(); this.field_148937_e = p_148837_1_.readFloat(); this.field_148935_f = p_148837_1_.readBoolean(); } /** * Writes the raw packet data to the data stream. */ public void writePacketData(PacketBuffer p_148840_1_) throws IOException { p_148840_1_.writeDouble(this.field_148940_a); p_148840_1_.writeDouble(this.field_148938_b); p_148840_1_.writeDouble(this.field_148939_c); p_148840_1_.writeFloat(this.field_148936_d); p_148840_1_.writeFloat(this.field_148937_e); p_148840_1_.writeBoolean(this.field_148935_f); } public void processPacket(INetHandlerPlayClient p_148833_1_) { p_148833_1_.handlePlayerPosLook(this); } public double func_148932_c() { return this.field_148940_a; } public double func_148928_d() { return this.field_148938_b; } public double func_148933_e() { return this.field_148939_c; } public float func_148931_f() { return this.field_148936_d; } public float func_148930_g() { return this.field_148937_e; } public boolean func_148929_h() { return this.field_148935_f; } public void processPacket(INetHandler p_148833_1_) { this.processPacket((INetHandlerPlayClient)p_148833_1_); } }
9b132bc0a31dae0ee3bdb2fa6dae850a39721a5e
bdef4522e54283152e5fad0490878ad07d4e4273
/app/src/main/java/com/horizon/android/activity/WebViewActivity.java
47a6606472b5a9557d088fcadcbf615dd7eaaef9
[]
no_license
Horizonxy/horizon_android
1b15a2f02539e9d15e0de351b3a2df330bbf81fe
688a537c53b043eca2b3f97cc2b341d843591bb9
refs/heads/master
2021-01-17T10:24:04.054447
2016-06-13T03:06:48
2016-06-13T03:06:48
57,014,789
0
0
null
null
null
null
UTF-8
Java
false
false
3,830
java
package com.horizon.android.activity; import android.content.Context; import android.net.ConnectivityManager; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.widget.ProgressBar; import com.horizon.android.Constants; import com.horizon.android.R; import com.horizon.android.util.LogUtils; import com.horizon.android.web.WebChromeClient; import com.horizon.android.web.WebView; import com.horizon.android.web.WebViewClient; import com.horizon.android.web.WebViewView; import butterknife.Bind; public class WebViewActivity extends BaseLoadActivity implements WebViewView { @Bind(R.id.web_view) WebView mWevView; @Bind(R.id.progress) ProgressBar mProgress; boolean firstLoadAfter; String url; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); firstLoadAfter = true; mWevView.setWebChromeClient(new WebChromeClient(this)); mWevView.setWebViewClient(new WebViewClient(this)); url = getIntent().getStringExtra(Constants.BUNDLE_WEBVIEW_URL); if(url != null) { if(!url.startsWith("http")){ url = "http://".concat(url); } firstLoad(); } } private void firstLoad(){ if(isNetworkAvailable()) { mWevView.loadUrl(url); } else { noNet(); } } @Override void clickRetry() { initBody(); firstLoad(); } @Override public void firstLoadAfter(){ if(firstLoadAfter){ initAfter(); firstLoadAfter = false; } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: back(); return true; default: break; } } return super.onKeyDown(keyCode, event); } public void back(){ if (url != null) { if(url.equals(mWevView.getUrl())){ finish(); } else if (null != mWevView.getUrl() && mWevView.getUrl().startsWith("data:")) {//页面请求失败,报错 if (mWevView.canGoBackOrForward(-2)) { mWevView.goBackOrForward(-2); finish(); } else if (mWevView.canGoBack()) { mWevView.goBack(); }else { finish(); } } else if (mWevView.canGoBack()) { mWevView.goBack(); } else { finish(); } } else if(mWevView.canGoBack()){ mWevView.goBack(); } else { finish(); } } @Override public void onReceivedTitle(String title) { setTitle(title); } @Override public void onProgressChanged(int newProgress) { LogUtils.e("newProgress: "+newProgress); if(newProgress == 100){ mProgress.setVisibility(View.GONE); } else { if(mProgress.getVisibility() == View.GONE){ mProgress.setVisibility(View.VISIBLE); } mProgress.setProgress(newProgress); } } private boolean isNetworkAvailable() { // 得到网络连接信息 ConnectivityManager manager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); // 去进行判断网络是否连接 if (manager.getActiveNetworkInfo() != null) { return manager.getActiveNetworkInfo().isAvailable(); } return false; } }
5c008655dcda93ab5d67ed16ff60b61903f216ae
74a91f99f35408d99e4dcbd13f762cd00ef7510a
/PSGTreimanento/src/main/T1019.java
371ceb369806a37752926d20d2cd237a4a4caa3e
[]
no_license
silas00/PSGTraining
8f68a4b282b61d3fea02434231f59817611f6ddc
c386dfcdf6816cce6cf855f30b530331465c34c1
refs/heads/master
2022-12-03T05:44:44.499694
2020-08-25T15:30:48
2020-08-25T15:30:48
286,883,873
0
0
null
null
null
null
UTF-8
Java
false
false
490
java
package main; import java.util.Scanner; public class T1019 { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int valor = entrada.nextInt(); int horas = valor / 3600; int restoHoras = valor % 3600; int minutos = restoHoras / 60; int restoMinutos = restoHoras % 60; int segundos = restoMinutos; System.out.printf("%d:%d:%d\n", horas, minutos, segundos); } }
8562343a17b21c1e8e78a5955fa688da13fab173
d049893e680f6f7736748459a2bcd0d2f52be645
/Lp-common/src/main/java/com/lp/rpc/LpClass.java
e821cd6faf6a19dfe82a6b9c99b7f876acd26f86
[ "MIT" ]
permissive
steakliu/Lp-Rpc
c3337c9d5ee3166df6523833769cf574637d5b22
6616190763c2e3006d486bbf8bec1f1d81162ff0
refs/heads/master
2023-07-16T10:20:28.297058
2021-08-31T09:26:40
2021-08-31T09:26:40
399,060,021
1
0
null
null
null
null
UTF-8
Java
false
false
48
java
package com.lp.rpc; public class LpClass { }
65b6ca02e24c3b6264848c25aac1671ef2f74516
d817267149acf53fafe3ec4553485e2169c9c6e9
/api/src/main/java/org/openmrs/module/shr/cdahandler/order/ObservationOrder.java
f3c848aed56df73c0c42875ca7b416913b9324ba
[]
no_license
jembi/openmrs-module-shr-cdahandler
5f21b326b449047142c6044e72809da43df03086
47610b625fd50214af66b2ed7caa4918194cb36f
refs/heads/master
2020-06-02T19:56:29.221932
2017-02-24T08:57:11
2017-02-24T08:57:11
15,729,824
0
3
null
2017-02-24T08:57:12
2014-01-08T08:30:11
Java
UTF-8
Java
false
false
2,311
java
package org.openmrs.module.shr.cdahandler.order; import org.openmrs.Concept; import org.openmrs.Order; import org.openmrs.module.shr.cdahandler.processor.util.OpenmrsMetadataUtil; /** * Represents a request to perform an observation */ public class ObservationOrder extends Order { /** * */ private static final long serialVersionUID = 1L; // Openmrs meta-data util private final OpenmrsMetadataUtil s_metaDataUtil = OpenmrsMetadataUtil.getInstance(); // Goal values private String goalText; private Double goalNumeric; private Concept goalCoded; // Method and target private Concept method; private Concept targetSite; /** * Observation order */ public ObservationOrder() { this.setOrderType(s_metaDataUtil.getOrCreateObservationOrderType()); } /** * Gets the textual description of the goal of this order */ public String getGoalText() { return goalText; } /** * Sets a value indicating the goal as a form of text */ public void setGoalText(String goalText) { this.goalText = goalText; } /** * Gets a numeric value representing the goal of this order */ public Double getGoalNumeric() { return goalNumeric; } /** * Sets the numeric value representing the goal of the order */ public void setGoalNumeric(Double goalNumeric) { this.goalNumeric = goalNumeric; } /** * Gets the codified value of the goal */ public Concept getGoalCoded() { return goalCoded; } /** * Sets the codified value of the goal */ public void setGoalCoded(Concept goalCoded) { this.goalCoded = goalCoded; } /** * Gets a concept identifying the method of observation */ public Concept getMethod() { return method; } /** * Sets a concept identifying the method of observation */ public void setMethod(Concept method) { this.method = method; } /** * Gets a concept identifying the target site of the observation. Eg. Face, Neck, etc */ public Concept getTargetSite() { return targetSite; } /** * Sets a concept identifying the target site of the observation */ public void setTargetSite(Concept targetSite) { this.targetSite = targetSite; } }
4593b59e868f3c57bcc075305136be093f0cf5e0
5af057e66e70dae899a87bdc1407f169b46e0038
/plgE/AnalizadorLexico.java
18be569c63c91765e1bb6873e5d8313efc779c5d
[]
no_license
BackupTheBerlios/plg0506
ad249382fe0e719a9e6733b629e27f6feae7168d
4962c1c55d575c72a75caf8ff68d3898a626d3d8
refs/heads/master
2021-01-01T17:21:08.351401
2008-06-08T17:35:34
2008-06-08T17:35:34
40,042,713
0
0
null
null
null
null
ISO-8859-1
Java
false
false
8,503
java
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; /** * Clase que implementa el analizador léxico.<p> * @author */ public class AnalizadorLexico { // Archivo a analizar; private BufferedReader in; // Puntero a la tabla de símbolos. private tablaSimbolos ts; // Buffer para guardar el lexema que se está leyendo actualmente. // La posición cero la utilizamos de centinela. private char[] bufferLex; // Puntero al último carácter leido. private int puntero; // Buffer que guarda el carácter actualmente procesado. private char bufferCar; // Estado en el que se encuentra el analizador léxico. private int estado; // Linea en la que estamos leyendo. private int linea; // Constantes que se corresponden con los estados en los que //se puede encontrar el analizador léxico. Equivalente a hacer un //enum en C. private static final int S0 = 0; private static final int S1 = 1; private static final int S2 = 2; private static final int S3 = 3; private static final int S4 = 4; private static final int S5 = 5; private static final int S6 = 6; private static final int S7 = 7; private static final int S8 = 8; private static final int S9 = 9; private static final int S10 = 10; private static final int S11 = 11; private static final int S12 = 12; private static final int S13 = 13; private static final int S14 = 14; private static final int S15 = 15; /** * Constructora de la clase. * @param fichero Archivo a analizar. */ public AnalizadorLexico(String fichero, tablaSimbolos ts) { try { in = new BufferedReader(new FileReader(fichero)); bufferLex = new char[256]; puntero = 0; linea = 1; //Dejamos el primer carácter en bufferCar. bufferCar = (char)in.read(); this.ts = ts; } catch(IOException e) { System.out.println(e.getMessage()); } } /** * Función principal del analizador léxico. * @return Devuelve el siguiente token leido. */ public Object[] siguienteToken() { puntero = 0; estado = S0; boolean completado = false; Object[] token = new Object[2]; while(!completado) { switch(estado) { case S0: if(bufferCar == (char)-1){ token[0] = new Integer(Constantes.END); completado = true; } else if(bufferCar == '\t' || bufferCar == '\r' || bufferCar == '\n' || bufferCar == ' ') { // Control de nueva linea de lectura. if(bufferCar == '\n') linea += 1; transita(S0); puntero = 0; } else if(bufferCar == '=') transita(S1); else if(bufferCar == '>') transita(S2); else if(bufferCar == '<') transita(S3); else if(bufferCar == '!') transita(S4); else if(bufferCar == '&') transita(S6); else if(bufferCar == '|') transita(S8); else if(bufferCar == '*' || bufferCar == '%' || bufferCar == '0' || bufferCar == '{' || bufferCar == '}' || bufferCar == '(' || bufferCar == ')' || bufferCar == ';') transita(S10); else if((bufferCar >= 'A' && bufferCar <= 'Z') || (bufferCar >= 'a' && bufferCar <= 'z')) transita(S11); else if(bufferCar == '+' || bufferCar == '-') transita(S12); else if(bufferCar >= '1' && bufferCar <= '9') transita(S13); else if(bufferCar == '/') transita(S14); else transita(S15); break; case S1: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.ASIG); completado = true; } break; case S2: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.MAYOR); completado = true; } break; case S3: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.MENOR); completado = true; } break; case S4: if(bufferCar == '=') transita(S5); else { token[0] = new Integer(Constantes.NOT); completado = true; } break; case S5: String rel = String.valueOf(bufferLex); rel = rel.substring(1,3); if(rel.equals((String)"==")) { token[0] = new Integer(Constantes.IGUAL); completado = true; } else if(rel.equals((String)">=")) { token[0] = new Integer(Constantes.MAYORIGUAL); completado = true; } else if(rel.equals((String)"<=")) { token[0] = new Integer(Constantes.MENORIGUAL); completado = true; } else if(rel.equals((String)"!=")) { token[0] = new Integer(Constantes.DISTINTO); completado = true; } break; case S6: if(bufferCar == '&') transita(S7); else { transita(S15); } break; case S7: token[0] = new Integer(Constantes.AND); completado = true; break; case S8: if(bufferCar == '|') transita(S9); else { transita(S15); } break; case S9: token[0] = new Integer(Constantes.OR); completado = true; break; case S10: if(bufferLex[1] == '*') { token[0] = new Integer(Constantes.MULTIPLICA); completado = true; } else if(bufferLex[1] == '%') { token[0] = new Integer(Constantes.MOD); completado = true; } else if(bufferLex[1] == '{') { token[0] = new Integer(Constantes.LLAVEAB); completado = true; } else if(bufferLex[1] == '}') { token[0] = new Integer(Constantes.LLAVECERR); completado = true; } else if(bufferLex[1] == '(') { token[0] = new Integer(Constantes.PARENTAB); completado = true; } else if(bufferLex[1] == ')') { token[0] = new Integer(Constantes.PARENTCERR); completado = true; } else if(bufferLex[1] == ';') { token[0] = new Integer(Constantes.PUNTOYCOMA); completado = true; } else if(bufferLex[1] == '0') { token[0] = new Integer(Constantes.ENTERO); token[1] = new Integer(0); completado = true; } break; case S11: if((bufferCar >= 'A' && bufferCar <= 'Z') || (bufferCar >= 'a' && bufferCar <= 'z') || (bufferCar >= '0' && bufferCar <= '9')) transita(S11); else { // Verifico si es una palabra clave. String caracs = String.valueOf(bufferLex); caracs = caracs.substring(1, puntero +1); if(caracs.equals((String)"true")) { token[0] = new Integer(Constantes.TRUE); } else if(caracs.equals((String)"false")) token[0] = new Integer(Constantes.FALSE); else if(caracs.equals((String)"int")) token[0] = new Integer(Constantes.INT); else if(caracs.equals((String)"bool")) token[0] = new Integer(Constantes.BOOL); else { token[0] = new Integer(Constantes.ID); if(!ts.existeID(caracs)) ts.añadeID(caracs,linea); token[1] = caracs; } completado = true; } break; case S12: if(bufferCar >= '1' && bufferCar <= '9') transita(S13); else { if(bufferLex[1] == '+') token[0] = new Integer(Constantes.SUMA); else if(bufferLex[1] == '-') token[0] = new Integer(Constantes.RESTA); completado = true; } break; case S13: if(bufferCar >= '0' && bufferCar <= '9') transita(S13); else { token[0] = new Integer(Constantes.ENTERO); token[1] = new Integer(char_to_int()); completado = true; } break; case S14: if(bufferCar == '/') { try { if(in.readLine() != null) linea += 1; } catch(IOException e) { System.out.println(e.getMessage()); } transita(S0); puntero = 0; } else { token[0] = new Integer(Constantes.DIVIDE); completado = true; } break; case S15: token[0] = new Integer(Constantes.ERROR); token[1] = new String("Carácter no válido: " + bufferLex[puntero] + ", error en linea " + String.valueOf(linea)); completado = true; break; } } return token; } /** * Hace la trasición a otro estado. * @param estado Estado al que ir. */ private void transita(int estado) { try { puntero += 1; bufferLex[puntero] = bufferCar; bufferCar = (char)in.read(); this.estado = estado; } catch(IOException e) { System.out.println(e.getMessage()); } } /** * Tranforma carácteres a un entero. * @return La transformación a entero. */ private int char_to_int() { String caracs = String.valueOf(bufferLex); if(bufferLex[1] == '+') caracs = caracs.substring(2,puntero+1); else caracs = caracs.substring(1,puntero+1); return Integer.parseInt(caracs); } }
[ "scaramouche" ]
scaramouche
e85f80cd8f92eea6b11f1784e618d8206550fdeb
852c382f0dcb93f5118a9265e84892fcdf56de73
/prototypes/ethosnet/trunk/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/ItemsBySubjectServlet.java
10593c859e84ee7741163340ae9abf38a7f74639
[]
no_license
DSpace-Labs/dspace-sandbox
101a0cf0c371a52fb78bf02d394deae1e8157d25
a17fe69a08fb629f7da574cfc95632dc0e9118a8
refs/heads/master
2020-05-17T21:33:34.009260
2009-04-17T13:43:32
2009-04-17T13:43:32
32,347,896
0
4
null
null
null
null
UTF-8
Java
false
false
4,863
java
/* * ItemsBySubjectServlet.java * * Version: $Revision$ * * Date: $Date$ * * Copyright (c) 2002, Hewlett-Packard Company and Massachusetts * Institute of Technology. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Hewlett-Packard Company nor the name of the * Massachusetts Institute of Technology nor the names of their * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.dspace.app.webui.servlet; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.dspace.app.webui.util.JSPManager; import org.dspace.app.webui.util.UIUtil; import org.dspace.authorize.AuthorizeException; import org.dspace.browse.Browse; import org.dspace.browse.BrowseInfo; import org.dspace.browse.BrowseScope; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.core.Context; import org.dspace.core.LogManager; /** * Displays the items with a particular subject. * * @version $Revision$ */ public class ItemsBySubjectServlet extends DSpaceServlet { /** log4j logger */ private static Logger log = Logger.getLogger(ItemsBySubjectServlet.class); protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { // We will resolve the HTTP request parameters into a scope BrowseScope scope = new BrowseScope(context); // Get log information String logInfo = ""; // Get the HTTP parameters String subject = request.getParameter("subject"); String order = request.getParameter("order"); // How should we order the items? boolean orderByTitle; if ((order != null) && order.equalsIgnoreCase("title")) { orderByTitle = true; logInfo = "order=title"; } else { orderByTitle = false; logInfo = "order=date"; } // Get the community or collection scope Community community = UIUtil.getCommunityLocation(request); Collection collection = UIUtil.getCollectionLocation(request); if (collection != null) { logInfo = logInfo + ",collection_id=" + collection.getID(); scope.setScope(collection); } else if (community != null) { logInfo = logInfo + ",community_id=" + community.getID(); scope.setScope(community); } // Ensure subject is non-null if (subject == null) { subject = ""; } // Do the browse scope.setFocus(subject); BrowseInfo browseInfo = Browse.getItemsBySubject(scope, orderByTitle); log.info(LogManager.getHeader(context, "items_by_subject", logInfo + ",result_count=" + browseInfo.getResultCount())); // Display the JSP request.setAttribute("community", community); request.setAttribute("collection", collection); request.setAttribute("subject", subject); request.setAttribute("order.by.title", new Boolean(orderByTitle)); request.setAttribute("browse.info", browseInfo); JSPManager.showJSP(request, response, "/browse/items-by-subject.jsp"); } }
a60fed07c8dfa62a62ed564e0648fcefc3c18e7e
2e22ebfe6cee0e3b511b7a2026a31a15a59e758b
/src/main/java/com/Application.java
5eebf24a3139ca19fd0aa6b40b53da616a42c3a0
[]
no_license
kumaraakash25/StockViewer
b91a8bd0d8aa6c6601f2884d49518c7819abf973
3adef59e24351c1856b6c645e90be47089861ab4
refs/heads/master
2021-06-27T22:38:10.873566
2020-11-27T22:16:36
2020-11-27T22:16:36
176,833,453
0
0
null
null
null
null
UTF-8
Java
false
false
394
java
package com; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @EnableJpaRepositories @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
a3e1638ddf3d2ec1a9419fdab3fc252fede548e8
69deb05dc31c2e33de28738191a402011b61c855
/src/pl/AdamWisniewski/car/Car.java
ece0bc04eacd1f7d0f265cb3d218f5f51a933e80
[]
no_license
AdamWisniewski/VimExercise01
7479561b26da92cb6c03af53a3fcf12fc825d34d
9867be3c1b1280379f1ea06de32822b771fdae2e
refs/heads/master
2021-03-31T01:42:44.171167
2018-03-08T17:27:44
2018-03-08T17:27:44
124,422,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,079
java
package pl.AdamWisniewski.car; public class Car { private ElectricEngine electricEngine; private ConventionalEngine conventionalEngine; private boolean carWorks = false; private int fuel = 100; // Electric car public Car(ElectricEngine electricEngine) { this.electricEngine = electricEngine; } // Conventional Car public Car(ConventionalEngine conventionalEngine) { this.conventionalEngine = conventionalEngine; } // Hybrid Car public Car(ElectricEngine electricEngine, ConventionalEngine conventionalEngine) { this.electricEngine = electricEngine; this.conventionalEngine = conventionalEngine; } public void turnOnCar() { carWorks = true; } public void turnOfCar() { carWorks = false; } public void refuelCar(int fuelAdded) { if (conventionalEngine == null) { System.out.println("You can't fuel electric Car! Look for charging distributor."); } else { fuel += fuelAdded; } } public void move(String pointA, String pointB) { System.out.println("So lets take a ride from " + pointA + " to " + pointB + "!"); } }
716ca392e5a6f141cd967c2f2948df6bef710bad
6dfe44a8e2c8c577536e0757164a4647eb020b3e
/src/me/naithantu/ArenaPVP/Gamemodes/Gamemodes/Paintball/PaintballTimer.java
60f1e883a45ccdaf88738b220ae47fc474643bc7
[]
no_license
SlapGaming/ArenaPVP
0e2fd47fe5a6e1cc2bc3e2c6a8f9f55a6044fd68
685ede15b91f8e7330ef49c92e0057e19eb1acfa
refs/heads/master
2016-09-05T23:09:28.002571
2015-03-02T20:52:31
2015-03-02T20:52:31
11,369,390
0
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
package me.naithantu.ArenaPVP.Gamemodes.Gamemodes.Paintball; import me.naithantu.ArenaPVP.Arena.ArenaExtras.ArenaPlayerState; import me.naithantu.ArenaPVP.Arena.ArenaPlayer; import me.naithantu.ArenaPVP.Arena.ArenaTeam; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import java.util.List; public class PaintballTimer extends BukkitRunnable { private List<ArenaTeam> teams; private ItemStack snowBall; public PaintballTimer(List<ArenaTeam> teams){ this.teams = teams; snowBall = new ItemStack(Material.SNOW_BALL, 1); } @Override public void run() { for(ArenaTeam team: teams){ for(ArenaPlayer arenaPlayer: team.getPlayers()){ if(arenaPlayer.getPlayerState() == ArenaPlayerState.PLAYING){ Player player = Bukkit.getPlayerExact(arenaPlayer.getPlayerName()); if(!player.isDead()){ player.getInventory().addItem(snowBall); } } } } } }
21ca4dc5699b462dbed402ce28724ac20dec1298
4ef733fecc5f85f57516b7cd5a113aa6c556b6aa
/user.java
38782ba76d439f81fe5bbaeb35e68703e6e2d20b
[]
no_license
cocakolla123/MazeGame
519330bd04d3522ad4494c6549dc30c3311740dc
8a0eb3bde131f271cee121a7ff8ab399414b7d95
refs/heads/main
2023-01-22T06:34:45.606095
2020-12-04T05:49:01
2020-12-04T05:49:01
318,416,528
0
0
null
null
null
null
UTF-8
Java
false
false
6,265
java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.* ; //import java.util.List; //import java.util.ArrayList; /** * Write a description of class user here. * * @author (your name) * @version (a version number or a date) */ public class user extends Actor { // set the speed of the player int personVal = 5; // count of how many questins are correct int count = 0; // initializing questions arraylist ArrayList<String> questions = new ArrayList<String>(); // initializing answers arraylist ArrayList<String> answers = new ArrayList<String>(); /** * Act - do whatever the user wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ // adding all the questions and answers to the arraylists protected user() { questions.add( "What is Earth's largest continent?" ); questions.add( "What razor-thin country accounts for more than half of the western coastline of South America?" ); questions.add( "What river runs through Baghdad?" ); questions.add("What country has the most natural lakes?"); questions.add("What is the only sea without any coasts?"); questions.add("Is Washington D.C. a state?"); questions.add("What African country served as the setting for Tatooine in Star Wars?"); questions.add("Which African nation has the most pyramids? (Not Egypt)"); questions.add("What is the next prime number after 7?"); questions.add("How many sides does a nonagon have?"); questions.add("What is the top number on a fraction called?"); questions.add("What is the periodic symbol for gold?"); questions.add("What is the hottest planet in the solar system?"); questions.add("Does sound travel faster in water or air?"); questions.add("What is the only metal that is liquid at room temperature?"); questions.add("What is the age of the sun?"); answers.add("Asia"); answers.add("Chile"); answers.add("Tigris"); answers.add("Canada"); answers.add("Sargasso Sea"); answers.add("no"); answers.add("Tunisia"); answers.add("Sudan"); answers.add("11"); answers.add("9"); answers.add("numerator"); answers.add("Au"); answers.add("Venus"); answers.add("Water"); answers.add("Mercury"); answers.add("5 billion years"); } public void act() { // making arrow keys control direction of the user if (Greenfoot.isKeyDown("left")) { if (!checkForOtherWall('l')) { setLocation(getX() - personVal, getY()); } } if (Greenfoot.isKeyDown("right")) { if (!checkForOtherWall('r')) { setLocation(getX() + personVal, getY()); } } if (Greenfoot.isKeyDown("up")) { if (!checkForOtherWall('u')) { setLocation(getX(), getY() - personVal); } } if (Greenfoot.isKeyDown("down")) { if (!checkForOtherWall('d')) { setLocation(getX(), getY() + personVal); } } if (getX() == 50) { setImage(new GreenfootImage("images/ppl1.png")); } cherryTouch(); // calling cherryTouch functions exit(); // calling exit function } public boolean checkForOtherWall(char dir) { wall w = null; wallTwo w2 = null; // checks for wall in the left direction if (dir == 'l') { w2 = (wallTwo) getOneObjectAtOffset(-personVal, 0, wallTwo.class); w = (wall) getOneObjectAtOffset(-personVal, 0, wall.class); } // checks for wall in the right direction if (dir == 'r') { w2 = (wallTwo) getOneObjectAtOffset(personVal, 0, wallTwo.class); w = (wall) getOneObjectAtOffset(personVal, 0, wall.class); } // checks for wall in the down direction if (dir == 'd') { w = (wall) getOneObjectAtOffset(0, personVal, wall.class); w2 = (wallTwo) getOneObjectAtOffset(0, personVal, wallTwo.class); } // checks for wall in the up direction if (dir == 'u') { w = (wall) getOneObjectAtOffset(0,-personVal , wall.class); w2 = (wallTwo) getOneObjectAtOffset(0,-personVal , wallTwo.class); } // if there is a wall return true otherwise return false if (w != null || w2 != null) { return true; } return false; } public void cherryTouch() { // getting every time the user touches a cherry question c = (question) getOneIntersectingObject(question.class); // selecting a random question from the arraylist int rand = Greenfoot.getRandomNumber(questions.size()); if (c != null) { // prompting the user to answer the question String q = Greenfoot.ask(questions.get(rand)).toLowerCase(); // checking if the answer is correct if (q.contains(answers.get(rand).toLowerCase())) { // if the answer is correct it removes the cherry getWorld().removeObject(c); // removes the question and answer from the list questions.remove(rand); answers.remove(rand); // adds one to the count count ++; } else { // if its wrong, the game restarts Greenfoot.setWorld(new myWorld()); } } } public void exit() { // checks if it is toucvhing the exit Exit exit = (Exit) getOneIntersectingObject(Exit.class); // checks if all the cherries are answered and the player is at the end of the maze if (exit != null && count == 6) { // opens a pop up of a you win picture at the middle of the screen setImage(new GreenfootImage("you-win-lettering-pop-art-text-banner_185004-60.jpg")); setLocation(612, 404); } } }
4555ed7bd86e108d78260b475b8d1e56e7e4e216
d1d79c769156693f5b8e0eb921207bd1bf0e7ba2
/src/main/java/br/com/guilherme/cursomc/domain/Categoria.java
7a80b59866e199c3199b7f62a8e2917cb12bbd8a
[]
no_license
guilhermedigue/cursomc
bea90736d8e113b1eb1568708c4692da055cd838
52c75a723d7578ffee91af2ce171af8e056d08e6
refs/heads/master
2020-08-21T10:13:35.874271
2019-10-19T18:27:53
2019-10-19T18:27:53
216,138,191
0
0
null
null
null
null
UTF-8
Java
false
false
1,191
java
package br.com.guilherme.cursomc.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.io.Serializable; import java.util.Objects; @Entity public class Categoria implements Serializable { private static final long seriaVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String nome; public Categoria() { } public Categoria(Integer id, String nome) { this.id = id; this.nome = nome; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Categoria categoria = (Categoria) o; return Objects.equals(id, categoria.id); } @Override public int hashCode() { return Objects.hash(id); } }
0cd52a92f948162ee91cab8cbb49b7503f1e306f
4e7cc60be0d5b68da137506f4336a6a17167afa1
/src/stegen/client/gui/score/ScoreTableRow.java
d18491d7eab440094cf0992b944913571c1c3e2c
[]
no_license
askeew/Vinnarstegen
e0b75c91b2635442b8a036b18f8f40f5f2a0d6a9
c940703af68a77f4ecdbef7da01366431d687a4d
refs/heads/master
2021-01-15T18:14:52.260393
2011-12-04T22:51:27
2011-12-04T22:51:27
2,666,763
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package stegen.client.gui.score; import stegen.shared.*; // Går det att få bort PlayerDTO? public class ScoreTableRow { public final PlayerDto player; public final String score; public final String ranking; public final String changedDateTime; public final String changedBy; public final boolean currentUser; public ScoreTableRow(PlayerDto player, String score, String ranking, String changedDateTime, String changedBy, boolean currentUser) { this.player = player; this.score = score; this.ranking = ranking; this.changedDateTime = changedDateTime; this.changedBy = changedBy; this.currentUser = currentUser; } }
28272552d8bec107c216c4ac627bc5cf271bf6ce
3d12c4dd59406e12fa60cec790d9b3236a1a8ad8
/strings/anagrams/anagrams.java
9793651080e1b51277b465ae4bd6b4b12782c242
[]
no_license
toyotathon/leetcode_problems
5aec33d8ba810c63d73819400df0f5ca2b51e84e
b885f0e2c842902ba25bbd85859fccacad7bebb4
refs/heads/master
2021-09-04T01:28:17.944235
2018-01-14T03:19:05
2018-01-14T03:19:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,403
java
import java.util.*; class Solution { private static Map<Character, Integer> createMap(String s) { Map<Character, Integer> returnMap = new HashMap<Character, Integer>(); int length = s.length(); for (int i = 0; i < length; i++) { char current = s.charAt(i); if (returnMap.get(current) == null) { returnMap.put(current, 1); } else { int incrementValue = returnMap.get(current) + 1; returnMap.put(current, incrementValue); } } return returnMap; } private static boolean anagramMatch(Map<Character, Integer> sMap, Map<Character, Integer> tMap) { for (Map.Entry<Character, Integer> entry : sMap.entrySet()) { int entryValue = entry.getValue(); char entryKey = entry.getKey(); if (tMap.get(entryKey) == null) { return false; } else if (tMap.get(entryKey) != entryValue) { return false; } } return true; } public boolean isAnagram(String s, String t) { Map<Character, Integer> sMap = createMap(s); Map<Character, Integer> tMap = createMap(t); if (sMap.size() >= tMap.size()) { return anagramMatch(sMap, tMap); } return anagramMatch(tMap, sMap); } }
4d19d7ceae4a7ae7dc8c055f5582fa6b339d2d0c
362fe7b4b63d89c14e6a69549d6cda215b268204
/Mechanics.java
6878b1ad02b024ec87549ec0b15742f73ffd75e2
[]
no_license
tcloudb/Java-Wars
722881eb9ec6e04aed55111e64d98fb82f5fc24e
7c93347dd045950cf0407021963e14495619bc85
refs/heads/master
2021-01-19T14:45:52.138697
2017-04-13T21:06:21
2017-04-13T21:06:21
88,188,012
0
0
null
null
null
null
UTF-8
Java
false
false
762
java
public class Mechanics { private int turn; public Mechanics() { turn = 1; } public void battle(Unit a, Unit b) { a.damage(b); calcDeath(b); if (!b.getIsDead()) { b.damage(a); calcDeath(a); } } private void calcDeath(Unit a) { if (a.getHP() == 0) { a.setIsDead(true); } } public void endTurn() { turn++; } // returns a number which represents the player who's turn it is. Ex: 0 = player 1, 1 = player 2, etc. public int getTurn() { return turn%2; } // returns 0 if nobody has won, 1 if player 1 won, and 2 if player 2 won. public int calcVictory() { //if player 1 has no units, return 2 //if player 2 has no units, return 1 //else return 0 return 0; } }
f448a5cd6b58dfdc803561758843f90235d72534
4cc020d488db5e7f856276fc4f6ec96efa9e25a0
/src/main/java/io/praveen/reactbootapp/model/UserRepository.java
70e9db30adef276482cb15e238c13903d5388ceb
[]
no_license
praveen270794/react-boot
abd2134b1ac47e8688761ddb56246131c2f65e0b
7f54c3267078853049775e4b2eb963b75e49ed19
refs/heads/master
2023-02-09T21:59:11.145829
2020-05-31T11:45:23
2020-05-31T11:45:23
268,070,341
0
0
null
2021-01-06T03:43:54
2020-05-30T11:56:47
JavaScript
UTF-8
Java
false
false
174
java
package io.praveen.reactbootapp.model; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepository extends JpaRepository<User, String> { }
11cc14546abab3722f4a4c107b2948a0b97c627f
431ccc0276d045e34c1749782e2d99c1179d219f
/dayTwo/Expression/ComparisonOperators.java
b5101dd50434da31ed469613e305fc9f37a0b277
[]
no_license
Abeleencon/Core_java
16c8daf5bf7df8dd8760bb4f58176e457ccdc162
25d6482b56cfe3511112ff231313fd4aebdd715f
refs/heads/master
2020-04-01T15:32:21.879417
2018-10-16T19:26:01
2018-10-16T19:26:01
153,341,311
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package dayTwo.Expression; public class ComparisonOperators { //We have six relational operators in Java: ==, !=, <, >, <=, >= public static void main(String[] args) { int num1 = 10; int num2 = 50; if (num1 == num2) { System.out.println("Num1 and num2 are the same"); } else { System.out.println("Num1 and Num2 are not the same"); } if (num1 != num2) { System.out.println("Num1 and num2 are not the same"); } else { System.out.println("Num1 and Num2 are the same"); } if (num1 >= num2) { System.out.println("Num1 is greater or equal to num2 "); } else { System.out.println("Num1 is less than Num2"); } } }
f1fd5fb76369efbcbe4d6d867c51223389866c4f
1932273022878e5adcf56d0309c2e25d9c40e7da
/src/main/java/jp/bananafish/spark/sample/Address.java
3bd437135479cda5863fb22028667732947be712
[ "MIT" ]
permissive
border-aloha/SparkSample
47a5f2899d1aa8f0b7fc265a1d705c09d47b3ef5
f3e3e4b65afc3f8db56427dc54ef35462279fa79
refs/heads/master
2020-05-31T16:04:07.867432
2014-11-03T13:10:10
2014-11-03T13:10:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,943
java
/** * */ package jp.bananafish.spark.sample; import java.io.Serializable; /** * 郵便番号CSVのレコード * * @author border * */ public class Address implements Serializable { /** * 全国地方公共団体コード(JIS X0401、X0402) */ private String jisCode; /** * (旧)郵便番号(5桁) */ private String oldPostalCode; /** * 郵便番号(7桁) */ private String postalCode; /** * 都道府県名カナ */ private String prefectureNameKana; /** * 市区町村名カナ */ private String cityNameKana; /** * 町域名カナ */ private String townAreaNameKana; /** * 都道府県名 */ private String prefectureName; /** * 市区町村名 */ private String cityName; /** * 町域名 */ private String townAreaName; /** * 一町域が二以上の郵便番号で表される場合の表示 */ private String flag1; /** * 小字毎に番地が起番されている町域の表示 */ private String flag2; /** * 丁目を有する町域の場合の表示 */ private String flag3; /** * 一つの郵便番号で二以上の町域を表す場合の表示 */ private String flag4; /** * 更新の表示 */ private String updateType; /** * 変更理由 */ private String reasonForChange; /** * @return the jisCode */ public String getJisCode() { return jisCode; } /** * @param jisCode * the jisCode to set */ public void setJisCode(String jisCode) { this.jisCode = jisCode; } /** * @return the oldPostalCode */ public String getOldPostalCode() { return oldPostalCode; } /** * @param oldPostalCode * the oldPostalCode to set */ public void setOldPostalCode(String oldPostalCode) { this.oldPostalCode = oldPostalCode; } /** * @return the postalCode */ public String getPostalCode() { return postalCode; } /** * @param postalCode * the postalCode to set */ public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** * @return the prefectureNameKana */ public String getPrefectureNameKana() { return prefectureNameKana; } /** * @param prefectureNameKana * the prefectureNameKana to set */ public void setPrefectureNameKana(String prefectureNameKana) { this.prefectureNameKana = prefectureNameKana; } /** * @return the cityNameKana */ public String getCityNameKana() { return cityNameKana; } /** * @param cityNameKana * the cityNameKana to set */ public void setCityNameKana(String cityNameKana) { this.cityNameKana = cityNameKana; } /** * @return the townAreaNameKana */ public String getTownAreaNameKana() { return townAreaNameKana; } /** * @param townAreaNameKana * the townAreaNameKana to set */ public void setTownAreaNameKana(String townAreaNameKana) { this.townAreaNameKana = townAreaNameKana; } /** * @return the prefectureName */ public String getPrefectureName() { return prefectureName; } /** * @param prefectureName * the prefectureName to set */ public void setPrefectureName(String prefectureName) { this.prefectureName = prefectureName; } /** * @return the cityName */ public String getCityName() { return cityName; } /** * @param cityName * the cityName to set */ public void setCityName(String cityName) { this.cityName = cityName; } /** * @return the townAreaName */ public String getTownAreaName() { return townAreaName; } /** * @param townAreaName * the townAreaName to set */ public void setTownAreaName(String townAreaName) { this.townAreaName = townAreaName; } /** * @return the flag1 */ public String getFlag1() { return flag1; } /** * @param flag1 * the flag1 to set */ public void setFlag1(String flag1) { this.flag1 = flag1; } /** * @return the flag2 */ public String getFlag2() { return flag2; } /** * @param flag2 * the flag2 to set */ public void setFlag2(String flag2) { this.flag2 = flag2; } /** * @return the flag3 */ public String getFlag3() { return flag3; } /** * @param flag3 * the flag3 to set */ public void setFlag3(String flag3) { this.flag3 = flag3; } /** * @return the flag4 */ public String getFlag4() { return flag4; } /** * @param flag4 * the flag4 to set */ public void setFlag4(String flag4) { this.flag4 = flag4; } /** * @return the updateType */ public String getUpdateType() { return updateType; } /** * @param updateType * the updateType to set */ public void setUpdateType(String updateType) { this.updateType = updateType; } /** * @return the reasonForChange */ public String getReasonForChange() { return reasonForChange; } /** * @param reasonForChange * the reasonForChange to set */ public void setReasonForChange(String reasonForChange) { this.reasonForChange = reasonForChange; } }
6a6d36bc0a9f8d6934f2ecd2aee6d16913dd3e03
5e2cab8845e635b75f699631e64480225c1cf34d
/modules/core/org.jowidgets.tools/src/main/java/org/jowidgets/tools/powo/JoCheckedMenuItem.java
49f4b96252b84b6a8c19b95d8da8bbc1f2935636
[ "BSD-3-Clause" ]
permissive
alec-liu/jo-widgets
2277374f059500dfbdb376333743d5507d3c57f4
a1dde3daf1d534cb28828795d1b722f83654933a
refs/heads/master
2022-04-18T02:36:54.239029
2018-06-08T13:08:26
2018-06-08T13:08:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,518
java
/* * Copyright (c) 2010, grossmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the jo-widgets.org nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL jo-widgets.org BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ package org.jowidgets.tools.powo; import org.jowidgets.api.toolkit.Toolkit; import org.jowidgets.api.widgets.ISelectableMenuItem; import org.jowidgets.api.widgets.blueprint.ICheckedMenuItemBluePrint; import org.jowidgets.api.widgets.descriptor.ICheckedMenuItemDescriptor; import org.jowidgets.common.image.IImageConstant; /** * @deprecated The idea of POWO's (Plain Old Widget Object's) has not been established. * For that, POWO's will no longer be supported and may removed completely in middle term. * Feel free to move them to your own open source project. */ @Deprecated public class JoCheckedMenuItem extends SelectableMenuItem<ISelectableMenuItem, ICheckedMenuItemBluePrint> implements ISelectableMenuItem { public JoCheckedMenuItem(final String text, final IImageConstant icon) { this(bluePrint(text, icon)); } public JoCheckedMenuItem(final String text) { this(bluePrint(text)); } public JoCheckedMenuItem(final String text, final String tooltipText) { this(bluePrint(text, tooltipText)); } public JoCheckedMenuItem(final ICheckedMenuItemDescriptor descriptor) { super(bluePrint().setSetup(descriptor)); } public static ICheckedMenuItemBluePrint bluePrint() { return Toolkit.getBluePrintFactory().checkedMenuItem(); } public static ICheckedMenuItemBluePrint bluePrint(final String text) { return Toolkit.getBluePrintFactory().checkedMenuItem(text); } public static ICheckedMenuItemBluePrint bluePrint(final String text, final String tooltipText) { return Toolkit.getBluePrintFactory().checkedMenuItem(text).setToolTipText(tooltipText); } public static ICheckedMenuItemBluePrint bluePrint(final String text, final IImageConstant icon) { return Toolkit.getBluePrintFactory().checkedMenuItem(text).setIcon(icon); } }
769221ba660c3e35fb1dbe543fecb3fa0fd44de9
dca1f809072be590af0d518a488a173d4dd259c9
/AndroidApp/Android911Client/app/src/main/java/com/example/cuixuelai/android911client/TaggingFragment.java
d60173a92aef6d3075fb004dd72afcc38e670491
[]
no_license
yiwen-luo/911-Call-Indoor-Positioning
a6a18f138dc22b0ea15597314f3dc9c513103187
5bfd1b7ce56ab5e9d970db468499953486af417e
refs/heads/master
2023-01-11T20:57:03.178096
2019-12-03T06:28:54
2019-12-03T06:28:54
70,303,164
0
0
null
2022-12-26T20:23:15
2016-10-08T04:13:25
Python
UTF-8
Java
false
false
3,454
java
package com.example.cuixuelai.android911client; import android.app.Activity; import android.app.Fragment; import android.hardware.SensorEvent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Switch; import org.json.JSONException; public class TaggingFragment extends Fragment { TaggingCommunication myTaggingCommunication; Button tagButton; EditText street1; EditText zip; EditText state; EditText city; EditText building; EditText floor; EditText room; Switch mySwitch; boolean tagging_permission; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //get edit text by id... View view = inflater.inflate(R.layout.tagging_fragment, container, false); this.street1 = (EditText) view.findViewById(R.id.editText_street1); this.zip = (EditText) view.findViewById(R.id.editText_Zip); this.city = (EditText) view.findViewById(R.id.editText_City); this.state = (EditText) view.findViewById(R.id.editText_State); this.floor = (EditText) view.findViewById(R.id.editText_Floor); this.room = (EditText) view.findViewById(R.id.editText_Room); this.building = (EditText) view.findViewById(R.id.editText_Building); this.tagging_permission = false; this.mySwitch = (Switch) view.findViewById(R.id.switch1); mySwitch.setChecked(false); mySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { tagging_permission = true; } else { tagging_permission = false; } } }); this.tagButton = (Button) view.findViewById(R.id.tagging_button); this.tagButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //pass data through passTaggedData to main activity if (tagging_permission) { try { myTaggingCommunication.passTaggedData( street1.getText().toString(), zip.getText().toString(), city.getText().toString(), state.getText().toString(), floor.getText().toString(), room.getText().toString(), building.getText().toString()); } catch (JSONException e) { e.printStackTrace(); } } } }); return view; } interface TaggingCommunication { void onSensorChanged(SensorEvent event); public void passTaggedData(String street1, String zip, String city, String state, String floor, String room, String building) throws JSONException; } @Override public void onAttach(Activity a) { super.onAttach(a); myTaggingCommunication = (TaggingCommunication) a; } }
d833795a1123b348c5226f027c35f0ec45fc6b57
a8e47979b45aa428a32e16ddc4ee2578ec969dfe
/base/config/src/main/java/org/artifactory/descriptor/repo/distribution/rule/package-info.java
dc7e8858814b341d6143eb9803fc30dbfb38d12c
[]
no_license
nuance-sspni/artifactory-oss
da505cac1984da131a61473813ee2c7c04d8d488
af3fcf09e27cac836762e9957ad85bdaeec6e7f8
refs/heads/master
2021-07-22T20:04:08.718321
2017-11-02T20:49:33
2017-11-02T20:49:33
109,313,757
0
1
null
null
null
null
UTF-8
Java
false
false
1,175
java
/* * * Artifactory is a binaries repository manager. * Copyright (C) 2016 JFrog Ltd. * * Artifactory is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Artifactory 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Artifactory. If not, see <http://www.gnu.org/licenses/>. * */ @XmlSchema(namespace = Descriptor.NS, elementFormDefault = XmlNsForm.QUALIFIED) @XmlAccessorType(XmlAccessType.FIELD) package org.artifactory.descriptor.repo.distribution.rule; import org.artifactory.descriptor.Descriptor; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlSchema;
682b4ad86804011a0bc5d1cc4cb672b1a45e5192
5c206806f5c612d14400682030cda0bd23b98981
/src/main/java/org/cyclops/integrateddynamics/core/inventory/container/ContainerMultipart.java
4b60725b049eb059f755d9ef388597e89f1329af
[ "MIT" ]
permissive
way2muchnoise/IntegratedDynamics
1ed49a413a21492e18e9bbe9ab51c03ccc81e41e
fcd4d71623a5a70d929bb7f6a9bed15745ac039f
refs/heads/master-1.10
2021-05-04T09:06:40.797829
2016-11-01T10:21:15
2016-11-01T10:21:15
70,403,691
0
0
null
2016-10-09T13:08:23
2016-10-09T13:08:23
null
UTF-8
Java
false
false
3,709
java
package org.cyclops.integrateddynamics.core.inventory.container; import com.google.common.collect.Maps; import lombok.Data; import lombok.EqualsAndHashCode; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.cyclops.cyclopscore.helper.MinecraftHelpers; import org.cyclops.cyclopscore.inventory.IGuiContainerProvider; import org.cyclops.cyclopscore.inventory.container.ExtendedInventoryContainer; import org.cyclops.cyclopscore.inventory.container.InventoryContainer; import org.cyclops.cyclopscore.inventory.container.button.IButtonActionServer; import org.cyclops.cyclopscore.persist.IDirtyMarkListener; import org.cyclops.integrateddynamics.IntegratedDynamics; import org.cyclops.integrateddynamics.api.part.IPartContainer; import org.cyclops.integrateddynamics.api.part.IPartState; import org.cyclops.integrateddynamics.api.part.IPartType; import org.cyclops.integrateddynamics.api.part.PartTarget; import org.cyclops.integrateddynamics.api.part.aspect.IAspect; import org.cyclops.integrateddynamics.core.client.gui.ExtendedGuiHandler; import org.cyclops.integrateddynamics.core.helper.PartHelpers; import org.cyclops.integrateddynamics.core.part.PartTypeConfigurable; import java.util.Map; /** * Container for parts. * @author rubensworks */ @EqualsAndHashCode(callSuper = false) @Data public abstract class ContainerMultipart<P extends IPartType<P, S> & IGuiContainerProvider, S extends IPartState<P>> extends ExtendedInventoryContainer implements IDirtyMarkListener { public static final int BUTTON_SETTINGS = 1; private static final int PAGE_SIZE = 3; private final PartTarget target; private final IPartContainer partContainer; private final P partType; private final World world; private final BlockPos pos; private final Map<IAspect, Integer> aspectPropertyButtons = Maps.newHashMap(); protected final EntityPlayer player; /** * Make a new instance. * @param target The target. * @param player The player. * @param partContainer The part container. * @param partType The part type. */ public ContainerMultipart(EntityPlayer player, PartTarget target, IPartContainer partContainer, P partType) { super(player.inventory, partType); this.target = target; this.partContainer = partContainer; this.partType = partType; this.world = player.getEntityWorld(); this.pos = player.getPosition(); this.player = player; putButtonAction(BUTTON_SETTINGS, new IButtonActionServer<InventoryContainer>() { @Override public void onAction(int buttonId, InventoryContainer container) { IGuiContainerProvider gui = ((PartTypeConfigurable) getPartType()).getSettingsGuiProvider(); IntegratedDynamics._instance.getGuiHandler().setTemporaryData(ExtendedGuiHandler.PART, getTarget().getCenter().getSide()); // Pass the side as extra data to the gui if(!MinecraftHelpers.isClientSide()) { BlockPos cPos = getTarget().getCenter().getPos().getBlockPos(); ContainerMultipart.this.player.openGui(gui.getModGui(), gui.getGuiID(), world, cPos.getX(), cPos.getY(), cPos.getZ()); } } }); } @SuppressWarnings("unchecked") public S getPartState() { return (S) partContainer.getPartState(getTarget().getCenter().getSide()); } @Override public boolean canInteractWith(EntityPlayer playerIn) { return PartHelpers.canInteractWith(getTarget(), player, this.partContainer); } }
eac0a88286d07c50a89e1375a892df44977d1cc0
e789eec798176e5ac3836680c7b458332151cceb
/src/persistentie/JPAUtil.java
ed24300902928cb196ea04e3f735e5b25f926e9c
[]
no_license
thomasdejagere/SaniManage
7ac5ac9213762259d4d8f7b95f78fd00c39074dd
503ce4b004a9539c2901d668ef33bbf443b4ce3c
refs/heads/master
2021-01-10T02:34:40.154927
2015-12-16T19:01:44
2015-12-16T19:01:44
48,129,117
0
0
null
null
null
null
UTF-8
Java
false
false
652
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 persistentie; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; /** * * @author Seppe */ public class JPAUtil { private final static EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("BarcodeSystemSV"); public static EntityManagerFactory getEntityManagerFactory() { return entityManagerFactory; } private JPAUtil() { } }
d01d4cab57c46cb4c1f20fb8e394c4d0ab5e4984
06810721513d822ee66f72b0c3de355899510597
/src/main/java/com/cis/project/config/CacheConfiguration.java
14a2e99d6d4dc8e74869c751520f7f9cd221dc76
[]
no_license
bonnefoipatrick/CisProjectApplication
776c4070c55b961b3691c34600de08331ab3675e
174598b4cc371e4a4e93ff2aff8eb440038e7398
refs/heads/master
2020-03-09T13:56:43.980452
2018-04-09T19:54:43
2018-04-09T19:54:43
128,823,204
0
0
null
2018-04-10T19:57:14
2018-04-09T19:28:13
Java
UTF-8
Java
false
false
2,457
java
package com.cis.project.config; import io.github.jhipster.config.JHipsterProperties; import org.ehcache.config.builders.CacheConfigurationBuilder; import org.ehcache.config.builders.ResourcePoolsBuilder; import org.ehcache.expiry.Duration; import org.ehcache.expiry.Expirations; import org.ehcache.jsr107.Eh107Configuration; import java.util.concurrent.TimeUnit; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.context.annotation.*; @Configuration @EnableCaching @AutoConfigureAfter(value = { MetricsConfiguration.class }) @AutoConfigureBefore(value = { WebConfigurer.class, DatabaseConfiguration.class }) public class CacheConfiguration { private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; public CacheConfiguration(JHipsterProperties jHipsterProperties) { JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache(); jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) .withExpiry(Expirations.timeToLiveExpiration(Duration.of(ehcache.getTimeToLiveSeconds(), TimeUnit.SECONDS))) .build()); } @Bean public JCacheManagerCustomizer cacheManagerCustomizer() { return cm -> { cm.createCache(com.cis.project.repository.UserRepository.USERS_BY_LOGIN_CACHE, jcacheConfiguration); cm.createCache(com.cis.project.repository.UserRepository.USERS_BY_EMAIL_CACHE, jcacheConfiguration); cm.createCache(com.cis.project.domain.User.class.getName(), jcacheConfiguration); cm.createCache(com.cis.project.domain.Authority.class.getName(), jcacheConfiguration); cm.createCache(com.cis.project.domain.User.class.getName() + ".authorities", jcacheConfiguration); // jhipster-needle-ehcache-add-entry }; } }
b53279da1c7a21c5ff4713b8b3cbaed4e9a26ed0
fe9d840eefd1034d86531678077513df021a6bad
/app/src/main/java/com/huoxy/androidheros/chapter3/CustomMeasureView.java
c953479516152a9acc92695c5340a104c40ed8e4
[ "Apache-2.0" ]
permissive
ContinueCoding/AndroidHeros
1d3496a4c3f8fb009adf9ee026a6dd6e6cde482f
0d71bf022e037340a3627b38494e139bca9fce54
refs/heads/master
2021-01-20T06:15:17.020652
2018-01-31T00:32:48
2018-01-31T00:32:48
101,497,348
0
0
null
null
null
null
UTF-8
Java
false
false
3,038
java
package com.huoxy.androidheros.chapter3; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.View; /** * Created by huoxy on 2017/8/16. * 自定义View - 测量测试 */ public class CustomMeasureView extends View { private static final String TAG = "CustomMeasureView"; public CustomMeasureView(Context context) { super(context); } public CustomMeasureView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } public CustomMeasureView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec)); } private int measureWidth(int widthMeasureSpec){ int result = 0; //分别获取测量模式和大小 int specMode = MeasureSpec.getMode(widthMeasureSpec); int specSize = MeasureSpec.getSize(widthMeasureSpec); Log.i(TAG, "********** measureWidth() --- specMode = " + specMode + ", specSize = " + specSize); if(specMode == MeasureSpec.EXACTLY){ result = specSize; Log.i(TAG, "********** measureWidth() --- MeasureSpec.EXACTLY"); } else { //指定一个默认大小 —— 待优化 result = 300; if(specMode == MeasureSpec.AT_MOST){ result = Math.min(result, specSize); Log.i(TAG, "********** measureWidth() --- MeasureSpec.AT_MOST"); } if(specMode == MeasureSpec.UNSPECIFIED){ Log.i(TAG, "********** measureWidth() --- MeasureSpec.UNSPECIFIED"); } } return result; } private int measureHeight(int heightMeasureSpec){ int result = 0; //分别获取测量模式和大小 int specMode = MeasureSpec.getMode(heightMeasureSpec); int specSize = MeasureSpec.getSize(heightMeasureSpec); Log.i(TAG, "measureHeight() --- specMode = " + specMode + ", specSize = " + specSize); if(specMode == MeasureSpec.EXACTLY){ result = specSize; Log.i(TAG, "measureHeight() --- MeasureSpec.EXACTLY"); } else { //指定一个默认大小 —— 待优化 result = 300; if(specMode == MeasureSpec.AT_MOST){ result = Math.min(result, specSize); Log.i(TAG, "measureHeight() --- MeasureSpec.AT_MOST"); } if(specMode == MeasureSpec.UNSPECIFIED){ Log.i(TAG, "measureHeight() --- MeasureSpec.UNSPECIFIED"); } } return result; } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.RED); } }
9eadbbf238528a51c55eebc82f60658220b8745b
96f23ab49d69dff1431d81ae1428d4ef205774c1
/src/main/java/com/capgemini/movieManagement/dao/MovieDao.java
ba814ebc1f41b43a06df2f137c5f20bb42d9f89c
[]
no_license
andy077/movieManagement
6abe3a3245f8937ca0e1cc9e1008c9b51c25cda1
a766e7435611340c8798bda265ccf13ee7b4a8ed
refs/heads/master
2021-01-07T01:48:54.787059
2020-03-23T11:33:57
2020-03-23T11:33:57
241,543,336
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package com.capgemini.movieManagement.dao; import com.capgemini.movieManagement.dto.Movie; import com.capgemini.movieManagement.util.MovieRepository; public class MovieDao implements MovieDaoInterface { public Movie searchMovieById(int id) { for(int i=0;i<MovieRepository.getMoviesList().size();i++) { if(MovieRepository.getMoviesList().get(i).getMovieId()==id)return MovieRepository.getMoviesList().get(i); } return null; } }
66a21cf490f8c011efd63bd375bae8363f7d6f63
7dafd999eeef3092e7462ecb975a91b13e7ed6b7
/src/main/java/org/audit4j/core/RunStatus.java
51a6d53f5447edbb3b0e282d307339d5e0ca4c10
[ "Apache-2.0" ]
permissive
hascode/audit4j-core
937329a8a494e10e44ac6512ae362db21e5b8dda
60f075c1828164c7d1041561ab12978bb5d4b687
refs/heads/master
2021-01-16T20:04:47.137389
2015-02-16T18:59:44
2015-02-16T18:59:44
30,883,039
0
0
null
2015-02-16T18:57:13
2015-02-16T18:57:12
null
UTF-8
Java
false
false
963
java
/* * Copyright 2014 Janith Bandara, This source is a part of * Audit4j - An open source auditing framework. * http://audit4j.org * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.audit4j.core; /** * The Enum RunStatus. * * @author <a href="mailto:[email protected]">Janith Bandara</a> */ public enum RunStatus { /** The start. */ READY, RUNNING, /** The stop. */ STOPPED, /** The terminated. */ DISABLED, TERMINATED; }
784716ccd7a95a0788ab43e82f72df63bee4e9d7
54f352a242a8ad6ff5516703e91da61e08d9a9e6
/Source Codes/CodeJamData/14/52/7.java
6d740833a1fb6426268c1c2d013843319594dc85
[]
no_license
Kawser-nerd/CLCDSA
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
aee32551795763b54acb26856ab239370cac4e75
refs/heads/master
2022-02-09T11:08:56.588303
2022-01-26T18:53:40
2022-01-26T18:53:40
211,783,197
23
9
null
null
null
null
UTF-8
Java
false
false
2,037
java
package round3; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class B { public static void main(String[] args) throws FileNotFoundException { Kattio io; // io = new Kattio(System.in, System.out); // io = new Kattio(new FileInputStream("round3/B-sample.in"), System.out); // io = new Kattio(new FileInputStream("round3/B-small-0.in"), new FileOutputStream("round3/B-small-0.out")); io = new Kattio(new FileInputStream("round3/B-large-0.in"), new FileOutputStream("round3/B-large-0.out")); int cases = io.getInt(); for (int i = 1; i <= cases; i++) { io.print("Case #" + i + ": "); System.err.println(i); new B().solve(io); } io.close(); } int myPower, towerPower; int health[], gold[]; private void solve(Kattio io) { myPower = io.getInt(); towerPower = io.getInt(); int n = io.getInt(); health = new int[n]; gold = new int[n]; for (int i = 0; i < n; i++) { health[i] = io.getInt(); gold[i] = io.getInt(); } memo = new int[n][201*n+10]; io.println(go(0, 1)); } int memo[][]; private int go(int monster, int savedTurns) { if (monster == health.length) return 0; int orgSavedTurns = savedTurns; if (memo[monster][savedTurns] > 0) return memo[monster][savedTurns] - 1; // skip it int towerShots = (health[monster] + towerPower - 1) / towerPower; int best = go(monster + 1, savedTurns + towerShots); int h = health[monster] % towerPower; if (h == 0) h = towerPower; int shotsReq = (h + myPower - 1) / myPower; savedTurns += towerShots - 1; if (shotsReq <= savedTurns) { best = Math.max(best, gold[monster] + go(monster + 1, savedTurns - shotsReq)); } memo[monster][orgSavedTurns] = best + 1; return best; } }
304573aedc00f46d3c1a923ad2ac4f8f3e49d26e
ee83062efa5a231fcac01a074880138687966a06
/src/main/java/cn/wanglei/bi/utils/MissInfo2Redis.java
294e60e02351fc25121f8bb3fd24c1e67ee825fc
[]
no_license
blake-wang/MyXiaoPeng_BI
6f5a7549d2560c14fac4bca30ee862b80f149cd7
412b1bebc8761b7c4390cfc0c5b53c6f6671ff19
refs/heads/master
2021-01-01T15:37:31.407048
2018-02-10T10:37:11
2018-02-10T10:37:11
97,658,415
1
0
null
null
null
null
UTF-8
Java
false
false
3,370
java
package cn.wanglei.bi.utils; import cn.xiaopeng.bi.utils.JdbcUtil; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import testdemo.redis.JedisUtil; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.Map; /** * Created by bigdata on 17-8-18. * 由于redis中可能出现帐号或者通行证等信息的遗漏,避免出现问题,半个小时监测一次 */ public class MissInfo2Redis { public static int checkAccount(String accountList) throws SQLException { Connection conn = JdbcUtil.getXiaopeng2Conn(); int flag = 1; Statement stmt = null; try { stmt = conn.createStatement(); } catch (SQLException e) { e.printStackTrace(); flag = 0; } String sql = "select '00' requestid,'' as userid,a.account as game_account,a.gameid as game_id,a.addtime as reg_time,'' reg_resource,a.account_channel as channel_id,a.uid as owner_id,a.bind_member as bind_member_id,a.state status,if(a.os='','UNKNOW',os) from bgameaccount a left join promo_user b on a.uid=b.member_id where a.account in ('accountList')".replace("accountList", accountList); ResultSet rs = stmt.executeQuery(sql); try { JedisPool pool = JedisUtil.getJedisPool(); Jedis jedis = pool.getResource(); while(rs.next()){ Map<String,String> account = new HashMap<String,String>(); account.put("requestid",rs.getString("requestid")==null? "":rs.getString("requestid")); account.put("userid",rs.getString("userid")==null?"":rs.getString("userid")); account.put("game_account",rs.getString("game_account")==null?"":rs.getString("game_account").trim().toLowerCase()); account.put("game_id",rs.getString("game_id")==null?"0":rs.getString("game_id")); account.put("reg_time",rs.getString("reg_time")==null?"0000-00-00":rs.getString("reg_time")); account.put("reg_resource",rs.getString("reg_resource")==null?"2":rs.getString("reg_resource")); account.put("channel_id",rs.getString("channel_id")==null?"0":rs.getString("channel_id")); account.put("owner_id",rs.getString("owner_id")==null?"0":rs.getString("owner_id")); account.put("bind_member_id",rs.getString("bind_member_id")==null?"0":rs.getString("bind_member_id")); account.put("status",rs.getString("status")==null?"1":rs.getString("status")); account.put("reg_os_type",rs.getString("reg_os_type")==null?"UNKNOW":rs.getString("reg_os_type")); account.put("expand_code",rs.getString("expand_code")==null?"":rs.getString("expand_code")); account.put("expand_channel",rs.getString("expand_channel")); if(rs.getString("game_account")!=null){ jedis.hmset(rs.getString("game_account").trim().toLowerCase(),account); } } stmt.close(); conn.close(); pool.returnResource(jedis); pool.destroy(); } catch (SQLException e) { e.printStackTrace(); System.out.println(e); flag=0; } return flag; } }
255d15959da3a65b9235e8cf06906f6d14f8012d
0a053c3321ca12ef5d8f8f018f481f0537d8bc1a
/java-jdi/src/main/java/com/baeldung/jdi/ProgramTrace.java
e4f9e87864dfc793c20610ba0befd5021e11d1c0
[]
no_license
jeremyVienne/CAL_DEBUG
b791883a0e4c5a2228a9955860654a5ce7376a85
9f2efde4dca170f2949d1ab5e44b11a09239fba6
refs/heads/master
2020-11-24T09:38:21.439303
2019-12-14T20:37:23
2019-12-14T20:37:23
228,085,254
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
import java.util.ArrayList; public class ProgramTrace{ private static final ProgramTrace pgm = new ProgramTrace(); private ArrayList<Trace> traces; private int index; private ProgramTrace(){ this.traces = new ArrayList<Trace>(); this.index = 0; } public static ProgramTrace getPgm(){ return pgm; } public void addTrace(Trace t ){ this.index ++; this.traces.add(t); } public Trace next(){ if(this.index < this.traces.size()-1){this.index ++ ;} return this.traces.get(this.index); } public Trace previous(){ if(this.index > 0){ this.index --; } return this.traces.get(this.index); } }
[ "https://gitlab-etu.fil.univ-lille1.fr" ]
https://gitlab-etu.fil.univ-lille1.fr
85074a20bb8809ca03fc3d0f1e1f13c662296100
b4f4e0fda77d0d58cac2fad2d753e2a1925224de
/src/main/java/com/hekaihang/service/AccountServiceImpl.java
39a97e706d6b8d117d09e349daad46b6437e22e8
[]
no_license
1yujian1/ssmbuild
aa4180c428cfce00dbc647f5e3a91dceb946f409
38ffcac3190b0d77e1e06e4e43e9592e8034f72e
refs/heads/master
2023-01-05T15:53:48.897936
2020-10-20T01:48:38
2020-10-20T01:48:38
305,560,358
0
0
null
null
null
null
UTF-8
Java
false
false
2,104
java
package com.hekaihang.service; import com.hekaihang.dao.AccountMapper; import com.hekaihang.pojo.Accounts; import javax.servlet.http.HttpSession; import java.util.HashMap; import java.util.List; import java.util.Map; public class AccountServiceImpl implements AccountService { private AccountMapper accountMapper; public void setAccountMapper(AccountMapper accountMapper) { this.accountMapper = accountMapper; } @Override public int addAccount(Accounts accounts) { return accountMapper.addAccount(accounts); } @Override public int deleteAccountById(int id) { return accountMapper.deleteAccountById(id); } @Override public int updateAccount(Accounts accounts) { return accountMapper.updateAccount(accounts); } @Override public int updateAccountPass(Accounts accounts) { return accountMapper.updateAccountPass(accounts); } @Override public int updateAccountDepart(Accounts accounts) { return accountMapper.updateAccountDepart(accounts); } @Override public Accounts queryAccountById(int id) { return accountMapper.queryAccountById(id); } @Override public List<Accounts> queryAllAccount() { return accountMapper.queryAllAccount(); } @Override public List<Accounts> queryAllAccount0() { return accountMapper.queryAllAccount0(); } @Override public List<Accounts> queryAccountByName(String name) { return accountMapper.queryAccountByName(name); } @Override public List<Accounts> queryAccountByDepart(String department) { return accountMapper.queryAccountByDepart(department); } @Override public boolean login(int id,String password, HttpSession session) { List<Accounts> accounts=accountMapper.queryAccountByIdPass(id,password); //如果用户存在,放入session域 if(accounts.size()>0) { session.setAttribute("account", accounts.get(0)); return true; }else { return false; } } }
8bd1edaa6003116730fd8c6d81c086997bd32fa8
373d01d25ecaa4564ba8a5dd5a4477f2ccc8d426
/Lab3/src/lab3/Driver.java
6a576656ac333e356d63cbbde0471d7b47c3f318
[]
no_license
paytonharrison/232Algorithms
182b7e94854abf3f5bb25b90ead1b47868c6ed4c
34c99a2906b49c402bed2c4d87657bf1769357c6
refs/heads/master
2020-03-11T06:32:55.230101
2018-04-17T02:26:52
2018-04-17T02:26:52
129,832,826
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package lab3; import lab3.Graph; public class Driver { public static void main(String[] args) { Graph graph = new Graph(); System.out.println("Prim's Algorithm: "); System.out.println(""); graph.prims(); System.out.println(""); graph.resetVertices(); System.out.println("Kruskal's Algorithm: "); System.out.println(""); graph.kruskals(); System.out.println(""); graph.resetVertices(); System.out.println("Floyd-Warshall's Algorithm: "); graph.floydWarshall(); } }
7cabb8f1c4926b8ecd06c3c82da9c62c20170a57
1213f1dcf5500859a248de45c1ff986c48c56c43
/flightSearch/src/com/iss/controller/ForgetPwd.java
3185e15c2dbdcf3451544e39e28b214c55bf4c06
[]
no_license
Crisgene/JavaDemo
a6f7ac9c3f565b31f95d0c7181d5c35802b6f28b
028e60261fabb211512f92bd9100f13def8165b5
refs/heads/master
2020-12-07T21:43:26.891298
2020-01-09T13:06:26
2020-01-09T13:06:26
232,808,325
3
0
null
null
null
null
GB18030
Java
false
false
3,290
java
package com.iss.controller; import java.io.IOException; import java.io.PrintWriter; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; import com.iss.po.t_person; import com.iss.util.DBUtil; import com.iss.util.MailUtil; /** * Servlet implementation class ForgetPwd */ @WebServlet("/ForgetPwd") public class ForgetPwd extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ForgetPwd() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.setCharacterEncoding("UTF-8"); response.setContentType("text/json"); response.setHeader("Access-Control-Allow-Origin", "*"); PrintWriter out=response.getWriter(); Gson gson=new Gson(); List list=new ArrayList<>(); String username=""; String id=""; String password=""; String ccode=""; String receiveMailAccount=""; //System.out.println(request.getParameter("t_user_pwd")); try { if (request.getParameter("email")!=null) { receiveMailAccount=request.getParameter("email"); Random random = new Random(); String result=""; for (int i=0;i<6;i++) { result+=random.nextInt(10); } String string="亲爱的用户,您好!您现在正在通过邮箱找回密码,您的验证码是"+result+",如果不是本人请无视~"; ccode=result; MailUtil.sendMail(receiveMailAccount,string); } if(request.getParameter("ForgetPwd")!=null&&request.getParameter("ForgetPwdUsername")!=null){ username=request.getParameter("ForgetPwdUsername"); Statement statement=DBUtil.getConnection().createStatement(); String sql2="SELECT * FROM `t_sys_user` where t_user_name='"+username+"' " ; System.out.println(sql2); ResultSet resultSet2=statement.executeQuery(sql2); if(resultSet2.next()) id=resultSet2.getString(1); System.out.println(id); System.out.println(request.getParameter("ForgetPwd")); password=request.getParameter("ForgetPwd"); //Statement statement1=DBUtil.getConnection().createStatement(); String sql="UPDATE `t_sys_user` SET t_user_pwd='"+password+"' WHERE t_user_id='"+id+"' "; System.out.println(sql); statement.execute(sql); } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } out.print(gson.toJson(ccode)); out.flush(); out.close(); } }
9bb315b17c7d93e8f80aaf4892d801386d800629
0689f3b456ddce965659abcd4d2de68903de59a1
/src/main/java/com/example/jooq/demo_jooq/introduction/db/pg_catalog/routines/GinExtractJsonb.java
8894d219518d2e3e6406aae81bfc2e230803e650
[]
no_license
vic0692/demo_spring_jooq
c92d2d188bbbb4aa851adab5cc301d1051c2f209
a5c1fd1cb915f313f40e6f4404fdc894fffc8e70
refs/heads/master
2022-09-18T09:38:30.362573
2020-01-23T17:09:40
2020-01-23T17:09:40
220,638,715
0
0
null
2022-09-08T01:04:47
2019-11-09T12:25:46
Java
UTF-8
Java
false
true
4,037
java
/* * This file is generated by jOOQ. */ package com.example.jooq.demo_jooq.introduction.db.pg_catalog.routines; import com.example.jooq.demo_jooq.introduction.db.pg_catalog.PgCatalog; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Parameter; import org.jooq.impl.AbstractRoutine; import org.jooq.impl.Internal; /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated @Generated( value = { "http://www.jooq.org", "jOOQ version:3.12.3" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class GinExtractJsonb extends AbstractRoutine<Object> { private static final long serialVersionUID = -1040339210; /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> RETURN_VALUE = Internal.createParameter("RETURN_VALUE", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, false); /** * The parameter <code>pg_catalog.gin_extract_jsonb._1</code>. */ public static final Parameter<JSONB> _1 = Internal.createParameter("_1", org.jooq.impl.SQLDataType.JSONB, false, true); /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> _2 = Internal.createParameter("_2", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, true); /** * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration. */ @java.lang.Deprecated public static final Parameter<Object> _3 = Internal.createParameter("_3", org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\""), false, true); /** * Create a new routine call instance */ public GinExtractJsonb() { super("gin_extract_jsonb", PgCatalog.PG_CATALOG, org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"internal\"")); setReturnParameter(RETURN_VALUE); addInParameter(_1); addInParameter(_2); addInParameter(_3); } /** * Set the <code>_1</code> parameter IN value to the routine */ public void set__1(JSONB value) { setValue(_1, value); } /** * Set the <code>_1</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__1(Field<JSONB> field) { setField(_1, field); } /** * Set the <code>_2</code> parameter IN value to the routine */ public void set__2(Object value) { setValue(_2, value); } /** * Set the <code>_2</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__2(Field<Object> field) { setField(_2, field); } /** * Set the <code>_3</code> parameter IN value to the routine */ public void set__3(Object value) { setValue(_3, value); } /** * Set the <code>_3</code> parameter to the function to be used with a {@link org.jooq.Select} statement */ public void set__3(Field<Object> field) { setField(_3, field); } }
1ad37e2558a417f5f775b07cb1c3e94e855e15e7
5783dc53ae048651c7730958562cec22bd0e0d59
/src/javaapplication9/asdf/NewJInternalFrame.java
d9c633e70ab0105d69f45864740b75e7759dd94d
[]
no_license
jagannath311/DailyHunt
02b0638b23800d695efaac2a38ce10ef291d9cbe
98078e260f41bd219eea0a4da37c9678ab8445d1
refs/heads/master
2022-10-03T00:52:08.497226
2020-04-18T12:49:12
2020-04-18T12:49:12
270,144,741
1
0
null
null
null
null
UTF-8
Java
false
false
91,340
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 javaapplication9.asdf; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; /** * * @author sai */ public class NewJInternalFrame extends javax.swing.JInternalFrame { private Object bundle; /** * Creates new form NewJInternalFrame */ public NewJInternalFrame() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jToggleButton9 = new javax.swing.JToggleButton(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jTextArea2 = new javax.swing.JTextArea(); jMenu1 = new javax.swing.JMenu(); jLabel21 = new javax.swing.JLabel(); jScrollPane5 = new javax.swing.JScrollPane(); jTextPane1 = new javax.swing.JTextPane(); jScrollPane6 = new javax.swing.JScrollPane(); jEditorPane1 = new javax.swing.JEditorPane(); jPanel8 = new javax.swing.JPanel(); jTextField6 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jScrollPane4 = new javax.swing.JScrollPane(); jPanel7 = new javax.swing.JPanel(); jPanel9 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jToggleButton3 = new javax.swing.JToggleButton(); jToggleButton4 = new javax.swing.JToggleButton(); jToggleButton6 = new javax.swing.JToggleButton(); jToggleButton7 = new javax.swing.JToggleButton(); jToggleButton5 = new javax.swing.JToggleButton(); jToggleButton1 = new javax.swing.JToggleButton(); jToggleButton8 = new javax.swing.JToggleButton(); jScrollPane1 = new javax.swing.JScrollPane(); jPanel3 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jScrollPane8 = new javax.swing.JScrollPane(); jTextPane3 = new javax.swing.JTextPane(); jScrollPane10 = new javax.swing.JScrollPane(); jTextPane5 = new javax.swing.JTextPane(); jLabel7 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); jLabel29 = new javax.swing.JLabel(); jPanel6 = new javax.swing.JPanel(); jLabel24 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jScrollPane11 = new javax.swing.JScrollPane(); jTextPane6 = new javax.swing.JTextPane(); jScrollPane13 = new javax.swing.JScrollPane(); jTextPane7 = new javax.swing.JTextPane(); jPanel4 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); textArea1 = new java.awt.TextArea(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); jLabel20 = new javax.swing.JLabel(); jPanel5 = new javax.swing.JPanel(); jScrollPane7 = new javax.swing.JScrollPane(); jTextPane2 = new javax.swing.JTextPane(); jLabel23 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel22 = new javax.swing.JLabel(); jPanel10 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); jLabel31 = new javax.swing.JLabel(); jLabel32 = new javax.swing.JLabel(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("javaapplication9/asdf/Bundle"); // NOI18N jToggleButton9.setText(bundle.getString("NewJInternalFrame.jToggleButton9.text")); // NOI18N jLabel4.setText(bundle.getString("NewJInternalFrame.jLabel4.text")); // NOI18N jLabel5.setText(bundle.getString("NewJInternalFrame.jLabel5.text")); // NOI18N jTextArea2.setColumns(20); jTextArea2.setRows(5); jScrollPane3.setViewportView(jTextArea2); jMenu1.setText(bundle.getString("NewJInternalFrame.jMenu1.text")); // NOI18N jLabel21.setText(bundle.getString("NewJInternalFrame.jLabel21.text")); // NOI18N jScrollPane5.setViewportView(jTextPane1); jScrollPane6.setViewportView(jEditorPane1); javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jPanel8Layout.setVerticalGroup( jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 100, Short.MAX_VALUE) ); jTextField6.setText(bundle.getString("NewJInternalFrame.jTextField6.text")); // NOI18N jTextField3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField3.setText(bundle.getString("NewJInternalFrame.jTextField3.text")); // NOI18N jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); jTextField1.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField1.setText(bundle.getString("NewJInternalFrame.jTextField1.text")); // NOI18N jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jTextField2.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextField2.setText(bundle.getString("NewJInternalFrame.jTextField2.text")); // NOI18N jTextField5.setText(bundle.getString("NewJInternalFrame.jTextField5.text")); // NOI18N jTextField5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField5ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1181, Short.MAX_VALUE) ); jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 412, Short.MAX_VALUE) ); jScrollPane4.setViewportView(jPanel7); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jPanel9Layout.setVerticalGroup( jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 367, Short.MAX_VALUE) ); getContentPane().setLayout(new java.awt.CardLayout()); jPanel2.setBackground(java.awt.Color.white); jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT); jToggleButton3.setBackground(java.awt.Color.red); jToggleButton3.setText(bundle.getString("NewJInternalFrame.jToggleButton3.text")); // NOI18N jToggleButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton3ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton3.TabConstraints.tabTitle"), jToggleButton3); // NOI18N jToggleButton4.setBackground(java.awt.Color.white); jToggleButton4.setText(bundle.getString("NewJInternalFrame.jToggleButton4.text")); // NOI18N jToggleButton4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jToggleButton4MouseClicked(evt); } }); jToggleButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton4ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton4.TabConstraints.tabTitle"), jToggleButton4); // NOI18N jToggleButton6.setText(bundle.getString("NewJInternalFrame.jToggleButton6.text")); // NOI18N jToggleButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton6ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton6.TabConstraints.tabTitle"), jToggleButton6); // NOI18N jToggleButton7.setText(bundle.getString("NewJInternalFrame.jToggleButton7.text")); // NOI18N jToggleButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton7ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton7.TabConstraints.tabTitle"), jToggleButton7); // NOI18N jToggleButton5.setText(bundle.getString("NewJInternalFrame.jToggleButton5.text")); // NOI18N jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton5.TabConstraints.tabTitle"), jToggleButton5); // NOI18N jToggleButton1.setText(bundle.getString("NewJInternalFrame.jToggleButton1.text")); // NOI18N jToggleButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jToggleButton1ActionPerformed(evt); } }); jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton1.TabConstraints.tabTitle"), jToggleButton1); // NOI18N jToggleButton8.setText(bundle.getString("NewJInternalFrame.jToggleButton8.text")); // NOI18N jTabbedPane1.addTab(bundle.getString("NewJInternalFrame.jToggleButton8.TabConstraints.tabTitle"), jToggleButton8); // NOI18N jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); // NOI18N jLabel3.setText(bundle.getString("NewJInternalFrame.jLabel3.text")); // NOI18N jLabel3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel3MouseClicked(evt); } }); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jLabel1.setText(bundle.getString("NewJInternalFrame.jLabel1.text")); // NOI18N jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel1MouseClicked(evt); } }); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText(bundle.getString("NewJInternalFrame.jTextPane3.text")); // NOI18N jTextPane3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextPane3MouseClicked(evt); } }); jScrollPane8.setViewportView(jTextPane3); jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText(bundle.getString("NewJInternalFrame.jTextPane5.text")); // NOI18N jTextPane5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jTextPane5MouseClicked(evt); } }); jScrollPane10.setViewportView(jTextPane5); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 367, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(268, Short.MAX_VALUE)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 453, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(10, 10, 10) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 404, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); jScrollPane1.setViewportView(jPanel3); jLabel7.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-menu-26.png")); // NOI18N jLabel7.setText(bundle.getString("NewJInternalFrame.jLabel7.text")); // NOI18N jLabel7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel7MouseClicked(evt); } }); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); // NOI18N jLabel25.setText(bundle.getString("NewJInternalFrame.jLabel25.text")); // NOI18N jLabel25.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel25MouseClicked(evt); } }); jLabel26.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-star-50.png")); // NOI18N jLabel26.setText(bundle.getString("NewJInternalFrame.jLabel26.text")); // NOI18N jLabel26.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel26MouseClicked(evt); } }); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); // NOI18N jLabel27.setText(bundle.getString("NewJInternalFrame.jLabel27.text")); // NOI18N jLabel27.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel27MouseClicked(evt); } }); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); // NOI18N jLabel28.setText(bundle.getString("NewJInternalFrame.jLabel28.text")); // NOI18N jLabel28.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel28MouseClicked(evt); } }); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); // NOI18N jLabel29.setText(bundle.getString("NewJInternalFrame.jLabel29.text")); // NOI18N jLabel29.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel29MouseClicked(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel25) .addGap(18, 18, 18) .addComponent(jLabel29) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 470, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))) ); getContentPane().add(jPanel2, "card2"); jLabel24.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel24.setText(bundle.getString("NewJInternalFrame.jLabel24.text")); // NOI18N jLabel24.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel24MouseClicked(evt); } }); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jLabel6.setText(bundle.getString("NewJInternalFrame.jLabel6.text")); // NOI18N jTextPane6.setFont(new java.awt.Font("Ubuntu", 1, 24)); // NOI18N jScrollPane11.setViewportView(jTextPane6); jScrollPane13.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane13.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); jTextPane7.setText(bundle.getString("NewJInternalFrame.jTextPane7.text")); // NOI18N jScrollPane13.setViewportView(jTextPane7); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 392, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); getContentPane().add(jPanel6, "card3"); jLabel12.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64.png")); // NOI18N jLabel12.setText(bundle.getString("NewJInternalFrame.jLabel12.text")); // NOI18N jLabel12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel12MouseClicked(evt); } }); jLabel13.setText(bundle.getString("NewJInternalFrame.jLabel13.text")); // NOI18N jLabel14.setText(bundle.getString("NewJInternalFrame.jLabel14.text")); // NOI18N jLabel15.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-around-the-globe-64.png")); // NOI18N jLabel15.setText(bundle.getString("NewJInternalFrame.jLabel15.text")); // NOI18N jLabel16.setText(bundle.getString("NewJInternalFrame.jLabel16.text")); // NOI18N jLabel17.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-dancing-64.png")); // NOI18N jLabel17.setText(bundle.getString("NewJInternalFrame.jLabel17.text")); // NOI18N jLabel18.setText(bundle.getString("NewJInternalFrame.jLabel18.text")); // NOI18N jLabel19.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-trophy-64.png")); // NOI18N jLabel19.setText(bundle.getString("NewJInternalFrame.jLabel19.text")); // NOI18N jLabel20.setText(bundle.getString("NewJInternalFrame.jLabel20.text")); // NOI18N javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16)) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(77, 77, 77) .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(48, 48, 48) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(77, 77, 77)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30) .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16) .addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGap(392, 392, 392)) ); getContentPane().add(jPanel4, "card5"); jPanel5.setBackground(java.awt.Color.white); jScrollPane7.setViewportView(jTextPane2); jLabel23.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel23.setText(bundle.getString("NewJInternalFrame.jLabel23.text")); // NOI18N jLabel23.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel23MouseClicked(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane7) .addGroup(jPanel5Layout.createSequentialGroup() .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 449, Short.MAX_VALUE)) ); jPanel5Layout.setVerticalGroup( jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(627, Short.MAX_VALUE)) ); getContentPane().add(jPanel5, "card6"); jPanel1.setBackground(java.awt.Color.white); jLabel8.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); // NOI18N jLabel8.setText(bundle.getString("NewJInternalFrame.jLabel8.text")); // NOI18N jLabel8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel8MouseClicked(evt); } }); jLabel9.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-star-50.png")); // NOI18N jLabel9.setText(bundle.getString("NewJInternalFrame.jLabel9.text")); // NOI18N jLabel9.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel9MouseClicked(evt); } }); jLabel10.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); // NOI18N jLabel10.setText(bundle.getString("NewJInternalFrame.jLabel10.text")); // NOI18N jLabel10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel10MouseClicked(evt); } }); jLabel11.setIcon(new javax.swing.ImageIcon("/home/sai/Pictures/2019/IMG_20190428_184750.jpg")); // NOI18N jLabel11.setText(bundle.getString("NewJInternalFrame.jLabel11.text")); // NOI18N jLabel22.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-help-64.png")); // NOI18N jLabel22.setText(bundle.getString("NewJInternalFrame.jLabel22.text")); // NOI18N jLabel22.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel22MouseClicked(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 168, Short.MAX_VALUE)) .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel22, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(315, Short.MAX_VALUE)) ); getContentPane().add(jPanel1, "card4"); jLabel2.setBackground(java.awt.Color.white); jLabel2.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-sad-40.png")); // NOI18N jLabel2.setText(bundle.getString("NewJInternalFrame.jLabel2.text")); // NOI18N jLabel30.setBackground(java.awt.Color.white); jLabel30.setText(bundle.getString("NewJInternalFrame.jLabel30.text")); // NOI18N jLabel31.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-left-64(2).png")); // NOI18N jLabel31.setText(bundle.getString("NewJInternalFrame.jLabel31.text")); // NOI18N jLabel31.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel31MouseClicked(evt); } }); jLabel32.setIcon(new javax.swing.ImageIcon("/home/sai/Pictures/index1.jpeg")); // NOI18N jLabel32.setText(bundle.getString("NewJInternalFrame.jLabel32.text")); // NOI18N javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addComponent(jLabel31) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jPanel10Layout.createSequentialGroup() .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(45, Short.MAX_VALUE)) ); jPanel10Layout.setVerticalGroup( jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel31, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 206, Short.MAX_VALUE)) ); getContentPane().add(jPanel10, "card7"); pack(); }// </editor-fold>//GEN-END:initComponents private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField3ActionPerformed private void jToggleButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton4ActionPerformed // TODO add your handling code here: jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton4.setBackground(java.awt.Color.red); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton7.setBackground(java.awt.Color.white); try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=800;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String a=rs.getString("NHeader"); //String b=rs.getString("NContent"); jTextPane5.setText(a); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=801;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String a=rs.getString("NHeader"); //String b=rs.getString("NContent"); jTextPane3.setText(a); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } }//GEN-LAST:event_jToggleButton4ActionPerformed private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel7MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel7MouseClicked private void jLabel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel8MouseClicked jPanel2.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jPanel1.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel8MouseClicked private void jLabel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel9MouseClicked jPanel4.setVisible(true); jPanel2.setVisible(false); jPanel1.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel9MouseClicked private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed // TODO add your handling code here: // jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal "); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/ROHITSHARMA.jpeg")); //jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); //jTextField2.setText("‘Nyay’ is diesel for Indian economy’s engine, says Rahul Gandhi "); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/RAHULGANDHI.jpeg")); //jTextField3.setText(" BJP's Jadavpur candidate meets Trinamool's Birbhum leader on polling day, fuels speculation "); //jLabel1.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/Birbhum.jpeg")); jToggleButton7.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton3.setBackground(java.awt.Color.red); jToggleButton4.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"); }//GEN-LAST:event_jToggleButton3ActionPerformed private void jLabel12MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel12MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel12MouseClicked private void jLabel22MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel22MouseClicked jTextPane2.setText("for any queries contact us at [email protected]"); jPanel5.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel22MouseClicked private void jLabel23MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel23MouseClicked jPanel1.setVisible(true); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false);// TODO add your handling code here: }//GEN-LAST:event_jLabel23MouseClicked private void jLabel24MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel24MouseClicked jPanel1.setVisible(false); jPanel2.setVisible(true); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel24MouseClicked private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jToggleButton1ActionPerformed private void jLabel25MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel25MouseClicked jPanel2.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel1.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel25MouseClicked private void jLabel26MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel26MouseClicked jPanel4.setVisible(true); jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jPanel2.setVisible(false); jPanel1.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); // TODO add your handling code here: }//GEN-LAST:event_jLabel26MouseClicked private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField5ActionPerformed private void jTextPane5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextPane5MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane5.getText(); String b="IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"; String c; c = "Does Exercise Help or Hurt Sleep?"; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); String d; d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); String d; d="Exercise is one of the best things you can do for your health. But how about for your sleep? It turns out, being active during the day can improve the sleep people get at night—with a few caveats. Learn more about the exercise-sleep relationship, including answers to these common questions.How does exercise influence sleeIndividuals who exercise regularly report better sleep than those who don’t, according to a National Sleep Foundation poll. Three-fourths of exercisers said their sleep quality was fairly good or very good over a two-week period, versus just over half or non-exercisers. Other research indicates that exercise increases total sleep time, delays REM sleep onset, and increases slow-wave sleep, all things that lead to greater sleep satisfaction.The reason for these sleep benefits is due in part to the fact that exercise increases the amount of adenosine in the body. Adenosine is a chemical that can cause drowsiness, increase body temperature, and improve circadian rhythm regulation, explains Shawn Youngstedt, PhD, a professor at Arizona State University. In addition, an increase in body temperature due to daytime exercise may lead to a decrease in body temperature at night, allowing people to experience deeper sleep cycles.\n" + "What time of day is best for exercise?For most people, the specific hour that they work out doesn’t matter—the main thing is that they make time to prioritize it. However, “in a minority of individuals, vigorous exercise ending two hours or closer to bedtime can have negative effects on sleep,” says Youngstedt. He adds that for strenuous exercise, the late afternoon might be the best time, allowing the body’s heart rate and other vital signs to return to normal before bed. For ongoing training (for a sporting event such as a race), morning might be preferable, if only to ensure you get the workout in before the day gets too busy.If you feel too amped up after exercising at night to sleep, try moving your workouts to earlier in the day. If night is the only time you have available to work out, you can also try a longer cool down and gentle stretching session after exercising. This will help let your body know it is time to wind down.Which type of exercise is best for sleep?In simplest terms, the best type of exercise is the type of exercise you enjoy enough to stick with it and make it a regular part of your routine. “Sleep-promoting effects have been found for both aerobic exercise and resistance exercise,” says Youngstedt. In other words, either spin class or lifting weights can help you sleep well, as long as you do it consistently.How much exercise do you need for better sleep?There is no magic number (and the amount will vary depending on factors such as age and fitness level), but it’s wise to aim for about 150 minutes of moderate-intensity aerobic exercise (such as brisk walking) every week, or about 30 minutes, five days a week. Alternately, you can aim for 75 minutes of vigorous exercise (running, cycling) each week, to get your heart rate pumping.If finding 30 minutes in your schedule seems impossible, know that it’s not just about the 30 minutes you spend in the gym that counts: Little things you do all day long can add up, from taking the stairs to walking instead of driving when you run local errands. Try to spend fewer minutes sitting during the day. The less sedentary you are, the better you’ll sleep at night"; jTextPane7.setText(d); } else { // jTextPane6.setText(a); //jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; //jTextPane7.setText(d); try{ Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/DH1","user","password"); Statement st=con.createStatement(); String q= "select * from NewsContent i where i.Nid=800;"; ResultSet rs=st.executeQuery(q); if(rs.next()){ String l=rs.getString("NHeader"); String s=rs.getString("NContent"); jTextPane6.setText(l); //jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); jTextPane7.setText(s); }} catch(ClassNotFoundException | SQLException e){ jLabel5.setText("Error while establishing connection"); System.out.println(e); } } }//GEN-LAST:event_jTextPane5MouseClicked private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane5.getText(); String b="IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"; String c; c = "Does Exercise Help or Hurt Sleep?"; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); String d; d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); String d; d="Exercise is one of the best things you can do for your health. But how about for your sleep? It turns out, being active during the day can improve the sleep people get at night—with a few caveats. Learn more about the exercise-sleep relationship, including answers to these common questions.How does exercise influence sleeIndividuals who exercise regularly report better sleep than those who don’t, according to a National Sleep Foundation poll. Three-fourths of exercisers said their sleep quality was fairly good or very good over a two-week period, versus just over half or non-exercisers. Other research indicates that exercise increases total sleep time, delays REM sleep onset, and increases slow-wave sleep, all things that lead to greater sleep satisfaction.The reason for these sleep benefits is due in part to the fact that exercise increases the amount of adenosine in the body. Adenosine is a chemical that can cause drowsiness, increase body temperature, and improve circadian rhythm regulation, explains Shawn Youngstedt, PhD, a professor at Arizona State University. In addition, an increase in body temperature due to daytime exercise may lead to a decrease in body temperature at night, allowing people to experience deeper sleep cycles.\n" + "What time of day is best for exercise?For most people, the specific hour that they work out doesn’t matter—the main thing is that they make time to prioritize it. However, “in a minority of individuals, vigorous exercise ending two hours or closer to bedtime can have negative effects on sleep,” says Youngstedt. He adds that for strenuous exercise, the late afternoon might be the best time, allowing the body’s heart rate and other vital signs to return to normal before bed. For ongoing training (for a sporting event such as a race), morning might be preferable, if only to ensure you get the workout in before the day gets too busy.If you feel too amped up after exercising at night to sleep, try moving your workouts to earlier in the day. If night is the only time you have available to work out, you can also try a longer cool down and gentle stretching session after exercising. This will help let your body know it is time to wind down.Which type of exercise is best for sleep?In simplest terms, the best type of exercise is the type of exercise you enjoy enough to stick with it and make it a regular part of your routine. “Sleep-promoting effects have been found for both aerobic exercise and resistance exercise,” says Youngstedt. In other words, either spin class or lifting weights can help you sleep well, as long as you do it consistently.How much exercise do you need for better sleep?There is no magic number (and the amount will vary depending on factors such as age and fitness level), but it’s wise to aim for about 150 minutes of moderate-intensity aerobic exercise (such as brisk walking) every week, or about 30 minutes, five days a week. Alternately, you can aim for 75 minutes of vigorous exercise (running, cycling) each week, to get your heart rate pumping.If finding 30 minutes in your schedule seems impossible, know that it’s not just about the 30 minutes you spend in the gym that counts: Little things you do all day long can add up, from taking the stairs to walking instead of driving when you run local errands. Try to spend fewer minutes sitting during the day. The less sedentary you are, the better you’ll sleep at night"; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SRILANKA.jpeg"))); String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; jTextPane7.setText(d); } }//GEN-LAST:event_jLabel1MouseClicked private void jToggleButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton6ActionPerformed // TODO add your handling code here: jToggleButton6.setBackground(java.awt.Color.white); jToggleButton6.setBackground(java.awt.Color.red); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton7.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ROHITSHARMA.jpeg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jToggleButton4.setBackground(java.awt.Color.white); jTextPane5.setText("IPL 2019: Rohit fined 15% of match fee for hitting stumps after dismissal"); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText("La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); }//GEN-LAST:event_jToggleButton6ActionPerformed private void jTextPane3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextPane3MouseClicked // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane3.getText(); String b="La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "; String c; c="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit "; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); String d; //d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; d=" 'We did nothing today on any level, from the first minute until the last'Zidane told reporters.A toothless and haggard Real Madrid slumped to a humiliating 10th Liga defeat of the season on Sunday as they lost 1-0 at struggling neighbours Rayo Vallecano, who began the weekend bottom of the standings but dominated the game.The only goal came when Adri Embarba sent Real goalkeeper Thibaut Courtois the wrong way with a penalty midway through the first half, giving Rayo a deserved lead after an ambitious start in front of the home crowd.The spot kick, given for a foul by Jesus Vallejo on Javi Guerra, was awarded following a VAR review after the referee had waved play on and Gareth Bale had narrowly failed to score as Madrid counter-attacked.Real later had a goal from Mariano ruled out for a clear offside, one of the rare occasions in the game in which Zinedine Zidane's side troubled the hosts, who looked far likelier to score again than concede a goal to Madrid's toothless attack.'We did nothing today on any level, from the first minute until the last,'Zidane told reporters.'Sometimes you are not able to score but today we didn't even create chances, we did nothing well. We have to all be angry with our performance. I am angry because we gave an awful image of ourselves.'Madrid are third in the standings on 65 points after 35 games, nine behind second-placed Atletico Madrid and 18 adrift of champions Barcelona, and look destined to finish third for the second season in a row.'Yes we can'Rayo moved above SD Huesca to 19th on 31 points and are still six away from escaping the relegation zone, but their supporters showed they believe they can still avoid the drop, chanting “Yes we can” when the final whistle blew.It was Rayo's first win over their illustrious neighbours since 1997, when Fabio Capello was in charge of Madrid.The build up to the game was dominated by Real's refusal to allow Rayo's top scorer Raul de Tomas, who is on loan from Zidane's side and prevented from facing his parent club due to a clause in his contract, to turn out for the home side.Real were also without their top scorer as Karim Benzema, who had netted 10 times in his last eight games, was missing with a hamstring injury, while captain Sergio Ramos was also out.\n" + "Madrid's attack was lead by the inexperienced Mariano and out-of-form Bale and, despite the huge gap in riches between the two sides, Rayo always looked in control and were well worthy of the victory.\n" + "'We didn't suffer much but that shouldn't take anything away from us,' said Rayo coach Paco Jemez, who had lost his previous eight games against Madrid in his previous spell with the club, including a harrowing 10-2 defeat in 2015.'We played a spectacular game in every aspect. I dreamt once that I would never beat Real Madrid in my entire life but now we have done it I can die happy.'"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); String d; d="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit | NULL | Two suspected militants were killed on Monday after they blew themselves up during a raid at their hideout by the Bangladesh’s elite anti-terrorism unit in Mohammadpur area in Dhaka, officials said.The Rapid Action Battalion (RAB) surrounded a single-storey tin-shed house in Mohammadpur’s Basila area, on the outskirts of Dhaka, following a tip off.The personnel of the elite anti-crime and anti-terrorism unit met with gunfire, followed by a powerful blast, they said.“We, overnight, laid a siege to the house. They [suspected militants] staged a blast early on Monday in which at least two of them were killed,” a RAB spokesman said.He said that those living in the neighbourhood were evacuated ahead of the raid.According to witnesses, the blast was so powerful that it shook the whole area. A fire also broke out following the blast and fire-fighters were called in to douse the blaze.RAB chief Benazir Ahmed said that at least two (suspected) militants have been killed in the blast.In a nationwide raids since then, the security forces have killed around 100 terrorists and detained several others."; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; String d="A 28-page formal response from Congress president Rahul Gandhi to a notice on a criminal contempt plea expressed “regret” for juxtaposing a political slogan ‘ Chowkidar chor hai’ with Supreme Court proceedings in a moment of euphoria, but there was no word of apology in it.He also said the Rafale deal was a 'tainted transaction' and a 'gross, brazen abuse of power' by the 'BJP government led by Prime Minister Narendra Modi'. He said it deserved to be investigated by a Joint Parliamentary Committee.He made his position clear a day before the court is to hear the Rafale review petitions along with this contempt plea. It is to be seen whether the hearing takes place on Tuesday as the government on Monday sought more time to respond to the review petitions.Mr. Gandhi’s counter-affidavit was identical to an earlier ‘explanation’ with regard to the contempt plea. It had also expressed “regret” without apologising. In his counter-affidavit, he reiterated that the comment was made with rhetorical flourish in the heat of campaigning."; jTextPane7.setText(d); } }//GEN-LAST:event_jTextPane3MouseClicked private void jLabel3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel3MouseClicked // TODO add your handling code here: // TODO add your handling code here: jPanel2.setVisible(false); jPanel6.setVisible(true); String a=jTextPane3.getText(); String b="La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "; String c; c="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit "; if(a.equals(b)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); String d; //d = "Rohit admitted to the Level 1 offence 2.2 of the IPLs code of conduct and accepted the sanction. Mumbai Indians skipper Rohit Sharma has been fined 15 percent of his match fee for hitting the stumps with his bat after his dismissal during their IPL match against Kolkata Knight Riders in Kolkata.Expressing his frustration after being given out leg before wicket, the batsman hit the stumps with his bat at the non-strikers end, violating the Indian Premier League’s code of conduct at the Eden Gardens Sunday night.Mumbai Indians lost the high-scoring match by 34-runs, helping the hosts snap a six-match losing streak.Rohit admitted to the Level 1 offence 2.2 of the IPL’s code of conduct and accepted the sanction.“Mr. Sharma admitted to the Level 1 offence 2.2 of the IPL’s Code of Conduct and accepted the sanction,” an IPL release said.With MI chasing an imposing target of 233 to win and ensure a play-offs berth, Rohit looked in good touch before misreading a Harry Gurney delivery which hit his back leg.While the umpire had no hesitation in ruling the batsman out, Rohit opted for DRS, which upheld the field official’s decision.Rohit was earlier fined ₹12 lakh for his team’s slow over-rate against Kings XI Punjab"; d=" 'We did nothing today on any level, from the first minute until the last'Zidane told reporters.A toothless and haggard Real Madrid slumped to a humiliating 10th Liga defeat of the season on Sunday as they lost 1-0 at struggling neighbours Rayo Vallecano, who began the weekend bottom of the standings but dominated the game.The only goal came when Adri Embarba sent Real goalkeeper Thibaut Courtois the wrong way with a penalty midway through the first half, giving Rayo a deserved lead after an ambitious start in front of the home crowd.The spot kick, given for a foul by Jesus Vallejo on Javi Guerra, was awarded following a VAR review after the referee had waved play on and Gareth Bale had narrowly failed to score as Madrid counter-attacked.Real later had a goal from Mariano ruled out for a clear offside, one of the rare occasions in the game in which Zinedine Zidane's side troubled the hosts, who looked far likelier to score again than concede a goal to Madrid's toothless attack.'We did nothing today on any level, from the first minute until the last,'Zidane told reporters.'Sometimes you are not able to score but today we didn't even create chances, we did nothing well. We have to all be angry with our performance. I am angry because we gave an awful image of ourselves.'Madrid are third in the standings on 65 points after 35 games, nine behind second-placed Atletico Madrid and 18 adrift of champions Barcelona, and look destined to finish third for the second season in a row.'Yes we can'Rayo moved above SD Huesca to 19th on 31 points and are still six away from escaping the relegation zone, but their supporters showed they believe they can still avoid the drop, chanting “Yes we can” when the final whistle blew.It was Rayo's first win over their illustrious neighbours since 1997, when Fabio Capello was in charge of Madrid.The build up to the game was dominated by Real's refusal to allow Rayo's top scorer Raul de Tomas, who is on loan from Zidane's side and prevented from facing his parent club due to a clause in his contract, to turn out for the home side.Real were also without their top scorer as Karim Benzema, who had netted 10 times in his last eight games, was missing with a hamstring injury, while captain Sergio Ramos was also out.\n" + "Madrid's attack was lead by the inexperienced Mariano and out-of-form Bale and, despite the huge gap in riches between the two sides, Rayo always looked in control and were well worthy of the victory.\n" + "'We didn't suffer much but that shouldn't take anything away from us,' said Rayo coach Paco Jemez, who had lost his previous eight games against Madrid in his previous spell with the club, including a harrowing 10-2 defeat in 2015.'We played a spectacular game in every aspect. I dreamt once that I would never beat Real Madrid in my entire life but now we have done it I can die happy.'"; jTextPane7.setText(d); } else if(a.equals(c)){ jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/VBK-MILITANTDEN-BANGLADESH-REUTERS.jpeg"))); String d; d="Two suspected militants blow themselves up during raid by Bangladesh’s anti-terrorism unit | NULL | Two suspected militants were killed on Monday after they blew themselves up during a raid at their hideout by the Bangladesh’s elite anti-terrorism unit in Mohammadpur area in Dhaka, officials said.The Rapid Action Battalion (RAB) surrounded a single-storey tin-shed house in Mohammadpur’s Basila area, on the outskirts of Dhaka, following a tip off.The personnel of the elite anti-crime and anti-terrorism unit met with gunfire, followed by a powerful blast, they said.“We, overnight, laid a siege to the house. They [suspected militants] staged a blast early on Monday in which at least two of them were killed,” a RAB spokesman said.He said that those living in the neighbourhood were evacuated ahead of the raid.According to witnesses, the blast was so powerful that it shook the whole area. A fire also broke out following the blast and fire-fighters were called in to douse the blaze.RAB chief Benazir Ahmed said that at least two (suspected) militants have been killed in the blast.In a nationwide raids since then, the security forces have killed around 100 terrorists and detained several others."; jTextPane7.setText(d); } else { jTextPane6.setText(a); jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RAHULGANDHI.jpeg"))); //String d="Covering the face in a manner which prevents identification will be banned from today.A statement from the President’s Media Division on Sunday said covering of the face with veils, in a manner that prevents identification of a person, will be banned from Monday under emergency regulations.Meanwhile, the father and two brothers of Zahran Hashim, who is believed to have led the Easter attacks in Sri Lanka, were killed in Friday’s overnight gun battle between troops and suspects in the eastern Ampara district, the police said on Sunday.Hashim was earlier identified as one of the two suicide bombers who blew themselves up at Shangri-La Hotel in Colombo.Wife, daughter rescuedFurther, a woman and a four-year-old child, rescued from a safe house stormed in the search operation on Saturday, have been identified as the wife and daughter of Hashim, police sources told The Hindu."; String d="A 28-page formal response from Congress president Rahul Gandhi to a notice on a criminal contempt plea expressed “regret” for juxtaposing a political slogan ‘ Chowkidar chor hai’ with Supreme Court proceedings in a moment of euphoria, but there was no word of apology in it.He also said the Rafale deal was a 'tainted transaction' and a 'gross, brazen abuse of power' by the 'BJP government led by Prime Minister Narendra Modi'. He said it deserved to be investigated by a Joint Parliamentary Committee.He made his position clear a day before the court is to hear the Rafale review petitions along with this contempt plea. It is to be seen whether the hearing takes place on Tuesday as the government on Monday sought more time to respond to the review petitions.Mr. Gandhi’s counter-affidavit was identical to an earlier ‘explanation’ with regard to the contempt plea. It had also expressed “regret” without apologising. In his counter-affidavit, he reiterated that the comment was made with rhetorical flourish in the heat of campaigning."; jTextPane7.setText(d); } }//GEN-LAST:event_jLabel3MouseClicked private void jToggleButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton7ActionPerformed // TODO add your handling code here: jToggleButton7.setBackground(java.awt.Color.red); jToggleButton6.setBackground(java.awt.Color.white); jToggleButton3.setBackground(java.awt.Color.white); jToggleButton4.setBackground(java.awt.Color.white); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/step0005.jpg"))); // NOI18N jTextPane5.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane5.setText("Does Exercise Help or Hurt Sleep?"); jTextPane3.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N jTextPane3.setText("La Liga | Real Madrid sink to 10th league loss at hands of lowly Rayo Vallecano "); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SOCCER-SPAIN-RAY-MADTHNAK.jpeg"))); }//GEN-LAST:event_jToggleButton7ActionPerformed private void jLabel29MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel29MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64(1).png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel10.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel29MouseClicked private void jLabel27MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel27MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); }//GEN-LAST:event_jLabel27MouseClicked private void jLabel28MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel28MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50.png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100(1).png")); }//GEN-LAST:event_jLabel28MouseClicked private void jToggleButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jToggleButton4MouseClicked // TODO add your handling code here: }//GEN-LAST:event_jToggleButton4MouseClicked private void jLabel31MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel31MouseClicked // TODO add your handling code here: jLabel25.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-home-page-50(1).png")); jLabel29.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-show-64.png")); jLabel27.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-tv-64.png")); jLabel28.setIcon(new javax.swing.ImageIcon("/home/sai/Downloads/icons8-bell-100.png")); jPanel10.setVisible(false); jPanel1.setVisible(false); jPanel2.setVisible(true); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel31MouseClicked private void jLabel10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseClicked // TODO add your handling code here: jPanel10.setVisible(true); jPanel1.setVisible(false); jPanel2.setVisible(false); jPanel4.setVisible(false); jPanel5.setVisible(false); jPanel6.setVisible(false); }//GEN-LAST:event_jLabel10MouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables public javax.swing.JEditorPane jEditorPane1; public javax.swing.JLabel jLabel1; public javax.swing.JLabel jLabel10; public javax.swing.JLabel jLabel11; public javax.swing.JLabel jLabel12; public javax.swing.JLabel jLabel13; public javax.swing.JLabel jLabel14; public javax.swing.JLabel jLabel15; public javax.swing.JLabel jLabel16; public javax.swing.JLabel jLabel17; public javax.swing.JLabel jLabel18; public javax.swing.JLabel jLabel19; public javax.swing.JLabel jLabel2; public javax.swing.JLabel jLabel20; public javax.swing.JLabel jLabel21; public javax.swing.JLabel jLabel22; public javax.swing.JLabel jLabel23; public javax.swing.JLabel jLabel24; public javax.swing.JLabel jLabel25; public javax.swing.JLabel jLabel26; public javax.swing.JLabel jLabel27; public javax.swing.JLabel jLabel28; public javax.swing.JLabel jLabel29; public javax.swing.JLabel jLabel3; public javax.swing.JLabel jLabel30; public javax.swing.JLabel jLabel31; public javax.swing.JLabel jLabel32; public javax.swing.JLabel jLabel4; public javax.swing.JLabel jLabel5; public javax.swing.JLabel jLabel6; public javax.swing.JLabel jLabel7; public javax.swing.JLabel jLabel8; public javax.swing.JLabel jLabel9; public javax.swing.JMenu jMenu1; public javax.swing.JPanel jPanel1; public javax.swing.JPanel jPanel10; public javax.swing.JPanel jPanel2; public javax.swing.JPanel jPanel3; public javax.swing.JPanel jPanel4; public javax.swing.JPanel jPanel5; public javax.swing.JPanel jPanel6; public javax.swing.JPanel jPanel7; public javax.swing.JPanel jPanel8; public javax.swing.JPanel jPanel9; public javax.swing.JScrollPane jScrollPane1; public javax.swing.JScrollPane jScrollPane10; public javax.swing.JScrollPane jScrollPane11; public javax.swing.JScrollPane jScrollPane13; public javax.swing.JScrollPane jScrollPane3; public javax.swing.JScrollPane jScrollPane4; public javax.swing.JScrollPane jScrollPane5; public javax.swing.JScrollPane jScrollPane6; public javax.swing.JScrollPane jScrollPane7; public javax.swing.JScrollPane jScrollPane8; public javax.swing.JTabbedPane jTabbedPane1; public javax.swing.JTextArea jTextArea2; public javax.swing.JTextField jTextField1; public javax.swing.JTextField jTextField2; public javax.swing.JTextField jTextField3; public javax.swing.JTextField jTextField5; public javax.swing.JTextField jTextField6; public javax.swing.JTextPane jTextPane1; public javax.swing.JTextPane jTextPane2; public javax.swing.JTextPane jTextPane3; public javax.swing.JTextPane jTextPane5; public javax.swing.JTextPane jTextPane6; public javax.swing.JTextPane jTextPane7; public javax.swing.JToggleButton jToggleButton1; public javax.swing.JToggleButton jToggleButton3; public javax.swing.JToggleButton jToggleButton4; public javax.swing.JToggleButton jToggleButton5; public javax.swing.JToggleButton jToggleButton6; public javax.swing.JToggleButton jToggleButton7; public javax.swing.JToggleButton jToggleButton8; public javax.swing.JToggleButton jToggleButton9; public java.awt.TextArea textArea1; // End of variables declaration//GEN-END:variables
[ "" ]
91c3f2af06caa41186737cbbab219d5d4b145544
53f895ac58cb7c9e1e8976c235df9c4544e79d33
/18_Polymorphism (115- 123 in Section8)/com/source/polymorphism/D.java
65755f39c02a6d2c4d062eceb994f7918f06de60
[]
no_license
alagurajan/CoreJava
c336356b45cdbcdc88311efbba8f57503e050b66
be5a8c2a60aac072f777d8b0320e4c94a1266cb3
refs/heads/master
2021-01-11T01:33:11.447570
2016-12-16T22:24:58
2016-12-16T22:24:58
70,690,915
0
0
null
null
null
null
UTF-8
Java
false
false
121
java
package com.source.polymorphism; class D extends C { void test() { System.out.println("from D-test"); } }
9d09bb9e3a5c75dec2ecf3ad0d3f4410aaa05447
a1646e8ba2488f0fff0137eecc0306c1d880f5f4
/app/src/main/java/com/example/tvapp/activities/MainActivity.java
fce367f7960da54d4aab87765b95262424769d10
[]
no_license
Winhour/TVApp
ebf1da149ebc0135aadfd159c63a291d4b92e553
cec1c201a9e4b3f176a87ab7d3d8cd844a94456f
refs/heads/master
2023-04-04T04:17:34.977797
2021-04-08T09:49:53
2021-04-08T09:49:53
355,847,817
0
0
null
null
null
null
UTF-8
Java
false
false
4,462
java
package com.example.tvapp.activities; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.databinding.DataBindingUtil; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.example.tvapp.R; import com.example.tvapp.adapters.TVShowsAdapter; import com.example.tvapp.databinding.ActivityMainBinding; import com.example.tvapp.listeners.TVShowsListener; import com.example.tvapp.models.TVShow; import com.example.tvapp.viewmodels.MostPopularTVShowsViewModel; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity implements TVShowsListener { private ActivityMainBinding activityMainBinding; private MostPopularTVShowsViewModel viewModel; private List<TVShow> tvShows = new ArrayList<>(); private TVShowsAdapter tvShowsAdapter; private int currentPage = 1; private int totalAvailablePages = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main); doInitialization(); } private void doInitialization() { activityMainBinding.tvShowsRecyclerView.setHasFixedSize(true); viewModel = new ViewModelProvider(this).get(MostPopularTVShowsViewModel.class); tvShowsAdapter = new TVShowsAdapter(tvShows, this); activityMainBinding.tvShowsRecyclerView.setAdapter(tvShowsAdapter); activityMainBinding.tvShowsRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (!activityMainBinding.tvShowsRecyclerView.canScrollVertically(1)){ if (currentPage <= totalAvailablePages) { currentPage++; getMostPopularTVShows(); } } } }); activityMainBinding.imageWatchlist.setOnClickListener(view -> startActivity(new Intent(getApplicationContext(), WatchlistActivity.class))); activityMainBinding.imageSearch.setOnClickListener(view -> startActivity(new Intent(getApplicationContext(), SearchActivity.class))); getMostPopularTVShows(); } private void getMostPopularTVShows() { toggleLoading(); viewModel.getMostPopularTVShows(currentPage).observe(this, mostPopularTVShowsResponse ->{ toggleLoading(); if (mostPopularTVShowsResponse != null) { totalAvailablePages = mostPopularTVShowsResponse.getTotalPages(); if(mostPopularTVShowsResponse.getTvShows() != null) { int oldCount = tvShows.size(); tvShows.addAll(mostPopularTVShowsResponse.getTvShows()); tvShowsAdapter.notifyItemRangeInserted(oldCount, tvShows.size()); } } }); } private void toggleLoading() { if (currentPage == 1) { if (activityMainBinding.getIsLoading() != null && activityMainBinding.getIsLoading()) { activityMainBinding.setIsLoading(false); } else { activityMainBinding.setIsLoading(true); } } else { if (activityMainBinding.getIsLoadingMore() != null && activityMainBinding.getIsLoadingMore()) { activityMainBinding.setIsLoadingMore(false); } else { activityMainBinding.setIsLoadingMore(true); } } } @Override public void onTVShowClicked(TVShow tvShow) { Intent intent = new Intent (getApplicationContext(), TVShowDetailsActivity.class); /*intent.putExtra("id", tvShow.getId()); intent.putExtra("name", tvShow.getName()); intent.putExtra("startDate", tvShow.getStartDate()); intent.putExtra("country", tvShow.getCountry()); intent.putExtra("network", tvShow.getNetwork()); intent.putExtra("status", tvShow.getStatus());*/ intent.putExtra("tvShow", tvShow); startActivity(intent); } }
2af779dfc27eb5d2174641d6146807e2161b921e
51db985d221ee30b35f103adb07e3107426c33dc
/app/src/main/java/example/com/android_note/model/Note.java
09e7853de46a7ea806eebca329c7661062b1fc00
[]
no_license
andrei1994rus/Android_Note
5f879359cc6c7e814b8ebca2495904cf619d3ec0
9608ae63b08abbcba996f8634fccb1774a956adc
refs/heads/master
2020-04-19T18:33:09.665242
2020-01-29T17:26:50
2020-01-29T17:26:50
168,366,271
0
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
package example.com.android_note.model; import java.io.Serializable; /** * This class is used for work with information of every note. */ public class Note implements Serializable { /** * Date of creating/editing of note. */ private String date; /** * Identifier of note. */ private long id; /** * Path of image in note. */ private String imagePath; /** * Text of note. */ private String text; /** * Constructor of class Note. * * @param id * id of note. * * @param date * date of creating/updating note. * * @param text * text of note. * * @param imagePath * path of image in note. * */ public Note(long id, String date, String text, String imagePath) { this.id=id; this.date=date; this.text=text; this.imagePath=imagePath; } /** * Gets date. * * @return date of note's creating/updating. */ public String getDate() { return date; } /** * Gets identifier. * * @return id of note. * */ public long getID() { return id; } /** * Gets path of image. * * @return path of image in note. * */ public String getImagePath() { return imagePath; } /** * Gets text. * * @return text of note. * */ public String getText() { return text; } }
688aab9fdd3b8d9489174c7538e2f9e22429bfb6
1a3b0a73d52d029e709bfb1486fa1eb35c867a28
/src/java/Main/DeleteCommentServlet.java
ec92bd2fcf37a0c3a06d7175c5679fccfebc2c1e
[]
no_license
almontasser/LearnRemotely
d68834fad68d9070a1f84c7a3aea04bc482cb901
96913545d59e903c5036448eef32dd5d5cef38d9
refs/heads/main
2023-02-18T09:57:22.604537
2021-01-20T04:49:33
2021-01-20T04:49:33
323,308,077
0
0
null
null
null
null
UTF-8
Java
false
false
1,495
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 Main; import Main.Helpers.Auth; import Main.Helpers.DataAccess; import Main.Models.Comment; import Main.Models.Post; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Mahmoud */ @WebServlet(name = "DeleteComment", urlPatterns = {"/delete-comment"}) public class DeleteCommentServlet extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Integer id = Integer.parseInt(req.getParameter("id")); Comment comment = DataAccess.getCommentById(id); Integer postId = comment.getPostId(); Post post = DataAccess.getPostById(postId); if (!Auth.isAdmin(req, resp) && !Auth.isTeacher(req, resp) && !req.getSession().getAttribute("auth.id").equals(comment.getUserId())) { resp.sendRedirect("/"); return; } Main.Helpers.DataAccess.executeUpdate("DELETE FROM comments WHERE id='"+id+"';"); resp.sendRedirect("/subject?id=" + post.getSubjectId()); } }
8e52cbaec30ed0164f955f4d2ac7ed363462b655
ac93221d4f938ef525c75a0936ef99ab1ff545f2
/lib/src/main/java/plainbus/Listener.java
8721b29fd037a291226e1203204ada4897343792
[]
no_license
KidNox/plainbus
c16bc74bcaff30aecbe70dd5ff95144b6713c80a
b3ca854e60bfce1494eb443ea0f25373f0718433
refs/heads/master
2021-04-28T18:40:30.442325
2018-03-09T10:25:23
2018-03-09T10:25:23
121,878,662
0
0
null
null
null
null
UTF-8
Java
false
false
298
java
package plainbus; public interface Listener<Event> { void onEvent(Event event); static void reject() { throw new Rejection(); } class Rejection extends RuntimeException { @Override public Throwable fillInStackTrace() { return null; } } }
2bb1bbf324868fc16acfe4825294660c8ca8f0ca
b44c72e97af3180df9b779d5a62a8018a138f3ff
/app/src/main/java/com/openwebsolutions/propertybricks/ForgetPassword_Page/ForgetPasswordActivity.java
e9f8a3bca06c9ed5d9e90ad9d860b7b6af2779cd
[]
no_license
mou2706/PropertyBricks
54aacc0de9c23b803b11eac8b4ade6cfe9c786ed
bc08d36e4f6c82238e2505b49f8a060310f6c5a1
refs/heads/master
2023-03-31T12:02:36.634191
2021-04-03T08:49:36
2021-04-03T08:49:36
354,238,733
0
0
null
null
null
null
UTF-8
Java
false
false
6,636
java
package com.openwebsolutions.propertybricks.ForgetPassword_Page; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.github.ybq.android.spinkit.style.ThreeBounce; import com.openwebsolutions.propertybricks.Api.MainApplication; import com.openwebsolutions.propertybricks.Model.Forget_Password.ForgetPassword; import com.openwebsolutions.propertybricks.R; import es.dmoral.toasty.Toasty; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class ForgetPasswordActivity extends AppCompatActivity implements View.OnClickListener { ImageView iv_forget_back; EditText et_email_check; TextView tv_continue; RelativeLayout rel_forgot_password; String emailPattern = "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+"; String email=null; ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_forget_password); init(); } private void init() { iv_forget_back=findViewById(R.id.iv_forget_back); et_email_check=findViewById(R.id.et_email_check); tv_continue=findViewById(R.id.tv_continue); rel_forgot_password=findViewById(R.id.rel_forgot_password); iv_forget_back.setOnClickListener(this); tv_continue.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.iv_forget_back: super.onBackPressed(); ForgetPasswordActivity.this.overridePendingTransition(R.anim.left_to_right, R.anim.right_to_left); break; case R.id.tv_continue: email=et_email_check.getText().toString(); if(valid()){ progressBar= (ProgressBar) findViewById(R.id.spin_kit2_forget); progressBar.setVisibility(View.VISIBLE); ThreeBounce threeBounce = new ThreeBounce(); progressBar.setIndeterminateDrawable(threeBounce); getForget_password(email); LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.custom_toast_container)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("Link send Successfully.. "); Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); toast.show(); // Toast.makeText(this,"Link send to your valid email address",Toast.LENGTH_SHORT).show(); rel_forgot_password.setVisibility(View.INVISIBLE); } break; } } private void getForget_password(String email) { ConnectivityManager conMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); if ( conMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState() == NetworkInfo.State.CONNECTED || conMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED ) { try{ MainApplication.apiManager.getforget_password(email, new Callback<ForgetPassword>() { @Override public void onResponse(Call<ForgetPassword> call, Response<ForgetPassword> response) { ForgetPassword responseUser = response.body(); // response.isSuccessful(); if (response.isSuccessful() && responseUser != null) { tv_continue.setVisibility(View.VISIBLE); progressBar.setVisibility(View.GONE); try { if (responseUser.getSuccess().equals(false)) { Toasty.error(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT, true).show(); } else { Toast.makeText(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT).show(); } et_email_check.setText(""); } catch (Exception e) { } } else{ Toasty.error(ForgetPasswordActivity.this, "" + responseUser.getMessage(), Toast.LENGTH_SHORT, true).show(); } } @Override public void onFailure(Call<ForgetPassword> call, Throwable t) { Toasty.error(getApplicationContext(), "Internal Error", Toast.LENGTH_SHORT, true).show(); } }); } catch (Exception e){ } } else { Toasty.error(ForgetPasswordActivity.this, "Please check internet connection", Toast.LENGTH_SHORT).show(); } } private boolean valid() { boolean isvalid=true; if(email.equalsIgnoreCase("")){ isvalid=false; Toasty.warning(getApplicationContext(), "Please Enter email address", Toast.LENGTH_SHORT, true).show(); return isvalid; } else if(!email.matches(emailPattern) ){ isvalid=false; Toasty.error(getApplicationContext(), "Please Enter valid email address", Toast.LENGTH_SHORT, true).show(); return isvalid; } return isvalid; } @Override public void onBackPressed() { super.onBackPressed(); ForgetPasswordActivity.this.overridePendingTransition(R.anim.left_to_right, R.anim.right_to_left); } }
6befa2b7b43cb6b309c1cef57c5acb4af60b7fa3
c120a7bcd77f4911a4a19ad14ef806cb86226e39
/bucketlist/src/main/java/com/example/bucket/demo/services/PersonServiceImpl.java
84dfba5954634bb6e52dfcb255e0182eda20b47b
[]
no_license
vjanosigergely/projects
f51a1fccceab78677bf4d6eab93b62fb7afedba8
55ad5d4751845470e2484c3c60a07c8ae0dbfc7c
refs/heads/master
2021-05-22T16:57:45.259197
2020-04-21T14:57:59
2020-04-21T14:57:59
253,012,475
0
0
null
null
null
null
UTF-8
Java
false
false
694
java
package com.example.bucket.demo.services; import com.example.bucket.demo.models.Person; import com.example.bucket.demo.repos.PersonRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class PersonServiceImpl implements PersonService { private PersonRepository personRepository; @Autowired public PersonServiceImpl(PersonRepository personRepository) { this.personRepository = personRepository; } @Override public void save(Person person) { personRepository.save(person); } @Override public Person findById(long id) { return personRepository.findById(id).orElse(null); } }
0d113c3db80e0397a276b2d5bc7f25d14a93fc07
66b630094446e0456033f2a06348f21ea17bd3e1
/src/main/java/tch/impl/UserServiceImpl.java
11289eb745c15735e97debb826a206d9ebca3a99
[]
no_license
FiseTch/anaylse
ccaa0d73135a18ba33517f96178d46a8a742cde4
40e92ab766a8a1dd83e58e51ffbf7d06ff613fea
refs/heads/master
2022-12-21T22:32:53.526537
2018-06-07T04:29:12
2018-06-07T04:29:12
124,012,351
2
0
null
2022-12-16T08:39:17
2018-03-06T03:04:02
Java
UTF-8
Java
false
false
3,186
java
package tch.impl; import java.util.List; import javax.annotation.Resource; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import tch.dao.UserMapper; import tch.model.User; import tch.service.IUserService; import tch.util.ConstantTch; /** * * * Copyright:tch * * @class: tch.impl * @Description: * * @version: v1.0.0 * @author: tongch * @date: 2018-04-05 * Modification History: * date Author Version Description *------------------------------------------------------------ * 2018-04-05 tongch v1.1.0 */ @Service("userService") @Scope("prototype") public class UserServiceImpl implements IUserService { private Log log = LogFactory.getLog(UserServiceImpl.class); @Resource//放在set方法也可以,不过需要考虑名称与属性类型的问题 private UserMapper userMapper; /* public UserMapper getUserMapper() { return userMapper; } @Autowired与resource的区别在于一个根据名称,一个根据属性类型 public void setUserMapper(UserMapper userMapper) { this.userMapper = userMapper; }*/ /** * 通过id查询用户 */ public User getUserById(String username) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); User user = new User(); user = userMapper.getUserByPrimaryKey(username); if (user != null) { log.info("user:" + user.toString()); return user; }else{ log.error("当前查询用户为空"); return ConstantTch.DEFAULT_USER; } } /** * 查询所有用户 */ public List<User> getAllUser() { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.getAll() ; } /** * 插入记录,不允许为空 */ public int insertUser(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.insert(user); } /** * 插入记录,允许为空(包括主键) */ public int insertUserSelective(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.insertSelective(user); } /** * 根据主键id 删除记录 */ public void deleteUserById(String username) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); userMapper.deleteByPrimaryKey(username); } /** * 根据主键id更新记录(其余属性不允许为空) */ public int updateUserById(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.updateByPrimaryKey(user); } /** * 根据主键id更新记录(其余属性允许为空) */ public int updateUserByIdSelective(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.updateByPrimaryKeySelective(user); } /** * 根据属性值查记录 */ public User getUserByAttr(User user) { log.info("执行"+Thread.currentThread().getStackTrace()[1].getMethodName()); return userMapper.getUserByAttr(user); } }
2458f3a4ad44835fbf8b0350148633349beefa16
4dcca2f0b3e2649ce000b1af139bb5833d307f87
/RobotSpring/src/main/java/com/voytovych/basic/impls/sony/SonyLeg.java
f0fbd9e14dcdedb35ef6c25fd140896d14ad04bb
[]
no_license
Voytovych/spring-basic-repository-014
e006b32f8a1d584859a5904f55090801daa44b76
fd010cbc5b53cbdf24e64ddafeda12ac912f659e
refs/heads/master
2021-01-20T20:45:20.196636
2016-07-21T10:44:51
2016-07-21T10:44:51
63,598,625
0
0
null
null
null
null
UTF-8
Java
false
false
198
java
package com.voytovych.basic.impls.sony; import com.voytovych.basic.interfaces.Leg; public class SonyLeg implements Leg { public void go(){ System.out.println("Go to Sony!"); } }
81190acf62de3b3f74e55e99b8e6822c9fd54373
28e6915a086ec5b5bbdb0008cac479fe98d1dc4e
/Android/UdacityProjects/QuizApp/app/src/main/java/com/example/android/quizapp/MainActivity.java
fdae67155d7137121dd620a6625ef750ed086425
[]
no_license
Humad/Project-Playground
38215c208025d22a6e8ec90d203b8937f0f29ba1
a6ccd01edee7f136dc6aa6be36519ad1b5d0bfee
refs/heads/master
2018-10-10T03:31:11.400971
2018-08-17T01:05:35
2018-08-17T01:05:35
94,341,886
0
0
null
null
null
null
UTF-8
Java
false
false
1,399
java
package com.example.android.quizapp; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.RadioButton; import android.widget.Toast; public class MainActivity extends AppCompatActivity { private int score; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); score = 0; setContentView(R.layout.activity_main); } public void submit(View view){ boolean isCorrect = ((CheckBox) findViewById(R.id.correct1)).isChecked() && ((CheckBox) findViewById(R.id.correct2)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById(R.id.correct3)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById(R.id.correct4)).isChecked(); updateScore(isCorrect); isCorrect = ((RadioButton) findViewById((R.id.correct5))).isChecked(); updateScore(isCorrect); Toast.makeText(this, "You scored " + score + " out of 4", Toast.LENGTH_SHORT).show(); score = 0; } private void updateScore(boolean correct){ if (correct){ score++; } } public void reset(View view){ score = 0; setContentView(R.layout.activity_main); } }