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
4fac82239560ba95ebffec2d9ef1bda6e979414a
af068fea8cca46d2e8eb099358cf7875e0cef97f
/wup_v1/src/TRom/EAPNTYPE.java
8366d0e546fc75cf3d0a21d8d61f2d9b6400498e
[]
no_license
G5t4r/WupSource
d2ff35dbc8e25bc1a0aaf52f577c8f995dc03fd8
0802e65d8bc75e04120e0aa8cfd7045184e0aaf5
refs/heads/master
2020-03-16T17:34:49.016000
2017-01-24T10:04:14
2017-01-24T10:04:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,477
java
// ********************************************************************** // This file was generated by a TAF parser! // TAF version 3.1.1.2 by WSRD Tencent. // Generated from `LoginQ.jce' // ********************************************************************** package TRom; public final class EAPNTYPE implements java.io.Serializable { private static EAPNTYPE[] __values = new EAPNTYPE[9]; private int __value; private String __T = new String(); public static final int _APN_UNKNOWN = 0; public static final EAPNTYPE APN_UNKNOWN = new EAPNTYPE(0,_APN_UNKNOWN,"APN_UNKNOWN"); public static final int _APN_CMWAP = 1; public static final EAPNTYPE APN_CMWAP = new EAPNTYPE(1,_APN_CMWAP,"APN_CMWAP"); public static final int _APN_CMNET = 2; public static final EAPNTYPE APN_CMNET = new EAPNTYPE(2,_APN_CMNET,"APN_CMNET"); public static final int _APN_UNWAP = 3; public static final EAPNTYPE APN_UNWAP = new EAPNTYPE(3,_APN_UNWAP,"APN_UNWAP"); public static final int _APN_UNNET = 4; public static final EAPNTYPE APN_UNNET = new EAPNTYPE(4,_APN_UNNET,"APN_UNNET"); public static final int _APN_CTWAP = 5; public static final EAPNTYPE APN_CTWAP = new EAPNTYPE(5,_APN_CTWAP,"APN_CTWAP"); public static final int _APN_CTNET = 6; public static final EAPNTYPE APN_CTNET = new EAPNTYPE(6,_APN_CTNET,"APN_CTNET"); public static final int _APN_3GWAP = 7; public static final EAPNTYPE APN_3GWAP = new EAPNTYPE(7,_APN_3GWAP,"APN_3GWAP"); public static final int _APN_3GNET = 8; public static final EAPNTYPE APN_3GNET = new EAPNTYPE(8,_APN_3GNET,"APN_3GNET"); public static EAPNTYPE convert(int val) { for(int __i = 0; __i < __values.length; ++__i) { if(__values[__i].value() == val) { return __values[__i]; } } assert false; return null; } public static EAPNTYPE convert(String val) { for(int __i = 0; __i < __values.length; ++__i) { if(__values[__i].toString().equals(val)) { return __values[__i]; } } assert false; return null; } public int value() { return __value; } public String toString() { return __T; } private EAPNTYPE(int index, int val, String s) { __T = s; __value = val; __values[index] = this; } }
[ "p_qingyuan@pacewear.cn" ]
p_qingyuan@pacewear.cn
0342ea6937b56af0d22ab12d7d7cc3bd6f9bc04a
ff2f0013cb4259a13b5adbbe779b041b6a57e57a
/Java101/code/Inheritance/Elephant.java
da61d73aabd4b6448d8eb828f505d25a274d74cf
[]
no_license
Nohclu/Talks
92d8042dad72b5f3f75da795416e312c0d541c25
bf422490c41195c98cc4619518c3f87e224c0b6c
refs/heads/master
2020-04-22T18:37:06.187000
2019-02-13T21:50:46
2019-02-13T21:50:46
170,583,080
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
public class Elephant extends Mammal{ int tusks = 2; boolean hasFangs = false; boolean hasClaws = false; public Elephant( String name) { super(name); } public static void main(String[] args) { Elephant myElephant = new Elephant("Dumbo"); myElephant.changeSpeed(10); } }
[ "connor.mulready2@mail.dcu.ie" ]
connor.mulready2@mail.dcu.ie
0ee68c55459d03b0279e5b170636443c4dd9d241
20c25242d073d81a0bbfb16576ac576fc415156b
/aulas0912a1720/src/main/java/br/com/cleydsonjr/dsp20191/aulas1316/ap/persistencia/ddl/AdicionaFKLotacaoCargo.java
df21b087f9ada94e065b42b9d55db385426570fb
[]
no_license
cleydsonjr/UFG_DSP_20191_201602487_cleydson_junior
626edd5e90e0f40fd7262468c2baa62188ce2424
8ff588ca752db838a6de6c0c01472484675fc1f8
refs/heads/master
2020-04-30T12:33:17.319000
2019-04-25T00:28:07
2019-04-25T00:28:07
176,829,637
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package br.com.cleydsonjr.dsp20191.aulas1316.ap.persistencia.ddl; import br.com.cleydsonjr.dsp20191.aulas1316.ap.persistencia.base.PersistenciaJdbc; public class AdicionaFKLotacaoCargo extends PersistenciaJdbc { public boolean alteraTabela() throws Exception { preparaPersistencia(); System.out.println("Adicionando FK lotacao -> cargo"); String sql = readSqlFile("/aulas1316/ddl/fk_lotacao_cargo.sql"); stmt.executeUpdate(sql); System.out.println("FK lotacao -> cargo adicionada com sucesso!"); //STEP 4: Clean-up environment stmt.close(); connection.close(); return true; } }
[ "cleydsonjr@gmail.com" ]
cleydsonjr@gmail.com
bf572af302f0a7e0c8d0bda8bd430e0bfd338acb
8d03752fcb1ddc44395028ca2f850f3edd6127bf
/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java
66da9fcb455b9397edd64c8fd6a3e995b1df515f
[ "MIT" ]
permissive
renfeihn/RuoYi
13ca46926cb264e16cdbaaa049450c3e9925f748
d4bd8c2005b696a9c727ee949e09ffa76deac20e
refs/heads/master
2020-03-31T08:47:58.015000
2018-10-08T12:13:13
2018-10-08T12:13:13
152,072,775
3
2
null
null
null
null
UTF-8
Java
false
false
2,453
java
package com.ruoyi.system.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.base.BaseEntity; /** * 岗位表 sys_post * * @author ruoyi */ public class SysPost extends BaseEntity { private static final long serialVersionUID = 1L; /** 岗位序号 */ @Excel(name = "岗位序号") private Long postId; /** 岗位编码 */ @Excel(name = "岗位编码") private String postCode; /** 岗位名称 */ @Excel(name = "岗位名称") private String postName; /** 岗位排序 */ @Excel(name = "岗位排序") private String postSort; /** 状态(0正常 1停用) */ @Excel(name = "状态") private String status; /** 用户是否存在此岗位标识 默认不存在 */ private boolean flag = false; public Long getPostId() { return postId; } public void setPostId(Long postId) { this.postId = postId; } public String getPostCode() { return postCode; } public void setPostCode(String postCode) { this.postCode = postCode; } public String getPostName() { return postName; } public void setPostName(String postName) { this.postName = postName; } public String getPostSort() { return postSort; } public void setPostSort(String postSort) { this.postSort = postSort; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public boolean isFlag() { return flag; } public void setFlag(boolean flag) { this.flag = flag; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("postId", getPostId()) .append("postCode", getPostCode()) .append("postName", getPostName()) .append("postSort", getPostSort()) .append("status", getStatus()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .toString(); } }
[ "renfei_hn@163.com" ]
renfei_hn@163.com
8f646a28c78c2727ea6a87342cdea653ea0675ed
d7c6508a4c656128941a6e480b0512e4dc1d8ebb
/DataBus/src/Visuals/HMI/instrument/DirectionIndicatingLight.java
ee55a87ab00f2ae7b9b3c59270b4a4c0d4d4e794
[]
no_license
RolandLevai/FJKKL
08c55c170dd2d3d997278b2b37c744d2c7c5cd00
90c107757d2fc1e0561c8ff790f5f826df287ba0
refs/heads/master
2021-01-11T05:52:05.548000
2016-11-03T21:02:11
2016-11-03T21:02:11
69,097,207
0
0
null
2016-10-05T18:16:19
2016-09-24T11:04:05
Java
UTF-8
Java
false
false
961
java
package Visuals.HMI.instrument; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; /** * Created by levair on 2016.10.12.. */ public class DirectionIndicatingLight extends JPanel { private Color lastColor = Color.YELLOW; Timer timer; public DirectionIndicatingLight() { timer = new Timer(1000, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { //repaint(); } }); } public void on() { timer.start(); } public void off() { timer.stop(); } @Override public void paintComponent(Graphics g) { super.paintComponents(g); if(lastColor.equals(Color.YELLOW)) { lastColor = Color.WHITE; } else { lastColor = Color.YELLOW; } g.setColor(lastColor); g.fillOval(25, 25, 10, 10); } }
[ "rav34@live.com" ]
rav34@live.com
eb473247b8cd57d7241eb69e6aa5bac1c7ec3586
25e978504b69e2fce5d21de8f07e3523100b27ad
/app/src/main/java/com/example/yogi/gossipsbolo/ChatRoom/manager/operation/UserLoginOperation.java
014e384a27f6fa6f96623108c1da4f16d021a881
[]
no_license
ramkumartrk/GossipsBolo
1ca155741439d316e3ada509685b77e248b87b6c
04d36184bd9b462ce6c7e401a6f087858a554820
refs/heads/master
2021-01-19T13:05:46.388000
2017-02-18T05:43:31
2017-02-18T05:43:31
82,364,601
0
1
null
null
null
null
UTF-8
Java
false
false
2,226
java
package com.example.yogi.gossipsbolo.ChatRoom.manager.operation; import android.util.Log; import com.android.volley.Request; import com.example.yogi.gossipsbolo.ChatRoom.model.LoginResponse; import com.example.yogi.gossipsbolo.Config; import com.example.yogi.gossipsbolo.constant.URLConstant; import com.example.yogi.gossipsbolo.exception.GossipsBoloException; import com.example.yogi.gossipsbolo.manager.operation.WebServiceOperation; import java.util.Map; public class UserLoginOperation extends WebServiceOperation { private IUserLoginOperation iUserLoginOperation; public UserLoginOperation(Map<String, String> headers, String body, IUserLoginOperation listener) { super(URLConstant.USER_LOGIN_URI, Request.Method.POST,headers,body,LoginResponse.class,UserLoginOperation.class.getSimpleName()); this.iUserLoginOperation = listener; Log.d("check_gblogin","3.UserLoginOperation Constructor called"); } @Override public void addToRequestQueue() { Log.d("check_gblogin","4.addToRequestQueue called"); if(Config.HARDCODED_ENABLE) { Log.d("check_gblogin","4.1.Configuration.hardcore enabled=true"); onSuccess(getFromAssetsFolder("loginresponse.json",LoginResponse.class)); } else { Log.d("check_gblogin","hardcorenot enabled!!! addTorequestqueue called"); super.addToRequestQueue(); Log.d("check_gblogin","request successfully added"); } } @Override public void onError(GossipsBoloException exception) { Log.d("check_gblogin","i.userloginoperation.onError_entered"); iUserLoginOperation.onUserLoginError(exception); } @Override public void onSuccess(Object response) { Log.d("check_gblogin","5.(login.json,loginresponse.class)"); LoginResponse loginResponse = (LoginResponse) response; iUserLoginOperation.onUserLoginSuccess(loginResponse); Log.d("check_gblogin","onUserLoginsucces_userloginoperation"); } public interface IUserLoginOperation { void onUserLoginSuccess(LoginResponse loginResponse); void onUserLoginError(GossipsBoloException exception); } }
[ "Yogi" ]
Yogi
faf17d8a785305bd4601de21764e9dfba68b6c58
d386bc18729c841147404cd17106f3735f577242
/myjava/src/chapter12/section0201/BeepPrintExample1.java
bf133dd60afaee169935bbeabd3e12565afa51f1
[]
no_license
sebaek/java20180620
6232cf8c81e96abb76e8bcd33c6004229d4b93b0
704a81b0620b44fb5a056c7d4d7ab0d51f34e8f6
refs/heads/master
2020-03-21T01:42:19.562000
2018-07-13T05:14:17
2018-07-13T05:14:17
137,957,724
1
0
null
null
null
null
UTF-8
Java
false
false
543
java
package chapter12.section0201; public class BeepPrintExample1 { public static void main(String[] args) { for (int i = 0; i < 5; i++) { System.err.println("소리"); try { Thread.sleep(500); } catch (Exception e) { } } for (int i = 0; i < 5; i++) { System.out.println("띵"); try { Thread.sleep(500); } catch (Exception e) { } } } }
[ "choongang402@ca" ]
choongang402@ca
8d321ea19765f8491a2bd33029bcf9d2793ba7a8
53f6fe293c9c9f35612e9fcc63b7e446c45a42db
/rwge/src/com/dbylk/rwge/math/Angle.java
524ced1cd6c3da1b13d900254f571f6d1bc32896
[]
no_license
cnsuhao/RuneWordsGameEngine
e9b728b559e0d76cb43e93544fcda01e8c9db456
df2d6f6336881c1f455b793a040025011b573a91
refs/heads/master
2021-05-31T17:20:41.940000
2015-07-29T04:02:10
2015-07-29T04:02:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package com.dbylk.rwge.math; /** Euler Angle is ranged from 0 to 360. */ public class Angle { public float value; public Angle(float angle) { this.value = angle; } public Angle(Radian radian) { this.value = radian.value * 180f / (float) Math.PI; } /** * The Standard Euler angle is represented by a float range from 0 to 360. If the value is not * in this range, it will be transformed. */ public void correct() { if (value >= 360f) { int temp = (int) value; value -= temp; temp %= 360; value += temp; } else if (value < 0f) { int temp = (int) value; value -= temp; temp %= 360; value = value + temp + 360f; } } public static float getAngleValue(Radian radian) { return radian.value * 180f / (float) Math.PI; } public String toString() { return "Euler Angle: " + value; } }
[ "dbylk@hotmail.com" ]
dbylk@hotmail.com
2199d8e4ad9418f7eb5827f59265cf0d99a8f1d2
3b048f66060d647447d61a23a36931f1da062792
/Java/corejava(Java核心技术)/src/v1ch03/bigIntegerTest/BigIntegerTest.java
0975496722263af2920cb21f84a76ea7b4474fff
[]
no_license
rainyrun/practice
f5d68b11bb0e7fa870a7f4639851f8d6bd54a185
f49c3a1cadf04fbdb262c46219a8e276edefb07c
refs/heads/master
2021-03-01T15:01:13.500000
2020-03-08T04:14:22
2020-03-08T04:14:22
245,794,284
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package v1ch03.bigIntegerTest; import java.util.Scanner; import java.math.*; /** * 功能:对LotteryOdds的改进,可以使用大数值进行运算。如从 490 个可能的数值中抽取 60 个。 */ public class BigIntegerTest { public static void main(String[] args) { Scanner in = new Scanner(System.in); //询问从多少个数字中选 System.out.println("How many numbers you need?"); int nums = in.nextInt(); //中奖号码有多少个数字 System.out.println("How long the Lottery is?"); int len = in.nextInt(); //计算获奖概率(假设只有一个中奖号码) BigInteger lotteryOdds = BigInteger.valueOf(1); for(int i = 1; i <= len; i++) { lotteryOdds = lotteryOdds.multiply(BigInteger.valueOf(nums - i + 1)).divide(BigInteger.valueOf(i)); } System.out.println("Your odds is 1 in " + lotteryOdds); } }
[ "runlei123@126.com" ]
runlei123@126.com
7dd599e8bdb82a47bb63d037708fe0cf8cff03b3
a18808c881b7b45397a0f7cafbcaf03f8ea6a38b
/ElephantBike/src/com/xxn/servlet/BGetUnlockPass.java
55c99e017aed8f91a93374094fdcc1d23ff1e739
[]
no_license
xmuzhangshuai/ElephantBikeServer
fe6e65a7aa4342c6c1ce49997213a10e964b45ea
d35249ae1b9a99d5b79e7291cc0c75bef9c743ed
refs/heads/master
2021-01-23T21:03:50.201000
2016-07-22T09:04:37
2016-07-22T09:04:37
52,760,223
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
package com.xxn.servlet; 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; import com.xxn.butils.PassWordTool; /** * Servlet implementation class BGetUnlockPass */ @WebServlet("/bunlock") public class BGetUnlockPass extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public BGetUnlockPass() { super(); } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub 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 request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("UTF-8"); response.setContentType("text/html;Charset=UTF-8"); PrintWriter out = response.getWriter(); String bikeid = request.getParameter("bikeid"); String pass = PassWordTool.getUnlockPass(bikeid); out.print(pass); System.out.println("unlockpass:"+pass); } }
[ "Lee@Lee-PC" ]
Lee@Lee-PC
377cf0b06a3c5ccefb774e5aeefb667618f46988
7d05e603eef7728255bc60eaf244882ac5ffd22c
/easy-spring-practice/07-init-destroy-bean/src/main/java/cn/duktig/springframework/core/io/ResourceLoader.java
57f1b08d9f4f0e847b822b657379d634b8e0b8ba
[ "Apache-2.0" ]
permissive
duktig666/easy-spring
be620699c9044234ceef10cf64dfb0d8a53698ba
df973ae00b3b57447ef78c87bc521d434258ff39
refs/heads/main
2023-07-18T07:44:20.525000
2021-08-26T14:24:06
2021-08-26T14:24:06
399,673,002
2
0
null
null
null
null
UTF-8
Java
false
false
620
java
package cn.duktig.springframework.core.io; /** * description: 资源加载器 接口 * <p> * 按照资源加载的不同方式,资源加载器可以把这些方式集中到统一的类服务下进行处理,外部用户只需要传递资源地址即可,简化使用。 * * @author RenShiWei * Date: 2021/8/25 19:28 **/ public interface ResourceLoader { /** * 资源默认前缀: "classpath:" */ String CLASSPATH_URL_PREFIX = "classpath:"; /** * 获取资源 * * @param location 资源位置 * @return 资源 */ Resource getResource(String location); }
[ "1487660836@qq.com" ]
1487660836@qq.com
dff1fefce83114b1805274f32f4439d611f941a1
118d37c3645d75e5535b08e05dcf7b1901e039f6
/app/src/main/java/cn/kc/em/frag/common/FragmentFactory.java
32f02826ecefbcd79aaa393e1759f9c84a6ee763
[]
no_license
thankuandu/frag_and_bottom_navigation_pattern
0eaa463353a112bea1e6640411bcc9852e87422d
f6f284a7f9813a7ea07542f604caf2b8834fe2db
refs/heads/master
2020-04-08T07:24:41.642000
2018-11-26T09:22:18
2018-11-26T09:22:18
159,137,955
0
0
null
null
null
null
UTF-8
Java
false
false
2,867
java
package cn.kc.em.frag.common; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import java.util.LinkedList; import java.util.List; import cn.kc.em.MainActivity; import cn.kc.em.R; import cn.kc.em.frag.FirstFragment; import cn.kc.em.frag.FourthFragment; import cn.kc.em.frag.SecondFragment; import cn.kc.em.frag.ThirdFragment; /** * 作者: 张卓嘉 . * 日期: 2018/11/26 * 版本: V1.0 * 说明: */ public class FragmentFactory { private static LinkedList<String> NAMES = new LinkedList<String>() { { add(0, FirstFragment.class.getName()); add(1, SecondFragment.class.getName()); add(2, ThirdFragment.class.getName()); add(3, FourthFragment.class.getName()); } }; private static int showIndex = -1; public static void show(MainActivity context, String clzName) { FragmentManager supportFragmentManager = context.getSupportFragmentManager(); int currentIndex = NAMES.indexOf(clzName); if (currentIndex == showIndex) { return; } int enter = -1; int exit = -1; if (showIndex < currentIndex) { //如果上一个页面的下标小于要显示的页面下标,动画从左向右 enter = R.anim.enter_from_right; exit = R.anim.exit_to_left; } else if (showIndex > currentIndex) { //如果上一个页面的下标大于要显示的页面下标,动画从右向左 enter = R.anim.enter_from_left; exit = R.anim.exit_to_right; } //隐藏非目标fragment for (String name : NAMES) { Fragment f = supportFragmentManager.findFragmentByTag(name); if (!name.equalsIgnoreCase(clzName)) { if (f != null) supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).hide(f).commit(); } } //获取目标fragment Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(clzName); if (fragmentByTag == null) { try { fragmentByTag = (Fragment) Class.forName(clzName).newInstance(); supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).add(R.id.frame, fragmentByTag, clzName).commit(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } else { supportFragmentManager.beginTransaction().setCustomAnimations(enter, exit).show(fragmentByTag).commit(); } showIndex = NAMES.indexOf(clzName); } }
[ "zhangzhuojia2167@dingtalk.com" ]
zhangzhuojia2167@dingtalk.com
6cf12011eff5db635af7c0a8bfb0ceaf1e7df810
d1054e0dca688cae5f47bc0653afd31dd6778553
/chapter3/src/main/java/com/manning/pulsar/chapter3/consumers/BackAndForth.java
250ce076329017796e73a372c4d3cdbaa1905cc9
[]
no_license
chaitanyaphalak/pulsar-in-action
2576162be7ef1990cbafea61584b3f9d79dd9fa3
9ebe01d4a0ac7a485cca35c6bd9404f160d33583
refs/heads/master
2022-12-04T23:59:56.023000
2020-08-24T23:35:24
2020-08-24T23:35:24
298,701,823
1
0
null
2020-09-25T23:46:51
2020-09-25T23:46:50
null
UTF-8
Java
false
false
715
java
package com.manning.pulsar.chapter3.consumers; import org.apache.pulsar.client.api.Consumer; import org.apache.pulsar.client.api.PulsarClientException; import org.apache.pulsar.client.api.SubscriptionType; public class BackAndForth extends PulsarConsumerDemoBase { public static void main(String[] args) throws Exception { BackAndForth sl = new BackAndForth(); sl.startConsumer(); sl.startProducer(); } protected Consumer<byte[]> getConsumer() throws PulsarClientException { if (consumer == null) { consumer = getClient().newConsumer() .topic(topic) .subscriptionName(subscriptionName) .subscriptionType(SubscriptionType.Shared) .subscribe(); } return consumer; } }
[ "dkjerrumgaard@splunk.com" ]
dkjerrumgaard@splunk.com
4c22fdc4218a6c29848d8b886cb2036711cfb513
63153f5eb4e4ea4b57585bf170b53a53d29bda26
/src/com/personal/taskmanager/parseobjects/Task.java
2f58d5c1356be615f902b7f77965c5c00342b5d2
[]
no_license
og7593/TaskManager
4950dd55bebbf8d817abff01ea83d3aaa158f1a3
dd04ddfcaeb0357884ea5bfddd53b0cdaa72b0a8
refs/heads/master
2021-01-15T10:18:13.129000
2014-09-20T05:55:49
2014-09-20T05:55:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,100
java
package com.personal.taskmanager.parseobjects; import com.parse.ParseClassName; import com.parse.ParseObject; @ParseClassName("Task") public class Task extends ParseObject implements Comparable<Task> { public Task() { //Default Constructor } public String getAssignedTo() { return getString("assignedTo"); } public void setAssignedTo(String user) { put("assignedTo", user); } public String getName() { return getString("name"); } public void setTaskName(String name) { put("name", name); } public String getDescription() { return getString("description"); } public void setDescription(String description) { put("description", description); } //If true, task completed //If false, task in progress public boolean getCompleted() { return getBoolean("completed"); } public void setCompleted(boolean status) { put("completed", status); } public String getNotes() { return getString("notes"); } public void setNotes(String notes) { put("notes", notes); } public String getDueDate() { return getString ("dueDate"); } public void setDueDate(String dueDate) { put("dueDate", dueDate); } public String getProjectUID() { return getString("projectUID"); } public void setProjectUID(String projectUID) { put("projectUID", projectUID); } public String getStatus() { return getString("status"); } public void setStatus(String status) { put ("status", status); if (status.compareTo("Completed") == 0) { setCompleted(true); } else { setCompleted(false); } } public String getProjectAdmin() { return getString("projectAdmin"); } public void setProjectAdmin(String admin) { put ("projectAdmin", admin); } public String getProjectName() { return getString("projectName"); } public void setProjectName(String name) { put("projectName", name); } @Override public int compareTo(Task task) { return this.getName().compareTo(task.getName()); } }
[ "omidghomeshi@gmail.com" ]
omidghomeshi@gmail.com
954b65119e93fe1fb078e614a6f8b5d2dca73f75
2b1ea639059699312dfee28ed4a913ca70388bd9
/rx-dagger-android-base-views/src/test/java/com/broliveira/rx_dagger_base_fragment/ExampleUnitTest.java
55b76e085ff046b47f31a2c02e042c460f221655
[ "MIT" ]
permissive
bmoliveira/base-views-protocols
0adde24039d7de87edc0e32a2d226bb48f04a192
ffe1ac513fd895d114ab63cf2959da49f6530c39
refs/heads/master
2021-05-10T22:46:34.389000
2018-02-19T16:56:36
2018-02-19T16:56:36
118,266,113
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.broliveira.rx_dagger_base_fragment; 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); } }
[ "bm.oliveira.dev@gmail.com" ]
bm.oliveira.dev@gmail.com
8e310c09761638d96162bc98fb379a3f3236ae2f
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/guice/UserGroupMappingAWSSessionCredentialsProvider.java
b46b7ed98238253da1d1d84ab20233a481f6ca14
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500000
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
2,189
java
package com.amazon.ws.emr.hadoop.fs.guice; import com.amazon.ws.emr.hadoop.fs.identity.HadoopFileSystemOwner; import com.amazon.ws.emr.hadoop.fs.rolemapping.RoleMappings; import com.amazon.ws.emr.hadoop.fs.util.AWSSessionCredentialsProviderFactory; import com.amazonaws.auth.AWSSessionCredentials; import com.amazonaws.auth.AWSSessionCredentialsProvider; import java.io.IOException; import java.util.Optional; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UserGroupMappingAWSSessionCredentialsProvider implements AWSSessionCredentialsProvider { private static final Logger LOG = LoggerFactory.getLogger(UserGroupMappingAWSSessionCredentialsProvider.class); private final Optional<UserGroupInformation> ownerOptional; public UserGroupMappingAWSSessionCredentialsProvider() { UserGroupInformation currentUser = null; try { currentUser = UserGroupInformation.getCurrentUser(); } catch (IOException localIOException) {} ownerOptional = Optional.ofNullable(currentUser); } public AWSSessionCredentials getCredentials() { if (!ownerOptional.isPresent()) { return null; } UserGroupInformation ugi = (UserGroupInformation)ownerOptional.get(); LOG.debug("retrieving credentials for {}, short name {}", ugi, ugi.getShortUserName()); if ((UserGroupInformation.isSecurityEnabled()) && (ugi.getAuthenticationMethod() == UserGroupInformation.AuthenticationMethod.SIMPLE)) { return null; } AWSSessionCredentialsProvider sessionCredentialsProvider = AWSSessionCredentialsProviderFactory.getCredentialsProviderForRoleArn( RoleMappings.getRoleArnForFileSystemOwner(new HadoopFileSystemOwner(ugi))); if (sessionCredentialsProvider != null) { return sessionCredentialsProvider.getCredentials(); } return null; } public void refresh() {} } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.guice.UserGroupMappingAWSSessionCredentialsProvider * Java Class Version: 8 (52.0) * JD-Core Version: 0.7.1 */
[ "Arwin.tio@adroll.com" ]
Arwin.tio@adroll.com
76aa1e60427e9ef118e2c608a9f76dc2cf553a7a
cd1a60b4ff0f1ec4665696cc5d60060110493922
/src/day20/PalindromeTest.java
d5ab9db1a7d98ac47064f2b7a4fdf2e0a6cc2a28
[]
no_license
Birnigar/AllProjects
c2edec42a965f560a254e43c89c41c62ceb2d624
fcb6a38f953ba0fc48a9dbc1b617ca975462c5e9
refs/heads/master
2021-01-14T04:32:34.331000
2020-05-05T02:28:52
2020-05-05T02:28:52
242,600,846
0
0
null
null
null
null
UTF-8
Java
false
false
619
java
package day20; public class PalindromeTest { public static void main(String[] args) { //level,kayak,elle,madam,aziza, String name="kayak"; System.out.println("name ="+name); String reversedName=""; for (int x =name.length()-1; x >=0 ; x--) { reversedName=reversedName+name.charAt(x); } System.out.println("reversedName ="+reversedName); if(name.equalsIgnoreCase(reversedName)){ System.out.println("PALINDROME TEST HAS PASSED"); }else{ System.out.println("PALINDROME TEST HAS PASSED"); } } }
[ "farukgalatasaray34@gmail.com" ]
farukgalatasaray34@gmail.com
60e7bc7e0f80a085408c81507115f0eb3af52bb9
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_10084.java
e2a12b29df2c945eb8c1c6e6b589d8acb2730843
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606000
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
13,844
java
/** * Gets the user points with the specified user id, page number and page size. * @param userId the specified user id * @param currentPageNum the specified page number * @param pageSize the specified page size * @return result json object, for example, <pre>{ "paginationRecordCount": int, "rslts": java.util.List[{ Pointtransfer }, ....] } </pre> */ public JSONObject getUserPoints(final String userId,final int currentPageNum,final int pageSize){ final Query query=new Query().addSort(Keys.OBJECT_ID,SortDirection.DESCENDING).setPage(currentPageNum,pageSize); final List<Filter> filters=new ArrayList<>(); filters.add(new PropertyFilter(Pointtransfer.FROM_ID,FilterOperator.EQUAL,userId)); filters.add(new PropertyFilter(Pointtransfer.TO_ID,FilterOperator.EQUAL,userId)); query.setFilter(new CompositeFilter(CompositeFilterOperator.OR,filters)); try { final JSONObject ret=pointtransferRepository.get(query); final JSONArray records=ret.optJSONArray(Keys.RESULTS); for (int i=0; i < records.length(); i++) { final JSONObject record=records.optJSONObject(i); record.put(Common.CREATE_TIME,new Date(record.optLong(Pointtransfer.TIME))); final String toId=record.optString(Pointtransfer.TO_ID); final String fromId=record.optString(Pointtransfer.FROM_ID); String typeStr=record.optString(Pointtransfer.TYPE); if (("3".equals(typeStr) && userId.equals(toId)) || ("5".equals(typeStr) && userId.equals(fromId)) || ("9".equals(typeStr) && userId.equals(toId)) || ("14".equals(typeStr) && userId.equals(toId)) || ("22".equals(typeStr) && userId.equals(toId)) || ("34".equals(typeStr) && userId.equals(toId))) { typeStr+="In"; } if (fromId.equals(userId)) { record.put(Common.BALANCE,record.optInt(Pointtransfer.FROM_BALANCE)); record.put(Common.OPERATION,"-"); } else { record.put(Common.BALANCE,record.optInt(Pointtransfer.TO_BALANCE)); record.put(Common.OPERATION,"+"); } record.put(Common.DISPLAY_TYPE,langPropsService.get("pointType" + typeStr + "Label")); final int type=record.optInt(Pointtransfer.TYPE); final String dataId=record.optString(Pointtransfer.DATA_ID); String desTemplate=langPropsService.get("pointType" + typeStr + "DesLabel"); switch (type) { case Pointtransfer.TRANSFER_TYPE_C_DATA_EXPORT: desTemplate=desTemplate.replace("{num}",record.optString(Pointtransfer.DATA_ID)); break; case Pointtransfer.TRANSFER_TYPE_C_INIT: desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM)); break; case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE: final JSONObject addArticle=articleRepository.get(dataId); if (null == addArticle) { desTemplate=langPropsService.get("removedLabel"); break; } final String addArticleLink="<a href=\"" + addArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",addArticleLink); break; case Pointtransfer.TRANSFER_TYPE_C_UPDATE_ARTICLE: final JSONObject updateArticle=articleRepository.get(dataId); if (null == updateArticle) { desTemplate=langPropsService.get("removedLabel"); break; } final String updateArticleLink="<a href=\"" + updateArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(updateArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",updateArticleLink); break; case Pointtransfer.TRANSFER_TYPE_C_ADD_COMMENT: final JSONObject comment=commentRepository.get(dataId); if (null == comment) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleId=comment.optString(Comment.COMMENT_ON_ARTICLE_ID); final JSONObject commentArticle=articleRepository.get(articleId); final String commentArticleLink="<a href=\"" + commentArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(commentArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",commentArticleLink); if ("3In".equals(typeStr)) { final JSONObject commenter=userRepository.get(fromId); final String commenterLink=UserExt.getUserLink(commenter); desTemplate=desTemplate.replace("{user}",commenterLink); } break; case Pointtransfer.TRANSFER_TYPE_C_UPDATE_COMMENT: final JSONObject comment32=commentRepository.get(dataId); if (null == comment32) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleId32=comment32.optString(Comment.COMMENT_ON_ARTICLE_ID); final JSONObject commentArticle32=articleRepository.get(articleId32); final String commentArticleLink32="<a href=\"" + commentArticle32.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(commentArticle32.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",commentArticleLink32); break; case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE_REWARD: final JSONObject addArticleReword=articleRepository.get(dataId); if (null == addArticleReword) { desTemplate=langPropsService.get("removedLabel"); break; } final String addArticleRewordLink="<a href=\"" + addArticleReword.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticleReword.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",addArticleRewordLink); break; case Pointtransfer.TRANSFER_TYPE_C_ARTICLE_REWARD: final JSONObject reward=rewardRepository.get(dataId); String senderId=reward.optString(Reward.SENDER_ID); if ("5In".equals(typeStr)) { senderId=toId; } final String rewardArticleId=reward.optString(Reward.DATA_ID); final JSONObject sender=userRepository.get(senderId); final String senderLink=UserExt.getUserLink(sender); desTemplate=desTemplate.replace("{user}",senderLink); final JSONObject articleReward=articleRepository.get(rewardArticleId); if (null == articleReward) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleRewardLink="<a href=\"" + articleReward.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(articleReward.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",articleRewardLink); break; case Pointtransfer.TRANSFER_TYPE_C_COMMENT_REWARD: final JSONObject reward14=rewardRepository.get(dataId); JSONObject user14; if ("14In".equals(typeStr)) { user14=userRepository.get(fromId); } else { user14=userRepository.get(toId); } final String userLink14=UserExt.getUserLink(user14); desTemplate=desTemplate.replace("{user}",userLink14); final String articleId14=reward14.optString(Reward.DATA_ID); final JSONObject article14=articleRepository.get(articleId14); if (null == article14) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleLink14="<a href=\"" + article14.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article14.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",articleLink14); break; case Pointtransfer.TRANSFER_TYPE_C_ARTICLE_THANK: final JSONObject thank22=rewardRepository.get(dataId); JSONObject user22; if ("22In".equals(typeStr)) { user22=userRepository.get(fromId); } else { user22=userRepository.get(toId); } final String articleId22=thank22.optString(Reward.DATA_ID); final JSONObject article22=articleRepository.get(articleId22); if (null == article22) { desTemplate=langPropsService.get("removedLabel"); break; } final String userLink22=UserExt.getUserLink(user22); desTemplate=desTemplate.replace("{user}",userLink22); final String articleLink22="<a href=\"" + article22.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article22.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",articleLink22); break; case Pointtransfer.TRANSFER_TYPE_C_INVITE_REGISTER: final JSONObject newUser=userRepository.get(dataId); final String newUserLink=UserExt.getUserLink(newUser); desTemplate=desTemplate.replace("{user}",newUserLink); break; case Pointtransfer.TRANSFER_TYPE_C_INVITED_REGISTER: final JSONObject referralUser=userRepository.get(dataId); final String referralUserLink=UserExt.getUserLink(referralUser); desTemplate=desTemplate.replace("{user}",referralUserLink); break; case Pointtransfer.TRANSFER_TYPE_C_INVITECODE_USED: final JSONObject newUser1=userRepository.get(dataId); final String newUserLink1=UserExt.getUserLink(newUser1); desTemplate=desTemplate.replace("{user}",newUserLink1); break; case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHECKIN: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_YESTERDAY_LIVENESS_REWARD: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_1A0001: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_1A0001_COLLECT: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHARACTER: case Pointtransfer.TRANSFER_TYPE_C_BUY_INVITECODE: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_EATINGSNAKE: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_EATINGSNAKE_COLLECT: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_GOBANG: case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_GOBANG_COLLECT: case Pointtransfer.TRANSFER_TYPE_C_REPORT_HANDLED: break; case Pointtransfer.TRANSFER_TYPE_C_AT_PARTICIPANTS: final JSONObject comment20=commentRepository.get(dataId); if (null == comment20) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleId20=comment20.optString(Comment.COMMENT_ON_ARTICLE_ID); final JSONObject atParticipantsArticle=articleRepository.get(articleId20); if (null == atParticipantsArticle) { desTemplate=langPropsService.get("removedLabel"); break; } final String ArticleLink20="<a href=\"" + atParticipantsArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(atParticipantsArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",ArticleLink20); break; case Pointtransfer.TRANSFER_TYPE_C_STICK_ARTICLE: final JSONObject stickArticle=articleRepository.get(dataId); if (null == stickArticle) { desTemplate=langPropsService.get("removedLabel"); break; } final String stickArticleLink="<a href=\"" + stickArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(stickArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",stickArticleLink); break; case Pointtransfer.TRANSFER_TYPE_C_ACCOUNT2ACCOUNT: JSONObject user9; if ("9In".equals(typeStr)) { user9=userRepository.get(fromId); } else { user9=userRepository.get(toId); } final String userLink=UserExt.getUserLink(user9); desTemplate=desTemplate.replace("{user}",userLink); final String memo=record.optString(Pointtransfer.MEMO); if (StringUtils.isNotBlank(memo)) { desTemplate=desTemplate.replace("{memo}",memo); } else { desTemplate=desTemplate.replace("{memo}",langPropsService.get("noMemoLabel")); } break; case Pointtransfer.TRANSFER_TYPE_C_ACTIVITY_CHECKIN_STREAK: desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM)); break; case Pointtransfer.TRANSFER_TYPE_C_CHARGE: final String yuan=dataId.split("-")[0]; desTemplate=desTemplate.replace("{yuan}",yuan); break; case Pointtransfer.TRANSFER_TYPE_C_EXCHANGE: final String exYuan=dataId; desTemplate=desTemplate.replace("{yuan}",exYuan); break; case Pointtransfer.TRANSFER_TYPE_C_ABUSE_DEDUCT: desTemplate=desTemplate.replace("{action}",dataId); desTemplate=desTemplate.replace("{point}",record.optString(Pointtransfer.SUM)); break; case Pointtransfer.TRANSFER_TYPE_C_ADD_ARTICLE_BROADCAST: final JSONObject addArticleBroadcast=articleRepository.get(dataId); if (null == addArticleBroadcast) { desTemplate=langPropsService.get("removedLabel"); break; } final String addArticleBroadcastLink="<a href=\"" + addArticleBroadcast.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(addArticleBroadcast.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",addArticleBroadcastLink); break; case Pointtransfer.TRANSFER_TYPE_C_PERFECT_ARTICLE: final JSONObject perfectArticle=articleRepository.get(dataId); if (null == perfectArticle) { desTemplate=langPropsService.get("removedLabel"); break; } final String perfectArticleLink="<a href=\"" + perfectArticle.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(perfectArticle.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",perfectArticleLink); break; case Pointtransfer.TRANSFER_TYPE_C_QNA_OFFER: final JSONObject reward34=rewardRepository.get(dataId); JSONObject user34; if ("34In".equals(typeStr)) { user34=userRepository.get(fromId); } else { user34=userRepository.get(toId); } final String userLink34=UserExt.getUserLink(user34); desTemplate=desTemplate.replace("{user}",userLink34); final String articleId34=reward34.optString(Reward.DATA_ID); final JSONObject article34=articleRepository.get(articleId34); if (null == article34) { desTemplate=langPropsService.get("removedLabel"); break; } final String articleLink34="<a href=\"" + article34.optString(Article.ARTICLE_PERMALINK) + "\">" + Escapes.escapeHTML(article34.optString(Article.ARTICLE_TITLE)) + "</a>"; desTemplate=desTemplate.replace("{article}",articleLink34); break; case Pointtransfer.TRANSFER_TYPE_C_CHANGE_USERNAME: final String oldName=dataId.split("-")[0]; final String newName=dataId.split("-")[1]; desTemplate=desTemplate.replace("{oldName}",oldName).replace("{newName}",newName); break; default : LOGGER.warn("Invalid point type [" + type + "]"); } desTemplate=Emotions.convert(desTemplate); record.put(Common.DESCRIPTION,desTemplate); } final int recordCnt=ret.optJSONObject(Pagination.PAGINATION).optInt(Pagination.PAGINATION_RECORD_COUNT); ret.remove(Pagination.PAGINATION); ret.put(Pagination.PAGINATION_RECORD_COUNT,recordCnt); return ret; } catch (final RepositoryException e) { LOGGER.log(Level.ERROR,"Gets user points failed",e); return null; } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
0db1a63e61069a52a5910006eba2a51a4269dc8e
23fbba09b810725f332453b5ee4cf95a0a0ca83e
/src/com/service/impl/UsersServiceImpl.java
096397ee4990dedf8997e5303c09613419fe3849
[]
no_license
swaggerduo/yongluocun1
f3545f1ba362f0b0257a807b8c70ee75550b89cd
800dad25f516ceb5249ddb74b2dbf4f13f793acb
refs/heads/master
2021-08-20T02:43:02.675000
2017-11-28T01:56:06
2017-11-28T01:56:06
111,492,404
0
0
null
null
null
null
GB18030
Java
false
false
1,820
java
package com.service.impl; import java.util.List; import com.dao.UsersDao; import com.dao.impl.UsersDaoDaoImpl; import com.entity.Favorite; import com.entity.Follower; import com.entity.User; import com.entity.Userinfo; import com.service.UsersService; import com.utils.BeFollower; import com.utils.UsersRanking; public class UsersServiceImpl implements UsersService { private UsersDao dao; public UsersServiceImpl() { dao = new UsersDaoDaoImpl(); } @Override //查询所有的用户 public List<UsersRanking> getUsersRanking() { try { return dao.getUsersRanking(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override //通过用户id获取此用户关注了谁 public List<Follower> getBeFollowerUserIdByuid(int uid) { try { return dao.getBeFollowerUserIdByuid(uid); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override //通过用户id获取此用户发表的帖子 public List<Favorite> getFavoritePostByuid(int uid) { try { return dao.getFavoritePostByuid(uid); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override //根据用户id在用户详细信息表中查到信息 public BeFollower getUserInfoByUid(Integer uid) { BeFollower beFollower; try { beFollower=dao.getUserInfoByUid(uid); return beFollower; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } @Override //根据用户id查到用户信息 public User getUserbyUid(int uid) { try { return dao.getgetUserbyUid(uid); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }
[ "s694911425d@qq.com" ]
s694911425d@qq.com
f02c5717ffa46ba50edcdf6a6f3417bd05e2b4bc
e31b8a00cecdbf2394c0e562691e5d253a329b58
/QuizApp.v3/app/src/main/java/com/tunahantuna/quizapp/dummy/DummyContent.java
0d0498da6f9cacca794b7056348e9f16a49c7c78
[]
no_license
etuna/quizapp
c11b2aa213b3ed6f49a266bb97066c85078102f0
9ebb8f11c1e671966f02887fe63737798ca6257b
refs/heads/master
2021-09-04T07:55:00.072000
2018-01-17T06:59:42
2018-01-17T06:59:42
117,797,679
0
0
null
null
null
null
UTF-8
Java
false
false
1,944
java
package com.tunahantuna.quizapp.dummy; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Helper class for providing sample content for user interfaces created by * Android template wizards. * <p> * TODO: Replace all uses of this class before publishing your app. */ public class DummyContent { /** * An array of sample (dummy) items. */ public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>(); /** * A map of sample (dummy) items, by ID. */ public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>(); private static final int COUNT = 25; static { // Add some sample items. for (int i = 1; i <= COUNT; i++) { addItem(createDummyItem(i)); } } private static void addItem(DummyItem item) { ITEMS.add(item); ITEM_MAP.put(item.id, item); } private static DummyItem createDummyItem(int position) { return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position)); } private static String makeDetails(int position) { StringBuilder builder = new StringBuilder(); builder.append("Details about Item: ").append(position); for (int i = 0; i < position; i++) { builder.append("\nMore details information here."); } return builder.toString(); } /** * A dummy item representing a piece of content. */ public static class DummyItem { public final String id; public final String content; public final String details; public DummyItem(String id, String content, String details) { this.id = id; this.content = content; this.details = details; } @Override public String toString() { return content; } } }
[ "etuna@ku.edu.tr" ]
etuna@ku.edu.tr
76a603e58477ac308bcba3a659d45e83037637a3
3ad8a22526ea6858ba354180ff72b5015d05b0e7
/wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/EntityConfigFieldValidator.java
58521fe16dfaf346e5aaee4a636463fdf8a28896
[ "Apache-2.0" ]
permissive
cobbzilla/cobbzilla-wizard
d4df7d3dc132798d5720f9f5fd5d79a5128f90ba
9792c0ac6d6a7cfde87c65a109cc239ab196f1f9
refs/heads/master
2022-12-23T04:54:07.878000
2020-12-11T15:46:15
2020-12-11T15:46:15
9,473,488
3
7
Apache-2.0
2018-10-23T17:11:53
2013-04-16T13:48:22
Java
UTF-8
Java
false
false
397
java
package org.cobbzilla.wizard.model.entityconfig; import org.cobbzilla.wizard.validation.ValidationResult; import org.cobbzilla.wizard.validation.Validator; import java.util.Locale; public interface EntityConfigFieldValidator { ValidationResult validate(Locale locale, Validator validator, EntityFieldConfig fieldConfig, Object value); Object toObject(Locale locale, String value); }
[ "jonathan@kyuss.org" ]
jonathan@kyuss.org
1c268e4099c0f503985075879bc3514f8d513f0f
0809f9319f6d4bcffb8953884185011d308184bc
/data-management/dm-integration-helper/src/main/java/com/infoclinika/mssharing/platform/model/impl/entities/InstrumentCreationRequestDefault.java
0a6a75487cd6f41f157366eca1ab6567dc4435bc
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
InfoClinika/chorus-opensource
5bd624796fc6d99b4b5ff1335a56670808108977
d0da23026aeaf3ac5c513b514224d537db98d551
refs/heads/master
2021-06-23T18:50:02.947000
2019-05-08T17:10:17
2019-05-08T17:10:17
115,448,491
1
3
Apache-2.0
2019-05-08T17:10:18
2017-12-26T19:15:15
Java
UTF-8
Java
false
false
342
java
package com.infoclinika.mssharing.platform.model.impl.entities; import com.infoclinika.mssharing.platform.entity.InstrumentCreationRequestTemplate; import javax.persistence.Entity; /** * @author Herman Zamula */ @Entity public class InstrumentCreationRequestDefault extends InstrumentCreationRequestTemplate<UserDefault, LabDefault> { }
[ "vladimir.moiseiev@teamdev.com" ]
vladimir.moiseiev@teamdev.com
71e9f2685ca7e2b4f7dc23b3caa7e9aa982c02a1
f4c7ffaf6d9bffb07486f33a30e73a4b1e4e26bf
/test/junitTests/SyndicateTest.java
dd0fe7115104bbac2ad49a3f97044a585046cc0a
[]
no_license
Samuel0c/SyndicateCalculator
ad414053f8008864e3b768e57111d0bbd660ef39
98f0e5c8e0f91f332677245ce764ca9f3bc6d078
refs/heads/master
2020-03-27T15:51:58.210000
2018-08-30T12:45:39
2018-08-30T12:45:39
82,948,656
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
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 junitTests; import fi.pageshare.simplesyndicatecalculator.logic.Product; import fi.pageshare.simplesyndicatecalculator.logic.Syndicate; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; public class SyndicateTest { private Syndicate syndicate; private Product stubProduct; private Product anotherStubProduct; // @Before // public void setUp() { // syndicate = new Syndicate(); // stubProduct = new Product("Photograph", 10.0); // anotherStubProduct = new Product("Book", 15.0); // } @Test public void addingMembersSuccessfullyToTheList() { syndicate.addMember(stubProduct); syndicate.addMember(anotherStubProduct); assertEquals(2, syndicate.getMembers().size()); } }
[ "sleppiniemi@protonmail.com" ]
sleppiniemi@protonmail.com
118bffcf49976c7a9270ccc193943b2e39da5327
578a66c0d1a4394ee084c2b89c670ba4952c912e
/app/src/main/java/jain/myapplication/model/TrainAvailability.java
1563af0a6da1dd14af7164e23c44b6735c1453b4
[]
no_license
harshj94/MyApplication2
42a3aa2dda50013fb7dbc01f8187e0c2c4fb964b
bdd9aafe48925cc59a743ed364641ea35c35d7fd
refs/heads/master
2020-09-16T10:02:46.439000
2016-09-03T07:24:07
2016-09-03T07:24:07
66,560,257
0
0
null
null
null
null
UTF-8
Java
false
false
2,646
java
package jain.myapplication.model; import java.util.Arrays; public class TrainAvailability { private To to; private String train_name; private Quota quota; private String error; private String failure_rate; private String response_code; private String train_number; private ClassType classType; private Last_updated last_updated; private From from; private Availability[] availability; public To getTo() { return to; } public void setTo(To to) { this.to = to; } public String getTrain_name() { return train_name; } public void setTrain_name(String train_name) { this.train_name = train_name; } public Quota getQuota() { return quota; } public void setQuota(Quota quota) { this.quota = quota; } public String getError() { return error; } public void setError(String error) { this.error = error; } public String getFailure_rate() { return failure_rate; } public void setFailure_rate(String failure_rate) { this.failure_rate = failure_rate; } public String getResponse_code() { return response_code; } public void setResponse_code(String response_code) { this.response_code = response_code; } public String getTrain_number() { return train_number; } public void setTrain_number(String train_number) { this.train_number = train_number; } public ClassType getClassType() { return classType; } public void setClasss(ClassType classType) { this.classType = classType; } public Last_updated getLast_updated() { return last_updated; } public void setLast_updated(Last_updated last_updated) { this.last_updated = last_updated; } public From getFrom() { return from; } public void setFrom(From from) { this.from = from; } public Availability[] getAvailability() { return availability; } public void setAvailability(Availability[] availability) { this.availability = availability; } @Override public String toString() { return "ClassPojo [to = " + to + ", train_name = " + train_name + ", quota = " + quota + ", error = " + error + ", failure_rate = " + failure_rate + ", response_code = " + response_code + ", train_number = " + train_number + ", class = " + classType + ", last_updated = " + last_updated + ", from = " + from + ", availability = " + Arrays.toString(availability) + "]"; } }
[ "harshkumarjain1994@gmail.com" ]
harshkumarjain1994@gmail.com
7ed5954101983ee98af844c27d39a229bd408cdd
62451f379cda397beea6f01fe4bdea0e771aa29b
/H. Games/src/fr/namu/hg/utils/ItemStackUtils.java
1beb3ee9ce080af9450ff8f97cc1d6b6a888f853
[]
no_license
namuuu/H.Games
588ebea11045bc90c6a005f114ec9cdc1857c4e0
649717e4671ba31f1c9ba72a5bff4ac919e57914
refs/heads/master
2022-12-07T16:44:36.838000
2020-08-23T15:13:28
2020-08-23T15:13:28
274,909,234
2
0
null
null
null
null
ISO-8859-1
Java
false
false
4,335
java
package fr.namu.hg.utils; import java.util.Arrays; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.inventory.meta.SkullMeta; import fr.namu.hg.MainHG; import net.minecraft.server.v1_8_R3.NBTTagCompound; public class ItemStackUtils { public ItemStackUtils(MainHG main) { } public ItemStack metaLeather(Material m, String ItemName, int Amount, Color color, String[] lore) { ItemStack item = new ItemStack(m, Amount); LeatherArmorMeta im = (LeatherArmorMeta)item.getItemMeta(); im.setDisplayName(ItemName); im.setColor(color); if(lore != null) im.setLore(Arrays.asList(lore)); item.setItemMeta((ItemMeta)im); return item; } public void setLeatherColored(Player p, Color color) { p.getInventory().setHelmet(metaLeather(Material.LEATHER_HELMET, "§eCasque en cuir", 1, color, null)); p.getInventory().setChestplate(metaLeather(Material.LEATHER_CHESTPLATE, "§ePlastron en cuir", 1, color, null)); p.getInventory().setLeggings(metaLeather(Material.LEATHER_LEGGINGS, "§eJambières en cuir", 1, color, null)); p.getInventory().setBoots(metaLeather(Material.LEATHER_BOOTS, "§eBottes en cuir", 1, color, null)); } public ItemStack metaLeatherFakeEnchanted(Material m, String ItemName, int Amount, Color color, String[] lore) { ItemStack item = new ItemStack(m, Amount); LeatherArmorMeta im = (LeatherArmorMeta)item.getItemMeta(); im.setDisplayName(ItemName); im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true)); im.addItemFlags(ItemFlag.HIDE_ENCHANTS); im.setColor(color); if(lore != null) im.setLore(Arrays.asList(lore)); item.setItemMeta((ItemMeta)im); return item; } public ItemStack metaExtraUnbreakable(Material m, String ItemName, int Amount, String[] lore) { ItemStack item = new ItemStack(m, Amount); ItemMeta im = item.getItemMeta(); im.setDisplayName(ItemName); im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true)); im.addItemFlags(ItemFlag.HIDE_ENCHANTS); im.spigot().setUnbreakable(true); if(lore != null) im.setLore(Arrays.asList(lore)); item.setItemMeta(im); return item; } public ItemStack metaExtra(Material m, String ItemName, int Amount, String[] lore) { ItemStack item = new ItemStack(m, Amount); ItemMeta im = item.getItemMeta(); im.setDisplayName(ItemName); if(lore != null) im.setLore(Arrays.asList(lore)); item.setItemMeta(im); return item; } public ItemStack metaExtraFakeEnchanted(Material m, String ItemName, int Amount, String[] lore) { ItemStack item = new ItemStack(m, Amount); ItemMeta im = item.getItemMeta(); im.addEnchant(Enchantment.DURABILITY, 1, Boolean.valueOf(true)); im.addItemFlags(ItemFlag.HIDE_ENCHANTS); im.setDisplayName(ItemName); if(lore != null) im.setLore(Arrays.asList(lore)); item.setItemMeta(im); return item; } public ItemStack skullMeta(String ItemName, String PlayerName) { ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short)3); SkullMeta skullMeta = (SkullMeta)skull.getItemMeta(); skullMeta.setOwner(PlayerName); skullMeta.setDisplayName(ItemName); skull.setItemMeta((ItemMeta)skullMeta); return skull; } //skullMeta("", "") public ItemStack metaVoid() { ItemStack voidItem = new ItemStack(Material.AIR, 1); return voidItem; } public static void removeAI(Entity entity) { net.minecraft.server.v1_8_R3.Entity nmsEnt = ((CraftEntity) entity).getHandle(); NBTTagCompound tag = nmsEnt.getNBTTag(); if (tag == null) { tag = new NBTTagCompound(); } nmsEnt.c(tag); tag.setInt("NoAI", 1); nmsEnt.f(tag); } }
[ "noreply@github.com" ]
namuuu.noreply@github.com
ea46769c5ca58a44afa5ea755d06da90f497304a
e034eadd636b4a43f6c7b97627af7d718dec58ff
/DSLEngineering/com.sap.furcas.metamodel/src/com/sap/furcas/metamodel/FURCAS/TCS/AndExp.java
273965e0d0cb1dd3d404f7ab0007cfaacc6b2a37
[]
no_license
FURCAS-dev/FURCAS
ed89b3152a56466fee04285fa02b09d3124adf8f
1f5651283f45666792b4747c5ce97128807761f1
refs/heads/master
2020-06-03T21:46:35.150000
2017-08-09T10:20:45
2017-08-09T10:20:45
1,083,639
2
3
null
null
null
null
UTF-8
Java
false
false
1,493
java
/** * <copyright> * </copyright> * * $Id$ */ package com.sap.furcas.metamodel.FURCAS.TCS; import org.eclipse.emf.common.util.EList; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>And Exp</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link com.sap.furcas.metamodel.FURCAS.TCS.AndExp#getExpressions <em>Expressions</em>}</li> * </ul> * </p> * * @see com.sap.furcas.metamodel.FURCAS.TCS.TCSPackage#getAndExp() * @model * @generated */ public interface AndExp extends Expression { /** * Returns the value of the '<em><b>Expressions</b></em>' containment reference list. * The list contents are of type {@link com.sap.furcas.metamodel.FURCAS.TCS.AtomExp}. * It is bidirectional and its opposite is '{@link com.sap.furcas.metamodel.FURCAS.TCS.AtomExp#getAndExp <em>And Exp</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Expressions</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Expressions</em>' containment reference list. * @see com.sap.furcas.metamodel.FURCAS.TCS.TCSPackage#getAndExp_Expressions() * @see com.sap.furcas.metamodel.FURCAS.TCS.AtomExp#getAndExp * @model opposite="andExp" containment="true" * @generated */ EList<AtomExp> getExpressions(); } // AndExp
[ "stephan@dev.static-void.de" ]
stephan@dev.static-void.de
3305d3c0e9af925f56501cfe0c521c6b985091a9
755deeebc4795ce3b4470b0f9c0754e7e04fe022
/impl/src/main/java/org/jboss/weld/interceptor/builder/MethodReference.java
179e8e3fda70a8af17753791c63e5ed4b1f246ec
[]
no_license
dmlloyd/core
c10d0fe3bcd085bf6ba7e7ddbea580d409b12037
7592558ad65d09a82a9be3526ff9989b40eb2183
refs/heads/master
2023-07-22T19:42:57.915000
2013-03-29T09:26:03
2013-03-29T09:46:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,363
java
/* * JBoss, Home of Professional Open Source * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * 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.jboss.weld.interceptor.builder; import java.io.Serializable; import java.lang.reflect.Method; import java.util.Arrays; import org.jboss.weld.interceptor.spi.metadata.MethodMetadata; /** * Wrapper for a method. Allows serializing references to methods. * * @author <a href="mailto:mariusb@redhat.com">Marius Bogoevici</a> */ public class MethodReference implements Serializable { private final String methodName; private final Class<?>[] parameterTypes; private final Class<?> declaringClass; public static MethodReference of(Method method, boolean withDeclaringClass) { return new MethodReference(method, withDeclaringClass); } public static MethodReference of(MethodMetadata method, boolean withDeclaringClass) { return new MethodReference(method.getJavaMethod(), withDeclaringClass); } private MethodReference(Method method, boolean withDeclaringClass) { this.methodName = method.getName(); this.parameterTypes = method.getParameterTypes(); if (withDeclaringClass) { this.declaringClass = method.getDeclaringClass(); } else { this.declaringClass = null; } } private MethodReference(String methodName, Class<?>[] parameterTypes, Class<?> declaringClass) { this.methodName = methodName; this.parameterTypes = parameterTypes; this.declaringClass = declaringClass; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MethodReference that = (MethodReference) o; if (declaringClass != null ? !declaringClass.equals(that.declaringClass) : that.declaringClass != null) return false; if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) return false; if (!Arrays.equals(parameterTypes, that.parameterTypes)) return false; return true; } public String getMethodName() { return methodName; } public Class<?>[] getParameterTypes() { return parameterTypes; } public Class<?> getDeclaringClass() { return declaringClass; } @Override public int hashCode() { int result = methodName != null ? methodName.hashCode() : 0; result = 31 * result + (parameterTypes != null ? Arrays.hashCode(parameterTypes) : 0); result = 31 * result + (declaringClass != null ? declaringClass.hashCode() : 0); return result; } }
[ "marko.luksa@gmail.com" ]
marko.luksa@gmail.com
b994c86baa459696bd0d0dabec139fe6a620eda3
c81011aab1a2c07946f0fbe96acd5bcff68b3c58
/src/org/Course.java
d502cfb25be99020e50c0547ab24dc49705c514c
[]
no_license
JavaK2/JavaConcept
6b0ddab5d8149597caaade39946d7ea82dc78dad
8ed0778b379dbac698f5611aa3215c1cf8477091
refs/heads/master
2021-01-17T17:21:31.252000
2016-11-05T06:06:16
2016-11-05T06:06:16
66,184,923
0
0
null
2016-08-21T06:40:05
2016-08-21T06:40:05
null
UTF-8
Java
false
false
556
java
package org; public class Course { private String jCourse = "Java"; private void privateCourse() { System.out.println("I am private " + jCourse); } public void publicCourse() { System.out.println("I am public " + jCourse); } public static void main(String[] args) { Course course = new Course(); System.out.println(course.jCourse);// Private variable can be access // with in same Class Object. course.privateCourse(); // Private method can be access with in same // Class Object. course.publicCourse(); } }
[ "kinshuk.ram@gmail.com" ]
kinshuk.ram@gmail.com
c49f34e8b9f9a642c9ce690849a6ed433b3ff1f7
2b3048a41ad801429504b0b2fc9e028d4f7e48ce
/main/java/com/example/gabri/tugasbesar2/Presenter/MyPresenter.java
6eccc311fa8d67a54c168a857275d838b436a0f8
[]
no_license
Bephometh/Tugas-Besar-2
fe1d2a22b8f5ee9ad5dc481be4987ef7b8b19fd6
18eaea7802aa4d59dc4038e72e628c7078d6b419
refs/heads/master
2020-04-06T17:39:56.787000
2018-12-08T13:51:06
2018-12-08T13:51:06
157,668,473
0
0
null
null
null
null
UTF-8
Java
false
false
1,899
java
package com.example.gabri.tugasbesar2.Presenter; import android.util.Log; import com.example.gabri.tugasbesar2.View.FragmentStart; import com.example.gabri.tugasbesar2.View.MainActivity; import com.example.gabri.tugasbesar2.Model.BolaMoveable; import com.example.gabri.tugasbesar2.Model.Hole; import com.example.gabri.tugasbesar2.Model.SensorReader; public class MyPresenter { public MainActivity activity; protected FragmentStart fragStart; protected SensorReader sensorReader; protected BolaMoveable moveable; protected Hole hole; public MyPresenter(MainActivity activity) { this.activity = activity; this.fragStart = this.fragStart.newInstance(activity); this.hole = new Hole(); this.moveable = new BolaMoveable(); this.sensorReader = new SensorReader(activity); } public void startSensor(){ this.sensorReader.start(); } public void stopSensor(){ this.sensorReader.stop(); } public void drawCircles(int height, int width){ this.hole.posistion(height,width); if(200 == this.holeX() &&100 == this.holeY()){ drawCircles(height, width); } else{ } } public void updateMoveable(int x, int y){ this.fragStart.drawMoveable(x,y); } public int moveableX(){return (int) this.moveable.getX();} public int moveableY(){return (int) this.moveable.getY();} public void setMoveableX(int x){ this.moveable.setX(x); } public void setMoveableY(int y){ this.moveable.setY(y); } public void setMoveable(int x, int y){ this.moveable.move(x,y); } public int holeX(){ return (int) this.hole.getX(); } public int holeY(){ return (int) this.hole.getY(); } }
[ "noreply@github.com" ]
Bephometh.noreply@github.com
5899d1f9da388f61582ec24baaf75e7150a81436
bbfdd75558763c3e4ee813a6b9b89cbda8ea5f29
/Sea-Life/src/main/java/com/revature/services/AnimalServiceImpl.java
b08de964bf9eb8b83b8f43c72a2887b45fa9a13e
[]
no_license
1810Oct29SPARK/sea-life-team
fbc79f0998e0ffcad38c39baa9fd477939708466
0aa97aa94c2390e04db2e452ff2a6112689f8727
refs/heads/master
2020-04-13T15:51:45.023000
2019-01-10T15:37:19
2019-01-10T15:37:19
163,304,149
0
1
null
null
null
null
UTF-8
Java
false
false
1,027
java
package com.revature.services; import java.util.List; import org.springframework.stereotype.Service; import com.revature.beans.Animal; import com.revature.dao.FakeSeaLifeDAOImpl; import com.revature.dao.SeaLifeDAO; @Service(value="aquaService") public class AnimalServiceImpl implements AquaService { private SeaLifeDAO ad = new FakeSeaLifeDAOImpl(); public AnimalServiceImpl() { } public List<Animal> allAnimals() { return ad.allAnimals(); } @Override public Animal getAnimalById(int id) { // TODO Auto-generated method stub return null; } @Override public Animal updateAnimal(Animal fish) { // TODO Auto-generated method stub return null; } @Override public void deleteAnimal(Animal fish) { // TODO Auto-generated method stub } @Override public void createAnimal(int id, String genus, String characteristics, String habitat, String species, String diet) { ad.createAnimals(id, genus, characteristics, habitat, species, diet); System.out.println("method override"); } }
[ "esteban.perez7391@hotmail.com" ]
esteban.perez7391@hotmail.com
13b99689647ca7a5ae59bbf53615c2b015703479
5a8712119b32671e505d1f5f4830d7e2d01b1125
/src/main/java/uz/almsoft/gateway/config/SecurityConfiguration.java
df818c4e7531803e61cea2653cf5df5d891df5ae
[]
no_license
anvar1/xb-gateway-application
7502d0808593155d889a12246c5728f0d86e2bc7
8a1b18974ddb25f8262f15a5de50629209dd77f8
refs/heads/master
2020-09-07T00:55:14.058000
2019-11-09T07:41:47
2019-11-09T07:41:47
220,608,533
0
0
null
2020-07-18T18:21:59
2019-11-09T07:41:33
TypeScript
UTF-8
Java
false
false
3,633
java
package uz.almsoft.gateway.config; import uz.almsoft.gateway.config.oauth2.OAuth2JwtAccessTokenConverter; import uz.almsoft.gateway.config.oauth2.OAuth2Properties; import uz.almsoft.gateway.security.oauth2.OAuth2SignatureVerifierClient; import uz.almsoft.gateway.security.AuthoritiesConstants; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter; import org.springframework.security.oauth2.provider.token.store.JwtTokenStore; import org.springframework.security.web.csrf.CookieCsrfTokenRepository; import org.springframework.security.web.csrf.CsrfFilter; import org.springframework.web.filter.CorsFilter; import org.springframework.web.client.RestTemplate; @Configuration @EnableResourceServer @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) public class SecurityConfiguration extends ResourceServerConfigurerAdapter { private final OAuth2Properties oAuth2Properties; private final CorsFilter corsFilter; public SecurityConfiguration(OAuth2Properties oAuth2Properties, CorsFilter corsFilter) { this.oAuth2Properties = oAuth2Properties; this.corsFilter = corsFilter; } @Override public void configure(HttpSecurity http) throws Exception { http .csrf() .ignoringAntMatchers("/h2-console/**") .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) .and() .addFilterBefore(corsFilter, CsrfFilter.class) .headers() .frameOptions() .disable() .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .authorizeRequests() .antMatchers("/api/**").authenticated() .antMatchers("/management/health").permitAll() .antMatchers("/management/info").permitAll() .antMatchers("/management/prometheus").permitAll() .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN); } @Bean public TokenStore tokenStore(JwtAccessTokenConverter jwtAccessTokenConverter) { return new JwtTokenStore(jwtAccessTokenConverter); } @Bean public JwtAccessTokenConverter jwtAccessTokenConverter(OAuth2SignatureVerifierClient signatureVerifierClient) { return new OAuth2JwtAccessTokenConverter(oAuth2Properties, signatureVerifierClient); } @Bean @Qualifier("loadBalancedRestTemplate") public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) { RestTemplate restTemplate = new RestTemplate(); customizer.customize(restTemplate); return restTemplate; } @Bean @Qualifier("vanillaRestTemplate") public RestTemplate vanillaRestTemplate() { return new RestTemplate(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
9156e9b72704dbf0766c2acc12729c8273cc5eba
9696f474d91d7d05a95af26228f4d08608546601
/app/src/main/java/com/example/blue/Menu2Activity5.java
b3604eefacfd15868022cf2b3e50d0f9bc8a5b64
[]
no_license
choar816/blockchain-ux-app
c9aa9fdbade5c8025cc1fa4fb999e8d0173c2aa8
c3ce767feaf59dfcd6eed3c4ab912a3203fb69bb
refs/heads/master
2023-07-25T01:22:24.496000
2021-09-07T14:17:47
2021-09-07T14:17:47
380,180,350
0
0
null
null
null
null
UTF-8
Java
false
false
5,912
java
package com.example.blue; import android.content.Intent; import android.graphics.Paint; import android.graphics.Typeface; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.RadioGroup; import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; public class Menu2Activity5 extends AppCompatActivity { int num_unchecked; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_menu2_5); RadioGroup groups[] = new RadioGroup[8]; groups[0] = (RadioGroup) findViewById(R.id.rg_501); groups[1] = (RadioGroup) findViewById(R.id.rg_502); groups[2] = (RadioGroup) findViewById(R.id.rg_503); groups[3] = (RadioGroup) findViewById(R.id.rg_504); groups[4] = (RadioGroup) findViewById(R.id.rg_505); groups[5] = (RadioGroup) findViewById(R.id.rg_506); groups[6] = (RadioGroup) findViewById(R.id.rg_507); groups[7] = (RadioGroup) findViewById(R.id.rg_508); // action bar 설정 (제목, 뒤로가기버튼) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle("체크리스트(5/6)"); Intent intent = getIntent(); Bundle bundle = intent.getExtras(); int[] answer1 = bundle.getIntArray("answer1"); int[] answer2 = bundle.getIntArray("answer2"); int[] answer3 = bundle.getIntArray("answer3"); int[] answer4 = bundle.getIntArray("answer4"); int answer[] = new int[8]; for (int i=0; i<answer.length; ++i) { answer[i] = -1; } CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox5); checkBox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (((CheckBox)v).isChecked()) { for (int i = 0; i < groups.length; ++i) { groups[i].check(groups[i].getChildAt(5).getId()); answer[i] = 5; } } else { for (int i = 0; i < groups.length; ++i) { if (groups[i].getCheckedRadioButtonId() == groups[i].getChildAt(5).getId()) { groups[i].clearCheck(); answer[i] = -1; } } } } }); TextView texts[] = new TextView[8]; texts[0] = (TextView) findViewById(R.id.question_501); texts[1] = (TextView) findViewById(R.id.question_502); texts[2] = (TextView) findViewById(R.id.question_503); texts[3] = (TextView) findViewById(R.id.question_504); texts[4] = (TextView) findViewById(R.id.question_505); texts[5] = (TextView) findViewById(R.id.question_506); texts[6] = (TextView) findViewById(R.id.question_507); texts[7] = (TextView) findViewById(R.id.question_508); for (int i=0; i<groups.length; ++i) { int finalI = i; groups[i].setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { int index = group.indexOfChild(group.findViewById(checkedId)); if (index == 5) { texts[finalI].setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.textOmitted)); } else { texts[finalI].setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.textOriginal)); if (checkBox.isChecked()) { checkBox.toggle(); } } answer[finalI] = index; } }); } // 이전, 다음 버튼 click event 처리 Button prev = (Button) findViewById(R.id.btn5_prev); Button next = (Button) findViewById(R.id.btn5_next); prev.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); next.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { num_unchecked = 0; for (int i=0; i<groups.length; ++i) { if (groups[i].getCheckedRadioButtonId() == -1) { ++num_unchecked; texts[i].setTypeface(null, Typeface.BOLD); } else { texts[i].setTypeface(null, Typeface.NORMAL); } } if (num_unchecked != 0) { Toast.makeText(getApplicationContext(), "모든 항목을 선택하세요", Toast.LENGTH_SHORT).show(); } else { Intent intent = new Intent(getApplicationContext(), Menu2Activity6.class); intent.putExtra("answer1", answer1); intent.putExtra("answer2", answer2); intent.putExtra("answer3", answer3); intent.putExtra("answer4", answer4); intent.putExtra("answer5", answer); startActivity(intent); } } }); } public boolean onOptionsItemSelected(MenuItem item){ switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); } }
[ "choar816@postech.ac.kr" ]
choar816@postech.ac.kr
4ec6d6207d0efc96b678f9b50d7bf355ee2895c7
5ddcbd4d620adaf155422d592defacd2a40d413f
/src/persistent/abstractclass/Wishlist.java
0f77465a762169cf3878794fac7a9e162f4230aa
[]
no_license
Isilin/PolyDiy-Manager
b74493945c614856e7d0b0f45165ff685175ad61
be7c611845dcae13b5f50fc8f5c4050c8897dfff
refs/heads/master
2021-01-17T13:47:59.631000
2016-04-11T02:18:12
2016-04-11T02:18:12
55,290,832
0
0
null
2016-04-02T11:18:25
2016-04-02T11:18:25
null
UTF-8
Java
false
false
1,530
java
package persistent.abstractclass; import java.util.HashMap; import java.util.Map; import common.exception.dev.NotFoundParameter; import persistent.common.InterfaceModel; /** * @author IsilinBN * */ public abstract class Wishlist implements InterfaceModel { protected int ID = -1; protected String label = ""; protected int userID = -1; protected Map<Integer, WishlistProduct> products = new HashMap<Integer, WishlistProduct>(); /** * @return the iD * @throws NotFoundParameter */ public int getID() throws NotFoundParameter { if(this.ID == -1) { throw new NotFoundParameter("ID", "Wishlist"); } return this.ID; } /** * @return the label */ public String getLabel() { return this.label; } /** * @return the userID * @throws NotFoundParameter */ public int getUserID() throws NotFoundParameter { if(this.userID == -1) { throw new NotFoundParameter("userID", "Wishlist"); } return this.userID; } /** * @return the products */ public Map<Integer, WishlistProduct> getProducts() { return this.products; } /** * @param iD the iD to set */ public void setID(int iD) { ID = iD; } /** * @param label the label to set */ public void setLabel(String label) { this.label = label; } /** * @param userID the userID to set */ public void setUserID(int userID) { this.userID = userID; } /** * @param products the products to set */ public void setProducts(Map<Integer, WishlistProduct> products) { this.products = products; } }
[ "casa2pir@hotmail.fr" ]
casa2pir@hotmail.fr
65ffa8bf2663e0df203bfebb0fc2dc3c2f0336d0
847f1fe609080d08f69cce5555c01f2e119a7c1e
/org.eclipse.ufacekit.ui.swing.databinding/src/main/java/org/eclipse/ufacekit/ui/swing/databinding/internal/swing/properties/JListSingleSelectionIndexProperty.java
3dbcea84bb2cfd0f9db116adda1dbd621fc888f1
[]
no_license
davidtechcloud/emfdatabinding-tutorial
dc2ebdb13e84c9f6e06a9e4774142e4e18dcbe0e
2ac547d271809364cccc0d63a925c6f0af6ed516
refs/heads/master
2021-05-27T07:36:46.769000
2011-06-10T08:19:19
2011-06-10T08:19:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,164
java
/******************************************************************************* * Copyright (c) 2008, 2009 Matthew Hall and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Matthew Hall - initial API and implementation (bug 194734) ******************************************************************************/ package org.eclipse.ufacekit.ui.swing.databinding.internal.swing.properties; import javax.swing.JList; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.EventType; import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.IDelegateRegistration; import org.eclipse.ufacekit.ui.swing.databinding.internal.swing.properties.WidgetValueProperty.WidgetListener.Delegate; /** * @since 3.3 * */ public class JListSingleSelectionIndexProperty extends WidgetIntValueProperty<JListSingleSelectionIndexProperty.SelectionTypes, JList> { public enum SelectionTypes implements EventType { Selection; public boolean isNone() { return false; } } /** * */ public JListSingleSelectionIndexProperty() { super(new SelectionTypes[] { SelectionTypes.Selection }); } int doGetIntValue(Object source) { return ((JList) source).getSelectedIndex(); } void doSetIntValue(Object source, int value) { ((JList) source).setSelectedIndex(value); } public String toString() { return "List.selectionIndex <int>"; //$NON-NLS-1$ } @Override protected IDelegateRegistration registerDelegate(final SelectionTypes type, final JList widget, final Delegate delegate) { final ListSelectionListener l = new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { delegate.handle(type, widget); } }; widget.addListSelectionListener(l); return new IDelegateRegistration() { public void dispose() { widget.removeListSelectionListener(l); } }; } }
[ "tom.schindl@bestsolution.at" ]
tom.schindl@bestsolution.at
0cb4f385a9ee63338c6f32ceeba60c5c18bb4efb
40a5a580864dea4b54d7a072bbdc039503081973
/app/src/main/java/com/QQzzyy/bookreader/Bean.java
6b09b6ba527546e32db2ca7724789f4f45aa805c
[]
no_license
jimodeniuren/BookReader
edda3a3e463d930c3e46fb1773f14a63d8b6feab
e3f0f83eeeb1ae85ff7951f6e198776dcd2a7f57
refs/heads/master
2020-08-28T21:01:44.836000
2019-10-27T07:18:33
2019-10-27T07:18:33
217,819,199
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.QQzzyy.bookreader; public class Bean{ private ranking ranking; private boolean ok; public boolean isOk() { return ok; } public void setOk(boolean ok) { this.ok = ok; } public com.QQzzyy.bookreader.ranking getRanking() { return ranking; } public void setRanking(com.QQzzyy.bookreader.ranking ranking) { this.ranking = ranking; } }
[ "634193463@qq.com" ]
634193463@qq.com
93039b652f4b4cc36c7c020815c98a9f222605a1
22361430ab12e5a7c1eba4664293fc4a39051d9b
/QMRServer/src/com/game/guild/handler/ReqGuildAddDiplomaticToServerHandler.java
07edc2e9828c66b2e12b75495a8ce8cd8875ecc2
[]
no_license
liuziangexit/QMR
ab93a66623e670a7f276683d94188d1b627db853
91ea3bd35ee3a1ebf994fb3fd6ffdbaa6fbf4d22
refs/heads/master
2020-03-30T00:22:31.028000
2017-12-20T05:41:17
2017-12-20T05:41:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
719
java
package com.game.guild.handler; import org.apache.log4j.Logger; import com.game.guild.message.ReqGuildAddDiplomaticToServerMessage; import com.game.command.Handler; import com.game.guild.manager.GuildServerManager; import com.game.player.structs.Player; public class ReqGuildAddDiplomaticToServerHandler extends Handler{ Logger log = Logger.getLogger(ReqGuildAddDiplomaticToServerHandler.class); public void action(){ try{ ReqGuildAddDiplomaticToServerMessage msg = (ReqGuildAddDiplomaticToServerMessage)this.getMessage(); GuildServerManager.getInstance().reqGuildAddDiplomaticToServer((Player)this.getParameter(), msg); }catch(ClassCastException e){ log.error(e); } } }
[ "ctl70000@163.com" ]
ctl70000@163.com
3abff1eb85e101b942a62e8761266e7b30345e98
8d5ce6ddbfa34e16cea11f7a5ec2fbc9db3a46df
/src/main/java/com/example/demo/controller/ProfileController.java
82e16a80a4f3c9a23d4a1f490234198c6163a514
[]
no_license
hhhhhyf/SD-Group8
39c45e50646f1331555479905b01f86e9d5335af
053df47555cf7c761735815b8e9495a81aed2efc
refs/heads/master
2023-04-05T12:18:43.994000
2020-07-10T05:33:39
2020-07-10T05:33:39
252,575,418
0
0
null
2023-03-23T20:38:36
2020-04-02T22:09:50
HTML
UTF-8
Java
false
false
354
java
package com.example.demo.controller; import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class ProfileController { @RequestMapping("/profile") public String index() { return "profile"; } }
[ "y.hu-73@sms.ed.ac.uk" ]
y.hu-73@sms.ed.ac.uk
af9195901f9e3c942455996ff352844a4b2d946c
0cb124460298bf95586009f3a539d63d00ec1e64
/app/src/main/java/com/amanb/aman/feedreader/NavigationDrawerFragment.java
616c31ca2764968b13f6be900edc4c9d9d74656b
[]
no_license
Aman-B/newsreader
906b72dbdd365cb08cb1204be04cec66898ecbf5
f418d190cfda0c54135ed3539ab68cd8fffdaf3e
refs/heads/master
2021-01-17T07:08:24.227000
2016-06-21T20:48:58
2016-06-21T20:48:58
48,260,997
0
0
null
null
null
null
UTF-8
Java
false
false
10,610
java
package com.amanb.aman.feedreader; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; /** * Fragment used for managing interactions for and presentation of a navigation drawer. * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction"> * design guidelines</a> for a complete explanation of the behaviors implemented here. */ public class NavigationDrawerFragment extends Fragment { /** * Remember the position of the selected item. */ private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position"; /** * Per the design guidelines, you should show the drawer on launch until the user manually * expands it. This shared preference tracks this. */ private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned"; /** * A pointer to the current callbacks instance (the Activity). */ private NavigationDrawerCallbacks mCallbacks; /** * Helper component that ties the action bar to the navigation drawer. */ private ActionBarDrawerToggle mDrawerToggle; private DrawerLayout mDrawerLayout; private ListView mDrawerListView; private View mFragmentContainerView; private int mCurrentSelectedPosition = 0; private boolean mFromSavedInstanceState; private boolean mUserLearnedDrawer; public NavigationDrawerFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Read in the flag indicating whether or not the user has demonstrated awareness of the // drawer. See PREF_USER_LEARNED_DRAWER for details. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity()); mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false); if (savedInstanceState != null) { mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION); mFromSavedInstanceState = true; } // Select either the default item (0) or the last selected item. selectItem(mCurrentSelectedPosition); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // Indicate that this fragment would like to influence the set of actions in the action bar. setHasOptionsMenu(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mDrawerListView = (ListView) inflater.inflate( R.layout.drawer_next, container, false); mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { selectItem(position); } }); mDrawerListView.setAdapter(new ArrayAdapter<String>( getActionBar().getThemedContext(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, new String[]{ getString(R.string.title_section1), getString(R.string.title_section2), getString(R.string.title_section3), })); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); return mDrawerListView; } public boolean isDrawerOpen() { return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(mFragmentContainerView); } /** * Users of this fragment must call this method to set up the navigation drawer interactions. * * @param fragmentId The android:id of this fragment in its activity's layout. * @param drawerLayout The DrawerLayout containing this fragment's UI. */ public void setUp(int fragmentId, DrawerLayout drawerLayout) { mFragmentContainerView = getActivity().findViewById(fragmentId); mDrawerLayout = drawerLayout; // set a custom shadow that overlays the main content when the drawer opens mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); // set up the drawer's list view with items and click listener ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); // ActionBarDrawerToggle ties together the the proper interactions // between the navigation drawer and the action bar app icon. mDrawerToggle = new ActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */ R.string.navigation_drawer_open, /* "open drawer" description for accessibility */ R.string.navigation_drawer_close /* "close drawer" description for accessibility */ ) { @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); if (!isAdded()) { return; } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } @Override public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (!isAdded()) { return; } if (!mUserLearnedDrawer) { // The user manually opened the drawer; store this flag to prevent auto-showing // the navigation drawer automatically in the future. mUserLearnedDrawer = true; SharedPreferences sp = PreferenceManager .getDefaultSharedPreferences(getActivity()); sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply(); } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } }; // If the user hasn't 'learned' about the drawer, open it to introduce them to the drawer, // per the navigation drawer design guidelines. if (!mUserLearnedDrawer && !mFromSavedInstanceState) { mDrawerLayout.openDrawer(mFragmentContainerView); } // Defer code dependent on restoration of previous instance state. mDrawerLayout.post(new Runnable() { @Override public void run() { mDrawerToggle.syncState(); } }); mDrawerLayout.setDrawerListener(mDrawerToggle); } private void selectItem(int position) { mCurrentSelectedPosition = position; if (mDrawerListView != null) { mDrawerListView.setItemChecked(position, true); } if (mDrawerLayout != null) { mDrawerLayout.closeDrawer(mFragmentContainerView); } if (mCallbacks != null) { mCallbacks.onNavigationDrawerItemSelected(position); } } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mCallbacks = (NavigationDrawerCallbacks) activity; } catch (ClassCastException e) { throw new ClassCastException("Activity must implement NavigationDrawerCallbacks."); } } @Override public void onDetach() { super.onDetach(); mCallbacks = null; } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_SELECTED_POSITION, mCurrentSelectedPosition); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Forward the new configuration the drawer toggle component. mDrawerToggle.onConfigurationChanged(newConfig); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // If the drawer is open, show the global app actions in the action bar. See also // showGlobalContextActionBar, which controls the top-left area of the action bar. if (mDrawerLayout != null && isDrawerOpen()) { inflater.inflate(R.menu.global, menu); showGlobalContextActionBar(); } super.onCreateOptionsMenu(menu, inflater); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } /*if (item.getItemId() == R.id.action_example) { Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show(); return true; }*/ return super.onOptionsItemSelected(item); } /** * Per the navigation drawer design guidelines, updates the action bar to show the global app * 'context', rather than just what's in the current screen. */ private void showGlobalContextActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.app_name); } private ActionBar getActionBar() { return getActivity().getActionBar(); } /** * Callbacks interface that all activities using this fragment must implement. */ public static interface NavigationDrawerCallbacks { /** * Called when an item in the navigation drawer is selected. */ void onNavigationDrawerItemSelected(int position); } }
[ "kingaman.bakshi4@gmail.com" ]
kingaman.bakshi4@gmail.com
9f21d87101e4b73430f469eeb1d73f44c8fa30e4
7e4a7ac03602c5a5828a5f312f7576f2c4089f93
/app/src/main/java/com/example/pspchaterbot/rest/Client.java
9f76efae0ab0a24d28fb4f644ad86e27b904595d
[]
no_license
AlejandroFnV/PSPChaterBot
cbf9c94bed5b0068a0a8dfa44b66e1148c75d45a
875a0fcf2599fa1abf09e3b598fb692a8037d123
refs/heads/master
2020-09-25T16:18:05.755000
2019-12-05T07:27:19
2019-12-05T07:27:19
226,041,863
0
0
null
null
null
null
UTF-8
Java
false
false
1,487
java
package com.example.pspchaterbot.rest; import android.util.Log; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class Client { public String postHttp(String src, String body) { StringBuffer buffer = new StringBuffer(); try { URL url = new URL(src); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setDoInput(true); connection.setDoOutput(true); connection.setRequestMethod("POST"); connection.setRequestProperty("Accept", "application/x-www-form-urlencoded"); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.connect(); OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); out.write(body); out.flush(); out.close(); BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { buffer.append(line + "\n"); } in.close(); } catch (IOException e) { Log.v("client", e.getMessage()); } return buffer.toString(); } }
[ "dam@iMac-de-Alejandro.local" ]
dam@iMac-de-Alejandro.local
372506909123fbd8ea7cae32d844394aa77b3128
de613719bbd26b5ded8e3f214d6599b7c3cf23ea
/spring9/src/main/java/com/coderzoe/demo4/Tenant.java
f8641832fc76bff2fc153257df54d2c9f6d45a04
[]
no_license
coderZoe/springlearn
d2b47ca09f26bb26a363572d3d008eb4472867d2
e657134f544109fb46a1eaec7bd761b5baf18dca
refs/heads/master
2022-10-06T22:31:04.575000
2020-06-07T12:55:07
2020-06-07T12:55:07
268,090,559
0
0
null
null
null
null
UTF-8
Java
false
false
273
java
package com.coderzoe.demo4; /** * @author yhs * @date 2020/6/5 12:24 * @description */ public class Tenant { public static void main(String[] args) { MyProxy myProxy = new MyProxy(); myProxy.setRent(new Landlord()); myProxy.rent(); } }
[ "coder_yin@qq.com" ]
coder_yin@qq.com
5949f165676becd25d232c66dd6e0abe168795f6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/19/19_5fb2f00edba1f1f7c2c7a63a283131ac855da05a/WebFeatureServiceLayerTest2/19_5fb2f00edba1f1f7c2c7a63a283131ac855da05a_WebFeatureServiceLayerTest2_s.java
55960d66c175c3d9cf7d37e3ff82decb7a336a89
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516000
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
4,749
java
package org.vaadin.vol.demo; import org.vaadin.vol.AbstractAutoPopulatedVectorLayer.BeforeFeatureSelectedEvent; import org.vaadin.vol.AbstractAutoPopulatedVectorLayer.BeforeFeatureSelectedListener; import org.vaadin.vol.OpenLayersMap; import org.vaadin.vol.OpenStreetMapLayer; import org.vaadin.vol.Style; import org.vaadin.vol.StyleMap; import org.vaadin.vol.WebFeatureServiceLayer; import com.vaadin.ui.Component; /** * Loads different feature types from a wfs use beforefeature select event * to show messages. * TODO - only the last added Listener catch the mouse clicks, seems to be a bug * in mouse click handling */ public class WebFeatureServiceLayerTest2 extends AbstractVOLTest { @Override public String getDescription() { return "Just another WFS example. Shows reclickable feature, and btw you can click on all layers :-D"; } private WebFeatureServiceLayer createWfsLayer(String displayName, String proxyUrl, String featureType) { WebFeatureServiceLayer wfsLayer = new WebFeatureServiceLayer(); wfsLayer.setDisplayName(displayName); wfsLayer.setUri(proxyUrl); wfsLayer.setFeatureType(featureType); wfsLayer.setFeatureNS("http://www.openplans.org/topp"); wfsLayer.setProjection("EPSG:4326"); wfsLayer.setSelectionCtrlId("1"); return wfsLayer; } private void setStyle(WebFeatureServiceLayer wfs, double opacity, String fillColor, String strokeColor, double pointRadius, double strokeWidth) { Style style = new Style(); style.extendCoreStyle("default"); style.setFillColor(fillColor); style.setStrokeColor(strokeColor); style.setStrokeWidth(strokeWidth); style.setPointRadius(pointRadius); style.setFillOpacity(opacity); StyleMap styleMap = new StyleMap(style); styleMap.setExtendDefault(true); wfs.setStyleMap(styleMap); } @Override Component getMap() { OpenLayersMap openLayersMap = new OpenLayersMap(); OpenStreetMapLayer osmLayer = new OpenStreetMapLayer(); osmLayer.setUrl("http://b.tile.openstreetmap.org/${z}/${x}/${y}.png"); osmLayer.setDisplayName("OSM"); String proxyUrl = getApplication().getURL() + "../WFSPROXY/demo.opengeo.org/geoserver/wfs"; WebFeatureServiceLayer wfsCities = createWfsLayer("Cities", proxyUrl, "tasmania_cities"); setStyle(wfsCities, 1, "yellow", "red", 4, 2); wfsCities.addListener(new BeforeFeatureSelectedListener() { public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) { showNotification("I'm a city"); return false; } }); final WebFeatureServiceLayer wfsRoads = createWfsLayer("Roads", proxyUrl, "tasmania_roads"); setStyle(wfsRoads, 1, "gray", "gray", 0, 4); // don't use beforeselected and selected listener at the same time to show massages wfsRoads.addListener(new BeforeFeatureSelectedListener() { public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) { Object typeName = event.getAttributes().get("TYPE"); showNotification("Before feature Selected: Road type: " + typeName); return false; } }); WebFeatureServiceLayer wfsBoundaries = createWfsLayer("Boundaries", proxyUrl, "tasmania_state_boundaries"); wfsBoundaries.addListener(new BeforeFeatureSelectedListener() { public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) { showNotification("No idea what I am :'-("); return false; } }); WebFeatureServiceLayer wfsWater = createWfsLayer("Water", proxyUrl, "tasmania_water_bodies"); setStyle(wfsWater, 0.5, "blue", "blue", 1, 2); wfsWater.addListener(new BeforeFeatureSelectedListener() { public boolean beforeFeatureSelected(BeforeFeatureSelectedEvent event) { showNotification("I am water :-D"); return false; } }); openLayersMap.addLayer(osmLayer); openLayersMap.addLayer(wfsCities); openLayersMap.addLayer(wfsRoads); openLayersMap.addLayer(wfsWater); openLayersMap.addLayer(wfsBoundaries); openLayersMap.setSizeFull(); openLayersMap.setCenter(146.9417, -42.0429); openLayersMap.setZoom(7); return openLayersMap; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
25679a79b2e038717913b42dbce2809a14032c00
50e934b06884cd9bd145bd6ab1a6aac4270e5fce
/SpringWebProgramming/src/main/java/com/mycompany/myapp/dao/sub/Exam10Dao3ImplA.java
289c2d53931ec1b00c2b179be9db002fe0d0c56f
[]
no_license
Jangyukyung/TestRepository
2e4c33769b20aa515e9bd96b381fd613aaa9d11b
6d2d767d309ed28efbda591ba8dbdfe147182218
refs/heads/master
2021-01-20T00:45:41.592000
2017-06-30T09:01:10
2017-06-30T09:01:10
89,182,163
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package com.mycompany.myapp.dao.sub; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import com.mycompany.myapp.dao.Exam10Dao3; @Component("") public class Exam10Dao3ImplA implements Exam10Dao3{ private static final Logger LOGGER=LoggerFactory.getLogger(Exam10Dao3ImplA.class); @Override public void insert(){ LOGGER.info("회원가입"); //System.out.println("Exam10Dao3Impl insert() 실행 ! "); } @Override public void select(){ LOGGER.info("회원가입검색"); //System.out.println("Exam10Dao3Impl select() 실행 ! "); } }
[ "jyk602222@naver.com" ]
jyk602222@naver.com
dcbdb1b74d77decff18f482c0d5e9e80942d2dfb
b8d93b491298e08a6f9834e7da9ad17c5f431af0
/src/main/java/com/chlebek/library/Model/Form/UserForm.java
f9e8f989db418442533c64e171276ecb5b239ac8
[]
no_license
chlebek-tomasz/library
3c81b8cc395c364e2c1eda47e360e2c2ef63b575
a0f3425056ddaadd1b0110490fa245c4cb374412
refs/heads/master
2022-08-27T21:18:38.305000
2020-05-27T19:01:21
2020-05-27T19:01:21
267,403,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,200
java
package com.chlebek.library.Model.Form; public class UserForm { private String username; private String email; private String password; private String passwordMatches; private String firstName; private String lastName; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPasswordMatches() { return passwordMatches; } public void setPasswordMatches(String passwordMatches) { this.passwordMatches = passwordMatches; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } }
[ "tom123ek@gmail.com" ]
tom123ek@gmail.com
b1e4adaba2a43d1234f5ebc53f92421221a6e542
e754709fb9ee4f5ce28345b193ce1623f85579f9
/src/cn/jsoup/JsoupTest.java
852d60481d7957e0934223e7b4cfe5e26fe017f4
[]
no_license
bjll/jsoup
c489fe20dc98b953d1ec36b799231dad9bbe8521
7d1f527b1f944b54f535df4562a4a5a8667a1826
refs/heads/master
2020-03-23T02:03:48.808000
2018-09-08T07:09:45
2018-09-08T07:09:45
140,953,943
0
0
null
null
null
null
UTF-8
Java
false
false
1,772
java
package cn.jsoup; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * 这是用知乎为例进行 测试的 * @author Chris * */ public class JsoupTest { public static void main(String[] args) throws IOException { String s = null; //assert s!=null?true:false; assert false; System.out.println("end"); /* try { //获取编辑推荐页 Document document=Jsoup.connect("https://www.zhihu.com/explore/recommendations") //模拟火狐浏览器 .userAgent("Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36") .get(); Element main=document.getElementById("zh-recommend-list-full"); Elements es= main.select("div.zh-general-list"); for(Element e:es){ for(Element el:e.select("h2 > a[href]")){ System.err.println(el.attr("abs:href")); //在这里加入abs 选项是为了获取绝对路径 //这里就可以把得到的数据及进行处理 System.err.println(el.text()); } } // 提取易佰教程的 图片 Document doc = Jsoup.connect("http://www.yiibai.com").get(); Elements images = doc.select("img[src~=(?i)\\.(png|jpe?g|gif)]"); for (Element image : images) { System.out.println("src : " + image.attr("src")); System.out.println("height : " + image.attr("height")); System.out.println("width : " + image.attr("width")); System.out.println("alt : " + image.attr("alt")); } } catch (Exception e) { e.printStackTrace(); } */ } }
[ "lil@dsgdata.com" ]
lil@dsgdata.com
bfd756b7d665bd606fc71cab0604e54153a91afb
8cefcd801f8e9b69a93edbd1f75d99f77171c303
/src/cn/year2019/thread/obj/ObjectMethodTest.java
92283e6a6bc323343608b558dbdf2663f84d4008
[ "MIT" ]
permissive
chywx/JavaSE-chy
3219fe50df03ee1efb5dbdf26d3ea11d76929ee4
3f8ac7eaf2a1d87745f6eea996cf72f73450b05e
refs/heads/master
2023-04-30T21:12:25.172000
2023-04-21T02:18:19
2023-04-21T02:18:19
166,914,146
5
4
null
2021-10-09T02:12:11
2019-01-22T02:35:30
Java
UTF-8
Java
false
false
515
java
package cn.year2019.thread.obj; import org.junit.Test; /** * 功能描述 * * @author chy * @date 2019/11/28 0028 */ public class ObjectMethodTest { private static Object obj = new Object(); public static void main(String[] args) { } @Test public void test1(){ Object o = new Object(); synchronized (obj){ try { o.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "1559843332@qq.com" ]
1559843332@qq.com
aeb30d6c7eca899e68cc5aa58e7e6ea2943501b3
847015a24c701bb945ee72f9e1b6fc6ccc131ebf
/src/main/java/io/mrshannon/hexmek/views/MovementTypeSelectView.java
1b4d5ff3a5923997253a7e0d762f6493182392d1
[]
no_license
mrshannon/hexmek
68eee00b4dc8746bf77e4c81f26bdac0ef2a483c
5d7d91199d44413465baac8a9b624af96f46e939
refs/heads/master
2020-03-31T06:35:54.101000
2018-11-29T04:38:53
2018-11-29T04:38:53
151,988,022
0
0
null
null
null
null
UTF-8
Java
false
false
1,563
java
package io.mrshannon.hexmek.views; import io.mrshannon.hexmek.models.Mech; import io.mrshannon.hexmek.models.Unit; /** * Movement type select view, allows the user to select the type of movement. */ public class MovementTypeSelectView implements View { private Unit unit; /** * Create the view. * * @param unit unit to display movement options for */ public MovementTypeSelectView(Unit unit) { this.unit = unit; } /** * Render the view */ @Override public void render() { System.out.println(); System.out.println(" halt = do not move at all"); if (unit instanceof Mech) { printMechChoices(); } else { printVehicleChoices(); } System.out.println(); printPrompt(); } /** * Print mech movement choices. */ private void printMechChoices() { System.out.printf(" walk = %d MP (+1 gunnery)\n", unit.getCruiseMovementPoints()); System.out.printf(" run = %d MP (+2 gunnery)\n", unit.getFlankMovementPoints()); } /** * Print vehicle movement choices. */ private void printVehicleChoices() { System.out.printf(" cruise = %d MP (+1 gunnery)\n", unit.getCruiseMovementPoints()); System.out.printf(" flank = %d MP (+2 gunnery)\n", unit.getFlankMovementPoints()); } /** * Print the movement type prompt. */ private void printPrompt() { System.out.print("Select movement type: "); } }
[ "mrshannon.aerospace@gmail.com" ]
mrshannon.aerospace@gmail.com
085a7b80449d131f804d4e9dd2b03a226fb423e6
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/Math/math98/1/AstorMain-math_98/src/variant-208/org/apache/commons/math/linear/RealMatrixImpl.java
0b3b3353d792d3d7cb0490c687ef3efd007a494f
[]
no_license
SajjadZaidi/AutoRepair
5c7aa7a689747c143cafd267db64f1e365de4d98
e21eb9384197bae4d9b23af93df73b6e46bb749a
refs/heads/master
2021-05-07T00:07:06.345000
2017-12-02T18:48:14
2017-12-02T18:48:14
112,858,432
0
0
null
null
null
null
UTF-8
Java
false
false
30,314
java
package org.apache.commons.math.linear; public class RealMatrixImpl implements java.io.Serializable , org.apache.commons.math.linear.RealMatrix { private static final long serialVersionUID = -4828886979278117018L; protected double[][] data = null; protected double[][] lu = null; protected int[] permutation = null; protected int parity = 1; private static final double TOO_SMALL = 1.0E-11; public RealMatrixImpl() { } public RealMatrixImpl(int rowDimension ,int columnDimension) { if ((rowDimension <= 0) || (columnDimension <= 0)) { throw new java.lang.IllegalArgumentException("row and column dimensions must be postive"); } data = new double[rowDimension][columnDimension]; lu = null; } public RealMatrixImpl(double[][] d) { copyIn(d); lu = null; } public RealMatrixImpl(double[][] d ,boolean copyArray) { if (copyArray) { copyIn(d); } else { if (d == null) { throw new java.lang.NullPointerException(); } final int nRows = d.length; if (nRows == 0) { throw new java.lang.IllegalArgumentException("Matrix must have at least one row."); } final int nCols = d[0].length; if (nCols == 0) { throw new java.lang.IllegalArgumentException("Matrix must have at least one column."); } for (int r = 1 ; r < nRows ; r++) { if ((d[r].length) != nCols) { throw new java.lang.IllegalArgumentException("All input rows must have the same length."); } } data = d; } lu = null; } public RealMatrixImpl(double[] v) { final int nRows = v.length; data = new double[nRows][1]; for (int row = 0 ; row < nRows ; row++) { data[row][0] = v[row]; } } public org.apache.commons.math.linear.RealMatrix copy() { return new org.apache.commons.math.linear.RealMatrixImpl(copyOut() , false); } public org.apache.commons.math.linear.RealMatrix add(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException { try { return add(((org.apache.commons.math.linear.RealMatrixImpl)(m))); } catch (java.lang.ClassCastException cce) { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) { throw new java.lang.IllegalArgumentException("matrix dimension mismatch"); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) + (m.getEntry(row, col)); } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } } public org.apache.commons.math.linear.RealMatrixImpl add(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) { throw new java.lang.IllegalArgumentException("matrix dimension mismatch"); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] mRow = m.data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) + (mRow[col]); } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix subtract(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException { try { return subtract(((org.apache.commons.math.linear.RealMatrixImpl)(m))); } catch (java.lang.ClassCastException cce) { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) { throw new java.lang.IllegalArgumentException("matrix dimension mismatch"); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) - (m.getEntry(row, col)); } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } } public org.apache.commons.math.linear.RealMatrixImpl subtract(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); if ((columnCount != (m.getColumnDimension())) || (rowCount != (m.getRowDimension()))) { throw new java.lang.IllegalArgumentException("matrix dimension mismatch"); } final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] mRow = m.data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) - (mRow[col]); } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix scalarAdd(double d) { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) + d; } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix scalarMultiply(double d) { final int rowCount = getRowDimension(); final int columnCount = getColumnDimension(); final double[][] outData = new double[rowCount][columnCount]; for (int row = 0 ; row < rowCount ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < columnCount ; col++) { outDataRow[col] = (dataRow[col]) * d; } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix multiply(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException { try { return multiply(((org.apache.commons.math.linear.RealMatrixImpl)(m))); } catch (java.lang.ClassCastException cce) { if ((org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) != (m.getRowDimension())) { throw new java.lang.IllegalArgumentException("Matrices are not multiplication compatible."); } final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final int nCols = m.getColumnDimension(); final int nSum = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final double[][] outData = new double[nRows][nCols]; for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < nCols ; col++) { double sum = 0; for (int i = 0 ; i < nSum ; i++) { sum += (dataRow[i]) * (m.getEntry(i, col)); } outDataRow[col] = sum; } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } } public org.apache.commons.math.linear.RealMatrixImpl multiply(org.apache.commons.math.linear.RealMatrixImpl m) throws java.lang.IllegalArgumentException { if ((org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) != (m.getRowDimension())) { throw new java.lang.IllegalArgumentException("Matrices are not multiplication compatible."); } final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final int nCols = m.getColumnDimension(); final int nSum = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final double[][] outData = new double[nRows][nCols]; for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; final double[] outDataRow = outData[row]; for (int col = 0 ; col < nCols ; col++) { double sum = 0; for (int i = 0 ; i < nSum ; i++) { sum += (dataRow[i]) * (m.data[i][col]); } outDataRow[col] = sum; } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix preMultiply(org.apache.commons.math.linear.RealMatrix m) throws java.lang.IllegalArgumentException { return m.multiply(org.apache.commons.math.linear.RealMatrixImpl.this); } public double[][] getData() { return copyOut(); } public double[][] getDataRef() { return data; } public double getNorm() { double maxColSum = 0; for (int col = 0 ; col < (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) ; col++) { double sum = 0; for (int row = 0 ; row < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; row++) { sum += java.lang.Math.abs(data[row][col]); } maxColSum = java.lang.Math.max(maxColSum, sum); } return maxColSum; } public org.apache.commons.math.linear.RealMatrix getSubMatrix(int startRow, int endRow, int startColumn, int endColumn) throws org.apache.commons.math.linear.MatrixIndexException { if ((((((startRow < 0) || (startRow > endRow)) || (endRow > (data.length))) || (startColumn < 0)) || (startColumn > endColumn)) || (endColumn > (data[0].length))) { throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection"); } final double[][] subMatrixData = new double[(endRow - startRow) + 1][(endColumn - startColumn) + 1]; for (int i = startRow ; i <= endRow ; i++) { java.lang.System.arraycopy(data[i], startColumn, subMatrixData[(i - startRow)], 0, ((endColumn - startColumn) + 1)); } return new org.apache.commons.math.linear.RealMatrixImpl(subMatrixData , false); } public org.apache.commons.math.linear.RealMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns) throws org.apache.commons.math.linear.MatrixIndexException { if (((selectedRows.length) * (selectedColumns.length)) == 0) { throw new org.apache.commons.math.linear.MatrixIndexException("selected row and column index arrays must be non-empty"); } final double[][] subMatrixData = new double[selectedRows.length][selectedColumns.length]; try { for (int i = 0 ; i < (selectedRows.length) ; i++) { final double[] subI = subMatrixData[i]; final double[] dataSelectedI = data[selectedRows[i]]; for (int j = 0 ; j < (selectedColumns.length) ; j++) { subI[j] = dataSelectedI[selectedColumns[j]]; } } } catch (java.lang.ArrayIndexOutOfBoundsException e) { throw new org.apache.commons.math.linear.MatrixIndexException("matrix dimension mismatch"); } return new org.apache.commons.math.linear.RealMatrixImpl(subMatrixData , false); } public void setSubMatrix(double[][] subMatrix, int row, int column) throws org.apache.commons.math.linear.MatrixIndexException { if ((row < 0) || (column < 0)) { throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection"); } final int nRows = subMatrix.length; if (nRows == 0) { throw new java.lang.IllegalArgumentException("Matrix must have at least one row."); } final int nCols = subMatrix[0].length; if (nCols == 0) { throw new java.lang.IllegalArgumentException("Matrix must have at least one column."); } for (int r = 1 ; r < nRows ; r++) { if ((subMatrix[r].length) != nCols) { throw new java.lang.IllegalArgumentException("All input rows must have the same length."); } } if ((data) == null) { if ((row > 0) || (column > 0)) { throw new org.apache.commons.math.linear.MatrixIndexException("matrix must be initialized to perfom this method"); } data = new double[nRows][nCols]; java.lang.System.arraycopy(subMatrix, 0, data, 0, subMatrix.length); } if (((nRows + row) > (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension())) || ((nCols + column) > (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()))) { throw new org.apache.commons.math.linear.MatrixIndexException("invalid row or column index selection"); } for (int i = 0 ; i < nRows ; i++) { java.lang.System.arraycopy(subMatrix[i], 0, data[(row + i)], column, nCols); } lu = null; } public org.apache.commons.math.linear.RealMatrix getRowMatrix(int row) throws org.apache.commons.math.linear.MatrixIndexException { if (!(isValidCoordinate(row, 0))) { throw new org.apache.commons.math.linear.MatrixIndexException("illegal row argument"); } final int ncols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final double[][] out = new double[1][ncols]; java.lang.System.arraycopy(data[row], 0, out[0], 0, ncols); return new org.apache.commons.math.linear.RealMatrixImpl(out , false); } public org.apache.commons.math.linear.RealMatrix getColumnMatrix(int column) throws org.apache.commons.math.linear.MatrixIndexException { if (!(isValidCoordinate(0, column))) { throw new org.apache.commons.math.linear.MatrixIndexException("illegal column argument"); } final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final double[][] out = new double[nRows][1]; for (int row = 0 ; row < nRows ; row++) { out[row][0] = data[row][column]; } return new org.apache.commons.math.linear.RealMatrixImpl(out , false); } public double[] getRow(int row) throws org.apache.commons.math.linear.MatrixIndexException { if (!(isValidCoordinate(row, 0))) { throw new org.apache.commons.math.linear.MatrixIndexException("illegal row argument"); } final int ncols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final double[] out = new double[ncols]; java.lang.System.arraycopy(data[row], 0, out, 0, ncols); return out; } public double[] getColumn(int col) throws org.apache.commons.math.linear.MatrixIndexException { if (!(isValidCoordinate(0, col))) { throw new org.apache.commons.math.linear.MatrixIndexException("illegal column argument"); } final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final double[] out = new double[nRows]; for (int row = 0 ; row < nRows ; row++) { out[row] = data[row][col]; } return out; } public double getEntry(int row, int column) throws org.apache.commons.math.linear.MatrixIndexException { try { return data[row][column]; } catch (java.lang.ArrayIndexOutOfBoundsException e) { throw new org.apache.commons.math.linear.MatrixIndexException("matrix entry does not exist"); } } public org.apache.commons.math.linear.RealMatrix transpose() { final int nRows = getRowDimension(); final int nCols = getColumnDimension(); final double[][] outData = new double[nCols][nRows]; for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; for (int col = 0 ; col < nCols ; col++) { outData[col][row] = dataRow[col]; } } return new org.apache.commons.math.linear.RealMatrixImpl(outData , false); } public org.apache.commons.math.linear.RealMatrix inverse() throws org.apache.commons.math.linear.InvalidMatrixException { return solve(org.apache.commons.math.linear.MatrixUtils.createRealIdentityMatrix(getRowDimension())); } public double getDeterminant() throws org.apache.commons.math.linear.InvalidMatrixException { if (!(isSquare())) { throw new org.apache.commons.math.linear.InvalidMatrixException("matrix is not square"); } if (isSingular()) { return 0.0; } else { double det = parity; for (int i = 0 ; i < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; i++) { det *= lu[i][i]; } return det; } } public boolean isSquare() { return (org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()) == (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()); } public boolean isSingular() { if ((lu) == null) { try { luDecompose(); return false; } catch (org.apache.commons.math.linear.InvalidMatrixException ex) { return true; } } else { return false; } } public int getRowDimension() { return data.length; } public int getColumnDimension() { return data[0].length; } public double getTrace() throws java.lang.IllegalArgumentException { if (!(isSquare())) { throw new java.lang.IllegalArgumentException("matrix is not square"); } double trace = data[0][0]; for (int i = 1 ; i < (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension()) ; i++) { trace += data[i][i]; } return trace; } public double[] operate(double[] v) throws java.lang.IllegalArgumentException { final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); if ((v.length) != nCols) { throw new java.lang.IllegalArgumentException("vector has wrong length"); } final double[] out = new double[v.length]; for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; double sum = 0; for (int row = 0 ; row < nRows ; row++) { permutation[row] = row; } out[row] = sum; } return out; } public double[] preMultiply(double[] v) throws java.lang.IllegalArgumentException { final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); if ((v.length) != nRows) { throw new java.lang.IllegalArgumentException("vector has wrong length"); } final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final double[] out = new double[nCols]; for (int col = 0 ; col < nCols ; col++) { double sum = 0; for (int i = 0 ; i < nRows ; i++) { sum += (data[i][col]) * (v[i]); } out[col] = sum; } return out; } public double[] solve(double[] b) throws java.lang.IllegalArgumentException, org.apache.commons.math.linear.InvalidMatrixException { final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); if ((b.length) != nRows) { throw new java.lang.IllegalArgumentException("constant vector has wrong length"); } final org.apache.commons.math.linear.RealMatrix bMatrix = new org.apache.commons.math.linear.RealMatrixImpl(b); final double[][] solution = ((org.apache.commons.math.linear.RealMatrixImpl)(solve(bMatrix))).getDataRef(); final double[] out = new double[nRows]; for (int row = 0 ; row < nRows ; row++) { out[row] = solution[row][0]; } return out; } public org.apache.commons.math.linear.RealMatrix solve(org.apache.commons.math.linear.RealMatrix b) throws java.lang.IllegalArgumentException, org.apache.commons.math.linear.InvalidMatrixException { if ((b.getRowDimension()) != (org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension())) { throw new java.lang.IllegalArgumentException("Incorrect row dimension"); } if (!(org.apache.commons.math.linear.RealMatrixImpl.this.isSquare())) { throw new org.apache.commons.math.linear.InvalidMatrixException("coefficient matrix is not square"); } if (org.apache.commons.math.linear.RealMatrixImpl.this.isSingular()) { throw new org.apache.commons.math.linear.InvalidMatrixException("Matrix is singular."); } final int nCol = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); final int nColB = b.getColumnDimension(); final int nRowB = b.getRowDimension(); final double[][] bp = new double[nRowB][nColB]; for (int row = 0 ; row < nRowB ; row++) { final double[] bpRow = bp[row]; for (int col = 0 ; col < nColB ; col++) { bpRow[col] = b.getEntry(permutation[row], col); } } for (int col = 0 ; col < nCol ; col++) { for (int i = col + 1 ; i < nCol ; i++) { final double[] bpI = bp[i]; final double[] luI = lu[i]; for (int j = 0 ; j < nColB ; j++) { bpI[j] -= (bp[col][j]) * (luI[col]); } } } for (int col = nCol - 1 ; col >= 0 ; col--) { final double[] bpCol = bp[col]; final double luDiag = lu[col][col]; for (int j = 0 ; j < nColB ; j++) { bpCol[j] /= luDiag; } for (int i = 0 ; i < col ; i++) { final double[] bpI = bp[i]; final double[] luI = lu[i]; for (int j = 0 ; j < nColB ; j++) { bpI[j] -= (bp[col][j]) * (luI[col]); } } } return new org.apache.commons.math.linear.RealMatrixImpl(bp , false); } public void luDecompose() throws org.apache.commons.math.linear.InvalidMatrixException { final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final int nCols = org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension(); if (nRows != nCols) { throw new org.apache.commons.math.linear.InvalidMatrixException("LU decomposition requires that the matrix be square."); } lu = getData(); permutation = new int[nRows]; for (int row = 0 ; row < nRows ; row++) { permutation[row] = row; } parity = 1; for (int col = 0 ; col < nCols ; col++) { double sum = 0; for (int row = 0 ; row < col ; row++) { final double[] luRow = lu[row]; sum = luRow[col]; for (int i = 0 ; i < row ; i++) { sum -= (luRow[i]) * (lu[i][col]); } luRow[col] = sum; } int max = col; double largest = 0.0; for (int row = col ; row < nRows ; row++) { final double[] luRow = lu[row]; sum = luRow[col]; for (int i = 0 ; i < col ; i++) { sum -= (luRow[i]) * (lu[i][col]); } luRow[col] = sum; if ((java.lang.Math.abs(sum)) > largest) { largest = java.lang.Math.abs(sum); max = row; } } if ((java.lang.Math.abs(lu[max][col])) < (org.apache.commons.math.linear.RealMatrixImpl.TOO_SMALL)) { lu = null; throw new org.apache.commons.math.linear.InvalidMatrixException("matrix is singular"); } if (max != col) { double tmp = 0; for (int i = 0 ; i < nCols ; i++) { tmp = lu[max][i]; lu[max][i] = lu[col][i]; lu[col][i] = tmp; } int temp = permutation[max]; permutation[max] = permutation[col]; permutation[col] = temp; parity = -(parity); } final double luDiag = lu[col][col]; for (int row = col + 1 ; row < nRows ; row++) { lu[row][col] /= luDiag; } } } public java.lang.String toString() { java.lang.StringBuffer res = new java.lang.StringBuffer(); res.append("RealMatrixImpl{"); if ((data) != null) { for (int i = 0 ; i < (data.length) ; i++) { if (i > 0) { res.append(","); } res.append("{"); for (int j = 0 ; j < (data[0].length) ; j++) { if (j > 0) { res.append(","); } res.append(data[i][j]); } res.append("}"); } } res.append("}"); return res.toString(); } public boolean equals(java.lang.Object object) { if (object == (org.apache.commons.math.linear.RealMatrixImpl.this)) { return true; } if ((object instanceof org.apache.commons.math.linear.RealMatrixImpl) == false) { return false; } org.apache.commons.math.linear.RealMatrix m = ((org.apache.commons.math.linear.RealMatrix)(object)); final int nRows = getRowDimension(); final int nCols = getColumnDimension(); if (((m.getColumnDimension()) != nCols) || ((m.getRowDimension()) != nRows)) { return false; } for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; for (int col = 0 ; col < nCols ; col++) { if ((java.lang.Double.doubleToLongBits(dataRow[col])) != (java.lang.Double.doubleToLongBits(m.getEntry(row, col)))) { return false; } } } return true; } public int hashCode() { int ret = 7; final int nRows = getRowDimension(); final int nCols = getColumnDimension(); ret = (ret * 31) + nRows; ret = (ret * 31) + nCols; for (int row = 0 ; row < nRows ; row++) { final double[] dataRow = data[row]; for (int col = 0 ; col < nCols ; col++) { ret = (ret * 31) + (((11 * (row + 1)) + (17 * (col + 1))) * (org.apache.commons.math.util.MathUtils.hash(dataRow[col]))); } } return ret; } protected org.apache.commons.math.linear.RealMatrix getLUMatrix() throws org.apache.commons.math.linear.InvalidMatrixException { if ((lu) == null) { luDecompose(); } return new org.apache.commons.math.linear.RealMatrixImpl(lu); } protected int[] getPermutation() { final int[] out = new int[permutation.length]; java.lang.System.arraycopy(permutation, 0, out, 0, permutation.length); return out; } private double[][] copyOut() { final int nRows = org.apache.commons.math.linear.RealMatrixImpl.this.getRowDimension(); final double[][] out = new double[nRows][org.apache.commons.math.linear.RealMatrixImpl.this.getColumnDimension()]; for (int i = 0 ; i < nRows ; i++) { java.lang.System.arraycopy(data[i], 0, out[i], 0, data[i].length); } return out; } private void copyIn(double[][] in) { setSubMatrix(in, 0, 0); } private boolean isValidCoordinate(int row, int col) { final int nRows = getRowDimension(); final int nCols = getColumnDimension(); return !((((row < 0) || (row > (nRows - 1))) || (col < 0)) || (col > (nCols - 1))); } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
2e7c44ee32f309e2f3100f26922eafae928f0bd5
d44c621cc456ab6eddbea73aa1088be7e0d9b038
/app/src/main/java/com/dragoneye/wjjt/activity/base/ImageMulSelectedActivity.java
a6407e117ad9401807cd25929e156f7673dc1a95
[]
no_license
l1000965431/moneyclient
fcbfd80e10b271b5d7a95125b3fdda76511f29ee
102b8b065d710e32cfa2a8cbfb1ab4b946fd8347
refs/heads/master
2020-04-12T22:38:44.941000
2016-01-28T08:10:53
2016-01-28T08:10:53
41,911,488
0
0
null
null
null
null
UTF-8
Java
false
false
5,993
java
package com.dragoneye.wjjt.activity.base; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.GridView; import android.widget.ImageView; import com.dragoneye.wjjt.R; import com.dragoneye.wjjt.tool.ToolMaster; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.assist.ImageScaleType; import java.io.File; import java.util.ArrayList; import java.util.HashSet; import java.util.List; public class ImageMulSelectedActivity extends ActionBarActivity { public static String RESULT_IMAGE_PATH_ARRAY = "RESULT_IMAGE_PATH_ARRAY"; private GridView mGridView; ArrayList<String> mDataArrays; ImageSelectAdapter mAdapter; HashSet<Integer> mSelectedImageIndex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_image_select); initView(); initData(); getAllImagesFromGallery(); } private void initView(){ mGridView = (GridView)findViewById(R.id.image_select_main_grid_view); } private void initData(){ mSelectedImageIndex = new HashSet<>(); mDataArrays = new ArrayList<>(); mAdapter = new ImageSelectAdapter(this, mDataArrays); mGridView.setAdapter(mAdapter); } private void getAllImagesFromGallery(){ mDataArrays.clear(); mDataArrays.addAll(ToolMaster.getAllShownImagesPath(this)); mAdapter.notifyDataSetChanged(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_image_select, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.menu_image_select_finish) { ArrayList<String> strings = new ArrayList<>(); for( Integer index : mSelectedImageIndex ){ strings.add( mDataArrays.get(index) ); } Intent intent = new Intent(); intent.putStringArrayListExtra(RESULT_IMAGE_PATH_ARRAY, strings); setResult( RESULT_OK, intent ); finish(); return true; } return super.onOptionsItemSelected(item); } public class ImageSelectAdapter extends BaseAdapter { private List<String> data; private Context context; private LayoutInflater mInflater; public ImageSelectAdapter(Context context, List<String> data){ this.context = context; this.data = data; mInflater = LayoutInflater.from(context); } @Override public int getCount(){ return data.size(); } @Override public Object getItem(int position){ return data.get(position); } @Override public long getItemId(int position){ return position; } @Override public int getItemViewType(int position){ return 0; } @Override public int getViewTypeCount(){ return 1; } @Override public View getView(final int position, View convertView, ViewGroup parent){ // GalleryImage galleryImage = (GalleryImage)getItem(position); String imagePath = (String)getItem(position); ViewHolder viewHolder; if(convertView == null){ viewHolder = new ViewHolder(); convertView = mInflater.inflate(R.layout.function_gallery_upload_grid_view_item_image, parent, false); viewHolder.ivImage = (ImageView)convertView.findViewById(R.id.function_gallery_upload_grid_view_item_image_image); viewHolder.ckSelected = (CheckBox)convertView.findViewById(R.id.function_gallery_upload_grid_view_item_image_check_box); viewHolder.ckSelected.setVisibility(View.VISIBLE); viewHolder.ckSelected.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(mSelectedImageIndex.contains(position)){ mSelectedImageIndex.remove(position); }else { mSelectedImageIndex.add(position); } } }); convertView.setTag(viewHolder); }else{ viewHolder = (ViewHolder)convertView.getTag(); } viewHolder.ckSelected.setChecked( mSelectedImageIndex.contains(position) ); DisplayImageOptions options; options = new DisplayImageOptions.Builder() .showImageOnLoading(R.mipmap.icon_albums) .imageScaleType(ImageScaleType.EXACTLY) .build(); ImageLoader.getInstance().displayImage(Uri.fromFile(new File(imagePath)).toString(), viewHolder.ivImage, options); return convertView; } private class ViewHolder{ public ImageView ivImage; public CheckBox ckSelected; } } }
[ "510424705@qq.com" ]
510424705@qq.com
6db0c36da0dab5f362b22932f7d4da88250eb744
7afdfe4c3876a50cf256c16fdca5ad3e0bc3a885
/jerry-buy/jerry-buy-client/src/main/java/io/luan/jerry/buy/dto/creating/CreatingOrderRequest.java
40dc7dde2d1081f3e3ad0448756afd30271bd101
[ "Apache-2.0" ]
permissive
luangm/jerry-old
ebc3c6ee01b5f30524e529bc9ae892ad39b480ef
ffa94807f41657c0d04e8ec610bb8d516b34b061
refs/heads/master
2021-06-01T04:42:52.719000
2016-07-24T15:30:05
2016-07-24T15:30:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,039
java
package io.luan.jerry.buy.dto.creating; import io.luan.jerry.buy.dto.DeliveryAddressDTO; import io.luan.jerry.buy.dto.OrderDTO; import io.luan.jerry.common.dto.BaseDTO; import lombok.Data; import java.util.ArrayList; import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; /** * Request sent by either frontend or another service * Containing minimal information required to create a new order * * @author Guangmiao Luan * @since 7/3/2016 */ @Data public class CreatingOrderRequest extends BaseDTO { private long buyerId; private String buyerNick; private List<OrderDTO> orders = new ArrayList<>(); private DeliveryAddressDTO deliveryAddress; @Override public void validate() { checkState(buyerId > 0); checkNotNull(orders); checkState(orders.size() > 0); checkNotNull(deliveryAddress); orders.forEach(OrderDTO::validate); deliveryAddress.validate(); } }
[ "luangm@users.noreply.github.com" ]
luangm@users.noreply.github.com
054cb05a69bc2e70308ba315d4cba2f7509f5447
c0cbad908e8418ee316a7b68b7bb24829102a452
/src/main/java/de/master/manager/ui/events/RemoveCourseEvent.java
a3c9a9dee07fc0a883b249185fd5f12461e40608
[ "MIT" ]
permissive
uucly/mastermanager
e0ac3d187a0cc2f6e447b8bd6916984d85f60476
9af8050869b14b1b6966e6404d285e0e5d1cdde6
refs/heads/master
2021-01-10T02:04:42.114000
2015-12-21T04:43:40
2015-12-21T04:43:40
45,619,196
0
0
null
null
null
null
UTF-8
Java
false
false
311
java
package de.master.manager.ui.events; import org.apache.wicket.ajax.AjaxRequestTarget; public class RemoveCourseEvent { private final AjaxRequestTarget target; public RemoveCourseEvent(AjaxRequestTarget target) { this.target = target; } public AjaxRequestTarget getTarget() { return target; } }
[ "uucly@student.kit.edu" ]
uucly@student.kit.edu
02d73ba21330d56e238363ff4fc71afd939d13b9
9bab878f93005659f111be3f52f10f795add4e6a
/src/Servlet/UploadHandleServlet.java
e2668abaa9206ca249ad16416c7099c04ab39edf
[]
no_license
RCBOY/newpostgraduate
37d434aa063cfc0ca67b534a2f5c8b0dd770c76b
699b8b4a2c63a92f0a9c89ab7fcfa29b0caddea4
refs/heads/master
2020-07-21T14:58:42.150000
2016-09-15T05:40:59
2016-09-15T05:40:59
67,968,965
0
0
null
null
null
null
UTF-8
Java
false
false
6,208
java
package Servlet; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadBase; import org.apache.commons.fileupload.ProgressListener; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.swing.*; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.UUID; /** * Created by 1234ztc on 2016/7/3. */ public class UploadHandleServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); HttpSession httpSession=request.getSession(); String savepath = this.getServletContext().getRealPath("/WEB-INF/upload"); String tempath = this.getServletContext().getRealPath("/WEB-INF/temp"); System.out.print(tempath); File tempfile = new File(tempath); if (!tempfile.exists()) { tempfile.mkdir(); } try { DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(); diskFileItemFactory.setSizeThreshold(1024 * 100); diskFileItemFactory.setRepository(tempfile); ServletFileUpload servletFileUpload = new ServletFileUpload(diskFileItemFactory); servletFileUpload.setProgressListener(new ProgressListener() { @Override public void update(long pBytesRead, long pContentLength, int arg2) { System.out.println("文件大小为:" + pContentLength + ",当前已处理:" + pBytesRead); } }); servletFileUpload.setHeaderEncoding("UTF-8"); if (!ServletFileUpload.isMultipartContent(request)) { return; } servletFileUpload.setFileSizeMax(1024 * 1024); servletFileUpload.setSizeMax(1024 * 1024 * 10); List<FileItem> list = servletFileUpload.parseRequest(request); for(FileItem iterm:list){ if (iterm.isFormField()){ String name=iterm.getFieldName(); String value=iterm.getString("UTF-8"); System.out.println(name+"="+value); }else { String filename=iterm.getName(); // System.out.println(filename); if (filename==null||filename.trim().equals("")){ continue; } String username=(String)httpSession.getAttribute("username"); filename=username+filename.substring(filename.lastIndexOf("\\")+1); System.out.println("++"+filename); String fileExname=filename.substring(filename.lastIndexOf(".")+1); System.out.println("上传文件的扩展名为:"+fileExname); InputStream inputStream=iterm.getInputStream(); String saveFilename=makeFileName(filename); String realSavePath=makePath(filename,savepath); FileOutputStream out = new FileOutputStream(realSavePath + "\\" + saveFilename); byte buffer[]=new byte[1024]; int len=0; while((len=inputStream.read(buffer))>0){ out.write(buffer,0,len); } inputStream.close(); out.close(); } } JOptionPane.showMessageDialog(null, "上传成功!", "提示", JOptionPane.PLAIN_MESSAGE); // request.getRequestDispatcher("/AboutStudentJsp/StudentUpload.jsp").forward(request, response); } catch (FileUploadBase.FileSizeLimitExceededException e) { e.printStackTrace(); JOptionPane.showMessageDialog(null, "单个文件超出最大值!", "提示", JOptionPane.ERROR_MESSAGE); request.getRequestDispatcher("/Student.jsp").forward(request, response); return; }catch (FileUploadBase.SizeLimitExceededException e){ e.printStackTrace(); JOptionPane.showMessageDialog(null, "上传文件的总的大小超出限制的最大值!", "提示", JOptionPane.ERROR_MESSAGE); request.getRequestDispatcher("/Student.jsp").forward(request, response); return; }catch (Exception e){ e.printStackTrace(); JOptionPane.showMessageDialog(null, "上传文件失败!", "提示", JOptionPane.ERROR_MESSAGE); request.getRequestDispatcher("/Student.jsp").forward(request, response); return; } request.getRequestDispatcher("/Student.jsp").forward(request, response); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } private String makeFileName(String filename){ //为防止文件覆盖的现象发生,要为上传文件产生一个唯一的文件名 return UUID.randomUUID().toString() + "_" + filename; } private String makePath(String filename,String savePath){ //得到文件名的hashCode的值,得到的就是filename这个字符串对象在内存中的地址 int hashcode = filename.hashCode(); int dir1 = hashcode&0xf; //0--15 int dir2 = (hashcode&0xf0)>>4; //0-15 // 构造新的保存目录 String dir = savePath + "\\" + dir1 + "\\" + dir2; //upload\2\3 upload\3\5 //File既可以代表文件也可以代表目录 File file = new File(dir); //如果目录不存在 if(!file.exists()){ //创建目录 file.mkdirs(); } return dir; } }
[ "329942954@qq.com" ]
329942954@qq.com
README.md exists but content is empty.
Downloads last month
15