blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
dff782f7b4a40728b24f67deb09302eed2bf23bd
c89a7f5d0caed3355508fb85b0afbfbd9a135b1a
/Whack A Mole/src/whackamole/Game.java
0fa022f8747f01ea4e29165e3611c01e4583c370
[]
no_license
DjordjeD/Java-Games
67df199551431c4c70bec861179e2f13ddcedcdc
57e7182f99cd27a7a5b4052ccd54f4139b7318ff
refs/heads/master
2022-11-25T02:36:33.577615
2020-07-30T12:35:30
2020-07-30T12:35:30
283,766,079
0
0
null
null
null
null
UTF-8
Java
false
false
2,948
java
package whackamole; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Checkbox; import java.awt.CheckboxGroup; import java.awt.Color; import java.awt.Font; import java.awt.Frame; import java.awt.GridLayout; import java.awt.HeadlessException; import java.awt.Label; import java.awt.Panel; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @SuppressWarnings("serial") public class Game extends Frame { Garden garden; public static Label vegetables_count = new Label(); private static Game SINGLE_INSTANCE = null; public static Game getInstance() { if (SINGLE_INSTANCE == null) { synchronized (Game.class) { SINGLE_INSTANCE = new Game(); } } return SINGLE_INSTANCE; } private Game() throws HeadlessException { super("Whack a mole"); Button start = new Button("Start"); Panel panel = new Panel(); panel.setLayout(new GridLayout(0, 1)); Label difficulty = new Label("Difficulty"); Label vegetables = new Label("Vegetables"); Panel north = new Panel(); north.setLayout(new GridLayout(0, 1)); Panel south = new Panel(); south.setLayout(new GridLayout(0, 1)); vegetables.setFont(new Font("Arial", Font.BOLD, 20)); vegetables_count.setFont(new Font("Arial", Font.BOLD, 15)); difficulty.setFont(new Font("Arial", Font.BOLD, 20)); CheckboxGroup diff = new CheckboxGroup(); Checkbox easy = new Checkbox("easy", false, diff); Checkbox medium = new Checkbox("medium", true, diff); Checkbox hard = new Checkbox("hard", false, diff); panel.setBackground(Color.WHITE); north.add(difficulty, BorderLayout.NORTH); south.add(vegetables); south.add(vegetables_count); north.add(start, BorderLayout.SOUTH); north.add(easy); north.add(medium); north.add(hard); panel.add(north); panel.add(south); garden = new Garden(4, 4); add(panel, BorderLayout.EAST); add(garden, BorderLayout.CENTER); setVisible(true); setSize(800, 500); start.addActionListener((ae) -> { String sign = start.getLabel(); int wait = 0; int steps = 0; switch (diff.getSelectedCheckbox().getLabel()) { case "easy": wait = 1000; steps = 10; break; case "medium": wait = 750; steps = 8; break; case "hard": wait = 500; steps = 6; break; } if (sign == "Start") { garden.setWaitTime(wait); garden.setSteps(steps); garden.start(); vegetables_count.setText("" + garden.getVegetables()); start.setLabel("Stop"); } else { garden.stop(); start.setLabel("Start"); } }); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { // TODO Auto-generated method stub // garden.dispose(); garden.stop(); dispose(); } }); } public static void main(String[] args) { getInstance(); } }
[ "noreply@github.com" ]
noreply@github.com
342b30e888c9eb6cf98839a48940c13c0a1d3e61
804ca638106622a5db6d1460791a7ba17555bdf6
/src/generated/java/cherry/sqlapp/db/gen/mapper/SqltoolStatementSqlProvider.java
75ef587881edeeae39948947c46a2b124ed4214d
[ "Apache-2.0" ]
permissive
agwlvssainokuni/sqlapp
7126404dd2c167e35238c24512ba150a7662cacb
df164c38ded9e569de97c981550a99f1edf8243e
refs/heads/master
2020-12-24T13:27:55.667619
2015-03-16T23:36:47
2015-03-16T23:36:47
19,758,521
1
0
null
null
null
null
UTF-8
Java
false
false
12,741
java
package cherry.sqlapp.db.gen.mapper; import static org.apache.ibatis.jdbc.SqlBuilder.BEGIN; import static org.apache.ibatis.jdbc.SqlBuilder.DELETE_FROM; import static org.apache.ibatis.jdbc.SqlBuilder.FROM; import static org.apache.ibatis.jdbc.SqlBuilder.INSERT_INTO; import static org.apache.ibatis.jdbc.SqlBuilder.ORDER_BY; import static org.apache.ibatis.jdbc.SqlBuilder.SELECT; import static org.apache.ibatis.jdbc.SqlBuilder.SELECT_DISTINCT; import static org.apache.ibatis.jdbc.SqlBuilder.SET; import static org.apache.ibatis.jdbc.SqlBuilder.SQL; import static org.apache.ibatis.jdbc.SqlBuilder.UPDATE; import static org.apache.ibatis.jdbc.SqlBuilder.VALUES; import static org.apache.ibatis.jdbc.SqlBuilder.WHERE; import cherry.sqlapp.db.gen.dto.SqltoolStatement; import cherry.sqlapp.db.gen.dto.SqltoolStatementCriteria.Criteria; import cherry.sqlapp.db.gen.dto.SqltoolStatementCriteria.Criterion; import cherry.sqlapp.db.gen.dto.SqltoolStatementCriteria; import java.util.List; import java.util.Map; public class SqltoolStatementSqlProvider { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String countByExample(SqltoolStatementCriteria example) { BEGIN(); SELECT("count(*)"); FROM("SQLTOOL_STATEMENT"); applyWhere(example, false); return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String deleteByExample(SqltoolStatementCriteria example) { BEGIN(); DELETE_FROM("SQLTOOL_STATEMENT"); applyWhere(example, false); return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String insertSelective(SqltoolStatement record) { BEGIN(); INSERT_INTO("SQLTOOL_STATEMENT"); if (record.getDatabaseName() != null) { VALUES("DATABASE_NAME", "#{databaseName,jdbcType=VARCHAR}"); } if (record.getQuery() != null) { VALUES("QUERY", "#{query,jdbcType=VARCHAR}"); } if (record.getParamMap() != null) { VALUES("PARAM_MAP", "#{paramMap,jdbcType=VARCHAR}"); } if (record.getUpdatedAt() != null) { VALUES("UPDATED_AT", "#{updatedAt,jdbcType=TIMESTAMP}"); } if (record.getCreatedAt() != null) { VALUES("CREATED_AT", "#{createdAt,jdbcType=TIMESTAMP}"); } if (record.getLockVersion() != null) { VALUES("LOCK_VERSION", "#{lockVersion,jdbcType=INTEGER}"); } if (record.getDeletedFlg() != null) { VALUES("DELETED_FLG", "#{deletedFlg,jdbcType=INTEGER}"); } return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String selectByExample(SqltoolStatementCriteria example) { BEGIN(); if (example != null && example.isDistinct()) { SELECT_DISTINCT("ID"); } else { SELECT("ID"); } SELECT("DATABASE_NAME"); SELECT("QUERY"); SELECT("PARAM_MAP"); SELECT("UPDATED_AT"); SELECT("CREATED_AT"); SELECT("LOCK_VERSION"); SELECT("DELETED_FLG"); FROM("SQLTOOL_STATEMENT"); applyWhere(example, false); if (example != null && example.getOrderByClause() != null) { ORDER_BY(example.getOrderByClause()); } return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String updateByExampleSelective(Map<String, Object> parameter) { SqltoolStatement record = (SqltoolStatement) parameter.get("record"); SqltoolStatementCriteria example = (SqltoolStatementCriteria) parameter.get("example"); BEGIN(); UPDATE("SQLTOOL_STATEMENT"); if (record.getId() != null) { SET("ID = #{record.id,jdbcType=INTEGER}"); } if (record.getDatabaseName() != null) { SET("DATABASE_NAME = #{record.databaseName,jdbcType=VARCHAR}"); } if (record.getQuery() != null) { SET("QUERY = #{record.query,jdbcType=VARCHAR}"); } if (record.getParamMap() != null) { SET("PARAM_MAP = #{record.paramMap,jdbcType=VARCHAR}"); } if (record.getUpdatedAt() != null) { SET("UPDATED_AT = #{record.updatedAt,jdbcType=TIMESTAMP}"); } if (record.getCreatedAt() != null) { SET("CREATED_AT = #{record.createdAt,jdbcType=TIMESTAMP}"); } if (record.getLockVersion() != null) { SET("LOCK_VERSION = #{record.lockVersion,jdbcType=INTEGER}"); } if (record.getDeletedFlg() != null) { SET("DELETED_FLG = #{record.deletedFlg,jdbcType=INTEGER}"); } applyWhere(example, true); return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String updateByExample(Map<String, Object> parameter) { BEGIN(); UPDATE("SQLTOOL_STATEMENT"); SET("ID = #{record.id,jdbcType=INTEGER}"); SET("DATABASE_NAME = #{record.databaseName,jdbcType=VARCHAR}"); SET("QUERY = #{record.query,jdbcType=VARCHAR}"); SET("PARAM_MAP = #{record.paramMap,jdbcType=VARCHAR}"); SET("UPDATED_AT = #{record.updatedAt,jdbcType=TIMESTAMP}"); SET("CREATED_AT = #{record.createdAt,jdbcType=TIMESTAMP}"); SET("LOCK_VERSION = #{record.lockVersion,jdbcType=INTEGER}"); SET("DELETED_FLG = #{record.deletedFlg,jdbcType=INTEGER}"); SqltoolStatementCriteria example = (SqltoolStatementCriteria) parameter.get("example"); applyWhere(example, true); return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ public String updateByPrimaryKeySelective(SqltoolStatement record) { BEGIN(); UPDATE("SQLTOOL_STATEMENT"); if (record.getDatabaseName() != null) { SET("DATABASE_NAME = #{databaseName,jdbcType=VARCHAR}"); } if (record.getQuery() != null) { SET("QUERY = #{query,jdbcType=VARCHAR}"); } if (record.getParamMap() != null) { SET("PARAM_MAP = #{paramMap,jdbcType=VARCHAR}"); } if (record.getUpdatedAt() != null) { SET("UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP}"); } if (record.getCreatedAt() != null) { SET("CREATED_AT = #{createdAt,jdbcType=TIMESTAMP}"); } if (record.getLockVersion() != null) { SET("LOCK_VERSION = #{lockVersion,jdbcType=INTEGER}"); } if (record.getDeletedFlg() != null) { SET("DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}"); } WHERE("ID = #{id,jdbcType=INTEGER}"); return SQL(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table SQLTOOL_STATEMENT * * @mbggenerated */ protected void applyWhere(SqltoolStatementCriteria example, boolean includeExamplePhrase) { if (example == null) { return; } String parmPhrase1; String parmPhrase1_th; String parmPhrase2; String parmPhrase2_th; String parmPhrase3; String parmPhrase3_th; if (includeExamplePhrase) { parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; } else { parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; } StringBuilder sb = new StringBuilder(); List<Criteria> oredCriteria = example.getOredCriteria(); boolean firstCriteria = true; for (int i = 0; i < oredCriteria.size(); i++) { Criteria criteria = oredCriteria.get(i); if (criteria.isValid()) { if (firstCriteria) { firstCriteria = false; } else { sb.append(" or "); } sb.append('('); List<Criterion> criterions = criteria.getAllCriteria(); boolean firstCriterion = true; for (int j = 0; j < criterions.size(); j++) { Criterion criterion = criterions.get(j); if (firstCriterion) { firstCriterion = false; } else { sb.append(" and "); } if (criterion.isNoValue()) { sb.append(criterion.getCondition()); } else if (criterion.isSingleValue()) { if (criterion.getTypeHandler() == null) { sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); } else { sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); } } else if (criterion.isBetweenValue()) { if (criterion.getTypeHandler() == null) { sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); } else { sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); } } else if (criterion.isListValue()) { sb.append(criterion.getCondition()); sb.append(" ("); List<?> listItems = (List<?>) criterion.getValue(); boolean comma = false; for (int k = 0; k < listItems.size(); k++) { if (comma) { sb.append(", "); } else { comma = true; } if (criterion.getTypeHandler() == null) { sb.append(String.format(parmPhrase3, i, j, k)); } else { sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); } } sb.append(')'); } } sb.append(')'); } } if (sb.length() > 0) { WHERE(sb.toString()); } } }
[ "agw.lvs.sainokuni@gmail.com" ]
agw.lvs.sainokuni@gmail.com
aa24bca4d7ce76f891454502f6730c427ac82fa1
59d7e97ed554053d896f179fd018c57196784d04
/src/main/java/com/example/demo3/model/Search.java
e610fbecbec547ca310e64d0031617500ac1b439
[]
no_license
JaapHoltman/Project-IT-Academy
6394e9424e7461cf00428abf99aa4920f2b20668
676e53e17a77ce82d28dfa6c1e592fc34df96169
refs/heads/master
2021-06-24T09:50:53.503614
2020-12-18T12:47:59
2020-12-18T12:47:59
168,359,354
0
0
null
null
null
null
UTF-8
Java
false
false
500
java
package com.example.demo3.model; public class Search { String search; public Search() { } public Search(String search) { this.search = search; } public String getSearch() { return search; } public void setSearch(String search) { this.search = search; } @Override public String toString() { return "Search{" + "search='" + search + '\'' + '}'; } }
[ "noreply@github.com" ]
noreply@github.com
f13482900fb06f3a1ec466441438883966489796
c3418e12a25b435c1c344e11b6feacd344f9be10
/src/main/java/co/creativegaming/java/recruiting/cgspringboottest/task2/domain/Trip.java
24a7f58b74e3b06758963648ba1cf9288eb748f7
[]
no_license
conroy1234/cg-spring-boot-test
baeba3bcf7850235d86eda51090b16fec64862cb
0eeba16298d589a92cc70c331925c9b520cbabbe
refs/heads/master
2020-08-31T07:33:26.303874
2019-10-22T20:47:51
2019-10-22T20:47:51
218,637,427
1
0
null
2019-10-30T22:24:01
2019-10-30T22:24:01
null
UTF-8
Java
false
false
470
java
package co.creativegaming.java.recruiting.cgspringboottest.task2.domain; import lombok.Data; import java.util.Set; @Data public class Trip { private Driver driver; private Set<Passenger> passengers; private Integer duration; private Double distance; private Double discount; public Double cost() { if (discount == null) { discount = 0.0D; } return (1 - discount) * (this.duration + this.distance); } }
[ "x.meng@outlook.com" ]
x.meng@outlook.com
4e75cfc6ebd9aeaa3505656f0fc7edbd0a2857ee
0c39b468aab694abbc228a025c921418041926d7
/Spring Lab32/src/com/jlcindia/spring/A.java
f71a1b4a71abf5e2df6c7a4081e11c80fa0ada24
[]
no_license
jitendrakr93/JLC_ALL_PROGRAMS
17cfc903c8e5befe2fe50ae89d874b53cf6e748f
eb9748a94e4a70e2504a3007624b83ca2fcd7078
refs/heads/master
2023-07-02T17:38:27.603260
2021-08-05T05:34:22
2021-08-05T05:34:22
392,905,494
0
0
null
null
null
null
UTF-8
Java
false
false
255
java
package com.jlcindia.spring; public class A { private int a; private String msg; public void setA(int a) { this.a = a; } public void setMsg(String msg) { this.msg = msg; } @Override public String toString() { return a + "\t" + msg ; } }
[ "jk93.161@gmail.com" ]
jk93.161@gmail.com
4063ee284468e094b564cce378fb449f0086ebd0
77f6eb9a4d043a6f2f7a070cc54a8c0809734fa7
/src/main/java/com/example/demo/CustomUserDetails.java
f8a28543e978278c6aec98d25c61941379bf0bb7
[]
no_license
cnewton1428/UpdatedSpringBootBullhorn
5eab312679a91949d1ef85a36ac725a8790470c0
b7b16a6fbad2883cc7e2d73386bef1024a73f262
refs/heads/master
2020-04-06T07:37:53.314617
2018-11-12T22:03:06
2018-11-12T22:03:06
157,279,572
0
0
null
null
null
null
UTF-8
Java
false
false
1,165
java
package com.example.demo; import org.springframework.security.core.GrantedAuthority; import java.util.Collection; public class CustomUserDetails extends org.springframework.security.core.userdetails.User { private User user; public CustomUserDetails(User user, Collection<? extends GrantedAuthority> authorities){ super(user.getUsername(), user.getPassword(), authorities); this.user= user; } public CustomUserDetails(User user, String password, Collection<? extends GrantedAuthority> authorities){ super(user.getUsername(), password, authorities); this.user = user; } public CustomUserDetails(User user, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities){ super(user.getUsername(), user.getPassword(), enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); this.user = user; } public User getUser() { return user; } }
[ "cncnewton37@gmail.com" ]
cncnewton37@gmail.com
8ff12314bb61ee9ad2e9e581a7d35e44fcb8fa8e
e74d35635248075d4aec915d20c7e0aef91c65c6
/hw11-cache/src/main/java/ru/otus/kasymbekovPN/HW11/cache/Cache.java
c4645aba858476fe47a926b89c0bec27121fcab5
[]
no_license
KasymbekovPN/otusJ
5f13e19f43b1b534cc70c15c40f1cfd4f14ea4bf
a0254308a35f047652e8e6118a9f9938896a73fa
refs/heads/master
2020-06-13T02:29:15.330072
2019-12-20T21:16:15
2019-12-20T21:16:15
194,500,974
0
0
null
2019-12-20T21:16:16
2019-06-30T10:01:46
Java
UTF-8
Java
false
false
1,116
java
package ru.otus.kasymbekovPN.HW11.cache; /** * Интерфейс для реализации кэша */ public interface Cache<K, V> { /** * Вставка значения по ключу * @param key ключ * @param value значение */ void put(K key, V value); /** * Удалени езначения по ключу * @param key ключ */ void remove(K key); /** * Геттер значения по ключу * @param key ключ * @return Значение */ V get(K key); /** * Подписать слушателя на кэш * @param listener слушатель */ void subscribeListener(CacheListener<K,V> listener); /** * ОТписать слушателя от кэша * @param listener слушатель */ void unsubscribeListener(CacheListener<K,V> listener); /** * Геттер размера данных * @return размер данных */ int size(); /** * Очистить кэш */ void clear(); }
[ "KasymbekovPN@yandex.ru" ]
KasymbekovPN@yandex.ru
35538e96c8ccaabc1614d4eff76ab09e906ff6ab
10d8020546dbdaf51a8e8e2d5d4ef44787c85319
/java/2444.java
e1716772ee0f2428eed6592fa599e98c0e9208b7
[]
no_license
DongGeon0908/BAEKJOON
9efc9e37f26592d10255fc70cddef3123501796b
b882de05c9fbae62b577eb8d853266563adb80bd
refs/heads/master
2023-07-13T15:24:08.176728
2021-08-16T05:45:10
2021-08-16T05:45:10
275,744,714
5
3
null
null
null
null
UTF-8
Java
false
false
618
java
import java.util.ArrayList; import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int count = scan.nextInt(); for (int i = 1; i <= count; i++) { for (int j = 0; j < count - i; j++) { System.out.print(" "); } for (int j = 1; j <= 2 * i - 1; j++) { System.out.print("*"); } System.out.println(); } for (int i = count-1; i >= 1; i--) { for (int j = 0; j < count - i; j++) { System.out.print(" "); } for (int j = 1; j <= 2 * i - 1; j++) { System.out.print("*"); } System.out.println(); } } }
[ "noreply@github.com" ]
noreply@github.com
0d484cac68dab0c494032241fb75e046d374d2bc
bea03ecd9c44c2a786f229fabe1dca5076c8b849
/app/src/main/java/com/example/lenovo/jdappzyf/first/view/weight/HeadView.java
c9d35c145be79133c5048687eec6b9c8882fc9b5
[]
no_license
zhaoyuanfang12138/JDAppZYF
ebf126401a2da34a34691a407bb07a0ad1de630a
2126a7cbcc11c4cdac601f0755ed3e9b6573f6e4
refs/heads/master
2020-04-07T20:46:28.031543
2018-11-22T13:22:39
2018-11-22T13:22:39
158,702,626
0
0
null
null
null
null
UTF-8
Java
false
false
1,868
java
package com.example.lenovo.jdappzyf.first.view.weight; import android.content.Context; import android.content.res.TypedArray; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.widget.RelativeLayout; import android.widget.TextView; import com.example.lenovo.jdappzyf.R; /** * Created by lenovo on 2018/11/15. */ public class HeadView extends RelativeLayout{ private boolean isShow; private String title; public HeadView(Context context) { super(context); init(context); } public HeadView(Context context, AttributeSet attrs) { super(context, attrs); TypedArray ty = context.obtainStyledAttributes(attrs, R.styleable.HeadView); title=ty.getString(R.styleable.HeadView_title); isShow=ty.getBoolean(R.styleable.HeadView_show,true); ty.recycle(); init(context); } public HeadView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context); } private void init(final Context context) { View view=View.inflate(context, R.layout.layout_back,null); TextView titleTxt=(TextView) view.findViewById(R.id.head_title); if(!TextUtils.isEmpty(title)){ titleTxt.setText(title); } RelativeLayout layoutBack=(RelativeLayout) view.findViewById(R.id.layout_back); if(isShow){ layoutBack.setVisibility(VISIBLE); }else{ layoutBack.setVisibility(GONE); } layoutBack.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { ((AppCompatActivity)context).finish();//关闭 } }); addView(view); } }
[ "1262581890@qq.com" ]
1262581890@qq.com
d5988fa1a43dcb3ce0acda566b29c31d782c795f
d9b9f9f2f23d2bf05569914e2e7e8cd5076c8b00
/infosys-destination/src/main/java/com/infosys/destination/service/DestinationSpecification.java
7160dd81e0717bf58316d5408117cf9083969750
[]
no_license
satriaprayoga/infosys-app
4824a03fc8689e1c6b9dbc38bf1f78f468147a36
c670c6c6d19bc5993733d53ba622f2e5e4a5d851
refs/heads/master
2022-11-16T16:19:47.830670
2020-07-10T22:51:57
2020-07-10T22:51:57
257,819,701
0
0
null
2020-04-22T16:44:17
2020-04-22T07:05:00
Java
UTF-8
Java
false
false
3,642
java
package com.infosys.destination.service; import java.util.ArrayList; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; import com.infosys.destination.domain.Destination; public class DestinationSpecification implements Specification<Destination>{ private static final long serialVersionUID = 5471911312389631742L; private List<SearchCriteria> list; public DestinationSpecification() { this.list=new ArrayList<SearchCriteria>(); } public void add(SearchCriteria criteria) { list.add(criteria); } @Override public Predicate toPredicate(Root<Destination> root, CriteriaQuery<?> query, CriteriaBuilder builder) { //create a new predicate list List<Predicate> predicates = new ArrayList<>(); //add add criteria to predicates for (SearchCriteria criteria : list) { if (criteria.getOperation().equals(SearchOperation.GREATER_THAN)) { predicates.add(builder.greaterThan( root.get(criteria.getKey()), criteria.getValue().toString())); } else if (criteria.getOperation().equals(SearchOperation.LESS_THAN)) { predicates.add(builder.lessThan( root.get(criteria.getKey()), criteria.getValue().toString())); } else if (criteria.getOperation().equals(SearchOperation.GREATER_THAN_EQUAL)) { predicates.add(builder.greaterThanOrEqualTo( root.get(criteria.getKey()), criteria.getValue().toString())); } else if (criteria.getOperation().equals(SearchOperation.LESS_THAN_EQUAL)) { predicates.add(builder.lessThanOrEqualTo( root.get(criteria.getKey()), criteria.getValue().toString())); } else if (criteria.getOperation().equals(SearchOperation.NOT_EQUAL)) { predicates.add(builder.notEqual( root.get(criteria.getKey()), criteria.getValue())); } else if (criteria.getOperation().equals(SearchOperation.EQUAL)) { predicates.add(builder.equal( root.get(criteria.getKey()), criteria.getValue())); } else if (criteria.getOperation().equals(SearchOperation.MATCH)) { predicates.add(builder.like( builder.lower(root.get(criteria.getKey())), "%" + criteria.getValue().toString().toLowerCase() + "%")); } else if (criteria.getOperation().equals(SearchOperation.MATCH_END)) { predicates.add(builder.like( builder.lower(root.get(criteria.getKey())), criteria.getValue().toString().toLowerCase() + "%")); } else if (criteria.getOperation().equals(SearchOperation.MATCH_START)) { predicates.add(builder.like( builder.lower(root.get(criteria.getKey())), "%" + criteria.getValue().toString().toLowerCase())); } else if (criteria.getOperation().equals(SearchOperation.IN)) { predicates.add(builder.in(root.get(criteria.getKey())).value(criteria.getValue())); } else if (criteria.getOperation().equals(SearchOperation.NOT_IN)) { predicates.add(builder.not(root.get(criteria.getKey())).in(criteria.getValue())); } } return builder.and(predicates.toArray(new Predicate[0])); } }
[ "satria.prayoga@gmail.com" ]
satria.prayoga@gmail.com
c997b17ba70560205b39fbef28c961819b993368
b90e12f02b6851026ecc2ad963f28920779e6ba8
/hdinsight/resource-manager/v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java
19b74979ea12d426b0df8472bb5c072b52c122ba
[ "MIT" ]
permissive
jalkanen/azure-sdk-for-java
a65634e947501c3c4dfad244aad16b9fdb2e9236
a77e4190481df308fec851aeab2e28ed314f6018
refs/heads/master
2023-05-30T19:18:13.872701
2019-02-15T03:54:59
2019-02-15T03:54:59
170,857,156
0
0
MIT
2019-02-15T11:49:39
2019-02-15T11:49:38
null
UTF-8
Java
false
false
2,936
java
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * */ package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; import rx.Completable; import rx.Observable; import rx.functions.Func1; import com.microsoft.azure.Page; import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; class ScriptActionsImpl extends WrapperImpl<ScriptActionsInner> implements ScriptActions { private final HDInsightManager manager; ScriptActionsImpl(HDInsightManager manager) { super(manager.inner().scriptActions()); this.manager = manager; } public HDInsightManager manager() { return this.manager; } private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { return new RuntimeScriptActionDetailImpl(inner, manager()); } @Override public Observable<RuntimeScriptActionDetail> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { ScriptActionsInner client = this.inner(); return client.listPersistedScriptsAsync(resourceGroupName, clusterName) .flatMapIterable(new Func1<Page<RuntimeScriptActionDetailInner>, Iterable<RuntimeScriptActionDetailInner>>() { @Override public Iterable<RuntimeScriptActionDetailInner> call(Page<RuntimeScriptActionDetailInner> page) { return page.items(); } }) .map(new Func1<RuntimeScriptActionDetailInner, RuntimeScriptActionDetail>() { @Override public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { return wrapModel(inner); } }); } @Override public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { ScriptActionsInner client = this.inner(); return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); } @Override public Observable<RuntimeScriptActionDetail> getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { ScriptActionsInner client = this.inner(); return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) .map(new Func1<RuntimeScriptActionDetailInner, RuntimeScriptActionDetail>() { @Override public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { return new RuntimeScriptActionDetailImpl(inner, manager()); } }); } }
[ "noreply@github.com" ]
noreply@github.com
abf20a54c7282fc67b7df42013a17ac7154c0e24
79e881b0b65660983bd635c30902481d498ff039
/app/src/main/java/com/example/elsis/arsenalfc/Fixtures.java
b54d6e091c66f72d43500a4ac1bd3fd97ceeec22
[]
no_license
Skumbatee/ArsenalFc
46d7a83c0ce65105c5dc967fb05e0939a8d30153
4291d25eb5f6da2a17c1b3e0987b9484322b9b15
refs/heads/master
2021-06-01T09:34:15.718765
2016-05-30T08:29:09
2016-05-30T08:29:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,651
java
package com.example.elsis.arsenalfc; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Toast; public class Fixtures extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fixtures); String fixtures[]={"Arsenal vs Westham \n 22/04/2016","Arsenal vs Leicester \n 1/03/2016","Arsenal vs Tottenham \n 12/12/2016","Arsenal vs Chelsea", "Arsenal vs Sunderland \n 1/02/2016","Arsenal vs Swansea\n 4/5/2016","Arsenal vs Liverpool \n 17/4/2016","Arsenal vs ManchesterCity \n 4/12/2016", "Arsenal vs Stoke city \n 6/8/2016","Liverpool vs Arsenal \n 4/2/2016","Tottenham vs Arsenal \n 5/3/2016 ","Swansea vs Arsenal \n 8/10/2016"}; ListAdapter theAdapter =new ArrayAdapter<String>(this,R.layout.row_layout,R.id.textView13,fixtures); ListView theView = (ListView) findViewById(R.id.theListView); theView.setAdapter(theAdapter); theView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { String tvShowPicked = "You picked" +String.valueOf(adapterView.getItemAtPosition(position)); Toast.makeText(Fixtures.this,tvShowPicked,Toast.LENGTH_LONG).show(); } }); } }
[ "sitatielsis@gmail.com" ]
sitatielsis@gmail.com
dac462715c9291e847479f869b9f645497571a3e
4c1a04ddf8c70edb25e0ce0df23591845c8e9008
/app/src/main/java/com/mobileguard/service/MessageService.java
66a67acc75edb8324abf3df40edd0b24bc780e2c
[]
no_license
chenanddom/MobileGuard
702286d8c8559af0822f5c3fee3a7a1a0ef32ffd
0a935bee718d63d2c0620873908f71637d74d1a2
refs/heads/master
2021-01-22T22:45:43.608820
2017-05-30T02:20:00
2017-05-30T02:20:00
92,788,983
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package com.mobileguard.service; import com.mobileguard.domain.Call; import com.mobileguard.domain.Message; import java.util.List; /** * 实现黑名单的发送的信息的数据的管理 * Created by chendom on 2017/4/17 0017. */ public interface MessageService { public boolean addMessage(Message msg)throws Exception; public boolean deleteMessage(int _id)throws Exception; public boolean deleteMessage(Message msg)throws Exception; public boolean updateMessage(Message msg)throws Exception; public List<Message> findAllMessage()throws Exception; public Message findMessageById(int _id)throws Exception; public Message findMessageByNumber(String number)throws Exception; }
[ "772571631@qq.com" ]
772571631@qq.com
fd7316f9b3004d8370673fea4f579585bb7fc6b4
64a555a49aea0e71c4e0ba178a19a48d8273135a
/src/main/java/com/qbhy/apiboot/framework/contracts/auth/Guard.java
02a2a44d3df6896c8ffcb368249b4aa08b00f967
[]
no_license
qbhy/apiboot
6ce784eb6f38d0b031d197e75d11b3ad25150aa5
2203ba4a1cd7e0ad7962398cc488dc4f4ba2f4d6
refs/heads/master
2020-07-05T12:52:38.068657
2019-09-28T06:28:08
2019-09-28T06:28:08
202,652,439
7
1
null
null
null
null
UTF-8
Java
false
false
1,655
java
package com.qbhy.apiboot.framework.contracts.auth; public interface Guard extends Cloneable { /** * Determine if the current user is authenticated. * * @return bool */ public boolean check(); /** * Determine if the current user is a guest. * * @return bool */ public boolean guest(); /** * Get the currently authenticated user. * * @return UserContract */ public AuthenticateAble user(); /** * 通过凭证直接获取用户 * * @return UserContract */ public AuthenticateAble user(Object credentials); /** * 直接取 guard 属性 * * @param get 是否直接从属性中获取 * @return UserContract */ public AuthenticateAble user(boolean get); /** * Get the ID for the currently authenticated user. * * @return int|string|null */ public Object id(); public Guard parseCredentials(Object credentials) throws Throwable; /** * Set the current user. * * @param user 用户实例 */ public void setUser(AuthenticateAble user); /** * 用户登录 * * @param user 用户 * @return token 之类的 * @throws Throwable 异常 */ public Object login(AuthenticateAble user) throws Throwable; /** * 克隆 guard 实例 * * @return 克隆后的实例 * @throws CloneNotSupportedException 异常 */ public Guard clone() throws CloneNotSupportedException; /** * 凭证唯一key * * @return key */ public String credentialsKey(Object credentials); }
[ "96qbhy@gmail.com" ]
96qbhy@gmail.com
096afaf9d338b4675571305ae178b7dba4b0f7b1
d665b4e4a0d1b20581e4afce40f87d320ef406f0
/src/elementsCartes/Ordinateur.java
ad6d4297f0dab9cf7ede4068ca9457c05d96acdb
[]
no_license
mkitane/HandizGame
f6f6dc89805a5292d2ce9e3b99d78ac68c0da97b
073be0c103c9b1a42aafa9d756c3c82f80c5c46c
refs/heads/master
2020-04-13T00:51:39.881604
2015-01-08T17:26:17
2015-01-08T17:26:17
17,672,497
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package elementsCartes; /** * Classe qui modelise un Ordinateur. * C'est un objet. * */ public class Ordinateur extends ObjetRecuperable{ /** * @param positionX * @param positionY * @param nomImage * @param proprietaire */ public Ordinateur(int positionX, int positionY, Patient proprietaire) { super(positionX, positionY, "Ordinateur",proprietaire); this.setThemeAssocie("Handicap et Entreprise"); } public String toString(){ return "Ordinateur"; } }
[ "mehdikitane@gmail.com" ]
mehdikitane@gmail.com
3c9400eee3fba9f2d7072ecc31bd130003497d6b
463269db6d956d90d1bb218ad5a998ec77a0621a
/src/main/java/br/com/syspersistence/repository/ServicoRepository.java
a2bdcf6f04651a317f1c4b28ed4b84cbe27ae734
[]
no_license
gilmardeveloper/java-jpa-hibernate-syspersistence
0d55c4641463d5f89107e1cd174f20d08da0143c
ba53df91ff45ed37731d094d3f3913d92a5c5f60
refs/heads/master
2021-06-24T11:12:04.654655
2017-08-21T22:17:02
2017-08-21T22:17:02
100,257,498
0
0
null
null
null
null
UTF-8
Java
false
false
519
java
package br.com.syspersistence.repository; import java.util.List; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import br.com.syspersistence.model.Servico; public interface ServicoRepository extends CrudRepository<Servico, Long> { @Query("select s from Servico s") List<Servico> listAll(); @Query("select s from Servico s where id = :id") Servico findServico(@Param("id") Long id); }
[ "gilmarcarlos.developer@gmail.com" ]
gilmarcarlos.developer@gmail.com
5248d2022bc6254067b8bc90fc7d69f2df31c88f
8df4348b4acb74e3cf07ba2bf8f3785de711aeee
/src/main/java/com/spring/handson/Application.java
24251baef04c00d4ae25682925a675ac37d73420
[]
no_license
arunvenmany/spring-boot-aks-demo
9b6916c29291dd30aef0db87c75436f155860f8f
0a702a1dd5d7c2693311f3882ac8302ef9486e03
refs/heads/master
2021-02-15T12:21:01.694297
2020-03-10T09:06:18
2020-03-10T09:06:18
244,898,290
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.spring.handson; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
[ "arunvenmany@gmail.com" ]
arunvenmany@gmail.com
2a76f718a222efbf693814d36fbbe0aeb8ea06fd
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_674f550529ef071c7f8524b2a115fce6be163fc1/LLVM_LoadCommand/5_674f550529ef071c7f8524b2a115fce6be163fc1_LLVM_LoadCommand_t.java
053f09c813b99fcccb181f451abd706c7b505807
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,418
java
package de.fuberlin.optimierung.commands; import java.util.LinkedList; import de.fuberlin.optimierung.ILLVM_Block; import de.fuberlin.optimierung.ILLVM_Command; import de.fuberlin.optimierung.LLVM_Operation; import de.fuberlin.optimierung.LLVM_Parameter; /* * Syntax; <result> = load [volatile] <ty>* <pointer>[, align <alignment>][, !nontemporal !<index>][, !invariant.load !<index>] <result> = load atomic [volatile] <ty>* <pointer> [singlethread] <ordering>, align <alignment> !<index> = !{ i32 1 } */ public class LLVM_LoadCommand extends LLVM_GenericCommand{ public LLVM_LoadCommand(String[] cmd, LLVM_Operation operation, ILLVM_Command predecessor, ILLVM_Block block, String comment){ super(operation, predecessor, block, comment); // Init operands operands = new LinkedList<LLVM_Parameter>(); // Typ und Name wohin geladen wird target = new LLVM_Parameter(cmd[0], cmd[3]); // Name aus welcher Adresse geladen wird operands.add(new LLVM_Parameter(cmd[4], cmd[3])); System.out.println("Operands generiert: "); System.out.println(this.toString()); } public String toString() { String cmd_out = target.getName()+" = "; cmd_out += "load "; cmd_out += operands.get(0).getTypeString()+" "; cmd_out += operands.get(0).getName(); cmd_out += getComment(); return cmd_out; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ebc7fb59cbe64ff3ae1bddf32831dbdfd6fc4b73
9444f4e3e4ea31db6b653cdb323a2bc7aafe521d
/src/java/cart/CartObj.java
81f19e85c0b89c350ac89194594d86bd3655dbd4
[]
no_license
vannlse130680/HotelBooking-App
a65e33249d42d3620d5c191c02de0479add62ff4
a875a8e9b49028c9c484ee594f03ea480fbacf7e
refs/heads/master
2020-12-01T16:03:04.168926
2019-12-29T02:21:14
2019-12-29T02:21:14
230,692,058
0
0
null
null
null
null
UTF-8
Java
false
false
1,123
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 cart; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * * @author Acer */ public class CartObj implements Serializable{ private Map<String, Room> items; public Map<String, Room> getItems() { return items; } public void addItemToCart(Room r) { if (this.items == null) { this.items = new HashMap<>(); } int amount = 0; if (this.items.containsKey(r.romId)) { amount = this.items.get(r.romId).quantity + r.quantity; r.setQuantity(amount); } this.items.put(r.romId, r); } public void removeItemFromCart(String roomId) { if (this.items == null) { return; } if (this.items.containsKey(roomId)) { this.items.remove(roomId); if (this.items.isEmpty()) { this.items = null; } } } }
[ "nguyenlamvan1999@gmail.com" ]
nguyenlamvan1999@gmail.com
f984d38699fde64eefe4d639c638f3c1724d6f0d
5b15752f48e5fc16b1b08bef549ee9b8e107a8b4
/src/main/java/by/book/web/servlet/order/BasketServlet.java
9b372c43ef36dce0d2699eb959cf9a9ef1927022
[]
no_license
yourVovchik/book-store-servlet-c40
84dc97596d9f750384dfbd0619afd3378a64472f
ecaa8af34f218e76045a27c9223c039b16745e21
refs/heads/main
2023-05-15T06:49:40.409292
2021-06-07T07:01:28
2021-06-07T07:01:28
363,479,136
0
0
null
2021-05-01T18:22:36
2021-05-01T18:22:36
null
UTF-8
Java
false
false
1,603
java
package by.book.web.servlet.order; import by.book.exception.InvalidRequestException; import by.book.service.OrderService; import by.book.service.ValidationService; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebServlet(urlPatterns = "/basket", name = "BasketServlet") public class BasketServlet extends HttpServlet { private OrderService orderService = new OrderService(); @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (orderService.basketIsEmpty()) { req.setAttribute("totalPrice", orderService.totalPrice()); req.setAttribute("listBook", orderService.getListBookInBasket()); } else { req.setAttribute("message", "Ваша корзина пуста"); } getServletContext().getRequestDispatcher("/pages/order/basket.jsp").forward(req, resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { try { orderService.addBookInBasket(ValidationService.validAndTransformStringToLong(req.getParameter("id"))); } catch (InvalidRequestException e) { req.setAttribute("massage", "Неккоректные данные"); } getServletContext().getRequestDispatcher("/pages/book.jsp").forward(req, resp); } }
[ "noobito.2011@gmail.com" ]
noobito.2011@gmail.com
57ae65f77dc12ab33e49a816ea1a70789c769f11
36bcee0d219f43135e10d84dd09107bdf73c91f7
/3.JavaMultithreading/src/com/javarush/task/task22/task2210/Solution.java
e0a30153443e63300ec4fa54c902f1b28e2a9f22
[]
no_license
RomanZnamerovskiy/myJavaRushTasks
c295cfc049bb4db38befcbd241f78abc8e487617
fdfe8bf2b3fa53eb8097d664e22c588448312ef7
refs/heads/master
2021-01-20T08:46:36.829455
2019-01-26T11:39:52
2019-01-26T11:39:52
101,573,011
0
0
null
null
null
null
UTF-8
Java
false
false
726
java
package com.javarush.task.task22.task2210; import java.util.LinkedList; import java.util.List; import java.util.StringTokenizer; /* StringTokenizer */ public class Solution { public static void main(String[] args) { for (String s: getTokens("level22.lesson13.task01", ".")) { System.out.println(s); } } public static String [] getTokens(String query, String delimiter) { StringTokenizer tokenizer = new StringTokenizer(query, delimiter); List<String> list = new LinkedList<>(); while (tokenizer.hasMoreTokens()) { list.add(tokenizer.nextToken()); } String[] arr = new String[list.size()]; return list.toArray(arr); } }
[ "r.znamerovskiy@gmail.com" ]
r.znamerovskiy@gmail.com
dba6b89a76e13f61076d7f217000ec56df3bd4a4
5d570f6458b15771918f901f3df6ed8d1cde24a5
/Main/app/SolutionTemplate.java
fe57dfb7dbc2953e64507cee3461c0186fa175db
[]
no_license
pratiksinghal48/Competitive-Programming
ec662b69f27554567e7b2c7a4d65fb3295654c16
759865b5eb1790911a019c6040d716804d1ff2e5
refs/heads/master
2021-08-28T09:30:48.685915
2017-12-11T21:20:49
2017-12-11T21:20:49
113,861,243
0
0
null
null
null
null
UTF-8
Java
false
false
684
java
package app; import java.io.InputStream; import java.io.OutputStream; public class SolutionTemplate implements IProblemSolver{ @Override public void solve(InputReader in, OutputWriter out) { } public static void main(String[] args){ InputStream inputStream=System.in; OutputStream outputStream=System.out; InputReader in=new InputReader(inputStream); OutputWriter out=new OutputWriter(outputStream); IProblemSolver problemSolver=new SolutionTemplate(); problemSolver.solve(in,out); out.flush(); out.close(); } // static class InputReader { // } // // static class OutputWriter { // } }
[ "pratiksinghal48@gmail.com" ]
pratiksinghal48@gmail.com
24900ebf8f4a0f23fc53cfeba742927ed11cc927
96e538cd51197e818d122243fee78cd4bca4d8e6
/src/main/java/sam/springframework/sfgpetclinic/model/PetType.java
44e56e5cdd6f5d47ae28e998b6846ae81430d8c4
[]
no_license
samikshya06/sfg-pet-clinic
ca341b72b8c73858833e7bf3ef1580b52ffcc2fd
d2b8ad9a87f09af74e960845b71ea71deb1082d7
refs/heads/master
2020-04-10T12:00:11.219424
2018-12-13T04:18:49
2018-12-13T04:18:49
161,008,721
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package sam.springframework.sfgpetclinic.model; public class PetType { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "samikshya.natekar@ge.com" ]
samikshya.natekar@ge.com
c3558ec11d486c4e67a6d243efd74440ad9f6aff
baffff1bc6454352780e1262aac507f668853bfb
/src/main/java/com/boubei/tss/um/sso/UMPasswordIdentifier.java
0cf660020ee3bd2168d22b697411be7e447e7359
[ "MIT" ]
permissive
bierguogai/boubei-tss
926c76c9aabef22db3d659488c6adb2d0710b219
9af9b9437f70d86f27026beb1a88215ecef4a893
refs/heads/master
2021-04-09T10:38:15.249177
2018-03-16T06:05:53
2018-03-16T06:06:12
125,503,070
2
0
null
2018-03-16T10:45:16
2018-03-16T10:45:15
null
UTF-8
Java
false
false
4,182
java
/* ================================================================== * Created [2009-08-29] by Jon.King * ================================================================== * TSS * ================================================================== * mailTo:boubei@163.com * Copyright (c) boubei.com, 2015-2018 * ================================================================== */ package com.boubei.tss.um.sso; import org.apache.log4j.Logger; import com.boubei.tss.EX; import com.boubei.tss.framework.Global; import com.boubei.tss.framework.exception.BusinessException; import com.boubei.tss.framework.sso.IOperator; import com.boubei.tss.framework.sso.IPWDOperator; import com.boubei.tss.framework.sso.IdentityGetter; import com.boubei.tss.framework.sso.IdentityGetterFactory; import com.boubei.tss.framework.sso.PasswordPassport; import com.boubei.tss.framework.sso.identifier.BaseUserIdentifier; import com.boubei.tss.um.entity.User; import com.boubei.tss.um.service.ILoginService; import com.boubei.tss.util.InfoEncoder; /** * <p> * UM本地用户密码身份认证器<br> * 根据用户帐号、密码等信息,通过UM本地数据库进行身份认证 * </p> */ public class UMPasswordIdentifier extends BaseUserIdentifier { protected Logger log = Logger.getLogger(this.getClass()); protected ILoginService loginservice = (ILoginService) Global.getBean("LoginService"); protected IOperator validate() throws BusinessException { PasswordPassport passport = new PasswordPassport(); String loginName = passport.getLoginName(); // loginName/email/mobile String passwd = passport.getPassword(); IPWDOperator operator; try { operator = loginservice.getOperatorDTOByLoginName(loginName); // mysql 不区分大小写 } catch (BusinessException e) { throw new BusinessException(e.getMessage(), false); } loginName = operator.getLoginName(); int errorCount = loginservice.checkPwdErrorCount(loginName); String md5Passwd1 = User.encodePasswd(loginName, passwd); String md5Passwd2 = User.encodePasswd(loginName.toUpperCase(), passwd); // 转换成大写再次尝试 String md5Passwd3 = User.encodePasswd(loginName.toLowerCase(), passwd); // 转换成小写再次尝试 String md5Passwd0 = operator.getPassword(); // 数据库里存的MD5加密密码 // 如果各种验证都不通过 if ( !md5Passwd1.equals(md5Passwd0) && !md5Passwd2.equals(md5Passwd0) && !md5Passwd3.equals(md5Passwd0) && !customizeValidate(operator, passwd) ) { // 记录密码连续输入错误的次数,超过10次将禁止登陆10分钟 try { loginservice.recordPwdErrorCount(loginName, errorCount); errorCount ++; } catch(Exception e) { } log.debug("[" + loginName + ", " + passwd + "] is wrong inputing passwd " + errorCount + " times"); String notice = errorCount == 10 ? EX.U_39 : EX.parse(EX.U_40, (10-errorCount)); throw new BusinessException(notice); } else { loginSuccess("Logon by UM "); } try { loginservice.setLastLoginTime(operator.getId()); } catch( Exception e ) { } return operator; } /* * 判断用户输入的密码是否和第三方系统的密码的一致,如果是,则将用户的平台里的密码也设置为该密码,并完成本次登录 * (适用于UM的用户从第三方导入的情况,因密码是加密的(且TSS里加密方式是账号 + 密码)) */ protected boolean customizeValidate(IPWDOperator operator, String passwd) { IdentityGetter ig = IdentityGetterFactory.create(); boolean result = ig.indentify(operator, passwd); if(result) { // 如果密码是在第三方系统里验证通过,则设置到UM中 try { Object token = loginservice.resetPassword(operator.getId(), passwd); loginSuccess( InfoEncoder.simpleEncode( (String)token, 12) ); } catch( Exception e ) { } } return result; } }
[ "jinpujun@gmail.com" ]
jinpujun@gmail.com
a7a6761d917987085c3a4cbdfd1b6aea679fdebb
a5688af8105f540a5810bfc70e61c12d172b711b
/app/src/main/java/kr/edcan/cardline/handler/EventHandler.java
e6d8e5ea02844ff18f6c4bb60b44f443c4f6fb71
[]
no_license
clik-labs/cardline_android
efb9a501cb1065e8da77a5e98d799609e0503983
62c3ff3f64233a63412224b16aaf0f68c08538d5
refs/heads/master
2021-01-18T20:52:27.935335
2017-07-19T06:10:57
2017-07-19T06:10:57
86,997,667
1
1
null
2017-05-06T15:56:51
2017-04-02T16:02:22
Java
UTF-8
Java
false
false
3,303
java
package kr.edcan.cardline.handler; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.util.Log; import android.view.View; import android.widget.Toast; import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; import com.facebook.login.LoginManager; import kr.edcan.cardline.R; import kr.edcan.cardline.activity.AccountActivity; import kr.edcan.cardline.activity.AuthActivity; import kr.edcan.cardline.activity.EDYActivity; import kr.edcan.cardline.activity.HistoryActivity; import kr.edcan.cardline.models.CardNews; import kr.edcan.cardline.utils.CredentialsManager; /** * Created by Junseok Oh on 2017-05-11. */ public class EventHandler { private Context context; public EventHandler(Context context) { this.context = context; } /** * Click Events */ /* * CardNews Content Click Event * */ public void onCardNewsClick(CardNews item) { Toast.makeText(context, "asdf", Toast.LENGTH_SHORT).show(); Log.e("Asdf", "asdf"); } /* * Setting Content Click Event * */ public void onSettingsListClick(int position) { switch (position) { case 0: context.startActivity(new Intent(context, EDYActivity.class)); break; case 1: // TODO 튜토리얼 완성 후 startActivity() break; case 2: context.startActivity(new Intent(context, HistoryActivity.class)); break; } } /* * EDPass ID Content Click Event * */ public void onEDPassIdClick() { context.startActivity(new Intent(context, AccountActivity.class)); } /* * Account Content Click Event * */ public void onAccountListClick(int position) { switch (position) { case 0: new MaterialDialog.Builder(context) .title("로그아웃") .content("계정에서 로그아웃합니다. 계속하시겠습니까?") .positiveText("확인") .negativeText("취소") .positiveColor(ContextCompat.getColor(context, R.color.colorPrimaryDark)) .onPositive(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { CredentialsManager.getInstance().removeAllData(); LoginManager.getInstance().logOut(); context.startActivity(new Intent(context, AuthActivity.class) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)); } }) .show(); break; // Facebook Login Connect, Disconnect case 1: // Synchorize break; case 2: // Editor Pro break; } } }
[ "kotohana5706@edcan.kr" ]
kotohana5706@edcan.kr
1f70ac416956943f260e476e98c335e39da6aff3
6ba19aac3fa61609d81808f5a15de6d4654b87de
/back-end/src/main/java/br/ufms/estagio/server/repository/PessoaFisicaBaseRepository.java
2aaa2103951de1110dc6ea4d6d5ca6ab7e3940ba
[]
no_license
rafaelgov95/Estagio-BackEnd
fd2deeef942cef44fb22ca37c249609fd4aacf28
f4aaeed3c041dbf1316ecdd4acbef7980467c198
refs/heads/master
2022-06-19T12:42:32.943534
2020-01-13T23:17:44
2020-01-13T23:17:44
205,286,102
0
0
null
2022-05-20T21:07:12
2019-08-30T02:06:16
Java
UTF-8
Java
false
false
1,230
java
/* * Copyright (C) 2017 Universidade Federal de Mato Grosso do Sul * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package br.ufms.estagio.server.repository; import br.ufms.estagio.server.resource.entity.PessoaFisica; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.NoRepositoryBean; /** * @author Kleber Kruger * @author Rafael Viana */ @NoRepositoryBean public interface PessoaFisicaBaseRepository<PF extends PessoaFisica> extends PessoaBaseRepository<PF> { @Query("select p from Pessoa as p where p.cpfCnpj = ?1") public PF findByCpf(String cpf); }
[ "rafaelgov95@gmail.com" ]
rafaelgov95@gmail.com
0562e9e1e2d14874fbc9dcd6635ee40d1dfcdb41
ce59095f6c75667dfdd9923e501ffe0c95fb6e5e
/AbhishekKaushal/FirstProject/src/oops/Strings.java
fa9740d8539449ac47ed4dbb0503c5086c7bedf6
[]
no_license
akaushal830/Java_coding
c27ebd0b98794b5df08c6885ac4ee0496c3490f5
b737db83aaa6061f6a12f2fb9195dfe6f23283ca
refs/heads/master
2022-12-17T21:52:45.055111
2020-09-21T11:25:34
2020-09-21T11:25:34
295,923,937
0
0
null
2020-09-16T04:35:48
2020-09-16T04:35:48
null
UTF-8
Java
false
false
500
java
package oops; public class Strings { public static void main(String[] args) { // TODO Auto-generated method stub char helloArray[] = {'h','e','l','l','o'}; String helloString = new String(helloArray); System.out.println(helloString); String palindrome= "Dot saw I was Tod"; System.out.println(palindrome.length()); System.out.println("Hello".concat("World")); String fs = String.format("Value of float is %f, while integer is %d", 1.2F,45); System.out.print(fs); } }
[ "41081555+akaushal830@users.noreply.github.com" ]
41081555+akaushal830@users.noreply.github.com
0186f2c6ac2305f855799aab33b1e4616b7bfb39
9d263bb09120af4acd3001618363413e1a50ba20
/src/ejerciciovolu1/pkg2/pkg3/pkg4/pkg5/pkg6/pkg7/pkg8/pkg9/Vehiculo.java
edc6b967c73b4af9d88870c875c82172da514f63
[]
no_license
roaco96/Ejercicio_Tipos_de_Vehiculos
9fe101763c65645a072d9312cad7a7bd2c4da113
37d8fd387dfa40d2e5669b7c013151ca0e9000a7
refs/heads/master
2020-05-25T08:16:04.165623
2017-03-14T08:45:12
2017-03-14T08:45:12
84,925,580
0
0
null
null
null
null
UTF-8
Java
false
false
1,892
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 ejerciciovolu1.pkg2.pkg3.pkg4.pkg5.pkg6.pkg7.pkg8.pkg9; /** * * @author */ public abstract class Vehiculo { private String matricula; private int dias_alquiler; /** * * @return la matricula del vehículo */ public String getMatricula() { return matricula; } /** * * @param matricula guarda una nueva matrícula para el vehículo */ public void setMatricula(String matricula) { this.matricula = matricula; } /** * * @return los días de alquiler */ public int getDias_alquiler() { return dias_alquiler; } /** * * @param dias_alquiler guarda un número nuevo de días de alquiler */ public void setDias_alquiler(int dias_alquiler) { this.dias_alquiler = dias_alquiler; } /** * Constructor por defecto del vehículo */ public Vehiculo() { matricula=""; dias_alquiler=-1; } /** * Constructor con parámetros del vehículo * @param matricula guarda el valor de la matrícula * @param dias_alquiler guarda el número de días de alquiler */ public Vehiculo(String matricula, int dias_alquiler) { this.matricula = matricula; this.dias_alquiler = dias_alquiler; } /** * Calcula el importe del aquiler * @return devuelve el precio total del alquiler */ public abstract double importeAlquiler(); /** * Muestra el recibo del alquiler * @return el recibo del alquiler */ public abstract String recibo(); }
[ "user@user-PC" ]
user@user-PC
14893833ff31f1e6e29da1f7fef28ff158018a18
4e941396bb1807c399c450a1d87e3336e820795d
/java/src/main/java/com/punkstudio/java/collection/list/QueueTest.java
7e8aa14f48f165ed18d5c3a41376accf1a7475cb
[ "Apache-2.0" ]
permissive
MasonIT/AndroidTechStack
243d8b466d1f0fc9c82cf129b09a57fce72dec4a
94a6d49da653aebfee690c8b430db952719aa994
refs/heads/master
2023-04-06T02:27:54.831263
2021-05-11T03:22:50
2021-05-11T03:22:50
253,797,763
1
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.punkstudio.java.collection.list; import java.util.LinkedList; /** * Date:2021/1/26-11:06 AM * * @author Mason */ public class QueueTest { final LinkedList<String> linkedList = new LinkedList<>(); // 放入 public void put(String str){ linkedList.addFirst(str); } // 获取 public String get(){ return linkedList.removeLast(); } // 判断是否为空 public boolean isEmpty(){ return linkedList.isEmpty(); } }
[ "mason_it@outlook.com" ]
mason_it@outlook.com
6173e5dcd4d98a92be0f06a498f049d99ff90cfd
2997bb165d3fc4e96d04b51a9407546233a041f1
/Lab 6/Exercise5.java
683edf5596e527b07f51727ab3e12ece92ef7232
[]
no_license
Muppallasrihari/Sharable_codes
82801fcad3289d107b25e6163f594203a5b69c12
c8383c0b7cfaaa7dccdae0c20a0064cf11bfc5d6
refs/heads/main
2023-02-16T05:25:37.865050
2021-01-15T18:06:19
2021-01-15T18:06:19
327,833,006
1
0
null
null
null
null
UTF-8
Java
false
false
1,103
java
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; /* * Create a method which accepts an array of integer elements and return the second smallest element in the array * @author- Ananya Priyadarshini */ public class Exercise5 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter the array size:"); int size=sc.nextInt(); int [] inputArray=new int[size]; System.out.println("Enter the array values:"); for(int i=0;i<size;i++) { inputArray[i]=sc.nextInt(); } System.out.println("Entered array elements are"); for(int num:inputArray) { System.out.println(num); } System.out.println("Second smallest element is"); System.out.println(getSecondSmallest(inputArray)); } public static int getSecondSmallest(int[] inputArray){ List list=new ArrayList(); for(int num:inputArray) { list.add(num); } Collections.sort(list); return (int) list.get(1); } }
[ "noreply@github.com" ]
noreply@github.com
941daf74f4934f61b4dec57f8bc64763ecbbdef4
ec49847b220bf8f319300f3a99d05022fa44c0da
/GoogleConnector/src/main/java/com/PickMeUp/model/GeocodingResult.java
6a3b76d518313b932bd0fb22ccfed5508d095645
[]
no_license
Roberttenbosch/JavaProjectjes
010b9551153c3e8dbf1647a368df4ac4c9319cdc
3aeb900b54bb520de499ca2c4456d968ec812237
refs/heads/master
2020-04-11T04:33:51.971524
2018-12-18T13:11:04
2018-12-18T13:11:04
161,516,568
0
0
null
null
null
null
UTF-8
Java
false
false
1,943
java
package com.PickMeUp.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @JsonIgnoreProperties(ignoreUnknown = true) public class GeocodingResult { @JsonProperty("address_components") private AddressComponent[] addressComponents; @JsonProperty("formatted_address") private String formattedAddress;; @JsonProperty("postcode_localities") private String[] postcodeLocalities; @JsonProperty("geometry") private Geometry geometry; /* @JsonProperty("types") private AddressType[] types;*/ @JsonProperty("partial_match") private boolean partialMatch; @JsonProperty("place_id") private String placeId; public AddressComponent[] getAddressComponents() { return addressComponents; } public void setAddressComponents(AddressComponent[] addressComponents) { this.addressComponents = addressComponents; } public String getFormattedAddress() { return formattedAddress; } public void setFormattedAddress(String formattedAddress) { this.formattedAddress = formattedAddress; } public String[] getPostcodeLocalities() { return postcodeLocalities; } public void setPostcodeLocalities(String[] postcodeLocalities) { this.postcodeLocalities = postcodeLocalities; } public Geometry getGeometry() { return geometry; } public void setGeometry(Geometry geometry) { this.geometry = geometry; } /* public AddressType[] getTypes() { return types; } public void setTypes(AddressType[] types) { this.types = types; }*/ public boolean isPartialMatch() { return partialMatch; } public void setPartialMatch(boolean partialMatch) { this.partialMatch = partialMatch; } public String getPlaceId() { return placeId; } public void setPlaceId(String placeId) { this.placeId = placeId; } }
[ "roberttenbosch@gmail.com" ]
roberttenbosch@gmail.com
3c3934bc27f1798ab8e9bea1acaec5128c1f8bfe
ec4302037fbcc9247841268903b386da9badb402
/hmwkb/wkbjsonModel/src/main/java/com/heima/json/SubordinateTask.java
6baacec31c231669b3c91a3b339ae11856f2f612
[]
no_license
kuaima2018/wkb-java
25a6b089a47cbbf0e3d2e874d9f60a2960b7e7ab
7c8d5b73e2bbcade1d560fce3d1b2f85494bf3af
refs/heads/master
2021-05-02T07:53:30.207392
2018-03-31T03:46:11
2018-03-31T03:46:11
120,839,468
1
0
null
null
null
null
UTF-8
Java
false
false
689
java
package com.heima.json; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * Created with (TC). * User: 徐志凯 * Date: 14-4-20 * 橡果国际-系统集成部 * Copyright (c) 2012-2013 ACORN, Inc. All rights reserved. */ public class SubordinateTask extends UserTask implements Serializable { public SubordinateTask() { this.receivenames=new ArrayList<String>(); } public List<String> getReceivenames() { return receivenames; } public void setReceivenames(List<String> receivenames) { this.receivenames = receivenames; } private List<String> receivenames; }
[ "keithguo@192.168.1.107" ]
keithguo@192.168.1.107
02e7dbb68ffacdc2cfb3bf16664eaba8a26fca8f
3644db2a0f2e3bd228088688d27f3787ae8daa6d
/src/main/java/com/example/demo/test/BsasicInfo.java
3db6f86b7daf282808946f3a0abe6b1dd55bf0c7
[]
no_license
fbz1233333/test-fbz-myInfo
030bf8ac7ddc9fdb4e2d9454a5da8e2e4db0de1b
7aaca2e9d33eabec517d139a8ecf53527ad758c7
refs/heads/master
2020-12-04T01:42:37.012811
2020-01-08T05:51:16
2020-01-08T05:51:16
231,557,341
0
0
null
null
null
null
UTF-8
Java
false
false
158
java
package com.example.demo.test; import lombok.Data; import java.util.Date; @Data public class BsasicInfo { Integer isDel=1; Date date=new Date(); }
[ "719577252@qq.com" ]
719577252@qq.com
7a4d685cf9c952c1e400d3bc53ec9bdd5dc6d122
db97ce70bd53e5c258ecda4c34a5ec641e12d488
/src/main/java/com/alipay/api/domain/MybankPaymentTradeAccountSubvirtualcardCreateModel.java
10641376f5397f898d194a538a754e6cc86cef6c
[ "Apache-2.0" ]
permissive
smitzhang/alipay-sdk-java-all
dccc7493c03b3c937f93e7e2be750619f9bed068
a835a9c91e800e7c9350d479e84f9a74b211f0c4
refs/heads/master
2022-11-23T20:32:27.041116
2020-08-03T13:03:02
2020-08-03T13:03:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,115
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 开立子卡号 * * @author auto create * @since 1.0, 2019-03-26 10:40:04 */ public class MybankPaymentTradeAccountSubvirtualcardCreateModel extends AlipayObject { private static final long serialVersionUID = 6843815552581522631L; /** * 买家标识 */ @ApiField("member_id") private String memberId; /** * 卖家主卡户名 */ @ApiField("prim_card_name") private String primCardName; /** * 卖家主卡号 */ @ApiField("prim_card_no") private String primCardNo; public String getMemberId() { return this.memberId; } public void setMemberId(String memberId) { this.memberId = memberId; } public String getPrimCardName() { return this.primCardName; } public void setPrimCardName(String primCardName) { this.primCardName = primCardName; } public String getPrimCardNo() { return this.primCardNo; } public void setPrimCardNo(String primCardNo) { this.primCardNo = primCardNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
868cf377205ce974dd27f5b463c2aec5e64fcfd1
a13f3289e41432289c3ceab789de8aa3c9c41e05
/src/collection/Example1.java
934bfd9df854802b8f0bf1540b7d93c3a406cbd5
[]
no_license
aswanthkv/aswa
dd6550a248fef784ed8154859041cc92fab1e010
436b55f922e4d5ad1d7095eac01aed55c0fa6d07
refs/heads/master
2020-03-27T08:37:58.454944
2018-08-31T06:42:59
2018-08-31T06:42:59
146,271,770
0
0
null
null
null
null
UTF-8
Java
false
false
1,069
java
package collection; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Example1 { public static void main(String[] args) { /* generic declaration */ //array list mainatins order. ArrayList<String> al=new ArrayList(); ArrayList<Integer> a=new ArrayList(); List<String> al1=new ArrayList<>(); ArrayList<String>al2=new ArrayList<String>(); al.add("ashuk"); al.add("jiz"); a.add(1); a.add(45); a.add(3); al1.add("apple"); al1.add("cherry"); al.addAll(2,al1); al.remove(1); al.remove("apple"); for(String obj:al) { System.out.println(obj); } for(int ob:a) { //System.out.println(ob); } Iterator itr=a.iterator(); while(itr.hasNext()){ //System.out.println(itr.next()); } for(int i=0;i<al.size();i++) { //System.out.println(al.get(i)); } } }
[ "aswanthkv1996@gmail.com" ]
aswanthkv1996@gmail.com
3cb8bc480ad05612aa018083b3e6ed341a1299c4
c08c348d49881a7c8f0747cd3a6118adad07177a
/src/demo/MyThread2.java
235192509ce994c6c14b00e7f91b21cf63efb517
[]
no_license
dungchv13/module2_18_thuchanh_1
6a75f9f354fcd18788d7ef894e31fd7c5607e3f5
edd792e998b1f27a8054393a9c9846c0011831af
refs/heads/master
2023-01-03T13:07:09.534504
2020-10-28T04:15:04
2020-10-28T04:15:04
307,904,278
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package demo; class MyThread2 extends Thread { Table t; MyThread2(Table t) { this.t = t; } public void run() { t.printTable(100); } }
[ "Dungutc13@gmail.com" ]
Dungutc13@gmail.com
087d159dd5b00ea823379aeca86eeecd6c8d8e5c
782fbea594a223aa789b38e2f0f79479dc3afaeb
/src/main/java/com/bmc/files_loader/services/files_generator/FilesGenerator.java
5c0a478cd0ba14da9e92b54cc37d6612f369a2a0
[]
no_license
secured128/bmc-files-loader
6dfdbb881d1bd4c46cb6d2e8cfe87fea4cd29bb4
8abf08ec93e703b823d5b816b97cc8e2ab9ec230
refs/heads/master
2023-07-21T16:20:05.626849
2021-08-11T19:08:03
2021-08-11T19:08:03
395,073,457
0
0
null
null
null
null
UTF-8
Java
false
false
168
java
package com.bmc.files_loader.services.files_generator; public interface FilesGenerator { String generateFiles(); void createFile(String inputDirectoryPath); }
[ "ella.bromberg.1978@gmail.com" ]
ella.bromberg.1978@gmail.com
9f5a15ff1a6163b5543428a995c0886e2cb4db3c
0d8d110f4532cd0d9b69a0aaed0b22189ea36aaa
/WordCount.java
631ce6d63a8320aa2855b9458588e985b318c28a
[]
no_license
tbutz12/wordcount
b86bbdf98a59226afa1c3b47b97dacc9b142ad51
c96ac17ea39c306e7cbf5fc6d8c236bd2fc039f5
refs/heads/main
2023-04-13T03:07:04.301713
2021-03-27T18:53:32
2021-03-27T18:53:32
352,146,364
0
0
null
null
null
null
UTF-8
Java
false
false
2,305
java
import java.io.IOException; import java.util.StringTokenizer; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; public class WordCount { public static class TokenizerMapper extends Mapper<Object, Text, Text, IntWritable> { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map(Object key, Text value, Context context ) throws IOException, InterruptedException { StringTokenizer itr = new StringTokenizer(value.toString()); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); context.write(word, one); } } } public static class IntSumReducer extends Reducer<Text,IntWritable,Text,IntWritable> { private IntWritable result = new IntWritable(); public void reduce(Text key, Iterable<IntWritable> values, Context context ) throws IOException, InterruptedException { int sum = 0; for (IntWritable val : values) { sum += val.get(); } result.set(sum); context.write(key, result); } } public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); Configuration conf = new Configuration(); Job job = Job.getInstance(conf, "word count"); job.setJarByClass(WordCount.class); job.setMapperClass(TokenizerMapper.class); job.setCombinerClass(IntSumReducer.class); job.setReducerClass(IntSumReducer.class); job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); int x = job.waitForCompletion(true) ? 0 : 1; long end = System.currentTimeMillis(); System.out.println("Took : " + ((end - start) / 1000.0)); System.exit(x); } }
[ "53327335+tbutz12@users.noreply.github.com" ]
53327335+tbutz12@users.noreply.github.com
c5fa101d9516d1fb78c435349b150db158d941fd
b6a102cef8543f151a1655a8185b62235467c6cc
/SpringBootDevTeam/src/main/java/com/devteam/week1/BookNotFoundException.java
2425a165c689ecd85cd5187aa42f23fde2736c55
[]
no_license
MUHAMMAD-SAQIB-2000/SpringBoot
9f3911207a8225cbb5e01897ebf10d1db0a04f2a
034a273be4974714e8b3ac17de260d4cd410787d
refs/heads/master
2023-01-12T09:59:41.612380
2020-11-16T08:07:15
2020-11-16T08:07:15
275,642,504
0
0
null
2020-08-16T07:17:30
2020-06-28T18:14:50
JavaScript
UTF-8
Java
false
false
446
java
package com.devteam.week1; public class BookNotFoundException extends RuntimeException { public BookNotFoundException() { super(); } public BookNotFoundException(final String message, final Throwable cause) { super(message, cause); } public BookNotFoundException(final String message) { super(message); } public BookNotFoundException(final Throwable cause) { super(cause); } }
[ "saqibmakhan@gmail.com" ]
saqibmakhan@gmail.com
b0ef933b651a0e642fadf55849c9bbf59681ffc4
4490500e1df4002454598c584b31b2ee21acd9be
/src/sprite/Sprite.java
52fb38cabe5d5a2cc5dabb6a1484b13d2d7dd907
[]
no_license
noelweidner/JavaBasicGame
ca72ce3ed22e5e2d63fcdd8561c8319479de028a
ca20cdd90a839515f5191ab82e0b76d73d444f91
refs/heads/master
2020-12-23T09:19:01.040699
2020-01-30T00:34:09
2020-01-30T00:34:09
237,109,740
0
0
null
null
null
null
UTF-8
Java
false
false
1,042
java
package sprite; import java.awt.Image; import javax.swing.ImageIcon; import java.awt.Rectangle; public class Sprite { protected int x; protected int y; protected int width; protected int height; protected boolean visible; protected Image image; public Sprite(int x, int y) { this.x = x; this.y = y; visible = true; } protected void loadImage(String imageName) { ImageIcon ii = new ImageIcon(imageName); image = ii.getImage(); } protected void getImageDimensions() { width = image.getWidth(null); height = image.getHeight(null); } public Image getImage() { return image; } public int getX() { return x; } public int getY() { return y; } public boolean isVisible() { return visible; } public void setVisible(Boolean visible) { this.visible = visible; } public Rectangle getBounds(){ return new Rectangle(x, y, width, height); } }
[ "noel.weidner@web.de" ]
noel.weidner@web.de
4d4507f5bc54b040fd2e5c05caba25352b88d87f
7700bbacf8a5bcb63f8d3e46bdbd57d298fedc08
/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/TestingDispatcher.java
6a623768bb2f340661efef69d307e6a0e63a6204
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "MIT", "OFL-1.1", "ISC" ]
permissive
whw19950510/flink-dev
9029026f812cc802f3559f5c7d834f512da8e978
a81ccc2310c5c96bee2206e5b15baa29d0a459f4
refs/heads/master
2020-04-07T04:08:42.369140
2018-11-27T01:47:24
2018-11-27T01:47:24
158,041,646
1
1
Apache-2.0
2019-01-15T06:45:12
2018-11-18T02:01:18
Java
UTF-8
Java
false
false
3,255
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.runtime.dispatcher; import org.apache.flink.api.common.JobID; import org.apache.flink.api.common.time.Time; import org.apache.flink.configuration.Configuration; import org.apache.flink.runtime.blob.BlobServer; import org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph; import org.apache.flink.runtime.heartbeat.HeartbeatServices; import org.apache.flink.runtime.highavailability.HighAvailabilityServices; import org.apache.flink.runtime.metrics.groups.JobManagerMetricGroup; import org.apache.flink.runtime.resourcemanager.ResourceManagerGateway; import org.apache.flink.runtime.rpc.FatalErrorHandler; import org.apache.flink.runtime.rpc.RpcService; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.concurrent.CompletableFuture; import java.util.function.Function; /** * {@link Dispatcher} implementation used for testing purposes. */ class TestingDispatcher extends Dispatcher { TestingDispatcher( RpcService rpcService, String endpointId, Configuration configuration, HighAvailabilityServices highAvailabilityServices, ResourceManagerGateway resourceManagerGateway, BlobServer blobServer, HeartbeatServices heartbeatServices, JobManagerMetricGroup jobManagerMetricGroup, @Nullable String metricQueryServicePath, ArchivedExecutionGraphStore archivedExecutionGraphStore, JobManagerRunnerFactory jobManagerRunnerFactory, FatalErrorHandler fatalErrorHandler) throws Exception { super( rpcService, endpointId, configuration, highAvailabilityServices, highAvailabilityServices.getSubmittedJobGraphStore(), resourceManagerGateway, blobServer, heartbeatServices, jobManagerMetricGroup, metricQueryServicePath, archivedExecutionGraphStore, jobManagerRunnerFactory, fatalErrorHandler, null, VoidHistoryServerArchivist.INSTANCE); } void completeJobExecution(ArchivedExecutionGraph archivedExecutionGraph) { runAsync( () -> jobReachedGloballyTerminalState(archivedExecutionGraph)); } CompletableFuture<Void> getJobTerminationFuture(@Nonnull JobID jobId, @Nonnull Time timeout) { return callAsyncWithoutFencing( () -> getJobTerminationFuture(jobId), timeout).thenCompose(Function.identity()); } CompletableFuture<Void> getRecoverOperationFuture(@Nonnull Time timeout) { return callAsyncWithoutFencing( this::getRecoveryOperation, timeout).thenCompose(Function.identity()); } }
[ "weixiao@qunhemail.com" ]
weixiao@qunhemail.com
aa832ff7328bfec26d0d11640bd5d8e377730c1a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_06691402c06e64502e37a9b5ebdd6d9c6e99fb81/ID3v24Frames/8_06691402c06e64502e37a9b5ebdd6d9c6e99fb81_ID3v24Frames_s.java
7a0027d6847b89726837bf0d185762d78fb7f1bb
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
13,882
java
/* * Jaudiotagger Copyright (C)2004,2005 * * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, * or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, * you can get a copy from http://www.opensource.org/licenses/lgpl-license.php or write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.jaudiotagger.tag.id3; import org.jaudiotagger.tag.id3.ID3Frames; import java.util.*; /** * Defines ID3 frames and collections that categorise frames. * * @author Paul Taylor * @version $Id$ */ public class ID3v24Frames extends ID3Frames { /** * Frame IDs begining with T are text frames, & with W are url frames */ public static final String FRAME_ID_ACCOMPANIMENT = "TPE2"; public static final String FRAME_ID_ALBUM = "TALB"; public static final String FRAME_ID_ALBUM_SORT_ORDER = "TSOA"; public static final String FRAME_ID_ARTIST = "TPE1"; public static final String FRAME_ID_ATTACHED_PICTURE = "APIC"; public static final String FRAME_ID_AUDIO_ENCRYPTION = "AENC"; public static final String FRAME_ID_AUDIO_SEEK_POINT_INDEX = "ASPI"; public static final String FRAME_ID_BPM = "TBPM"; public static final String FRAME_ID_COMMENT = "COMM"; public static final String FRAME_ID_COMMERCIAL_FRAME = "COMR"; public static final String FRAME_ID_COMPOSER = "TCOM"; public static final String FRAME_ID_CONDUCTOR = "TPE3"; public static final String FRAME_ID_CONTENT_GROUP_DESC = "TIT1"; public static final String FRAME_ID_COPYRIGHTINFO = "TCOP"; public static final String FRAME_ID_ENCODEDBY = "TENC"; public static final String FRAME_ID_ENCODING_TIME = "TDEN"; public static final String FRAME_ID_ENCRYPTION = "ENCR"; public static final String FRAME_ID_EQUALISATION2 = "EQU2"; public static final String FRAME_ID_EVENT_TIMING_CODES = "ETCO"; public static final String FRAME_ID_FILE_OWNER = "TOWN"; public static final String FRAME_ID_FILE_TYPE = "TFLT"; public static final String FRAME_ID_GENERAL_ENCAPS_OBJECT = "GEOB"; public static final String FRAME_ID_GENRE = "TCON"; public static final String FRAME_ID_GROUP_ID_REG = "GRID"; public static final String FRAME_ID_HW_SW_SETTINGS = "TSSE"; public static final String FRAME_ID_INITIAL_KEY = "TKEY"; public static final String FRAME_ID_INVOLVED_PEOPLE = "TIPL"; public static final String FRAME_ID_ISRC = "TSRC"; public static final String FRAME_ID_LANGUAGE = "TLAN"; public static final String FRAME_ID_LENGTH = "TLEN"; public static final String FRAME_ID_LINKED_INFO = "LINK"; public static final String FRAME_ID_LYRICIST = "TEXT"; public static final String FRAME_ID_MEDIA_TYPE = "TMED"; public static final String FRAME_ID_MOOD = "TMOO"; public static final String FRAME_ID_MPEG_LOCATION_LOOKUP_TABLE = "MLLT"; public static final String FRAME_ID_MUSICIAN_CREDITS = "TMCL"; public static final String FRAME_ID_MUSIC_CD_ID = "MCDI"; public static final String FRAME_ID_ORIGARTIST = "TOPE"; public static final String FRAME_ID_ORIGINAL_RELEASE_TIME = "TDOR"; public static final String FRAME_ID_ORIG_FILENAME = "TOFN"; public static final String FRAME_ID_ORIG_LYRICIST = "TOLY"; public static final String FRAME_ID_ORIG_TITLE = "TOAL"; public static final String FRAME_ID_OWNERSHIP = "OWNE"; public static final String FRAME_ID_PERFORMER_SORT_OWNER = "TSOP"; public static final String FRAME_ID_PLAYLIST_DELAY = "TDLY"; public static final String FRAME_ID_PLAY_COUNTER = "PCNT"; public static final String FRAME_ID_POPULARIMETER = "POPM"; public static final String FRAME_ID_POSITION_SYNC = "POSS"; public static final String FRAME_ID_PRIVATE = "PRIV"; public static final String FRAME_ID_PRODUCED_NOTICE = "TPRO"; public static final String FRAME_ID_PUBLISHER = "TPUB"; public static final String FRAME_ID_RADIO_NAME = "TRSN"; public static final String FRAME_ID_RADIO_OWNER = "TRSO"; public static final String FRAME_ID_RECOMMENDED_BUFFER_SIZE = "RBUF"; public static final String FRAME_ID_RELATIVE_VOLUME_ADJUSTMENT2 = "RVA2"; public static final String FRAME_ID_RELEASE_TIME = "TDRL"; public static final String FRAME_ID_REMIXED = "TPE4"; public static final String FRAME_ID_REVERB = "RVRB"; public static final String FRAME_ID_SEEK = "SEEK"; public static final String FRAME_ID_SET = "TPOS"; public static final String FRAME_ID_SET_SUBTITLE = "TSST"; public static final String FRAME_ID_SIGNATURE = "SIGN"; public static final String FRAME_ID_SYNC_LYRIC = "SYLT"; public static final String FRAME_ID_SYNC_TEMPO = "SYTC"; public static final String FRAME_ID_TAGGING_TIME = "TDTG"; public static final String FRAME_ID_TERMS_OF_USE = "USER"; public static final String FRAME_ID_TITLE = "TIT2"; public static final String FRAME_ID_TITLE_REFINEMENT = "TIT3"; public static final String FRAME_ID_TITLE_SORT_OWNER = "TSOT"; public static final String FRAME_ID_TRACK = "TRCK"; public static final String FRAME_ID_UNIQUE_FILE_ID = "UFID"; public static final String FRAME_ID_UNSYNC_LYRICS = "USLT"; public static final String FRAME_ID_URL_ARTIST_WEB = "WOAR"; public static final String FRAME_ID_URL_COMMERCIAL = "WCOM"; public static final String FRAME_ID_URL_COPYRIGHT = "WCOP"; public static final String FRAME_ID_URL_FILE_WEB = "WOAF"; public static final String FRAME_ID_URL_OFFICIAL_RADIO = "WORS"; public static final String FRAME_ID_URL_PAYMENT = "WPAY"; public static final String FRAME_ID_URL_PUBLISHERS = "WPUB"; public static final String FRAME_ID_URL_SOURCE_WEB = "WOAS"; public static final String FRAME_ID_USER_DEFINED_INFO = "TXXX"; public static final String FRAME_ID_USER_DEFINED_URL = "WXXX"; public static final String FRAME_ID_YEAR = "TDRC"; private static ID3v24Frames id3v24Frames; public static ID3v24Frames getInstanceOf() { if (id3v24Frames == null) { id3v24Frames = new ID3v24Frames(); } return id3v24Frames; } private ID3v24Frames() { idToValue.put(FRAME_ID_ACCOMPANIMENT, "Text: Band/Orchestra/Accompaniment"); idToValue.put(FRAME_ID_ALBUM, "Text: Album/Movie/Show title"); idToValue.put(FRAME_ID_ALBUM_SORT_ORDER, "Album sort order"); idToValue.put(FRAME_ID_ARTIST, "Text: Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group"); idToValue.put(FRAME_ID_ATTACHED_PICTURE, "Attached picture"); idToValue.put(FRAME_ID_AUDIO_ENCRYPTION, "Audio encryption"); idToValue.put(FRAME_ID_AUDIO_SEEK_POINT_INDEX, "Audio seek point index"); idToValue.put(FRAME_ID_BPM, "Text: BPM (Beats Per Minute)"); idToValue.put(FRAME_ID_COMMENT, "Comments"); idToValue.put(FRAME_ID_COMMERCIAL_FRAME, "Commercial Frame"); idToValue.put(FRAME_ID_COMPOSER, "Text: Composer"); idToValue.put(FRAME_ID_CONDUCTOR, "Text: Conductor/Performer refinement"); idToValue.put(FRAME_ID_CONTENT_GROUP_DESC, "Text: Content group description"); idToValue.put(FRAME_ID_COPYRIGHTINFO, "Text: Copyright message"); idToValue.put(FRAME_ID_ENCODEDBY, "Text: Encoded by"); idToValue.put(FRAME_ID_ENCODING_TIME, "Text: Encoding time"); idToValue.put(FRAME_ID_ENCRYPTION, "Encryption method registration"); idToValue.put(FRAME_ID_EQUALISATION2, "Equalization (2)"); idToValue.put(FRAME_ID_EVENT_TIMING_CODES, "Event timing codes"); idToValue.put(FRAME_ID_FILE_OWNER, "Text:File Owner"); idToValue.put(FRAME_ID_FILE_TYPE, "Text: File type"); idToValue.put(FRAME_ID_GENERAL_ENCAPS_OBJECT, "General encapsulated datatype"); idToValue.put(FRAME_ID_GENRE, "Text: Content type"); idToValue.put(FRAME_ID_GROUP_ID_REG,"Group ID Registration"); idToValue.put(FRAME_ID_HW_SW_SETTINGS, "Text: Software/hardware and settings used for encoding"); idToValue.put(FRAME_ID_INITIAL_KEY, "Text: Initial key"); idToValue.put(FRAME_ID_INVOLVED_PEOPLE, "Involved people list"); idToValue.put(FRAME_ID_ISRC, "Text: ISRC (International Standard Recording Code)"); idToValue.put(FRAME_ID_LANGUAGE, "Text: Language(s)"); idToValue.put(FRAME_ID_LENGTH, "Text: Length"); idToValue.put(FRAME_ID_LINKED_INFO, "Linked information"); idToValue.put(FRAME_ID_LYRICIST, "Text: Lyricist/text writer"); idToValue.put(FRAME_ID_MEDIA_TYPE, "Text: Media type"); idToValue.put(FRAME_ID_MOOD, "Text: Mood"); idToValue.put(FRAME_ID_MPEG_LOCATION_LOOKUP_TABLE, "MPEG location lookup table"); idToValue.put(FRAME_ID_MUSIC_CD_ID, "Music CD Identifier"); idToValue.put(FRAME_ID_ORIGARTIST, "Text: Original artist(s)/performer(s)"); idToValue.put(FRAME_ID_ORIGINAL_RELEASE_TIME, "Text: Original release time"); idToValue.put(FRAME_ID_ORIG_FILENAME, "Text: Original filename"); idToValue.put(FRAME_ID_ORIG_LYRICIST, "Text: Original Lyricist(s)/text writer(s)"); idToValue.put(FRAME_ID_ORIG_TITLE, "Text: Original album/Movie/Show title"); idToValue.put(FRAME_ID_OWNERSHIP, "Ownership"); idToValue.put(FRAME_ID_PERFORMER_SORT_OWNER, "Performance Sort Order"); idToValue.put(FRAME_ID_PLAYLIST_DELAY, "Text: Playlist delay"); idToValue.put(FRAME_ID_PLAY_COUNTER, "Play counter"); idToValue.put(FRAME_ID_POPULARIMETER, "Popularimeter"); idToValue.put(FRAME_ID_POSITION_SYNC, "Position Sync"); idToValue.put(FRAME_ID_PRIVATE,"Private frame"); idToValue.put(FRAME_ID_PRODUCED_NOTICE,"Produced Notice"); idToValue.put(FRAME_ID_PUBLISHER, "Text: Publisher"); idToValue.put(FRAME_ID_RADIO_NAME, "Text: Radio Name"); idToValue.put(FRAME_ID_RADIO_OWNER, "Text: Radio Owner"); idToValue.put(FRAME_ID_RECOMMENDED_BUFFER_SIZE, "Recommended buffer size"); idToValue.put(FRAME_ID_RELATIVE_VOLUME_ADJUSTMENT2, "Relative volume adjustment(2)"); idToValue.put(FRAME_ID_RELEASE_TIME, "Release Time"); idToValue.put(FRAME_ID_REMIXED, "Text: Interpreted, remixed, or otherwise modified by"); idToValue.put(FRAME_ID_REVERB, "Reverb"); idToValue.put(FRAME_ID_SEEK, "Seek"); idToValue.put(FRAME_ID_SET, "Text: Part of a set"); idToValue.put(FRAME_ID_SET_SUBTITLE, "Text: Set subtitle"); idToValue.put(FRAME_ID_SIGNATURE, "Signature"); idToValue.put(FRAME_ID_SYNC_LYRIC, "Synchronized lyric/text"); idToValue.put(FRAME_ID_SYNC_TEMPO, "Synced tempo codes"); idToValue.put(FRAME_ID_TAGGING_TIME, "Text: Tagaging time"); idToValue.put(FRAME_ID_TERMS_OF_USE, "Terms of Use"); idToValue.put(FRAME_ID_TITLE, "Text: title"); idToValue.put(FRAME_ID_TITLE_REFINEMENT, "Text: Subtitle/Description refinement"); idToValue.put(FRAME_ID_TITLE_SORT_OWNER, "Text: title sort order"); idToValue.put(FRAME_ID_TRACK, "Text: Track number/Position in set"); idToValue.put(FRAME_ID_UNIQUE_FILE_ID, "Unique file identifier"); idToValue.put(FRAME_ID_UNSYNC_LYRICS, "Unsychronized lyric/text transcription"); idToValue.put(FRAME_ID_URL_ARTIST_WEB, "URL: Official artist/performer webpage"); idToValue.put(FRAME_ID_URL_COMMERCIAL, "URL: Commercial information"); idToValue.put(FRAME_ID_URL_COPYRIGHT, "URL: Copyright/Legal information"); idToValue.put(FRAME_ID_URL_FILE_WEB, "URL: Official audio file webpage"); idToValue.put(FRAME_ID_URL_OFFICIAL_RADIO,"URL: Official Radio website"); idToValue.put(FRAME_ID_URL_PAYMENT,"URL: Payment for this recording "); idToValue.put(FRAME_ID_URL_PUBLISHERS, "URL: Publishers official webpage"); idToValue.put(FRAME_ID_URL_SOURCE_WEB, "URL: Official audio source webpage"); idToValue.put(FRAME_ID_USER_DEFINED_INFO, "User defined text information frame"); idToValue.put(FRAME_ID_USER_DEFINED_URL, "User defined URL link frame"); idToValue.put(FRAME_ID_YEAR, "Text:Year"); createMaps(); multipleFrames = new TreeSet(); multipleFrames.add(FRAME_ID_USER_DEFINED_INFO); multipleFrames.add(FRAME_ID_USER_DEFINED_URL); multipleFrames.add(FRAME_ID_ATTACHED_PICTURE); multipleFrames.add(FRAME_ID_PRIVATE); multipleFrames.add(FRAME_ID_COMMENT); multipleFrames.add(FRAME_ID_UNIQUE_FILE_ID); discardIfFileAlteredFrames = new TreeSet(); discardIfFileAlteredFrames.add(FRAME_ID_EVENT_TIMING_CODES); discardIfFileAlteredFrames.add(FRAME_ID_MPEG_LOCATION_LOOKUP_TABLE); discardIfFileAlteredFrames.add(FRAME_ID_POSITION_SYNC); discardIfFileAlteredFrames.add(FRAME_ID_SYNC_LYRIC); discardIfFileAlteredFrames.add(FRAME_ID_SYNC_TEMPO); discardIfFileAlteredFrames.add(FRAME_ID_EVENT_TIMING_CODES); discardIfFileAlteredFrames.add(FRAME_ID_ENCODEDBY); discardIfFileAlteredFrames.add(FRAME_ID_LENGTH); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1ee5ca61dab498f709e2b97b06518e9a7a6e3037
090d8afa33725cc64f89a7a5d12cdee3c6f196d1
/src/com/orozuz/trianglevelocities/TriangleVelocities.java
9b479694ee475b7670ab9bd0841ab23c4f48c719
[]
no_license
oroz/Triangle-of-Velocities
06c98de48cacb582c20b0ca799c2f9b910b9d05f
6a0b0a15ea941db09718d39773660695cd76caef
refs/heads/master
2021-01-15T19:28:29.649740
2011-03-14T11:44:49
2011-03-14T11:44:49
1,478,400
0
0
null
null
null
null
UTF-8
Java
false
false
2,920
java
package com.orozuz.trianglevelocities; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class TriangleVelocities extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { TextView tasTV = (TextView) findViewById(R.id.tas); TextView trackTV = (TextView) findViewById(R.id.track); TextView windDirTV = (TextView) findViewById(R.id.windDirection); TextView windVelTV = (TextView) findViewById(R.id.windVelocity); TextView distTV = (TextView) findViewById(R.id.dist); double tas = Double.parseDouble(tasTV.getText().toString()); double track = Double.parseDouble(trackTV.getText().toString()); double windDirection = Double.parseDouble(windDirTV.getText().toString()); double windVelocity = Double.parseDouble(windVelTV.getText().toString()); double dist = Double.parseDouble(distTV.getText().toString()); double trueHeading = getTrueHeading(track, tas, windDirection, windVelocity); double groundSpeed = getGroundSpeed(track, tas, windDirection, windVelocity, trueHeading); double time = dist * 60. / groundSpeed; TextView headingTV = (TextView) findViewById(R.id.heading); headingTV.setText(Math.round(trueHeading) + "°"); TextView groundSpeedTV = (TextView) findViewById(R.id.groundSpeed); groundSpeedTV.setText("" + Math.round(groundSpeed)); TextView timeTV = (TextView) findViewById(R.id.time); timeTV.setText(Math.round(time) + "'"); } }); } private double getTrueHeading(double track, double trueAirSpeed, double windDirection, double windSpeed) { double trackInRadians = Math.toRadians(track); double windDirectionInRadians = Math.toRadians(windDirection) - Math.PI; double trueHeading = trackInRadians + Math.asin((windSpeed * Math.sin(trackInRadians - windDirectionInRadians)) / trueAirSpeed); return Math.toDegrees(trueHeading); } private double getGroundSpeed(double track, double trueAirSpeed, double windDirection, double windSpeed, double trueHeading) { double trackInRadians = Math.toRadians(track); double windDirectionInRadians = Math.toRadians(windDirection) - Math.PI; return trueAirSpeed * Math.cos(Math.toRadians(trueHeading) - trackInRadians) + windSpeed * Math.cos(trackInRadians - windDirectionInRadians); } }
[ "[omitted]" ]
[omitted]
dd412be317f2d0b954b047e0707c3a04e3e9d1e0
ea91769a4341b04d7f2c272a2ffc0ff6e18d7309
/Resources/Textbook_Source_Code/ch15/Set.java
06c7084ab826dd0a3d98f53a6d9c7cc5d9cc95d0
[ "MIT" ]
permissive
Beaconsyh08/COMP90041-2020SEM2
7f5a2bd2061b8fe28d4ba91da5306ddd44cf0466
d112c4ba53f9bd5bcdceff8f37832f1997b5fc7a
refs/heads/master
2023-01-05T00:16:29.579497
2020-11-06T17:09:02
2020-11-06T17:09:02
286,206,530
36
5
MIT
2020-08-09T10:32:42
2020-08-09T09:31:42
null
UTF-8
Java
false
false
2,569
java
// Uses a linked list as the internal data structure // to store items in a set. public class Set<T> { private class Node<T> { private T data; private Node<T> link; public Node( ) { data = null; link = null; } public Node(T newData, Node<T> linkValue) { data = newData; link = linkValue; } }//End of Node<T> inner class private Node<T> head; public Set() { head = null; } /** Add a new item to the set. If the item is already in the set, false is returned, otherwise true is returned. */ public boolean add(T newItem) { if (!contains(newItem)) { head = new Node<T>(newItem, head); return true; } return false; } public boolean contains(T item) { Node<T> position = head; T itemAtPosition; while (position != null) { itemAtPosition = position.data; if (itemAtPosition.equals(item)) return true; position = position.link; } return false; //target was not found } public void output( ) { Node position = head; while (position != null) { System.out.print(position.data.toString() + " "); position = position.link; } System.out.println(); } /** Returns a new set that is the union of this set and the input set. */ public Set<T> union(Set<T> otherSet) { Set<T> unionSet = new Set<T>(); // Copy this set to unionSet Node<T> position = head; while (position != null) { unionSet.add(position.data); position = position.link; } // Copy otherSet items to unionSet. // The add method eliminates any duplicates. position = otherSet.head; while (position != null) { unionSet.add(position.data); position = position.link; } return unionSet; } /** Returns a new that is the intersection of this set and the input set. */ public Set<T> intersection(Set<T> otherSet) { Set<T> interSet = new Set<T>(); // Copy only items in both sets Node<T> position = head; while (position != null) { if (otherSet.contains(position.data)) interSet.add(position.data); position = position.link; } return interSet; } /** The clear, size, and isEmpty methods are identical to those in Display 15.8 for the LinkedList3 class. */ }
[ "songyuhao2008@gmail.com" ]
songyuhao2008@gmail.com
f4fb3b3bb1919c37e36b8a9ab63bc3550a503a6f
5af54f3bf0c13e84a12c62930101b184f203ff15
/app/src/test/java/com/diplomski/student/rideabike/ExampleUnitTest.java
20925500eff34489ad0211acf4a3b6e9cdc3bc7c
[]
no_license
vanjs83/NewRideabike
e8708b78ae49b901d467453fd3b0040f0ce7ba68
07903f6007da06506c262f66b48ae5cf06c5a268
refs/heads/master
2021-01-21T16:04:22.994077
2017-06-27T23:21:12
2017-06-27T23:21:12
91,870,989
0
0
null
null
null
null
UTF-8
Java
false
false
324
java
package com.diplomski.student.rideabike; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "tihomir.vanjurek@gmail.com" ]
tihomir.vanjurek@gmail.com
6d3f7ed2d5735ec9f74f828416a5562fc9904083
7993c2a950f5ff21085cbbd94c1896242b4ce94d
/src/main/java/javafx/javafxtools/interfaces/FxmlPathModel.java
b8a40060b98992ea020440bab514c3bfcb026593
[]
no_license
thaylongs/JavaFxTools
fce1c7fdedf09f48aaec2e0fa38631591e117ae9
6175970b2b124619cb95a1583dc9b4c71d8d383d
refs/heads/master
2020-04-10T16:08:08.778553
2015-02-16T17:32:26
2015-02-16T17:32:26
30,882,355
1
0
null
null
null
null
UTF-8
Java
false
false
1,362
java
/* * The MIT License * * Copyright 2015 Thaylon Guedes Santos. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package javafx.javafxtools.interfaces; /** * * @author Thaylon Guede Santos * @author thaylon_guedes@hotmail.com */ public interface FxmlPathModel { public String getPath(); public String getTitle(); }
[ "thaylon_guedes@hotmail.com" ]
thaylon_guedes@hotmail.com
ee057e32ea699b1420a430e55988156c2e6404c3
78703ac975d964be0cf9757d0c2168655b2d3377
/LHweather/src/com/lihangogo/lhweather/entity/suggestion/ComfortIndex.java
a0d15376808d256c635b1e81f696d2b59b300af2
[]
no_license
lihangogo/LHweather
8c4f73f7d113c2b96967098af5e761eb8d7b3be2
653097e2eef3a634f2c074ea3a26306cf4e4f305
refs/heads/master
2021-01-18T13:16:31.818865
2017-08-22T00:01:26
2017-08-22T00:01:26
100,374,122
0
0
null
null
null
null
UTF-8
Java
false
false
775
java
package com.lihangogo.lhweather.entity.suggestion; import java.io.Serializable; /** * * @author lihan * */ public class ComfortIndex implements Serializable{ /** * */ private static final long serialVersionUID = 1912740727572237655L; /* * 简介 */ private String brf; /* * 数据详情 */ private String txt; public String getBrf() { return brf; } public void setBrf(String brf) { this.brf = brf; } public String getTxt() { return txt; } public void setTxt(String txt) { this.txt = txt; } public ComfortIndex(String brf, String txt) { super(); this.brf = brf; this.txt = txt; } public ComfortIndex() { super(); } @Override public String toString() { return "Comfortable [brf=" + brf + ", txt=" + txt + "]"; } }
[ "30977458+lihangogo@users.noreply.github.com" ]
30977458+lihangogo@users.noreply.github.com
a301c300727ff56090d2a6a94d5857f1c2c9a733
6bc1cf52798f0da46d11d0445d589308fbc7bab6
/java-eg-spring/src/test/java/com/baoyongan/scheduler/SchedulerServiceTest.java
4b7d65e4f6c7242da65efa2a7f62b87af596c8ca
[ "Apache-2.0" ]
permissive
baoyongan/java-examples
d210a2783191184829036315353c909f1dc3b7e4
d7e1b0b45c28137692a474f2f54118d56ed44d76
refs/heads/master
2023-08-08T02:57:24.075921
2023-07-28T06:31:54
2023-07-28T06:31:54
79,999,830
0
1
Apache-2.0
2022-12-16T12:10:33
2017-01-25T09:24:07
Java
UTF-8
Java
false
false
947
java
package com.baoyongan.scheduler; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class SchedulerServiceTest{ public ApplicationContext context; @Before() public void initSpring(){ context=new ClassPathXmlApplicationContext("classpath:scheduler/scheduler.xml"); } @Test public void schedulerTest(){ try { Thread.sleep(20000); } catch (InterruptedException e) { e.printStackTrace(); } } @After public void closeContext(){ if(null!=context && context instanceof ClassPathXmlApplicationContext){ ClassPathXmlApplicationContext classPathXmlApplicationContext=(ClassPathXmlApplicationContext) context; classPathXmlApplicationContext.destroy(); } } }
[ "baoyongan@hotmail.com" ]
baoyongan@hotmail.com
001055cbd266ba67f3b52a1e740543a36873902e
8df243d8d1a36413d1d512e36284135306048d30
/src/main/java/fr/sromain/xspeedit/service/impl/EmpaquetageServiceImpl.java
a0b9c4408115a9fc30d047961546e254cfbabb65
[]
no_license
sromain/xspeedit
5a2b64aca651021ee949d14217fe244cb2af5bac
033a2bb0c303a79534004b83bac232d20ec5459e
refs/heads/master
2020-03-12T11:56:25.840720
2018-05-22T19:06:13
2018-05-22T19:06:13
130,607,517
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,356
java
package fr.sromain.xspeedit.service.impl; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import fr.sromain.xspeedit.modele.Article; import fr.sromain.xspeedit.modele.Carton; import fr.sromain.xspeedit.service.IEmpaquetageService; public class EmpaquetageServiceImpl implements IEmpaquetageService { /** * {@link fr.sromain.xspeedit.service.IEmpaquetageService#emballerArticles(String)} */ public List<Carton> emballerArticles(String articlesChaine) { List<Article> articles = creerListeArticleDepuisChaine(articlesChaine); articles = trierArticlesParTailleDecroissante(articles); return emballerArticles(articles); } /** * crée la liste des cartons à partir d'une liste d'articles * @param articles * @return */ private List<Carton> emballerArticles(List<Article> articles) { List<Carton> cartons = new ArrayList<Carton>(); while (!articles.isEmpty()) { Carton carton = new Carton(); for (Integer index = 0; index < articles.size(); index++) { Article articleCourant = articles.get(index); if (carton.getCapaciteCourante() + articleCourant.getTaille() <= Carton.CAPACITE) { carton.ajouterArticle(articleCourant); articles.remove(articleCourant); index--; } } cartons.add(carton); } return cartons; } /** * crée une liste d'articles à partir d'une chaine de caractere * @param articlesChaine * @return */ private List<Article> creerListeArticleDepuisChaine(String articlesChaine) { List<Article> articles = new ArrayList<Article>(); for (char caractere: articlesChaine.toCharArray()) { try { int taille = Integer.parseInt(String.valueOf(caractere)); articles.add(new Article(taille)); } catch (NumberFormatException e) { System.out.println("Article ignoré - taille article incorrecte : " + caractere); } } return articles; } /** * trie une liste d'article par taille décroissante * @param articlesNonTries * @return */ private List<Article> trierArticlesParTailleDecroissante(List<Article> articles) { Collections.sort(articles, new Comparator<Article>() { public int compare(Article article1, Article article2) { return article2.getTaille().compareTo(article1.getTaille()); } }); return articles; } }
[ "sromain.open@gmail.com" ]
sromain.open@gmail.com
d7e0bf5f571271f1d386ae4b46fe0ae736b86fdd
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13616-7-17-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/mail/internal/thread/SendMailRunnable_ESTest.java
073464c736f8e635c2c54fa269a97322e5efbe95
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
/* * This file was automatically generated by EvoSuite * Fri Apr 03 23:21:47 UTC 2020 */ package org.xwiki.mail.internal.thread; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class SendMailRunnable_ESTest extends SendMailRunnable_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
c33012f9560fdafa0000ec13595de56f2522011d
8aa49babbbf3cbbb9b9ea423f722180ddbe3a423
/clients-nodes/flavors/rokos-flavors-Pi2-Pi3/horizon/test/java/nxt/BlockchainProcessorTest.java
07831bf3bedc30685378a5cbcf2bacfd24a94ee4
[ "EPL-1.0", "LicenseRef-scancode-proprietary-license", "LGPL-2.1-or-later", "MIT", "LGPL-2.1-only", "MPL-2.0", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-philippe-de-muyter" ]
permissive
pichlerx/ROKOS-OK-Bitcoin-Fullnode
1b80721f7e8bf31ab8a294e0c4f3054098e14176
2e45d48f2adcd067fde1838a64d1f575c703641d
refs/heads/master
2023-05-14T12:25:39.478089
2023-04-28T08:03:38
2023-04-28T08:03:38
158,067,231
1
0
MIT
2018-11-18T09:18:02
2018-11-18T09:18:02
null
UTF-8
Java
false
false
12,873
java
/****************************************************************************** * Copyright © 2013-2015 The Nxt Core Developers. * * * * See the AUTHORS.txt, DEVELOPER-AGREEMENT.txt and LICENSE.txt files at * * the top-level directory of this distribution for the individual copyright * * holder information and the developer policies on copyright and licensing. * * * * Unless otherwise agreed in a custom licensing agreement, no part of the * * Nxt software, including this file, may be copied, modified, propagated, * * or distributed except according to the terms contained in the LICENSE.txt * * file. * * * * Removal or modification of this copyright notice is prohibited. * * * ******************************************************************************/ package nxt; import nxt.db.DbIterator; import nxt.util.Logger; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class BlockchainProcessorTest extends AbstractBlockchainTest { private static final String defaultTraceFile = "nxt-trace-default.csv"; private static final String testTraceFile = "nxt-trace.csv"; private static final int maxHeight = Constants.LAST_KNOWN_BLOCK; private static final int startHeight = 0; private static final long[] testLesseeAccounts = new long[]{1460178482, -318308835203526404L, 3312398282095696184L, 6373452498729869295L, 1088641461782019913L, -7984504957518839920L, 814976497827634325L}; private static final long[] testAssets = new long[]{6775372232354238105L, 3061160746493230502L, -5981557335608550881L, 4551058913252105307L, -318057271556719590L, -2234297255166670436L}; private static DebugTrace debugTrace; @BeforeClass public static void init() { AbstractBlockchainTest.init(newTestProperties()); debugTrace = DebugTrace.addDebugTrace(Collections.<Long>emptySet(), BlockchainProcessorTest.testTraceFile); } @AfterClass public static void shutdown() { AbstractBlockchainTest.shutdown(); } public void reset(int height) { debugTrace.resetLog(); if (blockchain.getHeight() > height) { blockchainProcessor.popOffTo(height); Assert.assertEquals(startHeight, blockchain.getHeight()); } Assert.assertTrue(blockchain.getHeight() <= height); } @Test public void fullDownloadAndRescanTest() { reset(startHeight); download(startHeight, maxHeight); blockchainProcessor.scan(0, true); Assert.assertEquals(maxHeight, blockchain.getHeight()); Logger.logMessage("Successfully rescanned blockchain from 0 to " + maxHeight); compareTraceFiles(); debugTrace.resetLog(); } @Test public void multipleRescanTest() { reset(startHeight); int start = startHeight; int end; downloadTo(start); while ((end = start + 2000) <= maxHeight) { download(start, end); rescan(500); rescan(900); rescan(720); rescan(1439); rescan(200); rescan(1); rescan(2); start = end; } } @Test public void multiplePopOffTest() { reset(startHeight); int start = startHeight; int end; downloadTo(start); while ((end = start + 2000) <= maxHeight) { download(start, end); redownload(800, false); redownload(1440, false); redownload(720, false); redownload(1, false); start = end; } } @Test public void reprocessTransactionsTest() { int start = Constants.LAST_KNOWN_BLOCK - 2000; reset(start); int end; downloadTo(start); while (blockchain.getLastBlock().getTimestamp() < Nxt.getEpochTime() - 7200) { end = start + 100; download(start, end); redownload(100, true); redownload(800, true); redownload(1440, true); redownload(2, true); redownload(1024, true); redownload(10, true); redownload(720, true); redownload(1, true); start = end; } } private static void download(final int startHeight, final int endHeight) { Assert.assertEquals(startHeight, blockchain.getHeight()); downloadTo(endHeight); Logger.logMessage("Successfully downloaded blockchain from " + startHeight + " to " + endHeight); compareTraceFiles(); debugTrace.resetLog(); } private static void rescan(final int numBlocks) { if (numBlocks > Constants.MAX_ROLLBACK) { return; } int endHeight = blockchain.getHeight(); int rescanHeight = endHeight - numBlocks; blockchainProcessor.scan(rescanHeight, true); Assert.assertEquals(endHeight, blockchain.getHeight()); Logger.logMessage("Successfully rescanned blockchain from " + rescanHeight + " to " + endHeight); compareTraceFiles(); debugTrace.resetLog(); } private static void redownload(final int numBlocks, boolean preserveTransactions) { if (numBlocks > Constants.MAX_ROLLBACK) { return; } int endHeight = blockchain.getHeight(); List<List<Long>> allLessorsBefore = new ArrayList<>(); List<List<Long>> allLessorBalancesBefore = new ArrayList<>(); for (long accountId : testLesseeAccounts) { List<Long> lessors = new ArrayList<>(); List<Long> balances = new ArrayList<>(); allLessorsBefore.add(lessors); allLessorBalancesBefore.add(balances); Account account = Account.getAccount(accountId); if (account == null) { continue; } try (DbIterator<Account> iter = account.getLessors(endHeight - numBlocks)) { for (Account lessor : iter) { final int EFFECTIVE_BLOCKS = (endHeight - numBlocks < Constants.MONETARY_SYSTEM_BLOCK ? 40 : Constants.GUARANTEED_BALANCE_CONFIRMATIONS ); lessors.add(lessor.getId()); balances.add(lessor.getGuaranteedBalanceNQT(EFFECTIVE_BLOCKS, endHeight - numBlocks)); } } } List<List<TestAccountAsset>> allAccountAssetsBefore = new ArrayList<>(); for (long assetId : testAssets) { List<TestAccountAsset> accountAssets = new ArrayList<>(); allAccountAssetsBefore.add(accountAssets); Asset asset = Asset.getAsset(assetId); if (asset == null) { continue; } try (DbIterator<Account.AccountAsset> iter = asset.getAccounts(endHeight - numBlocks, 0, -1)) { for (Account.AccountAsset accountAsset : iter) { accountAssets.add(new TestAccountAsset(accountAsset)); } } } List<BlockImpl> poppedBlocks = blockchainProcessor.popOffTo(endHeight - numBlocks); if (preserveTransactions) { for (BlockImpl block : poppedBlocks) { TransactionProcessorImpl.getInstance().processLater(block.getTransactions()); } } Assert.assertEquals(endHeight - numBlocks, blockchain.getHeight()); List<List<Long>> allLessorsAfter = new ArrayList<>(); List<List<Long>> allLessorBalancesAfter = new ArrayList<>(); for (long accountId : testLesseeAccounts) { List<Long> lessors = new ArrayList<>(); List<Long> balances = new ArrayList<>(); allLessorsAfter.add(lessors); allLessorBalancesAfter.add(balances); Account account = Account.getAccount(accountId); if (account == null) { continue; } try (DbIterator<Account> iter = account.getLessors()) { for (Account lessor : iter) { lessors.add(lessor.getId()); balances.add(lessor.getGuaranteedBalanceNQT()); } } } Assert.assertEquals(allLessorsBefore, allLessorsAfter); Assert.assertEquals(allLessorBalancesBefore, allLessorBalancesAfter); List<List<TestAccountAsset>> allAccountAssetsAfter = new ArrayList<>(); for (long assetId : testAssets) { List<TestAccountAsset> accountAssets = new ArrayList<>(); allAccountAssetsAfter.add(accountAssets); Asset asset = Asset.getAsset(assetId); if (asset == null) { continue; } try (DbIterator<Account.AccountAsset> iter = asset.getAccounts(0, -1)) { for (Account.AccountAsset accountAsset : iter) { accountAssets.add(new TestAccountAsset(accountAsset)); } } } Assert.assertEquals(allAccountAssetsBefore, allAccountAssetsAfter); //Logger.logDebugMessage("Assets Before: " + allAccountAssetsBefore); //Logger.logDebugMessage("Assets After: " + allAccountAssetsAfter); downloadTo(endHeight); Logger.logMessage("Successfully redownloaded blockchain from " + (endHeight - numBlocks) + " to " + endHeight); compareTraceFiles(); debugTrace.resetLog(); } private static void compareTraceFiles() { try (BufferedReader defaultReader = new BufferedReader(new FileReader(defaultTraceFile)); BufferedReader testReader = new BufferedReader(new FileReader(testTraceFile))) { defaultReader.readLine(); testReader.readLine(); String testLine = testReader.readLine(); if (testLine == null) { Logger.logMessage("Empty trace file, nothing to compare"); return; } int height = parseHeight(testLine); String defaultLine; while ((defaultLine = defaultReader.readLine()) != null) { if (parseHeight(defaultLine) >= height) { break; } } if (defaultLine == null) { Logger.logMessage("End of default trace file, can't compare further"); return; } int endHeight = height; Assert.assertEquals(defaultLine, testLine); while ((testLine = testReader.readLine()) != null) { defaultLine = defaultReader.readLine(); if (defaultLine == null) { Logger.logMessage("End of default trace file, can't compare further"); return; } endHeight = parseHeight(testLine); Assert.assertEquals(defaultLine, testLine); } if ((defaultLine = defaultReader.readLine()) != null) { Assert.assertTrue(parseHeight(defaultLine) > endHeight); } Logger.logMessage("Comparison with default trace file passed from height " + height + " to " + endHeight); } catch (IOException e) { throw new RuntimeException(e.toString(), e); } } private static int parseHeight(String line) { return Integer.parseInt(line.substring(1, line.indexOf(DebugTrace.SEPARATOR) - 1)); } private static final class TestAccountAsset { private final Account.AccountAsset accountAsset; private TestAccountAsset(Account.AccountAsset accountAsset) { this.accountAsset = accountAsset; } @Override public boolean equals(Object o) { if (! (o instanceof TestAccountAsset)) { return false; } Account.AccountAsset other = ((TestAccountAsset)o).accountAsset; return this.accountAsset.getAccountId() == other.getAccountId() && this.accountAsset.getAssetId() == other.getAssetId() && this.accountAsset.getQuantityQNT() == other.getQuantityQNT(); } @Override public String toString() { return accountAsset.toString(); } } }
[ "devteam@okcash.co" ]
devteam@okcash.co
32c73daa1825d095822111de36ba2b3bb0fa41cf
9869578c362ce1dad8f9cb5d0d92306799260cc6
/support/src/com/support/service/DictService.java
f653228fcef64369d4a8c942edeef32a5dd01002
[]
no_license
vienloo/support
884296aa8bf6f5a2a17049dcc69105f98afb124e
4b2884b0640b8115037648b7fa9f158688c393e3
refs/heads/master
2021-08-21T20:38:03.492430
2017-11-28T09:59:36
2017-11-28T09:59:36
112,311,385
0
0
null
2017-11-28T09:59:37
2017-11-28T09:01:49
Java
UTF-8
Java
false
false
4,507
java
package com.support.service; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.support.dao.DictDao; import com.support.model.Dict; import com.support.utils.PageValue; @Service public class DictService { @Resource DictDao dao; public int getAllRecords_dictType(String keywords) { Map<String, Object> map = new HashMap<String, Object>(); map.put("keywords", keywords); return (int)dao.getAllRecords_dictType(map); } public List<Map<String, Object>> getAll_dictType(String keywords, PageValue page) { Map<String, Object> map = new HashMap<String, Object>(); map.put("keywords", keywords); map.put("startNumber",page.getStartNumber()); map.put("rows", page.getRows()); return dao.getAll_dictType(map); } @Transactional public Map<String, Object> addDictType(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.addDictType(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } @Transactional public Map<String, Object> updateDictType(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.updateDictType(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } @Transactional public Map<String, Object> removeDictType(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.removeDictType(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } public int getAllRecords_dictItem(String keywords) { Map<String, Object> map = new HashMap<String, Object>(); map.put("keywords", keywords); return (int)dao.getAllRecords_dictItem(map); } public List<Map<String, Object>> getAll_dictItem(String keywords, PageValue page) { Map<String, Object> map = new HashMap<String, Object>(); map.put("keywords", keywords); map.put("startNumber",page.getStartNumber()); map.put("rows", page.getRows()); return dao.getAll_dictItem(map); } @Transactional public Map<String, Object> addDictItem(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.addDictItem(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } @Transactional public Map<String, Object> updateDictItem(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.updateDictItem(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } @Transactional public Map<String, Object> removeDictItem(Dict dict) { Map<String, Object> map = new HashMap<String, Object>(); try{ int count = dao.removeDictItem(dict); if(count>0){ map.put("code",0); map.put("msg", "操作成功"); }else{ map.put("code",1); map.put("msg", "操作失败"); } }catch(Exception e){ e.printStackTrace(); map.put("code",1); map.put("msg", "操作异常"); throw new RuntimeException(e); } return map; } }
[ "vienloo@vienloo.com" ]
vienloo@vienloo.com
cd9c780a2c829a2a796965347728dcec2c420055
2bb58cc8b6b9292c9f088da9fb420c08079229bc
/app/src/main/java/br/com/faeterj/corujamobile/mensagens/entrada/Repository/DataBase.java
deb3128f10940edce28a4fd827207840131999fa
[]
no_license
francisco-calazans/CorujaMobile-1
b2d61d9b90ca5b354b460397e7122a2be6ec5612
62d7be2c141050213a7d44c13c8a29f04f1e9825
refs/heads/master
2021-01-18T06:30:44.014150
2016-06-18T03:50:48
2016-06-18T03:50:48
61,487,530
1
0
null
2016-06-19T15:46:32
2016-06-19T15:46:32
null
UTF-8
Java
false
false
4,433
java
package br.com.faeterj.corujamobile.mensagens.entrada.Repository; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.List; import br.com.faeterj.corujamobile.mensagens.entrada.Model.Mensagem; import br.com.faeterj.corujamobile.mensagens.entrada.Model.Perfil; import br.com.faeterj.corujamobile.mensagens.entrada.Model.ScriptSQL; import br.com.faeterj.corujamobile.R; /** * Created by thiago on 04/06/16. */ public class DataBase extends SQLiteOpenHelper { public DataBase(Context context) { super(context, "FaeterjAPP", null, 1); } private SQLiteDatabase conn; PerfilRepository perfilRepository = new PerfilRepository(conn); MensagemRepository mensagemRepository = new MensagemRepository(conn); Perfil professor = new Perfil(); Perfil professor1 = new Perfil("Professora", R.drawable.professora); Perfil professor2 = new Perfil("Professor Raimundo", R.drawable.professor_raimundo); Perfil professor3 = new Perfil("Bill Gates", R.drawable.billgates); Perfil professor4 = new Perfil("Ada Lovelace", R.drawable.ada_lovelace); Perfil equipe = new Perfil("Equipe FaterjApp", R.drawable.equipe); String mensagem2 = "O sucesso é um péssimo professor. Seduz pessoas inteligentes a pensarem quem não podem perder."; String mensagem3= "A luz acabou! Não teremos aula hoje"; Mensagem ms1 = criarMensagem("Reposição","marcada para segunda de 17:00 ás 18:20. Obrigada!",professor1); Mensagem ms2 = criarMensagem("Reposição","marcada para segunda de 17:00 ás 18:20. Obrigada!",professor1); Mensagem ms3 = criarMensagem("Prova de Algoritmos","Prova sem consulta valendo 8 pontos",professor4); Mensagem ms4 = criarMensagem("Atenção",mensagem3,equipe); Mensagem ms5 = criarMensagem("Reposição","marcada para segunda de 17:00 ás 18:20. Obrigada!",professor); Mensagem ms6 = criarMensagem("Reposição","marcada para segunda de 17:00 ás 18:20. Obrigada!",professor); Mensagem ms7 = criarMensagem("Notas Lançadas","Prezados alunos, as notas foram lançadas!! Todos com um 0 bem redondo!",professor2); Mensagem ms8 = criarMensagem("Sobre o Sucesso",mensagem2,professor3); Mensagem ms9 = criarMensagem("Proxíma Sexta","Não haverá aula",professor1); Mensagem ms10 = criarMensagem("Bem vindo","Seja bem vindo ao nosso aplicativo, faça bom uso!Caso note algum problema contate o estagiário",equipe); @Override public void onCreate(SQLiteDatabase db) { db.execSQL(ScriptSQL.getCreatePerfil()); db.execSQL(ScriptSQL.getCreateMensagem()); adicionaContatoMensagem(); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } public void adicionaContatoMensagem() { try { perfilRepository.inserirPerfil(professor); perfilRepository.inserirPerfil(professor1); ; perfilRepository.inserirPerfil(professor2); perfilRepository.inserirPerfil(professor3); perfilRepository.inserirPerfil(professor4); mensagemRepository.inserirMensagem(ms1); mensagemRepository.inserirMensagem(ms2); mensagemRepository.inserirMensagem(ms3); mensagemRepository.inserirMensagem(ms4); mensagemRepository.inserirMensagem(ms5); mensagemRepository.inserirMensagem(ms6); mensagemRepository.inserirMensagem(ms7); mensagemRepository.inserirMensagem(ms8); mensagemRepository.inserirMensagem(ms9); mensagemRepository.inserirMensagem(ms10); } catch (Exception e) { } } public List<Mensagem> buscaLista(){ List<Mensagem> listMensagens = new ArrayList<Mensagem>(); listMensagens.add(ms1); listMensagens.add(ms2); listMensagens.add(ms3); listMensagens.add(ms4); listMensagens.add(ms5); listMensagens.add(ms6); listMensagens.add(ms7); listMensagens.add(ms8); listMensagens.add(ms9); listMensagens.add(ms10); return listMensagens; } private Mensagem criarMensagem(String titulo, String conteudo, Perfil remetente){ Mensagem mensagem = new Mensagem(titulo,conteudo,remetente); return mensagem; } }
[ "thiagohenriq@gmail.com" ]
thiagohenriq@gmail.com
7c37e3c7d278c128717df1a48b32882ccb2d4d7f
d2929511a3c83c71f6928bd02eb978799695ccac
/src/main/java/com/reactivetechnologies/platform/interceptor/AbstractInboundInterceptor.java
840f03016e94a8ed18bae600a357479b74b046a7
[ "MIT" ]
permissive
javanotes/spring-data-hazelcast
3f4bf6c8f93a5ca4a800045f644cded449591244
fca9c2c6f8054e4d5dc79764dad218f23caf7e55
refs/heads/master
2021-01-10T08:56:29.996605
2016-02-12T13:50:19
2016-02-12T13:50:19
50,113,105
0
1
null
null
null
null
UTF-8
Java
false
false
3,383
java
/* ============================================================================ * * FILE: AbstractIncomingInterceptor.java * The MIT License (MIT) Copyright (c) 2016 Sutanu Dalui Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * ============================================================================ */ package com.reactivetechnologies.platform.interceptor; import java.io.Serializable; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import com.hazelcast.core.EntryEvent; import com.hazelcast.nio.serialization.DataSerializable; import com.reactivetechnologies.platform.datagrid.handlers.LocalPutMapEntryCallback; /** * * * @param <V> intercepted message type * @param <T> transformed message type */ @Component @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public abstract class AbstractInboundInterceptor<V extends DataSerializable, T extends Serializable> implements LocalPutMapEntryCallback<V>, InboundInterceptor<V, T> { private static final Logger log = LoggerFactory.getLogger(AbstractInboundInterceptor.class); protected AbstractOutboundChannel outChannel; public AbstractOutboundChannel getOutChannel() { return outChannel; } public void setOutChannel(AbstractOutboundChannel outChannel) { this.outChannel = outChannel; } @PostConstruct protected void init() { log.info("-- New Inbound channel created ["+name()+" - IN: "+inType()+" OUT: "+outType()+"], linked to outbound channel ["+outChannel.name()+"]"); } @Override public void entryAdded(EntryEvent<Serializable, V> event) { Serializable t = null; try { t = intercept(event.getKey(), event.getValue(), event.getOldValue()); outChannel.feed(t); } catch (Exception e) { log.error("Exception on message interception. Not fed to downstream", e); } } @Override public void entryUpdated(EntryEvent<Serializable, V> event) { Serializable t = null; try { t = intercept(event.getKey(), event.getValue(), event.getOldValue()); outChannel.feed(t); } catch (Exception e) { log.error("Exception on message interception. Not fed to downstream", e); } } }
[ "sutanu.dalui@ericsson.com" ]
sutanu.dalui@ericsson.com
41f8a255462088475f07c49f044c4ab702cacbc5
69b6e263715e4efe62c209b6bad9445cd035ffa2
/src/modulo4/ejercicio/MyDate.java
2f0324714da569027495064f5ecd28e288255213
[]
no_license
rogeliomorelos/JavaSE6TESE
a94136da89266ebf4dbaf212cac3e2d2fbcc54e3
44f86d88536f83e88de4b44917749b6c7a11b4bd
refs/heads/master
2020-12-25T05:07:51.402766
2016-02-27T19:15:32
2016-02-27T19:15:32
52,677,694
0
0
null
2016-02-27T17:02:35
2016-02-27T17:02:34
null
UTF-8
Java
false
false
2,028
java
/** * * @author Roberto Olvera */ package modulo4.ejercicio; public class MyDate { /** * Representa un dia */ private int day; /** * Representa un mes */ private int month; /** * Representa un año */ private int year; public MyDate(){ } /** * Construye un objeto con valores iniciales para * el dia , mes y año * @param d Representa el dia * @param m Representa el mes * @param y Representa el año */ public MyDate(int d,int m, int y){ day = d; month = m; year = y; } /** * Muestra la fecha en consola */ public void mostrar(){ System.out.println(day+"/"+month+"/"+year); } public int getDay() { return day; // regresar el valor de la variable day } public void setDay(int d) { // escribir funcionalidad para validar dia correcto /* * si el valor de d esta entre 1 y 31 colocar el valor * si no esta en el rango colocar por default 1 */ if(d<=31 && d>=1){ day = d; // colocar el valor del argumento d en day }else{ day=1; } } public int getMonth() { return month; } public void setMonth(int month) { this.month = month; } public int getYear() { return year; } public void setYear(int y) { year = y; } public void addDays(int moreDays){ this.day = this.day + moreDays; } /** * Retorna el nombre del numero del mes * ej. 2 = Febrero; * @return El nombre del mes */ public String getNameMonth(){ String nameMonth = ""; return nameMonth; } /** * Retorna el numero de dias en el mes * ej. 2 = Febrero; * @return El numero del mes */ public int getDaysMonth(){ int nameMonth = 0; return nameMonth; } }
[ "jolvera@7i.com.mx" ]
jolvera@7i.com.mx
f27e043468f2cae936481ddcd35767ac05fcecab
fdb4bb54d4bfd28423da60cf27d03f3892bcfb5e
/trunk/src/de/xplib/xdbm/ui/widgets/syntax/MakefileTokenMarker.java
12a69a9fb720f35a4d42f610d9da7ad2c762e409
[ "LicenseRef-scancode-public-domain" ]
permissive
BackupTheBerlios/xdbm-svn
6f84cdd286b00a11af7f87c5f3c86b58e7968f74
94f9204cc60fdb10cde1738991b12b8ecc95bf59
refs/heads/master
2020-06-07T23:44:39.792059
2005-04-12T08:12:22
2005-04-12T08:12:22
40,748,965
0
0
null
null
null
null
UTF-8
Java
false
false
3,255
java
/* * MakefileTokenMarker.java - Makefile token marker * Copyright (C) 1998, 1999 Slava Pestov * * You may use and modify this package for any purpose. Redistribution is * permitted, in both source and binary form, provided that this notice * remains intact in all source distributions of this package. */ package de.xplib.xdbm.ui.widgets.syntax; import javax.swing.text.Segment; /** * Makefile token marker. * * @author Slava Pestov * @version $Id: MakefileTokenMarker.java,v 1.18 1999/12/13 03:40:30 sp Exp $ */ public class MakefileTokenMarker extends TokenMarker { // public members public byte markTokensImpl(byte token, Segment line, int lineIndex) { char[] array = line.array; int offset = line.offset; int lastOffset = offset; int length = line.count + offset; boolean backslash = false; loop: for(int i = offset; i < length; i++) { int i1 = (i+1); char c = array[i]; if(c == '\\') { backslash = !backslash; continue; } switch(token) { case Token.NULL: switch(c) { case ':': case '=': case ' ': case '\t': backslash = false; if(lastOffset == offset) { addToken(i1 - lastOffset,Token.KEYWORD1); lastOffset = i1; } break; case '#': if(backslash) backslash = false; else { addToken(i - lastOffset,token); addToken(length - i,Token.COMMENT1); lastOffset = length; break loop; } break; case '$': if(backslash) backslash = false; else if(lastOffset != offset) { addToken(i - lastOffset,token); lastOffset = i; if(length - i > 1) { char c1 = array[i1]; if(c1 == '(' || c1 == '{') token = Token.KEYWORD2; else { addToken(2,Token.KEYWORD2); lastOffset += 2; i++; } } } break; case '"': if(backslash) backslash = false; else { addToken(i - lastOffset,token); token = Token.LITERAL1; lastOffset = i; } break; case '\'': if(backslash) backslash = false; else { addToken(i - lastOffset,token); token = Token.LITERAL2; lastOffset = i; } break; default: backslash = false; break; } case Token.KEYWORD2: backslash = false; if(c == ')' || c == '}') { addToken(i1 - lastOffset,token); token = Token.NULL; lastOffset = i1; } break; case Token.LITERAL1: if(backslash) backslash = false; else if(c == '"') { addToken(i1 - lastOffset,token); token = Token.NULL; lastOffset = i1; } else backslash = false; break; case Token.LITERAL2: if(backslash) backslash = false; else if(c == '\'') { addToken(i1 - lastOffset,Token.LITERAL1); token = Token.NULL; lastOffset = i1; } else backslash = false; break; } } switch(token) { case Token.KEYWORD2: addToken(length - lastOffset,Token.INVALID); token = Token.NULL; break; case Token.LITERAL2: addToken(length - lastOffset,Token.LITERAL1); break; default: addToken(length - lastOffset,token); break; } return token; } }
[ "nexd@f4f6faf6-76f4-0310-8e61-9ec1de070bf4" ]
nexd@f4f6faf6-76f4-0310-8e61-9ec1de070bf4
1c53a1618a132c5bf40c2f0bee3aa2c8b03eb539
dfb00bd334058b565ab82b2fe1094ed6d256d5bf
/client-reactive/src/main/java/com/viettel/imdb/policy/ReadPolicy.java
d7e49ae649dda1f9648b44a3fdf5df7330d897e6
[]
no_license
quannh0308/imdb-client-reactive
d5921983131caf1e7d9ced489d8a517960e28df8
f559acc803a4c80ca9d55bc8b769b55ee8782e7a
refs/heads/master
2022-12-28T12:16:15.019503
2020-05-25T09:18:58
2020-05-25T09:18:58
264,918,177
0
0
null
2020-10-13T22:05:01
2020-05-18T11:26:48
Java
UTF-8
Java
false
false
173
java
package com.viettel.imdb.policy; public class ReadPolicy { public static ReadPolicy just() { return new ReadPolicy(); } private ReadPolicy() { } }
[ "nguyenhoangquanptit@gmail.com" ]
nguyenhoangquanptit@gmail.com
330104255f077c5200ac7dab9318e2e3a7997901
737fa9c593d25122b611956238295a0b5be40193
/src/org/basic/comp/abst/ListWidget.java
e9e7f0ab94312c21750c22896d55c07f36f170db
[]
no_license
saiful-mukhlis/mlm
3f16ac1f150c0de5024fcef4d73450c8b647bfa1
6db7b54505106c83fc421fbb677ab638d6d81f3b
refs/heads/master
2021-01-19T18:51:35.795920
2013-02-05T05:24:47
2013-02-05T05:24:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
357
java
package org.basic.comp.abst; import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; import javax.swing.*; public interface ListWidget { JPanel getPanel(); void setPanel(JPanel panel); void build(ODatabaseDocumentTx db); void addWidgetChange(WidgetChangeObj widgetChangeObj); TableModel getTableModel(); }
[ "saiful.mukhlis@gmail.com" ]
saiful.mukhlis@gmail.com
0be2daf4dc44fcfe951ea49e3553d949e85173a2
70f8047ca3e9b71ef716f3ba0d1958c7a68130e5
/src/main/java/ifelse/loops/examples/Big2IntUsingIfelse.java
191c95800182cd14fd04dce51847d6c9ae6b9092
[]
no_license
ramreddykiran/CoreJavaExamples
75a90bfd11adda144effe4e6e5dc41624c4a3e09
eac44f2c60368b9aabdf3337a7328bcf1085b926
refs/heads/master
2021-01-22T05:20:51.547166
2017-10-16T09:40:45
2017-10-16T09:40:45
81,653,995
0
0
null
null
null
null
UTF-8
Java
false
false
510
java
package ifelse.loops.examples; public class Big2IntUsingIfelse { public void big2int(int a, int b) { if (a > b)// { } is optional System.out.println("A is big a=" + a); else if (b > a) { System.out.println("B is Big b=" + b); } else { System.out.println("A and B are same a= " + a + " b = " + b); } } public static void main(String[] args) { Big2IntUsingIfelse b = new Big2IntUsingIfelse(); b.big2int(20, 10); b.big2int(5, 10); b.big2int(15, 15); } }
[ "ramreddysrinivas532@gmail.com" ]
ramreddysrinivas532@gmail.com
dbf3209eb44523cbb3ddf2f1b2d5c948df0f9dc9
480f0384e4cece856017d96a9f4acf73db9ad5cd
/ExampleApp/app/src/main/java/com/example/app/animation/AnimationActivity.java
f2b49caa7a6e1e3562af6f627457c0d50be7bdc1
[]
no_license
liucaoye/AndroidExample
1583dd871b3afbcb61227ae08909951f47c5485d
86c2be64577d40a3760bcfcc5121384105801baf
refs/heads/master
2020-12-29T00:55:53.583503
2016-08-22T01:03:51
2016-08-22T01:03:51
47,063,651
0
0
null
null
null
null
UTF-8
Java
false
false
4,745
java
package com.example.app.animation; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.AnimationUtils; import android.view.animation.TranslateAnimation; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.example.app.R; /** * 1. Animation只是重绘了动画,View的实际位置没有发生变化(点击tv原来的位置,弹出toast),不适用于交互的组件 * 2. ObjectAnimator真正改变了控件的位置 * */ public class AnimationActivity extends Activity implements View.OnClickListener{ private Button mStartButton; private TextView mAnimTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_animation); initView(); initListener(); } private void initView() { mAnimTextView = (TextView) findViewById(R.id.tv_animation); mStartButton = (Button) findViewById(R.id.btn_start); } private void initListener() { mStartButton.setOnClickListener(this); mAnimTextView.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_start: // TODO: RotateAnimation使用 // 方法一: // Animation anim = new RotateAnimation(0.0f, 360f); // anim.setInterpolator(new AccelerateDecelerateInterpolator()); // anim.setDuration(3000); // 方法二: // Animation anim = AnimationUtils.loadAnimation(this, R.anim.rotate); // // TODO: Animation只是重绘了动画,View的实际位置没有发生变化,不适用于交互的组件 // TranslateAnimation anim = new TranslateAnimation(0, 200, 0, 100); // anim.setDuration(3000); // anim.setFillBefore(false); // // mAnimTextView.startAnimation(anim); // TODO: ObjectAnimator 多个动画一起同时开始 // ObjectAnimator.ofFloat(mAnimTextView, "rotation", 0, 360F).setDuration(1000).start(); // ObjectAnimator.ofFloat(mAnimTextView, "translationX", 0, 200F).setDuration(1000).start(); // ObjectAnimator.ofFloat(mAnimTextView, "translationY", 0, 200F).setDuration(1000).start(); // TODO: PropertyValuesHolder优化了多个属性动画一起使用时的更加节省内存, // PropertyValuesHolder holder1 = PropertyValuesHolder.ofFloat("rotation", 0, 360F); // PropertyValuesHolder holder2 = PropertyValuesHolder.ofFloat("translationX", 0, 200F); // PropertyValuesHolder holder3 = PropertyValuesHolder.ofFloat("translationY", 0, 200F); // ObjectAnimator.ofPropertyValuesHolder(mAnimTextView, holder1, holder2, holder3).setDuration(1000).start(); // TODO: AnimatorSet 动画可以灵活组合 // ObjectAnimator animator1 = ObjectAnimator.ofFloat(mAnimTextView, "rotation", 0, 360F); // ObjectAnimator animator2 = ObjectAnimator.ofFloat(mAnimTextView, "translationX", 0, 200F); // ObjectAnimator animator3 = ObjectAnimator.ofFloat(mAnimTextView, "translationY", 0, 200F); // AnimatorSet set = new AnimatorSet(); //// set.playSequentially(animator1, animator2, animator3); // 按顺序执行 // set.play(animator2).with(animator3); // set.play(animator2).after(animator1); // set.setDuration(1000).start(); break; case R.id.tv_animation: Toast.makeText(this, "click textview", Toast.LENGTH_SHORT).show(); // TODO: animator动画监听 // ObjectAnimator animator = ObjectAnimator.ofFloat(mAnimTextView, "alpha", 0, 1); // // AnimatorListenerAdapter实现了接口Animator.AnimatorListener // animator.addListener(new AnimatorListenerAdapter() { // @Override // public void onAnimationEnd(Animator animation) { // super.onAnimationEnd(animation); // } // }); // animator.setDuration(1000).start(); break; } } }
[ "liuyan@yinker.com" ]
liuyan@yinker.com
57dd0ab00915a8af7748520433cb807310137391
900b523629565f51e01c1e810044b0fc601bde83
/Lab5/springintro/src/main/java/softuni/springintro/services/AuthorService.java
e129efa205b8cb2b987bdaf809421a31515fa8c8
[]
no_license
alexurumov/Hibernate
dafa153b7fbc4dea8a15b1f0a299fa9f04a7645e
5eed4e80ee345d6b29e8080583182be17ee97027
refs/heads/main
2023-01-04T10:33:45.172417
2020-10-26T13:13:18
2020-10-26T13:13:18
307,377,361
0
0
null
null
null
null
UTF-8
Java
false
false
259
java
package softuni.springintro.services; import softuni.springintro.entities.Author; import java.io.IOException; import java.util.List; public interface AuthorService { void seedAuthors() throws IOException; List<String> findAllAuthorsOrdered(); }
[ "alex.urumov@gmail.com" ]
alex.urumov@gmail.com
0c6e8fbc7b65dc4f119291272a598898128e4c15
3fe9ae4c1044349e6307a899045074af58f68b95
/src/com/base/engine/PhongShader.java
3e4fc94a97547fba54be07df66b875a59698f891
[]
no_license
s0dz/3DGameEngine
406d4a69e160661eff10e43191c3551868b9c21e
f277b90f51d8022015b3c24cb6b16d4dd97d3804
refs/heads/master
2016-08-07T12:34:45.637134
2014-03-04T06:20:46
2014-03-04T06:20:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,483
java
package com.base.engine; public class PhongShader extends Shader { private static final PhongShader instance = new PhongShader(); public static PhongShader getInstance() { return instance; } private static Vector3f ambientLight = new Vector3f( 0.1f, 0.1f, 0.1f ); private static DirectionalLight directionalLight = new DirectionalLight( new BaseLight( new Vector3f( 1, 1, 1 ), 0 ), new Vector3f( 0, 0, 0 ) ); public PhongShader() { super(); addVertexShader( ResourceLoader.loadShader( "phongVertex.vs" ) ); addFragmentShader( ResourceLoader.loadShader( "phongFragment.fs" ) ); compileShader(); addUniform( "transform" ); addUniform( "transformProjected" ); addUniform( "baseColor" ); addUniform( "ambientLight" ); addUniform( "directionalLight.base.color" ); addUniform( "directionalLight.base.intensity" ); addUniform( "directionalLight.direction" ); } @Override public void updateUniforms( Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material ) { if( material.getTexture() != null ) { material.getTexture().bind(); } else { RenderUtil.unbindTextures(); } setUniform( "transformProjected", projectedMatrix ); setUniform( "transform", worldMatrix ); setUniform( "baseColor", material.getColor() ); setUniform( "ambientLight", ambientLight ); setUniform( "directionalLight", directionalLight ); } public static Vector3f getAmbientLight() { return ambientLight; } public static void setAmbientLight( Vector3f ambientLight ) { PhongShader.ambientLight = ambientLight; } public static void setDirectionalLight( DirectionalLight directionalLight ) { PhongShader.directionalLight = directionalLight; } public void setUniform( String uniformName, BaseLight baseLight ) { setUniform( uniformName + ".color", baseLight.getColor() ); setUniformf( uniformName + ".intensity", baseLight.getIntensity() ); } public void setUniform( String uniformName, DirectionalLight directionalLight ) { setUniform( uniformName + ".base", directionalLight.getBase() ); setUniform( uniformName + ".direction", directionalLight.getDirection() ); } }
[ "garrett.mctear@gmail.com" ]
garrett.mctear@gmail.com
fd46228cde48de204e5fd61532d468eec8f609ce
e1b5849d0a6eb0e20cc25bd46c16ea263a6768f2
/TelaPerguntas.java
b3f3dcc8674e556b71e0cd9fea0145a09110274c
[]
no_license
bunnytinha/KimeDachiNew
3f31f40c7057d9237406260c7b9930485c2da9dd
db6ebaac3bfb98187032c9f2ca01c812e81b0a1c
refs/heads/master
2022-06-10T00:27:43.156818
2020-05-06T20:44:37
2020-05-06T20:44:37
261,874,352
0
0
null
null
null
null
UTF-8
Java
false
false
1,887
java
import javax.swing.JFrame; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JTextField; import java.awt.Container; import java.awt.GridLayout; import java.awt.FlowLayout; import javax.swing.JPanel; public class TelaPerguntas extends JFrame implements ActionListener{ private JButton botao1; private JButton botao2; private JButton botao3; private JButton botao4; public TelaPerguntas telaPerguntas; public TelaPerguntas(){ super("Kime Dachi - Perguntas"); botao1 = new JButton("Cadastrar Perguntas"); botao2 = new JButton("Banco de Perguntas"); botao3 = new JButton("Registro de Aulas"); botao4 = new JButton("Voltar"); Container caixa = getContentPane(); caixa.setLayout(new FlowLayout()); JPanel painel = new JPanel(new GridLayout(1,3)); painel.add(botao1); painel.add(botao2); painel.add(botao3); painel.add(botao4); caixa.add(painel); botao1.addActionListener(this); botao2.addActionListener(this); botao3.addActionListener(this); botao4.addActionListener(this); setSize(700,200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); this.setLocationRelativeTo(null); } public void actionPerformed(ActionEvent a){ if(a.getSource() == botao1){ new CadastroPerguntas(); System.out.println("Novas Perguntas"); } if(a.getSource() == botao2){ new Perguntas(); System.out.println("Perguntas"); } if(a.getSource() == botao3){ new Aulas(); System.out.println("Registro de Aulas"); } if(a.getSource() == botao4){ new TelaMenu(); System.out.println("Voltar"); } } }
[ "tnubianunes@gmail.com" ]
tnubianunes@gmail.com
2914208d03a6f6ec6fd5c33e5788a06356f6382e
67bfcbd8c861c28c138450b52c9eea10b6c7d8b2
/src/modules/CrudProposal.java
8b57a2d19b4db10af51299811dc7e5494d31ec4d
[]
no_license
cmasana/GestionEmpresas_Sprint4
e8ee320db5a985cb948a622b18ea1e031328c158
9cc7952574a3073abc1cf8b8c3e83aa4c33e30bb
refs/heads/main
2023-03-10T22:18:00.323796
2021-02-25T07:29:14
2021-02-25T07:29:14
333,205,333
0
0
null
null
null
null
UTF-8
Java
false
false
9,484
java
package modules; import auxiliar.CustomException; import auxiliar.InputOutput; import auxiliar.Log; import custom_ui.tables.*; import mainclasses.database.ProposalDB; import mainclasses.entity.Entity; import auxiliar.Error; import mainclasses.proposal.Proposal; import javax.swing.*; import java.text.ParseException; import java.util.Date; /** * Clase CrudProposal: Implementa todos los métodos necesarios para la gestión de propuestas * * @author cmasana */ public class CrudProposal { // Array de tipo ProposalDB private final ProposalDB proposalList = new ProposalDB(); /** * Permite crear propuestas * * @param proposalTable tabla donde se visualizan las propuestas * @param name nombre de la propuesta * @param description descripción de la propuesta * @param startDate fecha de la propuesta * @param entity entidad de la propuesta */ public void createProposal(JTable proposalTable, String name, String description, String startDate, Entity entity) { try { // Si hay algún campo vacío if (name.isEmpty() || description.isEmpty() || startDate.isEmpty() || entity == null) { throw new CustomException(1111); } else { // Si la fecha introducida es anterior a la actual if (InputOutput.wrongDate(startDate)) { throw new CustomException(1117); } else { // Creamos objeto de la clase Proposal Proposal prop = new Proposal(name, description, InputOutput.stringToDate(startDate), entity); // Lo añadimos al arraylist de tipo Proposal proposalList.addProposal(prop); // Añadimos la entrada al log Log.capturarRegistro("PROPOSAL CREATE " + prop.toString()); // Actualizamos los datos en la tabla showData(proposalTable); } } } catch (CustomException ce) { InputOutput.printAlert(ce.getMessage()); // Capturamos error para el registro Error.capturarError("PROPOSAL " + ce.getMessage()); } catch (ParseException pe) { String alerta = "Error: Fecha con formato desconocido"; InputOutput.printAlert(alerta); // Capturamos error para el registro Error.capturarError("PROPOSAL " + alerta); } } /** * Permite eliminar propuestas * * @param proposalTable tabla donde se visualizan las propuestas */ public void deleteProposal(JTable proposalTable) { // Almacena el resultado de un cuadro de alerta si es 0 se elimina el elemento int ok; // Guardamos el número de fila (coincide con la posición en el ArrayList) int row = proposalTable.getSelectedRow(); try { // Si hay una fila seleccionada, mostramos mensaje de confirmación if (row >= 0) { // Mensaje de confirmación para eliminar ok = InputOutput.deleteConfirmation(); // Si el resultado es igual a 0, eliminamos la propuesta if (ok == 0) { // Añadimos la entrada al log Log.capturarRegistro("PROPOSAL DELETE " + proposalList.getProposalFromDB(row)); // Eliminamos propuesta proposalList.removeProposal(row); // Actualizamos datos de la tabla showData(proposalTable); } } // En caso contrario, mostramos un error por pantalla else { throw new CustomException(1114); } } catch (CustomException ce) { InputOutput.printAlert(ce.getMessage()); // Capturamos error para el registro Error.capturarError("PROPOSAL " + ce.getMessage()); } } /** * Permite vaciar toda la lista de propuestas * * @param proposalTable tabla donde se visualizan las propuestas creadas * @deprecated */ public void emptyAll(JTable proposalTable) { // Almacena un entero, si es 0 se eliminan todos los elementos int ok; // Almacenamos el nº total de filas que hay en la tabla int totalrows = proposalTable.getRowCount(); try { if (totalrows != 0) { // Mensaje de confirmación para eliminar ok = InputOutput.emptyConfirmation(); if (ok == 0) { // Recorremos el arrayList y eliminamos 1 a 1 los registros for (int i = (totalrows - 1); i >= 0; i--) { proposalList.removeProposal(i); } // Actualizamos los datos de la tabla showData(proposalTable); } } else { throw new CustomException(1116); } } catch (CustomException ce) { InputOutput.printAlert(ce.getMessage()); // Capturamos error para el registro Error.capturarError("PROPOSAL " + ce.getMessage()); } } /** * Permite modificar propuestas * * @param proposalTable tabla donde se visualizan las propuestas * @param name nombre de la propuesta * @param description descripción de la propuesta * @param startDate fecha de la propuesta * @param cbEntity comboBox con la lista de entidades */ public void editProposal(JTable proposalTable, String name, String description, String startDate, JComboBox<Entity> cbEntity) { // Almacenamos el nº total de filas que hay en la tabla int totalRows = proposalTable.getRowCount(); // Almacena el nº de fila seleccionado (coincide con el índice en el ArrayList) int selectedRow = proposalTable.getSelectedRow(); // Almacena el item seleccionado del comboBox Entity itemSelected = (Entity) cbEntity.getSelectedItem(); try { // Si no hay ninguna fila creada if (totalRows == 0) { throw new CustomException(1116); } else { // Si no hay ninguna fila seleccionada if (selectedRow < 0) { throw new CustomException(1114); } else { // Si los campos están vacíos if (name.isEmpty() || description.isEmpty() || startDate.isEmpty() || itemSelected == null) { throw new CustomException(1111); } else { // Si la fecha introducida es anterior a HOY if (InputOutput.wrongDate(startDate)) { throw new CustomException(1117); } else { proposalList.getProposalFromDB(selectedRow).setName(name); proposalList.getProposalFromDB(selectedRow).setDescription(description); proposalList.getProposalFromDB(selectedRow).setStartDate(InputOutput.stringToDate(startDate)); proposalList.getProposalFromDB(selectedRow).setEntity(itemSelected); // Añadimos la entrada al log Log.capturarRegistro("PROPOSAL EDIT " + name + " " + description + " " + InputOutput.stringToDate(startDate) + " " + itemSelected.toString()); // Actualizamos datos de la tabla showData(proposalTable); } } } } } catch (CustomException ce) { InputOutput.printAlert(ce.getMessage()); // Capturamos error para el registro Error.capturarError("PROPOSAL " + ce.getMessage()); } catch (ParseException e) { InputOutput.printAlert("Error: La fecha introducida no es válida"); } } /** * Muestra los datos actualizados en la tabla de propuestas * * @param proposalTable tabla dónde se visualizan las propuestas creadas */ public void showData(JTable proposalTable) { // Creamos array de tipo string e inicializamos con el tamaño del ArrayList String[][] tabla = new String[proposalList.sizeProposalDB()][5]; // Recorre la lista de Propuestas for (int i = 0; i < proposalList.sizeProposalDB(); i++) { // Datos de cada Empleado tabla[i][0] = proposalList.getProposalFromDB(i).getName(); tabla[i][1] = proposalList.getProposalFromDB(i).getDescription(); tabla[i][2] = InputOutput.dateToString(proposalList.getProposalFromDB(i).getStartDate()); tabla[i][3] = proposalList.getProposalFromDB(i).getEntity().toString(); } // Añade los datos al modelo proposalTable.setModel(new CustomTableModel( tabla, new String[]{ "Título", "Descripción", "Fecha Inicio", "Entidad" } )); // Diseño de la tabla CustomTableConfig.initConfig(proposalTable); } }
[ "unaltrataronja@gmail.com" ]
unaltrataronja@gmail.com
8e8b3dedee99356b4b93d34cf7de718b3d87f45c
566a21c1e48f257ee8c61bba543c9a4136c04c0c
/List.java
a0c09ffcd45b811b1ef635c6bc6268d6513832d8
[]
no_license
divamadea/polynomial-calc
b83e091742952786d9ee0fc1e125453b60e8849e
04ffa49e18e7d0a1d58859918f0d99ca41549e74
refs/heads/master
2022-10-22T20:38:18.340145
2020-06-12T10:06:01
2020-06-12T10:06:01
271,759,576
0
0
null
null
null
null
UTF-8
Java
false
false
1,646
java
package Polynomial; /** List ADT */ public interface List { /** Remove all contents from the list, so it is once again empty. Client is responsible for reclaiming storage used by the list elements. */ public void clear(); /** Insert an element at the current location. The client must ensure that the list’s capacity is not exceeded. @param item The element to be inserted. */ public void insert(int item); /** Append an element at the end of the list. The client must ensure that the list’s capacity is not exceeded. @param item The element to be appended. */ public void append(int item); /** Remove and return the current element. @return The element that was removed. */ public int remove(); /** Set the current position to the start of the list */ public void moveToStart(); /** Set the current position to the end of the list */ public void moveToEnd(); /** Move the current position one step left. No change if already at beginning. */ public void prev(); /** Move the current position one step right. No change if already at end. */ public void next(); /** @return The number of elements in the list. */ public int length(); /** @return The position of the current element. */ public int currPos(); /** Set current position. @param pos The position to make current. */ public void moveToPos(int pos); /** @return The current element. */ public int getValue(); }
[ "noreply@github.com" ]
noreply@github.com
939bd90ac6b02ccf85df5a8a98c7e8c5cad44e6d
8f0886a87d6370ead4dbd03d547c230c895b138d
/src/main/java/ink/chow/web/sovereigns/mapper/ex/BlogIgnoreFileMapperEx.java
7682849e51f7dbbe4c536a25175a8f20ec9535d2
[]
no_license
SvizzerChow/sovereigns
7b3c21b71f9554552a3428954719a42a772e1baf
03f240ea1d44fe93933594a995c014902ca6a943
refs/heads/master
2022-06-23T21:04:34.263894
2019-09-15T12:30:49
2019-09-15T12:30:49
202,084,068
0
0
null
null
null
null
UTF-8
Java
false
false
263
java
package ink.chow.web.sovereigns.mapper.ex; import org.springframework.stereotype.Repository; import java.util.List; import ink.chow.web.sovereigns.entity.BlogIgnoreFile; @Repository public interface BlogIgnoreFileMapperEx { List<BlogIgnoreFile> list(); }
[ "mysvizzera@outlook.com" ]
mysvizzera@outlook.com
0aab79051fe1a09e6f12244fa50040ab6dc809c7
93392ecf16e8fdff7e7703b5fb5b8061008f2f7c
/src/main/java/cn/wepact/dfm/generator/mapper/KnowledgeMapper.java
d540b1aa3371ea11ba70424cfefdd18da4556b11
[]
no_license
youlinJava/Knowledge
6d4e165625973a0ebc3f4c7ed95322a61029af20
9b4be6ae2b15e42ad1ae8f7f43ab8154a36d5a4d
refs/heads/master
2022-07-12T16:47:48.071826
2020-03-27T01:33:11
2020-03-27T01:33:11
250,167,918
1
0
null
2022-06-21T03:09:27
2020-03-26T05:18:08
Java
UTF-8
Java
false
false
193
java
package cn.wepact.dfm.generator.mapper; import cn.wepact.dfm.generator.entity.Knowledge; import tk.mybatis.mapper.common.Mapper; public interface KnowledgeMapper extends Mapper<Knowledge> { }
[ "5573878+DreamPlume@user.noreply.gitee.com" ]
5573878+DreamPlume@user.noreply.gitee.com
37353be2d44b0e20f3df794d7aed9bfa5ebab22e
8a2eee891accd75a2179ed2b742538b2a5ab621c
/src/view/AddJobFrame.java
079ae542e5056c7e088e5e179a31edb7dea1aed4
[]
no_license
itzzanu/PCSAutomation
5aa51a4160b2e04f9661bdb28fa688d34a9c486e
9ad58ab3f12c1fdad5c8ef219d3f4127ae5f8d60
refs/heads/master
2023-02-07T13:07:38.480240
2020-12-13T10:33:41
2020-12-13T10:33:41
320,290,649
0
0
null
null
null
null
UTF-8
Java
false
false
3,009
java
package view; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JTextField; import controller.JobController; public class AddJobFrame extends JFrame{ Container container; JLabel lJobtitle,lJobdescrip,lCompanyname,lLocation,lKeyskill,lSalary; JTextField tJobtitle,tJobdescrip,tCompanyname,tLocation,tKeyskill,tSalary; JButton bSubmit; JobController jobController=null; JFrame f; public AddJobFrame() throws ClassNotFoundException, SQLException { container=getContentPane(); jobController=new JobController(); lJobtitle=new JLabel("Job Title"); lJobdescrip=new JLabel("Job Description"); lCompanyname=new JLabel("Company Name"); lLocation=new JLabel("Location"); lKeyskill=new JLabel("Key Skill"); lSalary=new JLabel("Salary"); tJobtitle=new JTextField(); tJobdescrip=new JTextField(); tCompanyname=new JTextField(); tLocation=new JTextField(); tKeyskill=new JTextField(); tSalary=new JTextField(); bSubmit=new JButton("SUBMIT"); //Event handling for Register button bSubmit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { String s1,s2,s3,s4,s5,s6; s1=tJobtitle.getText(); s2=tJobdescrip.getText(); s3=tCompanyname.getText(); s4=tLocation.getText(); s5=tKeyskill.getText(); s6=tSalary.getText(); jobController.addJob(s1,s2,s3,s4,s5,s6); f=new JFrame(); JOptionPane.showMessageDialog(f,"Job Added"); } }); setLayoutManager(); setLocationAndSize(); addComponentsToContainer(); this.setTitle("Add Job"); this.setVisible(true); this.setBounds(10,10,500,550); //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setResizable(false); } private void setLayoutManager() { container.setLayout(null); } public void setLocationAndSize() { lJobtitle.setBounds(30, 50, 100, 30); lJobdescrip.setBounds(30, 100, 100, 30); lCompanyname.setBounds(30, 150, 100, 30); lLocation.setBounds(30, 200, 100, 30); lKeyskill.setBounds(30,250,100,30); lSalary.setBounds(30, 300, 100, 30); tJobtitle.setBounds(250, 50, 150, 30); tJobdescrip.setBounds(250,100,150,30); tCompanyname.setBounds(250, 150, 150, 30); tLocation.setBounds(250,200,150,30); tKeyskill.setBounds(250,250,150,30); tSalary.setBounds(250, 300, 150, 30); bSubmit.setBounds(150, 370, 150, 30); } public void addComponentsToContainer() { container.add(lJobtitle); container.add(lJobdescrip); container.add(lCompanyname); container.add(lLocation); container.add(lKeyskill); container.add(lSalary); container.add(tJobtitle); container.add(tJobdescrip); container.add(tCompanyname); container.add(tLocation); container.add(tKeyskill); container.add(tSalary); container.add(bSubmit); } }
[ "71927869+itzzanu@users.noreply.github.com" ]
71927869+itzzanu@users.noreply.github.com
9c180b3b11051fb6db3f4f0a290d9fc7e986a338
45736204805554b2d13f1805e47eb369a8e16ec3
/net/minecraft/block/BlockMobSpawner.java
3136350d086afbd912456f894d1a9d0bf89cd6aa
[]
no_license
KrOySi/ArchWare-Source
9afc6bfcb1d642d2da97604ddfed8048667e81fd
46cdf10af07341b26bfa704886299d80296320c2
refs/heads/main
2022-07-30T02:54:33.192997
2021-08-08T23:36:39
2021-08-08T23:36:39
394,089,144
2
0
null
null
null
null
UTF-8
Java
false
false
1,893
java
/* * Decompiled with CFR 0.150. */ package net.minecraft.block; import java.util.Random; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockMobSpawner extends BlockContainer { protected BlockMobSpawner() { super(Material.ROCK); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityMobSpawner(); } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Items.field_190931_a; } @Override public int quantityDropped(Random random) { return 0; } @Override public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) { super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); int i = 15 + worldIn.rand.nextInt(15) + worldIn.rand.nextInt(15); this.dropXpOnBlockBreak(worldIn, pos, i); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.MODEL; } @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } @Override public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) { return ItemStack.field_190927_a; } }
[ "67242784+KrOySi@users.noreply.github.com" ]
67242784+KrOySi@users.noreply.github.com
7b70807c6c285ff419241f365aa5fa43368d5440
cdbd53ceb24f1643b5957fa99d78b8f4efef455a
/vertx-gaia/vertx-co/src/main/java/io/vertx/up/uca/failure/CodeReadible.java
89f0f90b7d6a59a244a70d2392ea014fb1b75b2a
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
chundcm/vertx-zero
f3dcb692ae6b9cc4ced52386cab01e5896e69d80
d2a2d096426c30d90be13b162403d66c8e72cc9a
refs/heads/master
2023-04-27T18:41:47.489584
2023-04-23T01:53:40
2023-04-23T01:53:40
244,054,093
0
0
Apache-2.0
2020-02-29T23:00:59
2020-02-29T23:00:58
null
UTF-8
Java
false
false
1,157
java
package io.vertx.up.uca.failure; import io.vertx.core.json.JsonObject; import io.vertx.up.exception.WebException; import io.vertx.up.fn.Fn; import io.vertx.up.log.Annal; import io.vertx.up.util.Ut; import java.io.InputStream; public class CodeReadible implements Readible { private static final Annal LOGGER = Annal.get(CodeReadible.class); private static final JsonObject MESSAGE = new JsonObject(); private static final String FILENAME = "vertx-readible.yml"; @Override public void interpret(final WebException error) { if (MESSAGE.isEmpty()) { final InputStream in = Ut.ioStream(FILENAME); // Do not throw out EmptyStreamException when up.god.file does not existing. if (null != in) { MESSAGE.mergeIn(Ut.ioYaml(FILENAME)); } } // Pick up message from MESSAGE cache. final String message = MESSAGE.getString(String.valueOf(Math.abs(error.getCode()))); // Check whether the readible set. Fn.safeSemi(Ut.isNil(error.getReadible()), LOGGER, () -> Fn.safeNull(() -> error.setReadible(message), error)); } }
[ "silentbalanceyh@126.com" ]
silentbalanceyh@126.com
cbb509fbec553f22641cfbe3cc67a2440e5964dd
3171702d22be1ea7c5a84b09aa9e89a8b035ceae
/no.hal.learning/no.hal.learning.exercise/jdt.ecore/src/no/hal/learning/exercise/jdt/ecore/ast/impl/VariableDeclarationStatementImpl.java
429140b262b4116852ec2cec24dc779e14d6b560
[]
no_license
hallvard/jexercise
345b728a84b89e43632eb95d825e9d86ea4cec58
0e6a911ea31d8f7f7dc0f288122214e239d9d5eb
refs/heads/master
2021-05-25T09:19:30.421067
2020-12-14T15:57:44
2020-12-14T15:57:44
1,203,162
5
17
null
2020-10-13T10:16:03
2010-12-28T15:06:53
Java
UTF-8
Java
false
false
7,587
java
/** */ package no.hal.learning.exercise.jdt.ecore.ast.impl; import java.util.Collection; import no.hal.learning.exercise.jdt.ecore.ast.AstPackage; import no.hal.learning.exercise.jdt.ecore.ast.IExtendedModifier; import no.hal.learning.exercise.jdt.ecore.ast.Type; import no.hal.learning.exercise.jdt.ecore.ast.VariableDeclarationFragment; import no.hal.learning.exercise.jdt.ecore.ast.VariableDeclarationStatement; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Variable Declaration Statement</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link no.hal.learning.exercise.jdt.ecore.ast.impl.VariableDeclarationStatementImpl#getModifiers <em>Modifiers</em>}</li> * <li>{@link no.hal.learning.exercise.jdt.ecore.ast.impl.VariableDeclarationStatementImpl#getType <em>Type</em>}</li> * <li>{@link no.hal.learning.exercise.jdt.ecore.ast.impl.VariableDeclarationStatementImpl#getFragments <em>Fragments</em>}</li> * </ul> * * @generated */ public class VariableDeclarationStatementImpl extends StatementImpl implements VariableDeclarationStatement { /** * The cached value of the '{@link #getModifiers() <em>Modifiers</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getModifiers() * @generated * @ordered */ protected EList<IExtendedModifier> modifiers; /** * The cached value of the '{@link #getType() <em>Type</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected Type type; /** * The cached value of the '{@link #getFragments() <em>Fragments</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFragments() * @generated * @ordered */ protected EList<VariableDeclarationFragment> fragments; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected VariableDeclarationStatementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return AstPackage.Literals.VARIABLE_DECLARATION_STATEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<IExtendedModifier> getModifiers() { if (modifiers == null) { modifiers = new EObjectContainmentEList<IExtendedModifier>(IExtendedModifier.class, this, AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS); } return modifiers; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetType(Type newType, NotificationChain msgs) { Type oldType = type; type = newType; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE, oldType, newType); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(Type newType) { if (newType != type) { NotificationChain msgs = null; if (type != null) msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE, null, msgs); if (newType != null) msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE, null, msgs); msgs = basicSetType(newType, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE, newType, newType)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<VariableDeclarationFragment> getFragments() { if (fragments == null) { fragments = new EObjectContainmentEList<VariableDeclarationFragment>(VariableDeclarationFragment.class, this, AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS); } return fragments; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS: return ((InternalEList<?>)getModifiers()).basicRemove(otherEnd, msgs); case AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE: return basicSetType(null, msgs); case AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS: return ((InternalEList<?>)getFragments()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS: return getModifiers(); case AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE: return getType(); case AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS: return getFragments(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS: getModifiers().clear(); getModifiers().addAll((Collection<? extends IExtendedModifier>)newValue); return; case AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE: setType((Type)newValue); return; case AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS: getFragments().clear(); getFragments().addAll((Collection<? extends VariableDeclarationFragment>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS: getModifiers().clear(); return; case AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE: setType((Type)null); return; case AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS: getFragments().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.VARIABLE_DECLARATION_STATEMENT__MODIFIERS: return modifiers != null && !modifiers.isEmpty(); case AstPackage.VARIABLE_DECLARATION_STATEMENT__TYPE: return type != null; case AstPackage.VARIABLE_DECLARATION_STATEMENT__FRAGMENTS: return fragments != null && !fragments.isEmpty(); } return super.eIsSet(featureID); } } //VariableDeclarationStatementImpl
[ "hal@ntnu.no" ]
hal@ntnu.no
acbaf94ddce768aef311730103348b6abf7fbfbe
8af35ffc2e9e8f6f672b3920e8590d1db9df3e64
/src/todo/services/LoginService.java
7946011dbfd3d27aec0adf9d1c46924c7fdaafbf
[]
no_license
sudoy/todo_inada
209a7b6c5b1c7f2c56433530542ff60bd91b7bd2
9f43179bb15005565b45a3423f52978120e00ef6
refs/heads/master
2020-06-10T11:12:30.774125
2019-07-05T08:26:13
2019-07-05T08:26:13
193,638,894
0
0
null
null
null
null
UTF-8
Java
false
false
1,359
java
package todo.services; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import todo.forms.LoginForm; import todo.utils.DBUtils; import todo.utils.SHA2; public class LoginService { public LoginForm service(LoginForm form) { Connection con = null; PreparedStatement ps = null; String sql = null; ResultSet rs = null; boolean b = false; LoginForm f; String name = null; String mail = null; String pass = null; try { con = DBUtils.getConnection(); sql = "select mail, pass, name from user where mail = ? and pass = ?";//ここでSHA2()使えばよかった ps = con.prepareStatement(sql); //入力されたパスワードをハッシュ化 String hashPass = SHA2.getSHA256(form.getPass()); ps.setString(1, form.getMail()); ps.setString(2, hashPass); rs = ps.executeQuery(); while (rs.next()) { name = rs.getString("name"); mail = rs.getString("mail"); pass = rs.getString("pass"); if (mail != null && pass != null) { b = true; } } f = new LoginForm(b, name, form.getMail()); return f; } catch (Exception e) { e.printStackTrace(); b = false; f = new LoginForm(b, name, form.getMail()); return f; } finally { DBUtils.close(con, ps, rs); } } }
[ "稲田@TSD-INADA" ]
稲田@TSD-INADA
6010e8e03249c4985974c7b02e7367e587a63a08
81ca8a034d01f05e15c3ac3d5bfe8259d9c1908b
/app/src/main/java/com/example/koheisato/taskmanager/DisplayMessageActivity.java
69aaab0cc941d8270f71b2e610acd35c41038085
[]
no_license
s1240010/Test
0c02aed014fc6d93ab28b7a9cb046d2b70708e91
bfedbb2a469e107d2191c225dcbcc5c5e1dd399c
refs/heads/master
2020-03-19T01:31:47.299825
2018-05-31T09:10:19
2018-05-31T09:10:19
135,552,041
0
0
null
null
null
null
UTF-8
Java
false
false
713
java
package com.example.koheisato.taskmanager; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class DisplayMessageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_display_message); //get the Intent that started this activity anc extract the string Intent intent = getIntent(); String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); TextView textView = findViewById(R.id.textView); textView.setText(message); } }
[ "s1240010@u-aizu.ac.jp" ]
s1240010@u-aizu.ac.jp
067ff7718a6f99c5fdb1579344a4c410d6463d44
cbf68d02b0e2bb31d9b13fa4063ec1f9c4d9765e
/Java/Java Basics/Homeworks/LoopsMethodsClasses/src/_07DaysBetweenTwoDates.java
550eb51be210a44550c614234ef9806fd615c91f
[]
no_license
Petko-Petkov/SoftwareUniversity
a0dc38366288ef0cf3653b8dbbdaf7c93e700d87
82f29dd524b9aca03869ddc0b72995561540bd2c
refs/heads/master
2016-09-06T20:18:00.746536
2014-10-31T13:19:18
2014-10-31T13:19:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.Scanner; public class _07DaysBetweenTwoDates { public static void main(String[] args) { Scanner input = new Scanner(System.in); String beginDate = input.nextLine(); String endDate = input.nextLine(); LocalDate start = LocalDate.parse(beginDate, DateTimeFormatter.ofPattern("d-MM-uuuu")); LocalDate end = LocalDate.parse(endDate, DateTimeFormatter.ofPattern("d-MM-uuuu")); long result = ChronoUnit.DAYS.between(start, end); System.out.println(result); input.close(); } }
[ "Petko.Hr.Petkov@gmail.com" ]
Petko.Hr.Petkov@gmail.com
1dd32fb0c67e037fb887f2522938448dd2f3b799
ded01ab6e263e8aaa919904f4d48fcacd4fd1fda
/Test/QA_Automation/Java/InterfaceJava.java
bf7eccdd870607d60ee5d8aed7e4c5fbbee20166
[]
no_license
Automation-Guy/Selenium-Automation
a53a577b934aefcb2d7786e66aa9d15ae2ca038a
efba9f8320eeb7aaaa794051423a7b50776afa85
refs/heads/master
2022-12-10T04:18:14.294761
2020-09-12T20:00:09
2020-09-12T20:00:09
277,916,435
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package Java; public class InterfaceJava implements interfaceJavaConcept{ @Override public void credit() { // TODO Auto-generated method stub System.out.println("Core Method of Child"); } @Override public void debit() { // TODO Auto-generated method stub System.out.println("Core Method of GC"); } @Override public void transferMoney() { // TODO Auto-generated method stub System.out.println("Core Method of GGChild"); } }
[ "mknptl93@gmail.com" ]
mknptl93@gmail.com
68aa43f9cc86169a615a5e8a7a2db77ed79b8eef
8686e99a3cebce5b990982d1375ae4cca7dc1a80
/ApiCalls/android/app/src/main/java/com/apicalls/MainActivity.java
ee1b6315aacfd761c991b19786654963f2cabdd6
[]
no_license
rdubeydeqode/react-native-traning
1713c349a8ef34a49dbaa71327e3800b56116be9
f818dff2667511a7f46ee5fdce97f2c7e3fed42d
refs/heads/main
2023-03-29T06:27:38.432981
2021-04-01T09:05:39
2021-04-01T09:05:39
341,466,580
0
0
null
2021-03-03T06:53:46
2021-02-23T07:29:46
JavaScript
UTF-8
Java
false
false
343
java
package com.apicalls; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "ApiCalls"; } }
[ "rdubey@deqode.com" ]
rdubey@deqode.com
291e65f69909b7071c2bdb190f7d9142704106f8
5c2cf62ad326a7fccdc57339cb5e1e84df0922f3
/ISP/BetterInterface/ConcreteService.java
a93e4fdbea1ab649f2520cc16b2bfb06bf6c0b97
[]
no_license
QiyaoShn/Design-Pattern
ee9fe45398ff05488b2993c5f397a58ef9e6d98d
c8668dfbfce1a7c466899b259ea68daae905304a
refs/heads/master
2023-04-23T06:31:20.033024
2021-05-11T05:43:37
2021-05-11T05:43:37
343,760,944
0
0
null
null
null
null
UTF-8
Java
false
false
805
java
package BetterInterface; public class ConcreteService implements AbstractServiceA,AbstractServiceB,AbstractServiceC{ /*通过对接口细化,可以将其分割为三个专门的接口,每个接口中只包含一个方法,用于对应一个客户端 ,每个客户端只能看到与自己相关的业务方法,不能访问其他方法,保证了系统具有良好的封装性。但是, 接口不能太小,会造成接口泛滥,不利于维护;也不能太大,会违背接口隔离原则,灵活性差。*/ @Override public void operatorC() { // TODO Auto-generated method stub } @Override public void operatorB() { // TODO Auto-generated method stub } @Override public void operatorA() { // TODO Auto-generated method stub } }
[ "18272214732@163.com" ]
18272214732@163.com
620bc862b003e0cec2236b9db3cd111203ab8a1a
598c4d595424898c88c05263a6eb8580b5a97bb5
/src/jaegertracing-provider/src/main/java/cps/demo/jaegertracingprovider/JaegertracingProviderApplication.java
da3706d4f8a8e0813b32732cf9c1c0af9cb0fc6e
[]
no_license
vothanhdien/jaegertracing
0e08b2cc10625a438ef89d4e401ef5a50105c6aa
b7fd82d6ec418e9793edd4071ffe4c2ae259267c
refs/heads/master
2021-06-21T14:46:48.833422
2019-11-16T07:27:54
2019-11-16T07:27:54
221,587,560
1
0
null
2021-06-04T02:18:43
2019-11-14T01:46:11
Java
UTF-8
Java
false
false
365
java
package cps.demo.jaegertracingprovider; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class JaegertracingProviderApplication { public static void main(String[] args) { SpringApplication.run(JaegertracingProviderApplication.class, args); } }
[ "dienvt@vng.com.vn" ]
dienvt@vng.com.vn
6ba8ce570575753bb334eb7e6616b77758cafe8e
2884744481be5eab0bfab0c749d11ac73f6f1b83
/array/rotate-array/rotate.java
d27fa072b4e59ee0969a68d81e0e0ab54cf68329
[]
no_license
fatshaw/leetcode
c311177dbd7837fb07f8e9711096cdc117761a11
89340d03af40f9c77300c2f8363c336993bce32c
refs/heads/master
2022-02-08T15:28:01.215714
2022-01-26T03:28:55
2022-01-26T03:28:55
133,148,360
2
1
null
null
null
null
UTF-8
Java
false
false
352
java
private void reverseArray(int[] nums, int l, int r) { while (l < r) { int tmp = nums[l]; nums[l] = nums[r]; nums[r] = tmp; l++; r--; } } public void rotate(int[] nums, int k) { k = k % nums.length; reverseArray(nums, 0, nums.length - 1); reverseArray(nums, 0, k - 1); reverseArray(nums, k, nums.length - 1); }
[ "chaojie.xiao@baidao.com" ]
chaojie.xiao@baidao.com
87504cf74aaeb90719f70527b9a6f099b85d46af
e047c86bb4944145f6a836591155f9cc449811dd
/easyreport-data/src/main/java/com/easytoolsoft/easyreport/data/service/AbstractEditService.java
48f7ed0253ddf129331d7d1f81e0768b129452d3
[ "Apache-2.0" ]
permissive
liupantao/easyreport2
b3a627cb9efc77497b83b22b32dda8818183e310
9dd1b6e030a7db1a9b0dfd87d4cbea3eac3c57fc
refs/heads/master
2020-04-22T09:28:32.249091
2019-02-15T09:30:31
2019-02-15T09:30:31
170,273,130
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
package com.easytoolsoft.easyreport.data.service; import com.easytoolsoft.easyreport.data.dao.IUpdateDao; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; /** * @author tomdeng * @param <Dao> * @param <Po> * @param <Example> */ public abstract class AbstractEditService<Dao extends IUpdateDao<Po, Example>, Po, Example> implements IEditService<Po, Example> { @Autowired protected Dao dao; @Override public int editById(Po record) { return this.dao.updateById(record); } @Override public int editByExample(Po record, Example example) { return this.dao.updateByExample(record, example); } @Override public int batchEdit(List<Po> records) { return this.dao.batchUpdate(records); } }
[ "804878782@qq.com" ]
804878782@qq.com
fb8335306a2aaabc5d49150e6d83d0e90506e3de
b2f44ba766a44426cd06ebfb922d8b75c1773d63
/src/com/leetcode/P407_TrappingRainWaterII.java
4620ba958bb2379d38649ed3f922c8ab6eef4b08
[]
no_license
joy32812/leetcode
a1179ecff91127a6cda83cf70838354b0670970f
9bd74b9774012df0e2e221eedc63d10f3ba88238
refs/heads/master
2023-08-16T14:11:34.232388
2023-08-13T11:30:05
2023-08-13T11:30:05
81,704,645
10
5
null
null
null
null
UTF-8
Java
false
false
1,933
java
package com.leetcode; import java.util.PriorityQueue; /** * Created by xiaoyuan on 27/08/2017. */ public class P407_TrappingRainWaterII { private class Cell { int row; int col; int height; public Cell(int row, int col, int height) { this.row = row; this.col = col; this.height = height; } } int[] dx = {0, 0, 1, -1}; int[] dy = {1, -1, 0, 0}; public int trapRainWater(int[][] heightMap) { if (heightMap == null || heightMap.length == 0 || heightMap[0].length == 0) {return 0;} int m = heightMap.length; int n = heightMap[0].length; if (m <= 2 && n <= 2) {return 0;} PriorityQueue<Cell> pq = new PriorityQueue<>((a, b) -> {return a.height - b.height;}); boolean[][] visit = new boolean[m][n]; for (int i = 0; i < m; i++) { pq.add(new Cell(i, 0, heightMap[i][0])); visit[i][0] = true; pq.add(new Cell(i, n - 1, heightMap[i][n - 1])); visit[i][n - 1] = true; } for (int j = 0; j < n; j++) { pq.add(new Cell(0, j, heightMap[0][j])); visit[0][j] = true; pq.add(new Cell(m - 1, j, heightMap[m - 1][j])); visit[m - 1][j] = true; } int ans = 0; while (!pq.isEmpty()) { Cell cell = pq.poll(); for (int i = 0; i < dx.length; i++) { int row = cell.row + dx[i]; int col =cell.col + dy[i]; if (row >= 0 && row < m && col >= 0 && col < n && !visit[row][col]) { visit[row][col] = true; if (cell.height > heightMap[row][col]) ans += cell.height - heightMap[row][col]; pq.add(new Cell(row, col, Math.max(cell.height, heightMap[row][col]))); } } } return ans; } }
[ "joy32812@qq.com" ]
joy32812@qq.com
3bf07ed43e8ffb0e25667d7a49ce9403f5e56346
4c2784c70af5eb8d97bcce366497e1086a2184e7
/app/src/main/java/com/example/tictactoe/ui/gallery/GalleryFragment.java
811e5d73c08ff9c321549757d6616eb167759ce5
[]
no_license
Kat28bot/TicTacToe
4913a379e9a88cce34fa93e01706930e96ca71aa
a8d27ebe6854db262c7b1a986ffd9a86675da1c3
refs/heads/master
2023-04-01T09:54:56.477268
2021-04-12T18:52:34
2021-04-12T18:52:34
357,305,221
0
0
null
null
null
null
UTF-8
Java
false
false
1,180
java
package com.example.tictactoe.ui.gallery; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.example.tictactoe.R; public class GalleryFragment extends Fragment { private GalleryViewModel galleryViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { galleryViewModel = ViewModelProviders.of(this).get(GalleryViewModel.class); View root = inflater.inflate(R.layout.fragment_gallery, container, false); final TextView textView = root.findViewById(R.id.text_gallery); galleryViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() { @Override public void onChanged(@Nullable String s) { textView.setText(s); } }); return root; } }
[ "katarzyna.oleksiewicz28@gmail.com" ]
katarzyna.oleksiewicz28@gmail.com
100ed796bd9a05b37237325716ee1732f6587f23
f90dd84c017dce881960d96b25ed88afce7e2282
/JDMP/src/org/jdmp/core/script/jdmp/node/PLevel0.java
08ba20714255bcd68007a7a2ce645f10546b9030
[]
no_license
ashrafs/jeff-jdmp
8fe259dbcbbbcdffd6088497a1762ee6ea61dcf5
465c027a068e5728b9507e33adcd3e08a76ad15d
refs/heads/master
2022-09-24T07:22:43.667893
2022-09-04T16:49:53
2022-09-04T16:49:53
42,618,027
0
0
null
null
null
null
UTF-8
Java
false
false
175
java
/* This file was generated by SableCC (http://www.sablecc.org/). */ package org.jdmp.core.script.jdmp.node; public abstract class PLevel0 extends Node { // Empty body }
[ "zjffdu@a853d582-145d-11de-99d6-5fb3f1362b5f" ]
zjffdu@a853d582-145d-11de-99d6-5fb3f1362b5f
42e536d9506486d31a68f5aea5c46f4d847121e0
7697612f4a64237a1771f4e6d85ee9074496f470
/src/main/java/com/plivo/api/models/identity/IdentityCreator.java
d92a390141f2fb328ec1abf2de182e2bd0425f19
[ "MIT" ]
permissive
plivo/plivo-java
ce72d62765c19e05c139fa8a5ae7fa20285cb04f
584b2f702886691e91c69f7179247562dadcce7e
refs/heads/master
2023-08-03T20:20:21.317326
2023-08-03T09:48:28
2023-08-03T09:48:28
2,416,685
30
55
MIT
2023-09-07T07:25:51
2011-09-19T16:45:05
Java
UTF-8
Java
false
false
6,039
java
package com.plivo.api.models.identity; import com.plivo.api.models.base.Creator; import retrofit2.Call; import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class IdentityCreator extends Creator<IdentityCreateResponse> { private String countryIso; private String alias; private String salutation; private String firstName; private String lastName; private String birthPlace; private String birthDate; private String nationality; private String idNationality; private String idIssueDate; private String businessName; private String idType; private String idNumber; private String addressLine1; private String addressLine2; private String city; private String region; private String postalCode; private String fiscalIdentificationCode; private String streetCode; private String municipalCode; private String subaccount; private String file; public IdentityCreator(String countryIso, String salutation, String firstName, String lastName, String birthPlace, LocalDate birthDate, String nationality, String idNationality, LocalDate idIssueDate, String businessName, String idType, String idNumber, String addressLine1, String addressLine2, String city, String region, String postalCode ){ this.countryIso = countryIso; this.salutation = salutation; this.firstName = firstName; this.lastName = lastName; this.birthPlace = birthPlace; this.birthDate = birthDate.format(DateTimeFormatter.ISO_DATE); this.nationality = nationality; this.idNationality = idNationality; this.idIssueDate = idIssueDate.format(DateTimeFormatter.ISO_DATE);; this.businessName = businessName; this.idType = idType; this.idNumber = idNumber; this.addressLine1 = addressLine1; this.addressLine2 = addressLine2; this.city = city; this.region = region; this.postalCode = postalCode; } public String countryIso() { return countryIso; } public String salutation() { return salutation; } public String firstName() { return firstName; } public String lastName() { return lastName; } public String birthPlace() { return birthPlace; } public String birthDate() { return birthDate; } public String nationality() { return nationality; } public String idNationality() { return idNationality; } public String idIssueDate() { return idIssueDate; } public String businessName() { return businessName; } public String idType() { return idType; } public String idNumber() { return idNumber; } public String addressLine1() { return addressLine1; } public String addressLine2() { return addressLine2; } public String city() { return city; } public String region() { return region; } public String postalCode() { return postalCode; } public String fiscalIdentificationCode() { return fiscalIdentificationCode; } public String streetCode() { return streetCode; } public String municipalCode() { return municipalCode; } public String subaccount() { return subaccount; } public String file() { return file; } public IdentityCreator alias( String alias ){ this.alias = alias; return this; } public IdentityCreator countryIso( String countryIso ){ this.countryIso = countryIso; return this; } public IdentityCreator salutation( String salutation ){ this.salutation = salutation; return this; } public IdentityCreator firstName( String firstName ){ this.firstName = firstName; return this; } public IdentityCreator lastName( String lastName ){ this.lastName = lastName; return this; } public IdentityCreator birthPlace( String birthPlace ){ this.birthPlace = birthPlace; return this; } public IdentityCreator birthDate( String birthDate ){ this.birthDate = birthDate; return this; } public IdentityCreator nationality( String nationality ){ this.nationality = nationality; return this; } public IdentityCreator idNationality( String idNationality ){ this.idNationality = idNationality; return this; } public IdentityCreator idIssueDate( String idIssueDate ){ this.idIssueDate = idIssueDate; return this; } public IdentityCreator businessName( String businessName ){ this.businessName = businessName; return this; } public IdentityCreator idType( String idType ){ this.idType = idType; return this; } public IdentityCreator idNumber( String idNumber ){ this.idNumber = idNumber; return this; } public IdentityCreator addressLine1( String addressLine1 ){ this.addressLine1 = addressLine1; return this; } public IdentityCreator addressLine2( String addressLine2 ){ this.addressLine2 = addressLine2; return this; } public IdentityCreator city( String city ){ this.city = city; return this; } public IdentityCreator region( String region ){ this.region = region; return this; } public IdentityCreator postalCode( String postalCode ){ this.postalCode = postalCode; return this; } public IdentityCreator fiscalIdentificationCode( String fiscalIdentificationCode ){ this.fiscalIdentificationCode = fiscalIdentificationCode; return this; } public IdentityCreator streetCode( String streetCode ){ this.streetCode = streetCode; return this; } public IdentityCreator municipalCode( String municipalCode ){ this.municipalCode = municipalCode; return this; } public IdentityCreator subaccount( String subaccount ){ this.subaccount = subaccount; return this; } public IdentityCreator file( String file ){ this.file = file; return this; } @Override protected Call<IdentityCreateResponse> obtainCall() { return client().getApiService().identityCreate(client().getAuthId(), this); } }
[ "najam.s@gmail.com" ]
najam.s@gmail.com
87b1356f58047ffa8284e1413a36a56e9afe6248
e958442b0fd30f74c1db0b554835f35e77f394bc
/mybatis_myself/src/main/java/com/xuemiao/mybatis_myself/executor/statement/StatementHandler.java
56c3e829957fca6a380ac9744e568a91042ff0fc
[]
no_license
xxmiao1006/mybatisSourceCode
7b0a170bd069cc2af15a4394b473f93ef6ccf499
2f86808c9297729cc680487e67eb1e50320a6223
refs/heads/master
2023-03-16T20:17:30.996568
2021-02-26T03:42:47
2021-02-26T03:42:47
342,452,498
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.xuemiao.mybatis_myself.executor.statement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; /** * @author xxm * @date 2021/2/26 10:34 */ public interface StatementHandler { PreparedStatement prepare(Connection connection); ResultSet query(PreparedStatement statement); }
[ "1151856023@qq.com" ]
1151856023@qq.com
0c268403fce952def6bf50ec57452bd74314ae8d
ac64bdc1aae04ddc5a5100b651e43c3682f92285
/src/main/java/com/tresg/almacen/interfaz/DetalleAlmacenDAO.java
7ffa7ee48deae5d3a9878c874a4e14fa93e45173
[]
no_license
luegmy/SistemaGageCapelo
ff80d7662325c233fe61e9cc0274967ec5bb5bcb
c3204c6027a854780a87aed749b5eddbd0953aa7
refs/heads/master
2022-09-01T20:50:27.556088
2019-12-31T23:52:10
2019-12-31T23:52:10
213,458,372
0
0
null
2022-06-29T17:52:43
2019-10-07T18:35:00
Java
UTF-8
Java
false
false
393
java
package com.tresg.almacen.interfaz; import java.util.List; import com.tresg.almacen.jpa.DetalleAlmacenJPA; import com.tresg.incluido.jpa.ProductoJPA; public interface DetalleAlmacenDAO { //CU excluido para productos //consultar cantidad de productos que hay en cada almacen List<DetalleAlmacenJPA> listarDetalleAlmacen(); List<ProductoJPA> listarExistencias(String descripcion); }
[ "luegmy@gmail.com" ]
luegmy@gmail.com
a63c7a6ff139522026d8551282022b4d7aa181bd
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/appbrand/widget/desktop/f$$ExternalSyntheticLambda1.java
23620a4da38a1a801979ac42189e92415334151e
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
388
java
package com.tencent.mm.plugin.appbrand.widget.desktop; public final class f$$ExternalSyntheticLambda1 implements Runnable { public final void run() {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar * Qualified Name: com.tencent.mm.plugin.appbrand.widget.desktop.f..ExternalSyntheticLambda1 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
c9a547db14c7f5765ccc57081b245845a63472bf
b7725da1bb04f477e23b32c22e111af24fd4eb0a
/test/tugascasei/DateCalcTest.java
60965ce4cab154c24a9612a4d58dac81629d5fa6
[]
no_license
wunsc/TugasCase1
32398c8f3a2f657401c25a275dce3dc3b93700df
37213bba3eadfd90ee0fbc82180605db76d017f4
refs/heads/master
2021-09-05T21:13:10.420020
2018-01-31T02:52:27
2018-01-31T02:52:27
119,347,509
0
0
null
null
null
null
UTF-8
Java
false
false
1,052
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 tugascasei; 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.*; /** * * @author MuhammadTaufik */ public class DateCalcTest { public DateCalcTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } @Before public void setUp() { } @After public void tearDown() { } /** * Test of main method, of class DateCalc. */ @Test public void testMain() { System.out.println("main"); String[] args = null; DateCalc.main(args); // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } }
[ "35796729+wunsc@users.noreply.github.com" ]
35796729+wunsc@users.noreply.github.com
9b1811b2186eda6160b701b4504475a76c180e0d
972d9d4a0f7ced0d42ef4a80cc5e405e0a6c94e0
/js-bundle-mgr/src/main/java/com/didi/chameleon/weex/jsbundlemgr/CmlJsBundleEngine.java
80bedfd95bc1a69636f1ad9c9946c5bb2039e155
[]
no_license
haveam/chameleon-sdk-android
b079ac089653e161fdd19ec9b82c3ed3074b77e1
9e53f77a49c4a8da0551a4a0bfc9d6273ecbdce8
refs/heads/master
2021-10-22T18:03:23.758478
2019-01-18T09:15:10
2019-01-18T09:15:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,527
java
package com.didi.chameleon.weex.jsbundlemgr; import android.content.Context; import com.didi.chameleon.sdk.bundle.CmlBundle; import com.didi.chameleon.weex.jsbundlemgr.code.CmlCodeManager; import com.didi.chameleon.weex.jsbundlemgr.code.CmlGetCodeStringCallback; import com.didi.chameleon.weex.jsbundlemgr.utils.CmlLogUtils; import com.didi.chameleon.weex.jsbundlemgr.utils.CmlUtils; import java.util.List; /** * limeihong * create at 2018/10/15 */ public class CmlJsBundleEngine implements CmlJsBundleManager { private static final String TAG = CmlJsBundleEngine.class.getSimpleName(); private static final class JS_BUNDLE_ENGINE { private static final CmlJsBundleEngine INSTANCE = new CmlJsBundleEngine(); } private volatile boolean isInit = false; private CmlJsBundleEngine() { } public static CmlJsBundleEngine getInstance() { return JS_BUNDLE_ENGINE.INSTANCE; } /** * jsbundleMgr初始化 * * @param context Context * @param cmlJsBundleMgrConfig 预加载的相关配置 {@link CmlJsBundleMgrConfig} */ @Override public void initConfig(Context context, CmlJsBundleMgrConfig cmlJsBundleMgrConfig) { if (isInit) { return; } if (cmlJsBundleMgrConfig == null) { throw new NullPointerException("CmlJsBundleMgrConfig is null"); } if (!CmlUtils.isMainThread()) { throw new RuntimeException("请在主线程初始化CmlJsBundleEngine"); } CmlCodeManager.getInstance().init(context, cmlJsBundleMgrConfig); isInit = true; } @Override public void setPreloadList(List<CmlBundle> preloadList) { CmlCodeManager.getInstance().setPreloadList(preloadList); } /** * 开始预加载 */ @Override public void startPreload() { if (!isInit) { CmlLogUtils.e(TAG, "请先初始化CmlJsBundleEngine"); return; } CmlCodeManager.getInstance().startPreload(); } /** * 获取需要解析的js * * @param url js路径 * @param cmlGetCodeStringCallback 获取code的回调 */ @Override public void getWXTemplate(String url, CmlGetCodeStringCallback cmlGetCodeStringCallback) { if (!isInit) { CmlLogUtils.e(TAG, "请先初始化CmlJsBundleEngine"); return; } CmlCodeManager.getInstance().getCode(url, cmlGetCodeStringCallback); } }
[ "chenjingchenjing@didichuxing.com" ]
chenjingchenjing@didichuxing.com
23dff2ad60912d0ba3531d14d83030d7d4d5c8ed
1fc89c80068348031fdd012453d081bac68c85b0
/FEST/org/fest/swing/driver/JSliderLocation.java
43cb46beebe6ec9e3f32456978c3caf6c4912268
[]
no_license
Jose-R-Vieira/WorkspaceEstudosJava
e81858e295972928d3463f23390d5d5ee67966c9
7ba374eef760ba2c3ee3e8a69657a96f9adec5c1
refs/heads/master
2020-03-26T16:47:26.846023
2018-08-17T14:06:57
2018-08-17T14:06:57
145,123,028
0
0
null
null
null
null
UTF-8
Java
false
false
3,549
java
/* * Created on Jan 27, 2008 * * 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. * * Copyright @2008-2010 the original author or authors. */ package org.fest.swing.driver; import static javax.swing.SwingConstants.HORIZONTAL; import static javax.swing.SwingConstants.VERTICAL; import java.awt.Insets; import java.awt.Point; import java.util.HashMap; import java.util.Map; import javax.swing.JSlider; import org.fest.swing.annotation.RunsInCurrentThread; /** * Understands a location in a <code>{@link JSlider}</code>. * * @author Alex Ruiz * @author Yvonne Wang */ public final class JSliderLocation { private static final Map<Integer, JSliderLocationStrategy> LOCATIONS = new HashMap<Integer, JSliderLocationStrategy>(); static { LOCATIONS.put(HORIZONTAL, new JSliderHorizontalLocation()); LOCATIONS.put(VERTICAL, new JSliderVerticalLocation()); } /** * Returns the coordinates of the given value in the given <code>{@link JSlider}</code>. * <p> * <b>Note:</b> This method is <b>not</b> guaranteed to be executed in the event dispatch thread (EDT.) Clients are * responsible for calling this method from the EDT. * </p> * @param slider the given <code>JSlider</code>. * @param value the given value. * @return the coordinates of the given value in the given <code>JSlider</code>. */ @RunsInCurrentThread public Point pointAt(JSlider slider, int value) { return LOCATIONS.get(slider.getOrientation()).locationForValue(slider, value); } private static class JSliderHorizontalLocation extends JSliderLocationStrategy { @RunsInCurrentThread int max(JSlider slider, Insets insets) { return slider.getWidth() - insets.left - insets.right - 1; } @RunsInCurrentThread Point update(Point center, int coordinate) { return new Point(coordinate, center.y); } } private static class JSliderVerticalLocation extends JSliderLocationStrategy { @RunsInCurrentThread int max(JSlider slider, Insets insets) { return slider.getHeight() - insets.top - insets.bottom - 1; } @RunsInCurrentThread Point update(Point center, int coordinate) { return new Point(center.x, coordinate); } } private static abstract class JSliderLocationStrategy { @RunsInCurrentThread final Point locationForValue(JSlider slider, int value) { Point center = new Point(slider.getWidth() / 2, slider.getHeight() / 2); int max = max(slider, slider.getInsets()); int coordinate = (int)(percent(slider, value) * max); if (!slider.getInverted()) coordinate = max - coordinate; return update(center, coordinate); } @RunsInCurrentThread abstract int max(JSlider slider, Insets insets); @RunsInCurrentThread abstract Point update(Point center, int coordinate); @RunsInCurrentThread private float percent(JSlider slider, int value) { int minimum = slider.getMinimum(); int range = slider.getMaximum() - minimum; return (float)(value - minimum) / range; } } }
[ "jose.rodrigues@rsinet.com.br" ]
jose.rodrigues@rsinet.com.br
f7bc683c500ecf8d2336bc2bad1e401db2d75331
e10749c2a346fc162807182a5d054948d0ed9531
/src/br/edu/opet/ouvidoria/teste/TesteCidadeController.java
09c9633f1c82a4ee624dec30295b0a974b7707b2
[]
no_license
JhowRaul/Ouvidoria
eb88cc48adb6880ecf61ec39cd40af1389ee3a7d
914bcb81387e93db3065f7101193c6f66b1e1e22
refs/heads/master
2021-09-09T09:47:43.096975
2018-03-14T21:24:19
2018-03-14T21:24:19
103,266,872
0
0
null
null
null
null
ISO-8859-1
Java
false
false
3,274
java
package br.edu.opet.ouvidoria.teste; import br.edu.opet.ouvidoria.controller.CidadeController; import br.edu.opet.ouvidoria.dao.CidadeDao; import br.edu.opet.ouvidoria.dto.CidadeDto; import br.edu.opet.ouvidoria.model.Cidade; public class TesteCidadeController { public static void main(String[] pArgs) { // // Pré Teste // // Criar um Cidade Cidade tCidadeA = new Cidade(0, "PR", "Brasil", "Paraná"); // Criando o objeto de persistência CidadeDao tDao = new CidadeDao(); // Incluir o Cidade System.out.println(); System.out.println("Incluindo um Cidade"); Cidade tCidade2a = tDao.create(tCidadeA); if (tCidade2a != null) System.out.println("OK...... : " + tCidade2a); else System.out.println("ERRO.... : " + tCidade2a); // // Teste // // Criar um Cidade Cidade tCidadeB = new Cidade(0, "SC", "Brasil", "Santa Catarina"); // Criando o objeto de Controller CidadeController tController = new CidadeController(); // Incluindo o Cidade System.out.println(); System.out.println("Incluindo um Cidade via controller"); CidadeDto tDto = tController.cadastrarCidade(tCidadeB); if (tDto.isOk()) { System.out.println("OK...... : " + tDto.getMensagem()); System.out.println(" " + tDto.getCidade()); } else { System.out.println("ERRO.... : " + tDto.getMensagem()); } // Incluindo o Cidade System.out.println(); System.out.println("Incluindo um Cidade nulo"); tDto = tController.cadastrarCidade(null); if (!tDto.isOk()) { System.out.println("OK...... : " + tDto.getMensagem()); } else { System.out.println("ERRO.... : " + tDto.getMensagem()); } // Incluindo o Cidade System.out.println(); System.out.println("Incluindo um Cidade já existente"); tDto = tController.cadastrarCidade(tCidadeA); if (!tDto.isOk()) { System.out.println("OK...... : " + tDto.getMensagem()); } else { System.out.println("ERRO.... : " + tDto.getMensagem()); } // // Pós teste // // Remover o Cidade System.out.println(); System.out.println("Removendo um Cidade"); if (tDao.delete(tCidade2a.getCodigo())) System.out.println("OK...... : " + tCidade2a); else System.out.println("ERRO.... : " + tCidade2a); } }
[ "jhowopet@gmail.com" ]
jhowopet@gmail.com
33bea27471a9824fd6babff915079bdeaf8aed2a
a301c6b9c9b84be65359057bc71b17b5e17aaf87
/src/main/java/lokko12/berriespp/crops/bpp/trees/InstalledTreesGetter.java
d711b1ca7488d7719fa798b74a8e253536dcab44
[ "MIT", "BSD-3-Clause" ]
permissive
mtesseracttech/berries-plus-plus
b2d463e60988ee4cbaf0518c710a8cbb7d25f215
0f2f609db9be38d843f6ae5359bb8a95126f9110
refs/heads/master
2021-03-30T23:48:07.543465
2018-03-10T17:32:23
2018-03-10T17:32:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,103
java
package lokko12.berriespp.crops.bpp.trees; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.imageio.ImageIO; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import ic2.api.crops.CropCard; import lokko12.berriespp.Berriespp; import lokko12.berriespp.ConfigValures; import lokko12.croploadcore.Operators; import lokko12.croploadcore.OreDict; import lokko12.croploadcore.config; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class InstalledTreesGetter { public static List<CropCard> saved; public static List<ItemStack> BaseSeed; public static List<String> savedNames; public static List<ItemStack> savedDrop; private static String cfg; public static BonsaiRenderer renderer; public static boolean check_bonsai(FMLPreInitializationEvent preinit) { cfg = preinit.getModConfigurationDirectory().getPath(); cfg = cfg.replace("config", "BppBonsais_"); config c = new config(preinit, "berriespp.cfg"); ConfigValures.ayo_bonsai = c.tConfig.get("System", "Bonsai Generation", false).getBoolean(true); return ConfigValures.ayo_bonsai; } static BufferedImage make_crop_IIcons(ItemStack Sapling, String name) throws IOException { //Berriespp.bpplogger.info("IIcon: "+IIconpath); //Berriespp.bpplogger.info("Name: "+name); BufferedImage overlay; BufferedImage image = ImageIO.read(InstalledTreesGetter.class.getResource("/assets/bpp/textures/blocks/crop/blockCrop.empty.1.png")); //if (IICON.getIconName().contains(":")) overlay = ImageIO.read(Sapling.getClass().getResource(new String("/assets/"+Sapling.getItem().getClass().getName().replace(":", "/textures/blocks/")+".png"))); //else //Vanilla workaround //overlay = ImageIO.read(IICON.getClass().getResource(new String("/assets/minecraft/textures/blocks/"+IICON.getIconName()+".png"))); //Berriespp.bpplogger.info("Read this image: "+new String("/assets/"+IIconpath.getIconName().replace(":", "/textures/blocks/")+".png")); int w = Math.max(image.getWidth(), overlay.getWidth()); int h = Math.max(image.getHeight(), overlay.getHeight()); BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Graphics g = combined.getGraphics(); g.drawImage(image, 0, 0, null); g.drawImage(overlay, 0, 0, null); //Berriespp.bpplogger.info(combined.toString()); //ImageIO.write(combined, "PNG", new File(cfg+name.replaceAll(":", "_")+".png")); //Berriespp.bpplogger.info(cfg+name+".png"); //return cfg+name+".png"; return combined; } public static void InstalledTreesGet() { Berriespp.bpplogger.info("BonsaiGen Started"); List<Item> subtypes = new ArrayList<Item>(); List<Item> subtypesLog = new ArrayList<Item>(); for (int i=0; i < OreDictionary.getOres("treeSapling").size(); i++) { subtypes.add(i, OreDictionary.getOres("treeSapling").get(i).getItem()); } for (int i=0; i < OreDictionary.getOres("logWood").size(); i++) { subtypesLog.add(i, OreDictionary.getOres("logWood").get(i).getItem()); } List<String> SubItemNames = new ArrayList<String>(); List<ItemStack> helplist = OreDict.get_subtypes(subtypes, false); for (int i=0; i < helplist.size(); i++) { SubItemNames.add(helplist.get(i).getDisplayName()); } BaseSeed = new ArrayList<ItemStack>(helplist); List<ItemStack> helplistLog = synch_wood(helplist,OreDict.get_subtypes(subtypesLog, false)); List<CropCard> CropCards = new ArrayList<CropCard>(); for (int i=0; i < SubItemNames.size(); i++) { //prevent TC from making Shimmerleaf,Cinderpearl,Vishroom or Ethereal Bloom Bonsais if( Operators.AND(Operators.NOR( SubItemNames.get(i).contains("Shimmerleaf"),SubItemNames.get(i).contains("Cinderpearl") ) , Operators.NOR(SubItemNames.get(i).contains("Vishroom"),SubItemNames.get(i).contains("Ethereal Bloom")) ) ){ //rename ic2's Rubberwood if (SubItemNames.get(i).equals("ic2.blockRubSapling")) SubItemNames.set(i,"Rubber Wood Sapling"); if (helplist.size()!=helplistLog.size()) { Berriespp.bpplogger.error("Saplings/Logs out of synch!"+" Bonsaigen disabled!" + "\n helplist contains: "+Integer.toString(helplist.size()) + "\n helplistLog contains: "+Integer.toString(helplistLog.size()) + "\n helplist contains: "); for (int j=0; j < helplist.size(); j++) Berriespp.bpplogger.info(helplist.get(j).getDisplayName()); Berriespp.bpplogger.info("helplistLog contains: "); for (int j=0; j < helplistLog.size(); j++) Berriespp.bpplogger.info(helplistLog.get(j).getDisplayName()); break; } //Berriespp.bpplogger.info(SubItemNames.get(i)+" CropCard was created"); } } savedNames = new ArrayList<String>(SubItemNames); savedDrop = new ArrayList<ItemStack>(helplistLog); Set<CropCard> s = new HashSet<CropCard>(CropCards); saved = new ArrayList<CropCard>(s); Berriespp.bpplogger.info("preparing to create bonsais!"); } private static List<ItemStack> synch_wood(List<ItemStack> subtypes1, List<ItemStack> subtypes2){ List<ItemStack> itemsgot = new ArrayList<ItemStack>(); //<ItemStack> s1 = new HashSet<ItemStack>(subtypes1); //List<ItemStack> cleansubtypes1 = new ArrayList<ItemStack>(s1); //Set<ItemStack> s2 = new HashSet<ItemStack>(subtypes2); //List<ItemStack> cleansubtypes2 = new ArrayList<ItemStack>(s2); boolean synched = false; for (int i = 0; i < subtypes1.size(); i++) { for (int j = 0; j < subtypes2.size(); j++) { if (!synched && Operators.AND(subtypes2.get(j).getDisplayName().contains("Wood"),!subtypes2.get(j).getDisplayName().contains("Log"))) { //Berriespp.bpplogger.info(subtypes2.get(j).getDisplayName()+" conatins Wood."); if (subtypes1.get(i).getDisplayName().replace("Sapling", "").equals(subtypes2.get(j).getDisplayName().replace("Wood", ""))) { itemsgot.add(subtypes2.get(j)); synched = true; //Berriespp.bpplogger.info(subtypes2.get(j).getDisplayName()+" synched to "+subtypes1.get(i).getDisplayName()); } } else if (!synched && Operators.AND(subtypes2.get(j).getDisplayName().contains("Log"),!subtypes2.get(j).getDisplayName().contains("Wood"))) { //Berriespp.bpplogger.info(subtypes2.get(j).getDisplayName()+" conatins Log."); if (subtypes1.get(i).getDisplayName().replace("Sapling", "").equals(subtypes2.get(j).getDisplayName().replace("Log", ""))) { itemsgot.add(subtypes2.get(j)); synched = true; //Berriespp.bpplogger.info(subtypes2.get(j).getDisplayName()+" synched to "+subtypes1.get(i).getDisplayName()); } } } if(!synched) itemsgot.add(subtypes2.get(0)); synched = false; } //Berriespp.bpplogger.info("synch completed"); /*for (int k = 0; k < itemsgot.size(); k++) { //Berriespp.bpplogger.info("item synched: "+itemsgot.get(k).getDisplayName()); } */ return itemsgot; } }
[ "33183715+LOKKO12@users.noreply.github.com" ]
33183715+LOKKO12@users.noreply.github.com
938b2454407d1c426f64521d7c4f029dfde21e7f
2ac940fc1ffa3567ec3aeb51b839083ad0c4c75e
/src/uz/hbs/beans/RoomTypeDetails.java
5fef1087e7006acffbcfbf1a9636f1b3b4367ae3
[]
no_license
khamidullo/hb
340d36dd80fe22aa53e710938107d123a18fed1c
f99b1b26d1eed497d805fd9a8023d4ecf9fcca13
refs/heads/master
2020-04-07T15:34:11.104386
2018-11-25T16:14:25
2018-11-25T16:14:25
158,491,243
0
0
null
null
null
null
UTF-8
Java
false
false
3,074
java
package uz.hbs.beans; import org.apache.wicket.util.io.IClusterable; public class RoomTypeDetails implements IClusterable{ private static final long serialVersionUID = 1L; private String name; private Double price; private Integer count; private Integer adults; private Integer children; private Double total_price; private Boolean extra_bed_needed; private Double extra_bed_price_type_value; private Byte meal_options; private Double meal_cost; private String guest_name; private Byte status; private Boolean selected = Boolean.FALSE; private Long reservationroom_id; private Long hotel_id; private boolean is_group; public RoomTypeDetails() { } public RoomTypeDetails(Integer count, Double total_price) { this.count = count; this.total_price = total_price; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public Double getTotal_price() { return total_price; } public void setTotal_price(Double total_price) { this.total_price = total_price; } public Boolean getExtra_bed_needed() { return extra_bed_needed; } public void setExtra_bed_needed(Boolean extra_bed_needed) { this.extra_bed_needed = extra_bed_needed; } public Double getExtra_bed_price_type_value() { return extra_bed_price_type_value; } public void setExtra_bed_price_type_value(Double extra_bed_price_type_value) { this.extra_bed_price_type_value = extra_bed_price_type_value; } public Byte getMeal_options() { return meal_options; } public void setMeal_options(Byte meal_options) { this.meal_options = meal_options; } public Double getMeal_cost() { return meal_cost; } public void setMeal_cost(Double meal_cost) { this.meal_cost = meal_cost; } public Integer getAdults() { return adults; } public void setAdults(Integer adults) { this.adults = adults; } public Integer getChildren() { return children; } public void setChildren(Integer children) { this.children = children; } public String getGuest_name() { return guest_name; } public void setGuest_name(String guest_name) { this.guest_name = guest_name; } public Byte getStatus() { return status; } public void setStatus(Byte status) { this.status = status; } public Boolean getSelected() { return selected; } public void setSelected(Boolean selected) { this.selected = selected; } public Long getReservationrooms_id() { return reservationroom_id; } public void setReservationrooms_id(Long reservationroom_id) { this.reservationroom_id = reservationroom_id; } public boolean isIs_group() { return is_group; } public void setIs_group(boolean is_group) { this.is_group = is_group; } public Long getHotelsusers_id() { return hotel_id; } public void setHotelsusers_id(Long hotel_id) { this.hotel_id = hotel_id; } }
[ "khamidullo@gmail.com" ]
khamidullo@gmail.com
410553feaa1885026ded549944f4bdfef4c0f331
998b2c58e3515fcedd1f316709955728b6dd66f4
/SnailMap/app/src/main/java/com/example/snailmap/ui/home/HomeFragment.java
a59b9c973c3ebd00db06c7dd0e813a054a8b7ddd
[]
no_license
QianrXU/Projects
6796133f99acc10ac0986f404360df24bef8e6ee
a0c2299eec7b5ac8f3f6ffa1aea26ea872c4e2fd
refs/heads/main
2023-03-19T17:58:41.944269
2021-01-26T02:43:51
2021-01-26T02:43:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,629
java
package com.example.snailmap.ui.home; import android.Manifest; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.core.app.ActivityCompat; import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.example.snailmap.MainActivity; import com.example.snailmap.R; import com.example.snailmap.ui.ImageClassifier.ImageClassifier; import com.example.snailmap.ui.LocationTrack.LocationTrack; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.OnSuccessListener; import com.google.firebase.firestore.DocumentReference; import com.google.firebase.firestore.FirebaseFirestore; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; public class HomeFragment extends Fragment { //CAMERA_PERMISSION_REQUEST_CODE & CAMERA_REQUEST_CODE & ALL_PERMISSIONS_RESULT private static final int CAMERA_PERMISSION_REQUEST_CODE = 1000; private static final int CAMERA_REQUEST_CODE = 1001; private final static int ALL_PERMISSIONS_RESULT = 101; //ArrayList for permissions private ArrayList permissionsToRequest; private ArrayList permissionsRejected = new ArrayList(); private ArrayList permissions = new ArrayList(); //define locationTrack LocationTrack locationTrack; //define longitude and latitude double longitude; double latitude; //define if the image has snail boolean haveSnail; //define imageClassifier private ImageClassifier imageClassifier; //imageView and textView on Home Page private ImageView imageView; private TextView numOfSnails; private TextView coordinates; //button for use camera Button camera; //onCreateView for home page fragment public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View root = inflater.inflate(R.layout.fragment_home, container, false); imageView = (ImageView) root.findViewById(R.id.imageView2); numOfSnails = (TextView) root.findViewById(R.id.textView1); coordinates = (TextView) root.findViewById(R.id.textView2); camera = (Button) root.findViewById(R.id.button); //ask permissions for location permissions.add(ACCESS_FINE_LOCATION); permissions.add(ACCESS_COARSE_LOCATION); permissionsToRequest = findUnAskedPermissions(permissions); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (permissionsToRequest.size() > 0) requestPermissions((String[]) permissionsToRequest.toArray(new String[permissionsToRequest.size()]), ALL_PERMISSIONS_RESULT); } //try to load imageClassifier try { imageClassifier = new ImageClassifier(getActivity()); } catch (IOException e) { Log.e("Image Classifier Error", "ERROR: " + e); } //camera listener camera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { locationTrack = new LocationTrack(getContext()); if (locationTrack.canGetLocation()) { longitude = locationTrack.getLongitude(); latitude = locationTrack.getLatitude(); } else { locationTrack.showSettingsAlert(); } // checking whether camera permissions are available. // if permission is avaialble then we open camera intent to get picture // otherwise requests for permissions if (hasPermission()) { openCamera(); } else { requestPermission(); } } }); return root; } private ArrayList findUnAskedPermissions(ArrayList wanted) { ArrayList result = new ArrayList(); for (Object perm : wanted) { if (!hasPermission((String) perm)) { result.add(perm); } } return result; } private boolean hasPermission(String permission) { if (canMakeSmores()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return (ActivityCompat.checkSelfPermission(getContext(),permission) == PackageManager.PERMISSION_GRANTED); } } return true; } private boolean canMakeSmores() { return (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1); } //function of reset count of snails private void resetcount() { int numofsnail = 0; } //deal the captured image @Override public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { // if this is the result of our camera image request if (requestCode == CAMERA_REQUEST_CODE && resultCode == getActivity().RESULT_OK) { // getting bitmap of the image Bitmap photo = (Bitmap) data.getExtras().get("data"); // displaying this bitmap in imageview imageView.setImageBitmap(photo); int countsnail = 0; // pass this bitmap to classifier to make prediction List<ImageClassifier.Recognition> predictions = imageClassifier.recognizeImage( photo, 0); // creating a list of string to display in list view for (ImageClassifier.Recognition recog : predictions) { if (recog.getName() == "snail") { countsnail += 1; } } //set haveSnail by count of snails if (countsnail >= 1) { haveSnail = true; } else { haveSnail = false; } //set text view coordinates.setText("Latitude: " + latitude + "\n Longitude: " + longitude +"\n Number of Snail: " + countsnail); //save data to could if the data is right if (longitude != 0.0 && latitude != 0.0) { FirebaseFirestore db = FirebaseFirestore.getInstance(); Map<String, Object> snaildetection = new HashMap<>(); snaildetection.put("longitude", longitude); snaildetection.put("latitude", latitude); snaildetection.put("NumberofSnails", countsnail); snaildetection.put("HaveSnail", haveSnail); snaildetection.put("DateTime", new Date()); db.collection("snail-detection") .add(snaildetection) .addOnSuccessListener(new OnSuccessListener<DocumentReference>() { @Override public void onSuccess(DocumentReference documentReference) { Log.d("TAG", "DocumentSnapshot added with ID: " + documentReference.getId()); } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.w("TAG", "Error adding document", e); } }); } super.onActivityResult(requestCode, resultCode, data); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == CAMERA_PERMISSION_REQUEST_CODE) { if (hasAllPermissions(grantResults)) { openCamera(); } else { requestPermission(); } } switch (requestCode) { case ALL_PERMISSIONS_RESULT: for (Object perms : permissionsToRequest) { if (!hasPermission((String) perms)) { permissionsRejected.add(perms); } } if (permissionsRejected.size() > 0) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (shouldShowRequestPermissionRationale((String) permissionsRejected.get(0))) { showMessageOKCancel("These permissions are mandatory for the application. Please allow access.", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions((String[]) permissionsRejected.toArray(new String[permissionsRejected.size()]), ALL_PERMISSIONS_RESULT); } } }); return; } } } break; } } //function for show message to ask user allow the Permissions private void showMessageOKCancel (String message, DialogInterface.OnClickListener okListener){ new AlertDialog.Builder(getActivity()) .setMessage(message) .setPositiveButton("OK", okListener) .setNegativeButton("Cancel", null) .create() .show(); } //if has hasAllPermissions return true, otherWise return false private boolean hasAllPermissions ( int[] grantResults){ for (int result : grantResults) { if (result == PackageManager.PERMISSION_DENIED) return false; } return true; } /** * Method requests for permission if the android version is marshmallow or above */ private void requestPermission () { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // whether permission can be requested or on not if (shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)) { Toast.makeText(getActivity(), "Camera Permission Required", Toast.LENGTH_SHORT).show(); } // request the camera permission permission requestPermissions(new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_REQUEST_CODE); } } /** * creates and starts an intent to get a picture from camera */ private void openCamera () { try { Intent cameraIntent = new Intent(); cameraIntent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent,CAMERA_REQUEST_CODE); }catch (Exception e){ e.printStackTrace(); } } /** * checks whether camera permission is available or not * * @return true if android version is less than marshmallo, * otherwise returns whether camera permission has been granted or not */ private boolean hasPermission () { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return ActivityCompat.checkSelfPermission(getContext(),Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED; } return true; } }
[ "noreply@github.com" ]
noreply@github.com
549dfccbc2d64059adf7c7c5a3b6ae4c3a994df1
291fc10889a3c1e4576f4ff71010fbb819dff527
/javaAssignment/assignment-3/src/Adapters/MernisServiceAdapter.java
2aa36d745f20e013cc6b2c2413e0f041ed37e3f0
[]
no_license
ceydakamalii/JavaCamp
e54e0b46e1d3d5bf79648bcd10cd4d75b635cfcc
2e2901166d7e6a17dcd094db8a89a5bcf53da086
refs/heads/master
2023-05-31T09:51:05.122712
2021-06-05T22:26:34
2021-06-05T22:26:34
364,237,781
9
0
null
null
null
null
ISO-8859-13
Java
false
false
794
java
package Adapters; import java.rmi.RemoteException; import Abstract.MemberCheckService; import Entities.Member; import tr.gov.nvi.tckimlik.WS.KPSPublicSoapProxy; import tr.gov.nvi.tckimlik.WS.KPSPublicSoap; public class MernisServiceAdapter implements MemberCheckService { @Override public boolean checkIfRealPerson(Member member) { KPSPublicSoapProxy client=new KPSPublicSoapProxy();//kżlaynt boolean result; try { result= client.TCKimlikNoDogrula(Long.parseLong(member.getNationalityId()), member.getFirstName().toUpperCase(), member.getLastName().toUpperCase(), member.getDataOfBirth().getYear()); return result; }catch(RemoteException e) { e.printStackTrace(); }catch(NumberFormatException e) { e.printStackTrace(); } return false; } }
[ "ceydakamali3@gmail.com" ]
ceydakamali3@gmail.com
36cefe6941eac3a14c345e99fc713ec8b08e5945
ecab0f521d82a9b0aa520888239bff60cd2ec173
/WebCrawlerTrial/src/com/crawler/Spider.java
993988341d3c179829e076f8db90fefbf2b07434
[]
no_license
andydowne/WebCrawlerTrial
7548c684c3ef63180f0e0b2acb4a0ba3ba6ae830
1657bd8aa53e0fd006ca5ceb9e9d8da928185f43
refs/heads/master
2021-01-12T03:25:54.155067
2017-01-06T13:34:26
2017-01-06T13:34:26
78,206,730
0
0
null
null
null
null
UTF-8
Java
false
false
1,549
java
package com.crawler; import java.util.*; public class Spider { private Set<String> pagesCrawled = new HashSet<String>(); private List<String> currentStack = new LinkedList<String>(); private List<String> siteMap = new LinkedList<String>(); /** * Our main launching point for the Spider's functionality. Internally it creates spider legs * that make an HTTP request and parse the response (the web page). * * @param url The starting point of this iteration */ public void search(String url) { outputSitemap(url); currentStack.add(url); SpiderLeg leg = new SpiderLeg(); Set<String> links = leg.crawl(url); if(links != null) { for (String link : leg.crawl(url)) { if (link.length() >= 24 && link.toLowerCase().startsWith("http://wiprodigital.com/") && !currentStack.contains(link) && !pagesCrawled.contains(link)) { search(link); } else { outputSitemap(link); } } } currentStack.remove(url); pagesCrawled.add(url); } private void outputSitemap(String url) { StringBuilder sb = new StringBuilder(); for(int i = 0 ; i < (currentStack.size()) ; i++) { sb.append(" "); } siteMap.add(sb.toString() + url + (System.getProperty("line.separator"))); } public List<String> getSiteMap() { return siteMap; } }
[ "andy.downe@blueyonder.co.uk" ]
andy.downe@blueyonder.co.uk
ab4ecdd894fa6c19ac1ca028081e5a2503d04e49
25c192572e89e83365c8954e4efe87dd832927dd
/bots/src/test/java/br/com/fiap/bots/ProjetoN2020ApplicationTests.java
ae5d9198eec55320a8d686243db01bf1c2f4f739
[]
no_license
WilliamRett/N2020Java
bf388a32ff5b5526840799a9a3cf77ceadaf1cb3
1c8405a24cbac4813aabec0fabb5c68ab628fa1e
refs/heads/master
2022-11-09T04:53:44.289780
2020-06-20T01:42:01
2020-06-20T01:42:01
273,618,444
0
0
null
null
null
null
UTF-8
Java
false
false
214
java
package br.com.fiap.bots; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ProjetoN2020ApplicationTests { @Test void contextLoads() { } }
[ "william.rett" ]
william.rett
0ebac902c1612dc6928b45590f3defbd2f584953
9380438b1114aa677d81ad96c1f24ee412efd2ae
/src/cn/yjpt/util/CreateImageServlet.java
01d6119df4b29060831a66ce1ab6838011ccf608
[]
no_license
CXY6666668/-javaee-
20449da1e52fa5c88438ad38232ffabb08315a06
173981f121de4232940795865d3e42193a7741c9
refs/heads/master
2020-04-11T21:08:40.997325
2019-01-06T05:33:13
2019-01-06T05:33:13
162,096,303
4
1
null
null
null
null
GB18030
Java
false
false
4,146
java
package cn.yjpt.util; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; import javax.imageio.ImageIO; 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 javax.servlet.http.HttpSession; /** * Servlet implementation class CreateImageServlet */ @WebServlet("/CreateImageServlet") public class CreateImageServlet extends HttpServlet { Color getRandColor(int fc,int bc){ Random random=new Random(); if(fc>255){ fc=255; } if(bc>255){ bc=255; } int r=fc+random.nextInt(bc-fc); int g=fc+random.nextInt(bc-fc); int b=fc+random.nextInt(bc-fc); return new Color(r,g,b); } private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public CreateImageServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub //response.getWriter().append("Served at: ").append(request.getContextPath()); this.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 //doGet(request, response); // 设置页面类型 response.setContentType("image/jpeg"); // 设置页面不缓存 response.setHeader("Pragma", "no-cache"); response.setHeader("cache-control", "no-cache"); response.setDateHeader("expries", 0); // 绘制动态图像 // 定义验证码图片大小 int width=60; int height=20; // 创建能在内存中修改的图片对象 BufferedImage image=new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); // 获取绘制图片的Graphics对象 Graphics g=image.getGraphics(); // 画图片 // 设置背景图片的颜色 g.setColor(getRandColor(200, 250)); // 画背景图片 g.fillRect(0, 0, width, height); // 设置干扰线颜色 g.setColor(getRandColor(160, 200)); // 画出干扰线 Random random=new Random(); for(int i=0;i<100;i++){ // 设置起始点坐标 int x=random.nextInt(width); int y=random.nextInt(height); // 设置结束点坐标,从起始到结束点画直线 int x1=random.nextInt(12); int y1=random.nextInt(12); g.drawLine(x, y, x+x1,y+y1); } // 定义变量codestr,用来表示在会话中保存的验证码 String codestr=""; String [] str={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","P","Q","R","S","T","U","V","W","S","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","s","y","z"}; // 画出随机字符 for(int i=0;i<4;i++){ String rand=""; if(random.nextBoolean()){ rand=String.valueOf(random.nextInt(10)); }else{ // 获取一个随机整数作为要取整的数组元素的下标索引 int index=random.nextInt(49); rand=str[index]; } // 设置字体颜色 g.setColor(getRandColor(20, 130)); // 设置字体 g.setFont(new Font("Times New Roman",Font.PLAIN,18)); // 画出表达式 g.drawString(rand, 13*i+6, 16); codestr+=rand; } // 3.把4位验证码字符串保存在session中 HttpSession session=request.getSession(); session.setAttribute("code", codestr); // 4.把缓存图片输出到客户端,设置输出图片的格式 ImageIO.write(image, "jpeg", response.getOutputStream()); // 5.清除缓存,释放资源 response.getOutputStream().flush(); response.getOutputStream().close(); response.flushBuffer(); } }
[ "1085623683@qq.com" ]
1085623683@qq.com
b0bc39687ac4b6a1f8f983180a1d817737c3ff2f
ab109c9c436cbeded7a6de32d1416f0dfe7f4b47
/app/src/main/java/com/brightsky/medicab/hospitalsearchmodel/PlusCode.java
12035dfbd8638efa2f4236236ed66e20062d7d30
[]
no_license
jSarthak-987/Medicab-Customer-Android-App
6eef56b1b8f03944613daceddfde461b4865b8ef
91a62e9e6779e4e6b4857aceb600fe9559c2b53e
refs/heads/master
2023-03-22T16:39:24.205249
2021-03-05T17:53:58
2021-03-05T17:53:58
344,887,392
0
0
null
null
null
null
UTF-8
Java
false
false
679
java
package com.brightsky.medicab.hospitalsearchmodel; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class PlusCode { @SerializedName("compound_code") @Expose private String compoundCode; @SerializedName("global_code") @Expose private String globalCode; public String getCompoundCode() { return compoundCode; } public void setCompoundCode(String compoundCode) { this.compoundCode = compoundCode; } public String getGlobalCode() { return globalCode; } public void setGlobalCode(String globalCode) { this.globalCode = globalCode; } }
[ "sarthak987joshi@outlook.com" ]
sarthak987joshi@outlook.com
973d1a632928dd8a181989242ff767308c793ec8
2c79efd37fd67ec81e02a973bb7fca535de82ae2
/JavaApp14/src/javaapp14/BoxData.java
93ca90a969275bd4522413d83d7585c9e279e1e2
[]
no_license
accp1510/JAVA_SE
b3fd7bdd61a82f41e0728cd746aab03f99d219a1
a0558a7d4ca7e1b20882efe1bcb515e999985ec5
refs/heads/master
2021-01-12T15:06:26.749499
2016-10-23T11:07:47
2016-10-23T11:07:47
71,697,216
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
package javaapp14; import java.util.ArrayList; import java.util.Iterator; import java.util.List; //T - универсальный тип public class BoxData<T> { private List<T> dataList = new ArrayList<T>(); public void add(T o) { dataList.add(o); } public void print() { Iterator<T> it = dataList.iterator(); while (it.hasNext()) { System.out.println(it.next()); } } public T item(int i) { return (T) dataList.get(i); } }
[ "accp15@mail.ru" ]
accp15@mail.ru