blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
sequence
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
sequence
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
578c824de27c02561404116a82ca3668906658de
9,277,129,387,509
b89ca2771dce06f36f2c3bf9283f0784ddb999c0
/src/com/atg/review/dao/imageTestDao.java
5947ee06176d3987b77888b9710e2f44a5054fc1
[]
no_license
duswn158/Semi_ATG_Last
https://github.com/duswn158/Semi_ATG_Last
5672beb01834ab85344774e82428812ead10cf14
222d26b5dff871089acec0c28ce80c8c32de5f65
refs/heads/master
2023-01-13T15:28:15.276000
2020-11-09T17:05:30
2020-11-09T17:05:30
288,620,194
0
0
null
true
2020-08-19T03:06:24
2020-08-19T03:06:23
2020-08-18T06:44:32
2020-08-18T06:44:27
58,455
0
0
0
null
false
false
package com.atg.review.dao; import java.sql.Connection; public class imageTestDao { private Connection con = null; public imageTestDao(Connection con) { this.con = con; } }
UTF-8
Java
185
java
imageTestDao.java
Java
[]
null
[]
package com.atg.review.dao; import java.sql.Connection; public class imageTestDao { private Connection con = null; public imageTestDao(Connection con) { this.con = con; } }
185
0.718919
0.718919
13
13.230769
14.175569
38
false
false
0
0
0
0
0
0
0.846154
false
false
3
7f2e09239be27b630493586e00808eac79acd863
11,484,742,576,154
3f948466f880d75f355c0b48617c9a984667f2a7
/src/main/java/org/kenny/agent/Main.java
c454ad570c3fc18d333bda8cca6485402af3b16c
[]
no_license
jiangbin216/middleware-4th
https://github.com/jiangbin216/middleware-4th
88923257b94019ccd8e9ef641d7b45044180c6c9
535fba17777273bc8d6e4161dc605093ef332a13
refs/heads/master
2022-10-25T00:52:41.815000
2020-06-16T08:58:22
2020-06-16T08:58:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.kenny.agent; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import org.kenny.agent.discovery.Discovery; import org.kenny.agent.discovery.EtcdDiscovery; import org.kenny.agent.handlers.ConsumerAgentInitializer; import org.kenny.agent.handlers.ProducerAgentInitializer; public class Main { // 2000 for consumer agent and 3000 for provider agent private static final int PORT = Integer.parseInt(System.getProperty("server.port")); private static final String CONSUMER = "consumer"; private static final String PROVIDER = "provider"; public static void main(String[] args) throws Exception { String type = System.getProperty("type", "consumer"); EventLoopGroup bossGroup = new NioEventLoopGroup(2); EventLoopGroup workerGroup = new NioEventLoopGroup(8); Discovery discovery = new EtcdDiscovery(); try { ServerBootstrap b = new ServerBootstrap(); b.option(ChannelOption.SO_BACKLOG, 600); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class); if (CONSUMER.equals(type)) { b.childHandler(new ConsumerAgentInitializer(discovery)); } else if (PROVIDER.equals(type)) { b.childHandler(new ProducerAgentInitializer()); } else { throw new IllegalStateException("Environment variable type should set to provider or consumer."); } Channel ch = b.bind(PORT).sync().channel(); System.err.println("Agent start at http://127.0.0.1:" + PORT + '/'); ch.closeFuture().sync(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } }
UTF-8
Java
1,981
java
Main.java
Java
[ { "context": " System.err.println(\"Agent start at http://127.0.0.1:\" + PORT + '/');\n\n ch.closeFuture().sy", "end": 1797, "score": 0.9996054172515869, "start": 1788, "tag": "IP_ADDRESS", "value": "127.0.0.1" } ]
null
[]
package org.kenny.agent; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import org.kenny.agent.discovery.Discovery; import org.kenny.agent.discovery.EtcdDiscovery; import org.kenny.agent.handlers.ConsumerAgentInitializer; import org.kenny.agent.handlers.ProducerAgentInitializer; public class Main { // 2000 for consumer agent and 3000 for provider agent private static final int PORT = Integer.parseInt(System.getProperty("server.port")); private static final String CONSUMER = "consumer"; private static final String PROVIDER = "provider"; public static void main(String[] args) throws Exception { String type = System.getProperty("type", "consumer"); EventLoopGroup bossGroup = new NioEventLoopGroup(2); EventLoopGroup workerGroup = new NioEventLoopGroup(8); Discovery discovery = new EtcdDiscovery(); try { ServerBootstrap b = new ServerBootstrap(); b.option(ChannelOption.SO_BACKLOG, 600); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class); if (CONSUMER.equals(type)) { b.childHandler(new ConsumerAgentInitializer(discovery)); } else if (PROVIDER.equals(type)) { b.childHandler(new ProducerAgentInitializer()); } else { throw new IllegalStateException("Environment variable type should set to provider or consumer."); } Channel ch = b.bind(PORT).sync().channel(); System.err.println("Agent start at http://127.0.0.1:" + PORT + '/'); ch.closeFuture().sync(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } }
1,981
0.672892
0.663301
49
39.42857
26.091675
113
false
false
0
0
0
0
0
0
0.653061
false
false
3
7f7f464596d85b517c6f7fb86d4ad017ff228b34
13,709,535,650,234
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_2776c4f9fc89daf60f0c44558e72b3b9e9b11061/FakeSessionManager/34_2776c4f9fc89daf60f0c44558e72b3b9e9b11061_FakeSessionManager_s.java
d530a4649056bc4513be38a595b5912fe3b8d4e4
[]
no_license
zhongxingyu/Seer
https://github.com/zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516000
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
false
2023-06-22T07:55:57
2020-04-28T11:07:49
2023-06-21T00:53:27
2023-06-22T07:55:57
2,849,868
2
2
0
null
false
false
package org.sakaiproject.sitestats.test.mocks; import java.security.Principal; import javax.servlet.http.HttpServletRequest; import org.sakaiproject.tool.api.Session; import org.sakaiproject.tool.api.SessionManager; import org.sakaiproject.tool.api.ToolSession; public class FakeSessionManager implements SessionManager { private Session currentSession = new FakeSession(); public int getActiveUserCount(int arg0) { return 0; } public Session getCurrentSession() { return currentSession; } public String getCurrentSessionUserId() { return currentSession.getUserId(); } public ToolSession getCurrentToolSession() { return null; } public Session getSession(String arg0) { return currentSession; } public String makeSessionId(HttpServletRequest req, Principal principal) { return null; } public void setCurrentSession(Session arg0) { } public void setCurrentToolSession(ToolSession arg0) { } public Session startSession() { return null; } public Session startSession(String arg0) { return null; } }
UTF-8
Java
1,100
java
34_2776c4f9fc89daf60f0c44558e72b3b9e9b11061_FakeSessionManager_s.java
Java
[]
null
[]
package org.sakaiproject.sitestats.test.mocks; import java.security.Principal; import javax.servlet.http.HttpServletRequest; import org.sakaiproject.tool.api.Session; import org.sakaiproject.tool.api.SessionManager; import org.sakaiproject.tool.api.ToolSession; public class FakeSessionManager implements SessionManager { private Session currentSession = new FakeSession(); public int getActiveUserCount(int arg0) { return 0; } public Session getCurrentSession() { return currentSession; } public String getCurrentSessionUserId() { return currentSession.getUserId(); } public ToolSession getCurrentToolSession() { return null; } public Session getSession(String arg0) { return currentSession; } public String makeSessionId(HttpServletRequest req, Principal principal) { return null; } public void setCurrentSession(Session arg0) { } public void setCurrentToolSession(ToolSession arg0) { } public Session startSession() { return null; } public Session startSession(String arg0) { return null; } }
1,100
0.738182
0.732727
52
20.134615
21.346075
76
false
false
0
0
0
0
0
0
1.038462
false
false
3
3fe22cf3820a1154cff307148918615a3b9554d9
26,053,271,637,244
022f80be36bfa5fc296fd452e3627c1a966a45f3
/learn-spring/learn-spring-module/src/main/java/learn/spring/run/SpringbootRunDome.java
ad01dbd5895ffc68bccb9e58a83748803508f123
[]
no_license
kakaCat/learn-spring-cloud
https://github.com/kakaCat/learn-spring-cloud
d90fdb1141e48f165c6ce79fbd0c215cd22790a5
aa3095d41f70641b7c841341afdf96121b4ceeda
refs/heads/master
2022-06-22T00:09:10.848000
2021-01-02T14:32:46
2021-01-02T14:32:46
156,405,488
0
0
null
false
2022-06-21T04:12:35
2018-11-06T15:33:30
2021-01-02T14:33:04
2022-06-21T04:12:32
143
0
0
3
Java
false
false
package learn.spring.run; import com.alibaba.fastjson.JSON; import org.springframework.context.ApplicationContextInitializer; import org.springframework.core.io.support.SpringFactoriesLoader; import java.util.LinkedHashSet; import java.util.Set; /** * @ClassName SpringbootRunDome * @Description SpringbootRunDome * @Author yunp * @Date 2020/7/1 17:08 * @Version 1.0 **/ public class SpringbootRunDome { public static void main(String[] args) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Set<String> names = new LinkedHashSet<>(SpringFactoriesLoader.loadFactoryNames(ApplicationContextInitializer.class, classLoader)); // getSpringFactoriesInstances(ApplicationContextInitializer.class) String str = JSON.toJSONString(names); System.out.println(str); } }
UTF-8
Java
849
java
SpringbootRunDome.java
Java
[ { "context": "nDome\n * @Description SpringbootRunDome\n * @Author yunp\n * @Date 2020/7/1 17:08\n * @Version 1.0\n **/\npubl", "end": 334, "score": 0.999675989151001, "start": 330, "tag": "USERNAME", "value": "yunp" } ]
null
[]
package learn.spring.run; import com.alibaba.fastjson.JSON; import org.springframework.context.ApplicationContextInitializer; import org.springframework.core.io.support.SpringFactoriesLoader; import java.util.LinkedHashSet; import java.util.Set; /** * @ClassName SpringbootRunDome * @Description SpringbootRunDome * @Author yunp * @Date 2020/7/1 17:08 * @Version 1.0 **/ public class SpringbootRunDome { public static void main(String[] args) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Set<String> names = new LinkedHashSet<>(SpringFactoriesLoader.loadFactoryNames(ApplicationContextInitializer.class, classLoader)); // getSpringFactoriesInstances(ApplicationContextInitializer.class) String str = JSON.toJSONString(names); System.out.println(str); } }
849
0.753828
0.739694
32
25.53125
31.108665
138
false
false
0
0
0
0
0
0
0.34375
false
false
3
e780eff0fcbff84eb8d4c2cb3db4db503c801dbc
10,599,979,291,645
a69ac9fab65b5bb4f750cc9e53636b322661bd44
/src/ru/cache/DoubleLayerCache.java
f76c02626a782be750ab1b96bcda6572e228d485
[]
no_license
vgpetrov/DoubleLayerCache
https://github.com/vgpetrov/DoubleLayerCache
2640627bf55d1934d153833290ea43b43159ad59
42c406569ad08f7c78890d5f7168e9690b6f3e00
refs/heads/master
2016-09-03T07:11:27.542000
2013-02-20T18:48:00
2013-02-20T18:48:00
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.cache; public class DoubleLayerCache<K, V> implements ICache<K, V> { private ICache<K, V> ramCache; private ICache<K, V> diskCache; public DoubleLayerCache(Integer ramCacheSize, Integer diskCacheSize, String dirName) { ramCache = new RAMCache<K, V>(ramCacheSize); diskCache = new DiskCache<K, V>(diskCacheSize, dirName); } @Override public synchronized KV putObject(K key, V value) { KV obj = ramCache.putObject(key, value); if (obj != null) { diskCache.putObject((K) obj.getKey(), (V) obj.getVal()); } return null; } @Override public synchronized V getObject(K key) { V obj = ramCache.getObject(key); if (obj != null) { return obj; } else { V val = diskCache.getObject(key); diskCache.removeObject(key); if (val != null) { this.putObject(key, val); } return val; } } @Override public Integer getCacheSize() { return ramCache.getCacheSize() + diskCache.getCacheSize(); } @Override public void clearCache() { ramCache.clearCache(); diskCache.clearCache(); } @Override public synchronized void removeObject(K key) { ramCache.removeObject(key); diskCache.removeObject(key); } }
UTF-8
Java
1,390
java
DoubleLayerCache.java
Java
[]
null
[]
package ru.cache; public class DoubleLayerCache<K, V> implements ICache<K, V> { private ICache<K, V> ramCache; private ICache<K, V> diskCache; public DoubleLayerCache(Integer ramCacheSize, Integer diskCacheSize, String dirName) { ramCache = new RAMCache<K, V>(ramCacheSize); diskCache = new DiskCache<K, V>(diskCacheSize, dirName); } @Override public synchronized KV putObject(K key, V value) { KV obj = ramCache.putObject(key, value); if (obj != null) { diskCache.putObject((K) obj.getKey(), (V) obj.getVal()); } return null; } @Override public synchronized V getObject(K key) { V obj = ramCache.getObject(key); if (obj != null) { return obj; } else { V val = diskCache.getObject(key); diskCache.removeObject(key); if (val != null) { this.putObject(key, val); } return val; } } @Override public Integer getCacheSize() { return ramCache.getCacheSize() + diskCache.getCacheSize(); } @Override public void clearCache() { ramCache.clearCache(); diskCache.clearCache(); } @Override public synchronized void removeObject(K key) { ramCache.removeObject(key); diskCache.removeObject(key); } }
1,390
0.576978
0.576978
53
25.226416
21.677431
90
true
false
0
0
0
0
0
0
0.603774
false
false
3
9fa6bd2515c0eb2e7ec59818061c6d491fd85a50
13,108,240,189,424
8204f36c25540650b0c67ddd2f606f673091bc3f
/app/src/main/java/com/example/childhidden/Services/ForegroundService.java
4e850adaa2dd610f6cd827fad1093b8889bb2c22
[]
no_license
DhanviDesai/EducherChildHidden
https://github.com/DhanviDesai/EducherChildHidden
1b377f6285e667408132de1f0e6f0102a39885a7
a1e63f4c7f8439fe7567feb7bd5375153ba07f72
refs/heads/master
2020-12-20T04:07:58.334000
2020-02-04T12:35:31
2020-02-04T12:35:31
235,777,140
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.childhidden.Services; import android.app.Service; import android.content.Intent; import android.os.Build; import android.os.IBinder; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; import com.example.childhidden.MainActivity; import com.example.childhidden.OverlayDialog; import com.example.childhidden.R; import com.google.firebase.database.ChildEventListener; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import static com.example.childhidden.MainActivity.APPS; public class ForegroundService extends Service { OverlayDialog dialog; @Nullable @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { super.onCreate(); check(); initDialoge(); } public void check(){ String parent_key = MainActivity.parent_key; String child_id = MainActivity.child_id; if(parent_key!=null && child_id!=null){ DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child(parent_key) .child(child_id).child(APPS); reference.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { } @Override public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { String name = dataSnapshot.child("name").getValue().toString(); if(name.equals("Phone Screen")){ boolean value = (boolean)dataSnapshot.child("locked").getValue(); if(!value){ dialog.show(); } } if(name.equals("System UI")){ boolean value = (boolean)dataSnapshot.child("locked").getValue(); if(!value){ dialog.show(); } } } @Override public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) { } @Override public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } } private void initDialoge(){ LayoutInflater layoutInflater = LayoutInflater.from(this); View promptsView = layoutInflater.inflate(R.layout.activity_lock, null); TextView requestUnlock,call,sos; requestUnlock = promptsView.findViewById(R.id.textView14); requestUnlock.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); dialog = new OverlayDialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) { dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); }else{ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); } dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); dialog.setContentView(promptsView); dialog.getWindow().setGravity(Gravity.CENTER); } }
UTF-8
Java
4,031
java
ForegroundService.java
Java
[]
null
[]
package com.example.childhidden.Services; import android.app.Service; import android.content.Intent; import android.os.Build; import android.os.IBinder; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.TextView; import com.example.childhidden.MainActivity; import com.example.childhidden.OverlayDialog; import com.example.childhidden.R; import com.google.firebase.database.ChildEventListener; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import static com.example.childhidden.MainActivity.APPS; public class ForegroundService extends Service { OverlayDialog dialog; @Nullable @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { super.onCreate(); check(); initDialoge(); } public void check(){ String parent_key = MainActivity.parent_key; String child_id = MainActivity.child_id; if(parent_key!=null && child_id!=null){ DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child(parent_key) .child(child_id).child(APPS); reference.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { } @Override public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { String name = dataSnapshot.child("name").getValue().toString(); if(name.equals("Phone Screen")){ boolean value = (boolean)dataSnapshot.child("locked").getValue(); if(!value){ dialog.show(); } } if(name.equals("System UI")){ boolean value = (boolean)dataSnapshot.child("locked").getValue(); if(!value){ dialog.show(); } } } @Override public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) { } @Override public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } } private void initDialoge(){ LayoutInflater layoutInflater = LayoutInflater.from(this); View promptsView = layoutInflater.inflate(R.layout.activity_lock, null); TextView requestUnlock,call,sos; requestUnlock = promptsView.findViewById(R.id.textView14); requestUnlock.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); dialog = new OverlayDialog(this, android.R.style.Theme_Black_NoTitleBar_Fullscreen); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) { dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); }else{ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); } dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); dialog.setContentView(promptsView); dialog.getWindow().setGravity(Gravity.CENTER); } }
4,031
0.62069
0.620193
116
33.75
28.67802
119
false
false
0
0
0
0
0
0
0.491379
false
false
3
39cd7bda4d212c20fc3354281ed1712dec9c65ca
17,935,783,444,419
045a24a9395406be072f1cd4e744e975667cb850
/src/main/java/com/sonvu/onlineshopping/controller/AdminController.java
53782f0eb65d8564f0b96a3ddcb7ba883fab3d6c
[]
no_license
SonVu/OnlineShopping
https://github.com/SonVu/OnlineShopping
855bc0ebed6eaffbfc2f71422fa199ac6257f0f6
2d29633280b80a45824fa0d100636b768daa3e78
refs/heads/master
2021-01-01T18:34:48.215000
2014-05-28T09:12:00
2014-05-28T09:12:00
20,053,996
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sonvu.onlineshopping.controller; import com.sonvu.onlineshopping.entity.Category; import com.sonvu.onlineshopping.entity.Product; import com.sonvu.onlineshopping.service.CategoryService; import com.sonvu.onlineshopping.service.OrderService; import com.sonvu.onlineshopping.service.ProductService; import com.sonvu.onlineshopping.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Created by Imperius on 5/23/2014. */ @Controller public class AdminController { @Autowired private UserService userService; @Autowired private OrderService orderService; @Autowired private CategoryService categoryService; @Autowired private ProductService productService; public Map<Integer, String> getCategoryList() { Map<Integer,String> listCategory = new LinkedHashMap<Integer,String>(); List<Category> categories = categoryService.findAll(); listCategory.put(0, "ROOT CATEGORY"); for (int i = 0; i< categoryService.findAll().size(); i++) { if (categories.get(i).getParentId() == 0) { listCategory.put(categories.get(i).getId(), categories.get(i).getName()); } } return listCategory; } public Map<Integer, String> getCategoryListForProduct() { Map<Integer,String> listCategory = new LinkedHashMap<Integer,String>(); List<Category> categories = categoryService.findAll(); for (int i = 0; i< categoryService.findAll().size(); i++) { if (categories.get(i).getParentId() != 0) { listCategory.put(categories.get(i).getId(), categories.get(i).getName()); } } return listCategory; } @ModelAttribute("category") public Category constructCategory() { return new Category(); } @ModelAttribute("product") public Product constructProduct() { return new Product(); } @RequestMapping(value = "/login") public String login() { return "login"; } @RequestMapping(value = "/admin") public String admin(ModelMap model) { model.addAttribute("topOrder", orderService.findTopNew()); return "admin"; } @RequestMapping(value = "/admin/category") public String category(ModelMap model) { model.addAttribute("listCategory", categoryService.findAllPage(new PageRequest(0,20))); model.addAttribute("listChecked", new ArrayList<Integer>()); return "admin/category"; } @RequestMapping(value = "/admin/category/insert", method = RequestMethod.POST) public String insertCategory(@ModelAttribute("category") Category category, BindingResult result) { categoryService.save(category); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/category/insert") public String insertCategory(ModelMap model) { model.addAttribute("listCategory", getCategoryList()); return "admin/categoryForm"; } @RequestMapping(value = "/admin/category/edit/{id}") public String updateCategory(ModelMap model, @PathVariable Integer id) { model.addAttribute("listCategory", getCategoryList()); model.addAttribute("category", categoryService.findOne(id)); return "admin/categoryForm"; } @RequestMapping(value = "/admin/category/edit/", method = RequestMethod.POST) public String updateCategory(@ModelAttribute("category") Category category) { categoryService.save(category); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/category/delete/{id}") public String deleteCategory(ModelMap model, @PathVariable Integer id) { categoryService.delete(id); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/product") public String product(ModelMap model) { model.addAttribute("listProduct", productService.findAllPage(new PageRequest(0, 20))); return "admin/product"; } @RequestMapping(value = "/admin/product/insert") public String insertProduct(ModelMap model) { model.addAttribute("listCategory", getCategoryListForProduct()); return "admin/productForm"; } @RequestMapping(value = "/admin/product/insert", method = RequestMethod.POST) public String insertProduct(@ModelAttribute("product") Product product, BindingResult result) { productService.save(product); return "redirect:/admin/product"; } @RequestMapping(value = "/admin/product/edit/{id}") public String updateProduct(ModelMap model, @PathVariable Integer id) { model.addAttribute("listCategory", getCategoryListForProduct()); model.addAttribute("product", productService.findOne(id)); return "admin/productForm"; } @RequestMapping(value = "/admin/product/delete/{id}") public String deleteProduct(ModelMap model, @PathVariable Integer id) { productService.delete(id); return "redirect:/admin/product"; } @RequestMapping(value = "/admin/order") public String order(ModelMap model) { model.addAttribute("listOrder", orderService.findAllPage(new PageRequest(0, 20))); return "admin/order"; } }
UTF-8
Java
5,825
java
AdminController.java
Java
[ { "context": "til.List;\nimport java.util.Map;\n\n/**\n * Created by Imperius on 5/23/2014.\n */\n\n@Controller\npublic class Admin", "end": 1003, "score": 0.9408628940582275, "start": 995, "tag": "NAME", "value": "Imperius" } ]
null
[]
package com.sonvu.onlineshopping.controller; import com.sonvu.onlineshopping.entity.Category; import com.sonvu.onlineshopping.entity.Product; import com.sonvu.onlineshopping.service.CategoryService; import com.sonvu.onlineshopping.service.OrderService; import com.sonvu.onlineshopping.service.ProductService; import com.sonvu.onlineshopping.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Created by Imperius on 5/23/2014. */ @Controller public class AdminController { @Autowired private UserService userService; @Autowired private OrderService orderService; @Autowired private CategoryService categoryService; @Autowired private ProductService productService; public Map<Integer, String> getCategoryList() { Map<Integer,String> listCategory = new LinkedHashMap<Integer,String>(); List<Category> categories = categoryService.findAll(); listCategory.put(0, "ROOT CATEGORY"); for (int i = 0; i< categoryService.findAll().size(); i++) { if (categories.get(i).getParentId() == 0) { listCategory.put(categories.get(i).getId(), categories.get(i).getName()); } } return listCategory; } public Map<Integer, String> getCategoryListForProduct() { Map<Integer,String> listCategory = new LinkedHashMap<Integer,String>(); List<Category> categories = categoryService.findAll(); for (int i = 0; i< categoryService.findAll().size(); i++) { if (categories.get(i).getParentId() != 0) { listCategory.put(categories.get(i).getId(), categories.get(i).getName()); } } return listCategory; } @ModelAttribute("category") public Category constructCategory() { return new Category(); } @ModelAttribute("product") public Product constructProduct() { return new Product(); } @RequestMapping(value = "/login") public String login() { return "login"; } @RequestMapping(value = "/admin") public String admin(ModelMap model) { model.addAttribute("topOrder", orderService.findTopNew()); return "admin"; } @RequestMapping(value = "/admin/category") public String category(ModelMap model) { model.addAttribute("listCategory", categoryService.findAllPage(new PageRequest(0,20))); model.addAttribute("listChecked", new ArrayList<Integer>()); return "admin/category"; } @RequestMapping(value = "/admin/category/insert", method = RequestMethod.POST) public String insertCategory(@ModelAttribute("category") Category category, BindingResult result) { categoryService.save(category); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/category/insert") public String insertCategory(ModelMap model) { model.addAttribute("listCategory", getCategoryList()); return "admin/categoryForm"; } @RequestMapping(value = "/admin/category/edit/{id}") public String updateCategory(ModelMap model, @PathVariable Integer id) { model.addAttribute("listCategory", getCategoryList()); model.addAttribute("category", categoryService.findOne(id)); return "admin/categoryForm"; } @RequestMapping(value = "/admin/category/edit/", method = RequestMethod.POST) public String updateCategory(@ModelAttribute("category") Category category) { categoryService.save(category); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/category/delete/{id}") public String deleteCategory(ModelMap model, @PathVariable Integer id) { categoryService.delete(id); return "redirect:/admin/category"; } @RequestMapping(value = "/admin/product") public String product(ModelMap model) { model.addAttribute("listProduct", productService.findAllPage(new PageRequest(0, 20))); return "admin/product"; } @RequestMapping(value = "/admin/product/insert") public String insertProduct(ModelMap model) { model.addAttribute("listCategory", getCategoryListForProduct()); return "admin/productForm"; } @RequestMapping(value = "/admin/product/insert", method = RequestMethod.POST) public String insertProduct(@ModelAttribute("product") Product product, BindingResult result) { productService.save(product); return "redirect:/admin/product"; } @RequestMapping(value = "/admin/product/edit/{id}") public String updateProduct(ModelMap model, @PathVariable Integer id) { model.addAttribute("listCategory", getCategoryListForProduct()); model.addAttribute("product", productService.findOne(id)); return "admin/productForm"; } @RequestMapping(value = "/admin/product/delete/{id}") public String deleteProduct(ModelMap model, @PathVariable Integer id) { productService.delete(id); return "redirect:/admin/product"; } @RequestMapping(value = "/admin/order") public String order(ModelMap model) { model.addAttribute("listOrder", orderService.findAllPage(new PageRequest(0, 20))); return "admin/order"; } }
5,825
0.694077
0.690472
170
33.264706
28.15243
103
false
false
0
0
0
0
0
0
0.594118
false
false
3
0446452b167bef041438f7defe87a5798ba8fb49
17,935,783,443,460
2e98a3f4610e2861befb41e7e42375ede0ba1e80
/src/com/vimukti/accounter/web/client/ui/CustomMenuItem.java
19f77419dbca8926ce9652497d485a2b1167465b
[ "Apache-2.0" ]
permissive
kisorbiswal/accounter
https://github.com/kisorbiswal/accounter
6eefd17d7973132469455d4a5d6b4c2b0a7ec9b3
7ef60c1d18892db72cedca411c143e377c379808
refs/heads/master
2021-01-20T16:34:35.511000
2015-10-20T09:57:42
2015-10-20T09:57:42
44,603,239
0
1
null
true
2015-10-20T11:59:08
2015-10-20T11:59:08
2015-10-20T11:58:54
2015-10-20T10:52:09
0
0
0
0
null
null
null
package com.vimukti.accounter.web.client.ui; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.resources.client.ImageResource; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.MenuItem; import com.google.gwt.user.client.ui.SimplePanel; public class CustomMenuItem extends MenuItem { public CustomMenuItem(String text, Command cmd) { super(text, false, cmd); this.getElement().addClassName("menu-item-image"); } public void setIcon(ImageResource image) { if (image != null) { // this.getElement().getStyle().setProperty( // FinanceApplication.constants().background(), // "url(" + image.getURL() + ") no-repeat "); // this.getElement().addClassName( // FinanceApplication.constants().menuItemImage()); // this.getElement().getStyle().setBackgroundColor(""); // // // img.getElement().setAttribute("align", "left"); // String title = this.getElement().getInnerText(); // this.getElement().setInnerText(""); // this.getElement().appendChild(img.getElement()); // this.getElement().setInnerHTML( // this.getElement().getInnerHTML() + new HTML(title)); Image img = new Image(image); StyledPanel hPanel = new StyledPanel("hPanel"); HTML title = new HTML(this.getElement().getInnerText()); title.getElement().getStyle().setMarginLeft(4, Unit.PX); // hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hPanel.add(img); hPanel.add(title); this.getElement().setInnerText(""); SimplePanel simplePanel = new SimplePanel(); simplePanel.add(hPanel); this.setHTML(simplePanel.getElement().getInnerHTML()); // Element div = DOM.createDiv(); // div.setAttribute("align", "right"); // div.getStyle().setVerticalAlign(VerticalAlign.MIDDLE); // div.getStyle().setProperty("margin", "3px 0px 0px 0px"); // div.setInnerText(title); // this.getElement().appendChild(div); // this.getElement().addClassName( // FinanceApplication.constants().menuItemImage()); } } }
UTF-8
Java
2,111
java
CustomMenuItem.java
Java
[]
null
[]
package com.vimukti.accounter.web.client.ui; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.resources.client.ImageResource; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.MenuItem; import com.google.gwt.user.client.ui.SimplePanel; public class CustomMenuItem extends MenuItem { public CustomMenuItem(String text, Command cmd) { super(text, false, cmd); this.getElement().addClassName("menu-item-image"); } public void setIcon(ImageResource image) { if (image != null) { // this.getElement().getStyle().setProperty( // FinanceApplication.constants().background(), // "url(" + image.getURL() + ") no-repeat "); // this.getElement().addClassName( // FinanceApplication.constants().menuItemImage()); // this.getElement().getStyle().setBackgroundColor(""); // // // img.getElement().setAttribute("align", "left"); // String title = this.getElement().getInnerText(); // this.getElement().setInnerText(""); // this.getElement().appendChild(img.getElement()); // this.getElement().setInnerHTML( // this.getElement().getInnerHTML() + new HTML(title)); Image img = new Image(image); StyledPanel hPanel = new StyledPanel("hPanel"); HTML title = new HTML(this.getElement().getInnerText()); title.getElement().getStyle().setMarginLeft(4, Unit.PX); // hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hPanel.add(img); hPanel.add(title); this.getElement().setInnerText(""); SimplePanel simplePanel = new SimplePanel(); simplePanel.add(hPanel); this.setHTML(simplePanel.getElement().getInnerHTML()); // Element div = DOM.createDiv(); // div.setAttribute("align", "right"); // div.getStyle().setVerticalAlign(VerticalAlign.MIDDLE); // div.getStyle().setProperty("margin", "3px 0px 0px 0px"); // div.setInnerText(title); // this.getElement().appendChild(div); // this.getElement().addClassName( // FinanceApplication.constants().menuItemImage()); } } }
2,111
0.70109
0.698721
59
34.779659
21.186874
69
false
false
0
0
0
0
0
0
2.627119
false
false
3
98bbc91c4f2ec4e2d03672fbdf644fc74e066664
2,834,678,440,909
440723ad8753ab563f06e8b3c7b8db4929afae45
/NFV_MANO_SOL006_LIBS_COMMON/src/main/java/it/nextworks/nfvmano/libs/common/enums/ScopeEnum.java
7933640935a3a81d628cf3d3817ac1923a02203d
[ "Apache-2.0" ]
permissive
nextworks-it/nfv-sol-libs
https://github.com/nextworks-it/nfv-sol-libs
d1e21eb99790de73743e30a8acb86c00c4d52fdd
1c715e34b103d1d0450f825ea58014b5636ebb18
refs/heads/master
2022-02-28T03:23:16.405000
2022-02-03T16:17:39
2022-02-03T16:17:39
153,476,736
0
0
Apache-2.0
false
2022-02-03T16:17:40
2018-10-17T15:04:13
2021-06-04T15:23:30
2022-02-03T16:17:39
552
0
0
0
Java
false
false
package it.nextworks.nfvmano.libs.common.enums; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** * Specifies the scope of the affinity or anti-affinity relationship e.g. a NFVI node, an NFVI PoP, etc. */ public enum ScopeEnum { NFVI_NODE("nfvi-node"), ZONE_GROUP("zone-group"), ZONE("zone"), NFVI_POP("nfvi-pop"); private String value; ScopeEnum(String value) { this.value = value; } @Override @JsonValue public String toString() { return String.valueOf(value); } @JsonCreator public static ScopeEnum fromValue(String text) { for (ScopeEnum b : ScopeEnum.values()) { if (String.valueOf(b.value).equals(text)) { return b; } } return null; } }
UTF-8
Java
847
java
ScopeEnum.java
Java
[]
null
[]
package it.nextworks.nfvmano.libs.common.enums; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** * Specifies the scope of the affinity or anti-affinity relationship e.g. a NFVI node, an NFVI PoP, etc. */ public enum ScopeEnum { NFVI_NODE("nfvi-node"), ZONE_GROUP("zone-group"), ZONE("zone"), NFVI_POP("nfvi-pop"); private String value; ScopeEnum(String value) { this.value = value; } @Override @JsonValue public String toString() { return String.valueOf(value); } @JsonCreator public static ScopeEnum fromValue(String text) { for (ScopeEnum b : ScopeEnum.values()) { if (String.valueOf(b.value).equals(text)) { return b; } } return null; } }
847
0.618654
0.618654
39
20.743589
22.04159
104
false
false
0
0
0
0
0
0
0.358974
false
false
3
e9a749ca10543b56cea519bd36c1ebf4c0153283
7,310,034,364,645
182e1964cac5e4833ef6d9d613233256b8805a36
/app/src/main/java/adapter/ImageAdapter.java
c442d52987fc29b2a2ccb8266bbf859e89390127
[]
no_license
phyDream/Xianyu
https://github.com/phyDream/Xianyu
5238c7bfeb7e5298d5525ac189ea8afd97ad9f6d
fd80e53cd9259353afd18add5b4690f94f685197
refs/heads/master
2021-06-13T04:26:39.200000
2017-03-31T05:04:03
2017-03-31T05:04:03
86,779,882
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package adapter; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import android.widget.ToggleButton; import java.util.List; import bean.ImageItem; import day713.test.phy.xianyu.R; import de.greenrobot.event.EventBus; import de.greenrobot.event.Subscribe; import de.greenrobot.event.ThreadMode; import utils.BitmapCache; import utils.MyToast; import utils.StaticFinalNum; /** * Created by Administrator on 2016/7/28. */ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ItemViewHolder>{ final String TAG = getClass().getSimpleName(); private List<ImageItem> imageItems; private Context context; private List<ImageItem> imageItems_select; private SelectImageAdapter selectImageAdapter; BitmapCache cache; public ImageAdapter(List<ImageItem> imageItems, Context context,List<ImageItem> imageItems_select ,SelectImageAdapter selectImageAdapter) { cache = new BitmapCache(); this.imageItems = imageItems; this.context = context; this.imageItems_select = imageItems_select; this.selectImageAdapter = selectImageAdapter; } //设置图片 BitmapCache.ImageCallback callback = new BitmapCache.ImageCallback() { @Override public void imageLoad(ImageView imageView, Bitmap bitmap, Object... params) { if (imageView != null && bitmap != null) { String url = (String) params[0]; if (url != null && url.equals((String) imageView.getTag())) { ((ImageView) imageView).setImageBitmap(bitmap); } else { Log.e(TAG, "callback, bmp not match"); } } else { Log.e(TAG, "callback, bmp null"); } } }; @Override public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_item,null); ItemViewHolder itemViewHolder = new ItemViewHolder(view); return itemViewHolder; } @Override public void onBindViewHolder(final ItemViewHolder holder, final int position) { //设置图片并处理缓存显示 final ImageItem imageItem = imageItems.get(position); String path; if (imageItems != null && imageItems.size() > position)//相册有图片 path = imageItems.get(position).imagePath;//得到对应位置的图片获取地址 else// path = "camera_default";//没有图片地址设为默认显示地址 //判断地址 if (path.contains("camera_default")) {//没有图片就显示默认图片 holder.img.setImageResource(R.mipmap.ic_launcher); } else { final ImageItem item = imageItems.get(position); holder.img.setTag(item.imagePath);//设置标记 // Log.v(TAG,"~~~~~~~~~~~~"+item.thumbnailPath); cache.displayBmp(holder.img, item.thumbnailPath, item.imagePath, callback); //设置控件时,该位置没有被选中就设置未选中样式 if(!imageItems_select.contains(imageItems.get(position))){ holder.button.setChecked(false); holder.toggleButton.setChecked(false); }else { holder.button.setChecked(true); holder.toggleButton.setChecked(true); } } //item的勾选图片的点击事件,选中的图片加入选中的集合 holder.button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //如果点击已选中就取消选中 if(imageItems_select.contains(imageItems.get(position)) ){ imageItems_select.remove(imageItems.get(position)); selectImageAdapter.notifyDataSetChanged(); holder.button.setChecked(false); holder.toggleButton.setChecked(false); EventBus.getDefault().post(StaticFinalNum.EVENTBUS_TAG2); }else {//如果点击未选中的图片 if(imageItems_select.size() < StaticFinalNum.MAX_SELECT){ imageItems_select.add(imageItems.get(position)); selectImageAdapter.notifyDataSetChanged(); holder.button.setChecked(true); holder.toggleButton.setChecked(true); EventBus.getDefault().post(StaticFinalNum.EVENTBUS_TAG2); }else { holder.button.setChecked(false); holder.toggleButton.setChecked(false); Toast.makeText(context,"一次上传图片不能超过10张",Toast.LENGTH_LONG).show(); Log.v(TAG,"~~~~~~~~~~~~~~~一次上传图片不能超过10张"); } } } }); //item的点击事件 holder.toggleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EventBus.getDefault().post(position);//点击显示大图界面 //如果点击已选中就取消选中 if(imageItems_select.contains(imageItems.get(position)) ){ holder.toggleButton.setChecked(true); }else {//如果点击未选中的图片 holder.toggleButton.setChecked(false); } } }); } @Override public int getItemCount() { return imageItems.size(); } //自定义控件携带者--找到item视图上相应控件 public static class ItemViewHolder extends RecyclerView.ViewHolder{ private ImageView img; private ToggleButton toggleButton; private ToggleButton button; public ItemViewHolder(View itemView) { super(itemView); img = (ImageView) itemView.findViewById(R.id.imageItem); toggleButton = (ToggleButton) itemView.findViewById(R.id.toggle_button); button = (ToggleButton) itemView.findViewById(R.id.choosedbt); } } }
UTF-8
Java
6,712
java
ImageAdapter.java
Java
[ { "context": "t;\nimport utils.StaticFinalNum;\n\n/**\n * Created by Administrator on 2016/7/28.\n */\npublic class ImageAdapter exten", "end": 750, "score": 0.6442710161209106, "start": 737, "tag": "USERNAME", "value": "Administrator" } ]
null
[]
package adapter; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import android.widget.ToggleButton; import java.util.List; import bean.ImageItem; import day713.test.phy.xianyu.R; import de.greenrobot.event.EventBus; import de.greenrobot.event.Subscribe; import de.greenrobot.event.ThreadMode; import utils.BitmapCache; import utils.MyToast; import utils.StaticFinalNum; /** * Created by Administrator on 2016/7/28. */ public class ImageAdapter extends RecyclerView.Adapter<ImageAdapter.ItemViewHolder>{ final String TAG = getClass().getSimpleName(); private List<ImageItem> imageItems; private Context context; private List<ImageItem> imageItems_select; private SelectImageAdapter selectImageAdapter; BitmapCache cache; public ImageAdapter(List<ImageItem> imageItems, Context context,List<ImageItem> imageItems_select ,SelectImageAdapter selectImageAdapter) { cache = new BitmapCache(); this.imageItems = imageItems; this.context = context; this.imageItems_select = imageItems_select; this.selectImageAdapter = selectImageAdapter; } //设置图片 BitmapCache.ImageCallback callback = new BitmapCache.ImageCallback() { @Override public void imageLoad(ImageView imageView, Bitmap bitmap, Object... params) { if (imageView != null && bitmap != null) { String url = (String) params[0]; if (url != null && url.equals((String) imageView.getTag())) { ((ImageView) imageView).setImageBitmap(bitmap); } else { Log.e(TAG, "callback, bmp not match"); } } else { Log.e(TAG, "callback, bmp null"); } } }; @Override public ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_item,null); ItemViewHolder itemViewHolder = new ItemViewHolder(view); return itemViewHolder; } @Override public void onBindViewHolder(final ItemViewHolder holder, final int position) { //设置图片并处理缓存显示 final ImageItem imageItem = imageItems.get(position); String path; if (imageItems != null && imageItems.size() > position)//相册有图片 path = imageItems.get(position).imagePath;//得到对应位置的图片获取地址 else// path = "camera_default";//没有图片地址设为默认显示地址 //判断地址 if (path.contains("camera_default")) {//没有图片就显示默认图片 holder.img.setImageResource(R.mipmap.ic_launcher); } else { final ImageItem item = imageItems.get(position); holder.img.setTag(item.imagePath);//设置标记 // Log.v(TAG,"~~~~~~~~~~~~"+item.thumbnailPath); cache.displayBmp(holder.img, item.thumbnailPath, item.imagePath, callback); //设置控件时,该位置没有被选中就设置未选中样式 if(!imageItems_select.contains(imageItems.get(position))){ holder.button.setChecked(false); holder.toggleButton.setChecked(false); }else { holder.button.setChecked(true); holder.toggleButton.setChecked(true); } } //item的勾选图片的点击事件,选中的图片加入选中的集合 holder.button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //如果点击已选中就取消选中 if(imageItems_select.contains(imageItems.get(position)) ){ imageItems_select.remove(imageItems.get(position)); selectImageAdapter.notifyDataSetChanged(); holder.button.setChecked(false); holder.toggleButton.setChecked(false); EventBus.getDefault().post(StaticFinalNum.EVENTBUS_TAG2); }else {//如果点击未选中的图片 if(imageItems_select.size() < StaticFinalNum.MAX_SELECT){ imageItems_select.add(imageItems.get(position)); selectImageAdapter.notifyDataSetChanged(); holder.button.setChecked(true); holder.toggleButton.setChecked(true); EventBus.getDefault().post(StaticFinalNum.EVENTBUS_TAG2); }else { holder.button.setChecked(false); holder.toggleButton.setChecked(false); Toast.makeText(context,"一次上传图片不能超过10张",Toast.LENGTH_LONG).show(); Log.v(TAG,"~~~~~~~~~~~~~~~一次上传图片不能超过10张"); } } } }); //item的点击事件 holder.toggleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { EventBus.getDefault().post(position);//点击显示大图界面 //如果点击已选中就取消选中 if(imageItems_select.contains(imageItems.get(position)) ){ holder.toggleButton.setChecked(true); }else {//如果点击未选中的图片 holder.toggleButton.setChecked(false); } } }); } @Override public int getItemCount() { return imageItems.size(); } //自定义控件携带者--找到item视图上相应控件 public static class ItemViewHolder extends RecyclerView.ViewHolder{ private ImageView img; private ToggleButton toggleButton; private ToggleButton button; public ItemViewHolder(View itemView) { super(itemView); img = (ImageView) itemView.findViewById(R.id.imageItem); toggleButton = (ToggleButton) itemView.findViewById(R.id.toggle_button); button = (ToggleButton) itemView.findViewById(R.id.choosedbt); } } }
6,712
0.599555
0.596697
169
36.266273
25.96983
101
false
false
0
0
0
0
0
0
0.597633
false
false
3
1b440213aaa80230584031b6260cfdddfafb100f
25,598,005,146,726
262464a231b7f201859b2c4b1180ead71bf90eda
/src/sevelet01/courses_pc_request.java
7ff41f8b064e7ac837919e10dca57c928f884dc1
[]
no_license
hhnewbee/onlineLearning
https://github.com/hhnewbee/onlineLearning
dd32f14f79536067a5ef9618ab96560b473bd8d8
97efa5462678f87d8c82d5b1299fafea3cf9cd51
refs/heads/master
2021-04-03T05:59:52.181000
2018-03-14T04:47:23
2018-03-14T04:47:23
125,057,758
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package sevelet01; /** * Created by new bee on 2017/7/16. */ public class courses_pc_request { //课程类别 private String choose; }
UTF-8
Java
146
java
courses_pc_request.java
Java
[ { "context": "package sevelet01;\n\n/**\n * Created by new bee on 2017/7/16.\n */\npublic class courses_pc_request", "end": 45, "score": 0.996725857257843, "start": 38, "tag": "USERNAME", "value": "new bee" } ]
null
[]
package sevelet01; /** * Created by new bee on 2017/7/16. */ public class courses_pc_request { //课程类别 private String choose; }
146
0.652174
0.586957
9
14.333333
13.2665
35
false
false
0
0
0
0
0
0
0.222222
false
false
3
ca946f370fbaf0a406d5a2706b47036e987b03ce
30,889,404,829,910
d692e813f599d392d0a56fc4e6da51f5cf5ae6e1
/backend/src/main/java/br/edu/ufcg/ccc/pharma/repository/BatchRepository.java
fcf4aa43964e5aace80df266b24e28b164e669e6
[]
no_license
jessescn/ProjetoPSoft
https://github.com/jessescn/ProjetoPSoft
c3ba5776baf30227987def4e16e70ac9061c30d1
1dfdbe86e636f752f71afe2c515db6ae9ff02ff6
refs/heads/master
2020-04-07T18:36:01.634000
2018-12-09T02:40:15
2018-12-09T02:40:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.edu.ufcg.ccc.pharma.repository; import br.edu.ufcg.ccc.pharma.model.Batch; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; public interface BatchRepository extends CrudRepository<Batch, Long> { @Query( value = "SELECT SUM(b.amount) FROM Batch b WHERE product_id = :id AND b.expiration > CURRENT_DATE ") public int findTotalAmount(@Param("id") long id); }
UTF-8
Java
497
java
BatchRepository.java
Java
[]
null
[]
package br.edu.ufcg.ccc.pharma.repository; import br.edu.ufcg.ccc.pharma.model.Batch; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; public interface BatchRepository extends CrudRepository<Batch, Long> { @Query( value = "SELECT SUM(b.amount) FROM Batch b WHERE product_id = :id AND b.expiration > CURRENT_DATE ") public int findTotalAmount(@Param("id") long id); }
497
0.782696
0.782696
11
44.18182
32.344223
112
false
false
0
0
0
0
0
0
0.636364
false
false
3
9276d4979bb95f4731694c5f65a5f9db882b6520
16,982,300,701,396
3140d92d4e2d88d51c32f9bb0afbf09d42d6c655
/app/src/main/java/com/example/nuttygeek/rudrakshapp/ScientificIntroduction.java
510015a33eb0f3889bc07f90d90b8a3803779ae5
[]
no_license
NuttyGeek/RudrakshApp
https://github.com/NuttyGeek/RudrakshApp
5ba8a54538c3f08119c52f27c94039742878d3ee
cc1395e8bf479d3649360100e163ffb410d3b09e
refs/heads/master
2021-01-19T12:29:47.851000
2017-09-08T15:59:44
2017-09-08T15:59:44
100,792,417
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.nuttygeek.rudrakshapp; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.CardView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; /** * Created by nuttygeek on 11/8/17. */ public class ScientificIntroduction extends android.support.v4.app.Fragment { TextView one,two,three; CardView cardOne,cardTwo,cardThree; public ScientificIntroduction() { super(); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.scientific_introduction,container,false); one = (TextView)v.findViewById(R.id.chemical_text); two = (TextView)v.findViewById(R.id.text_electrical); three = (TextView)v.findViewById(R.id.text_magnetic); cardOne = (CardView)v.findViewById(R.id.card_one); cardTwo = (CardView)v.findViewById(R.id.card_two); cardThree = (CardView)v.findViewById(R.id.card_three); one.setVisibility(View.GONE); two.setVisibility(View.GONE); three.setVisibility(View.GONE); cardOne.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { one.setVisibility(View.VISIBLE); two.setVisibility(View.GONE); three.setVisibility(View.GONE); } }); cardTwo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { two.setVisibility(View.VISIBLE); one.setVisibility(View.GONE); three.setVisibility(View.GONE); } }); cardThree.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { three.setVisibility(View.VISIBLE); one.setVisibility(View.GONE); two.setVisibility(View.GONE); } }); return v; } }
UTF-8
Java
2,205
java
ScientificIntroduction.java
Java
[ { "context": "package com.example.nuttygeek.rudrakshapp;\n\nimport android.app.Fragment;\nimport", "end": 29, "score": 0.9231014251708984, "start": 20, "tag": "USERNAME", "value": "nuttygeek" }, { "context": "import android.widget.TextView;\n\n/**\n * Created by nuttygeek on 11/8/17.\n */\n\npublic class ScientificIntroduct", "end": 339, "score": 0.9992870092391968, "start": 330, "tag": "USERNAME", "value": "nuttygeek" } ]
null
[]
package com.example.nuttygeek.rudrakshapp; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.CardView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; /** * Created by nuttygeek on 11/8/17. */ public class ScientificIntroduction extends android.support.v4.app.Fragment { TextView one,two,three; CardView cardOne,cardTwo,cardThree; public ScientificIntroduction() { super(); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.scientific_introduction,container,false); one = (TextView)v.findViewById(R.id.chemical_text); two = (TextView)v.findViewById(R.id.text_electrical); three = (TextView)v.findViewById(R.id.text_magnetic); cardOne = (CardView)v.findViewById(R.id.card_one); cardTwo = (CardView)v.findViewById(R.id.card_two); cardThree = (CardView)v.findViewById(R.id.card_three); one.setVisibility(View.GONE); two.setVisibility(View.GONE); three.setVisibility(View.GONE); cardOne.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { one.setVisibility(View.VISIBLE); two.setVisibility(View.GONE); three.setVisibility(View.GONE); } }); cardTwo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { two.setVisibility(View.VISIBLE); one.setVisibility(View.GONE); three.setVisibility(View.GONE); } }); cardThree.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { three.setVisibility(View.VISIBLE); one.setVisibility(View.GONE); two.setVisibility(View.GONE); } }); return v; } }
2,205
0.631746
0.628571
77
27.636364
24.922689
113
false
false
0
0
0
0
0
0
0.558442
false
false
3
03dc5db182c2e41c8515572aa509c5c7403bb7c6
24,979,529,836,696
efedf993cf41fe25965b2a54058215369a0393f8
/titanium-0.3m-1.5.2-forge-737-738/ru/mchacked/titanium/TWindow.java
6776d56a2c2200a5a84ad2c21096613b673b849f
[]
no_license
tsnest/TitaniumCheats
https://github.com/tsnest/TitaniumCheats
5896f0428d46d4a5e18693212e1d44556112c157
e6786cc5833c1f7ba516156fcf7d19251b0f8303
refs/heads/main
2023-06-02T22:49:49.129000
2021-06-28T18:43:48
2021-06-28T18:43:48
381,129,046
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package ru.mchacked.titanium; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiIngame; import ru.mchacked.titanium.api.IWindow; public abstract class TWindow implements IWindow { private String caption; private int width; public TWindow(String caption, int width) { this.caption = caption; this.width = width; } @Override public String getCaption() { return this.caption; } @Override public boolean isCloseable() { return true; } @Override public int getWidth() { return this.width; } @Override public int getHeight() { return 12 * this.getSize(); } @Override public void onRender(int x, int y, int mx, int my) { FontRenderer fr = Titanium.getTitanium().getTGui().getFontRenderer(); int s = my / 12; if(my < 0) { s = -1; } if(mx < 0 || mx > this.getWidth()) { s = -1; } for(int i = 0; i < this.getSize(); ++i) { if(s == i && this.canHighlight(i)) { GuiIngame.drawRect(x, y + s * 12, x + this.getWidth(), y + (s + 1) * 12, 553648127); } for(int p = 0; p < this.Method193(i); ++p) { String t = this.getText(i, p); int pos = this.getPosition(i, p); int tw = pos == 0 ? 0 : fr.getStringWidth(t); int rx = 0; switch(pos) { case 0: rx = 2; break; case 1: rx = (this.width - tw) / 2; break; case 2: rx = this.width - tw - 2; } fr.drawString(t, x + rx, y + 12 * i + 2, 16777215); } } this.onEntryRender(s); } protected abstract String getText(int var1, int var2); protected boolean canHighlight(int i) { return true; } protected abstract int getSize(); protected void onEntryClick(int i) { } protected int getPosition(int i, int rp) { return 0; } protected void onEntryRender(int i) { } protected int Method193(int i) { return 1; } @Override public void onClick(int x, int y) { int i = y / 12; if(i >= 0 && i < this.getSize()) { this.onEntryClick(i); } } @Override public void flush() { } @Override public void onMouseScroll(int x, int y, int delta) { } @Override public void onClose() { } @Override public void onShow() { } }
UTF-8
Java
2,197
java
TWindow.java
Java
[]
null
[]
package ru.mchacked.titanium; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiIngame; import ru.mchacked.titanium.api.IWindow; public abstract class TWindow implements IWindow { private String caption; private int width; public TWindow(String caption, int width) { this.caption = caption; this.width = width; } @Override public String getCaption() { return this.caption; } @Override public boolean isCloseable() { return true; } @Override public int getWidth() { return this.width; } @Override public int getHeight() { return 12 * this.getSize(); } @Override public void onRender(int x, int y, int mx, int my) { FontRenderer fr = Titanium.getTitanium().getTGui().getFontRenderer(); int s = my / 12; if(my < 0) { s = -1; } if(mx < 0 || mx > this.getWidth()) { s = -1; } for(int i = 0; i < this.getSize(); ++i) { if(s == i && this.canHighlight(i)) { GuiIngame.drawRect(x, y + s * 12, x + this.getWidth(), y + (s + 1) * 12, 553648127); } for(int p = 0; p < this.Method193(i); ++p) { String t = this.getText(i, p); int pos = this.getPosition(i, p); int tw = pos == 0 ? 0 : fr.getStringWidth(t); int rx = 0; switch(pos) { case 0: rx = 2; break; case 1: rx = (this.width - tw) / 2; break; case 2: rx = this.width - tw - 2; } fr.drawString(t, x + rx, y + 12 * i + 2, 16777215); } } this.onEntryRender(s); } protected abstract String getText(int var1, int var2); protected boolean canHighlight(int i) { return true; } protected abstract int getSize(); protected void onEntryClick(int i) { } protected int getPosition(int i, int rp) { return 0; } protected void onEntryRender(int i) { } protected int Method193(int i) { return 1; } @Override public void onClick(int x, int y) { int i = y / 12; if(i >= 0 && i < this.getSize()) { this.onEntryClick(i); } } @Override public void flush() { } @Override public void onMouseScroll(int x, int y, int delta) { } @Override public void onClose() { } @Override public void onShow() { } }
2,197
0.603095
0.577151
117
17.777779
18.06546
88
false
false
0
0
0
0
0
0
2.324786
false
false
3
6831e2de9c4741ebaf05e8f76ade5f1f6fdd1301
3,401,614,137,556
6d33d31902e866a20f9eba69456d0dedcf5dfda4
/src/com/laxcus/bank/invoker/BankLoginSiteInvoker.java
4fabfc97682ba340097eb891ae3158af98440a94
[]
no_license
lingyiming/laxcus.git
https://github.com/lingyiming/laxcus.git
566cad422d589d2a37d06a47ca32db380ff1b7bd
9ad21437969ce0a37b729988c1d5f77022f36b38
refs/heads/main
2023-03-21T12:50:10.012000
2022-10-24T09:22:01
2022-10-24T09:22:01
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2009 laxcus.com. All rights reserved * * @license Laxcus Public License (LPL) */ package com.laxcus.bank.invoker; import com.laxcus.command.login.*; import com.laxcus.log.client.*; import com.laxcus.site.*; import com.laxcus.bank.pool.*; /** * 注册站点调用器。<br> * BANK子站点向BANK站点注册 * * @author scott.liang * @version 1.0 6/26/2018 * @since laxcus 1.0 */ public class BankLoginSiteInvoker extends BankInvoker { /** * 构造注册站点调用器,指定命令 * @param cmd 注册站点命令 */ public BankLoginSiteInvoker(LoginSite cmd) { super(cmd); } /* * (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#getCommand() */ @Override public LoginSite getCommand() { return (LoginSite) super.getCommand(); } /* (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#launch() */ @Override public boolean launch() { LoginSite cmd = getCommand(); Site site = cmd.getSite(); boolean success = false; // 注册到指定的管理池中 if (site.isAccount()) { success = AccountOnBankPool.getInstance().add(site); } else if (site.isHash()) { success = HashOnBankPool.getInstance().add(site); } else if (site.isGate()) { success = GateOnBankPool.getInstance().add(site); } else if (site.isEntrance()) { success = EntranceOnBankPool.getInstance().add(site); } else if(site.isLog()) { success = LogOnBankPool.getInstance().add(site); } // 备份BANK站点 else if(site.isBank()) { success = MonitorOnBankPool.getInstance().add(site); } // WATCH站点 else if (site.isWatch()) { success = WatchOnBankPool.getInstance().add(site); } Logger.debug(this, "launch", success, "login %s", site); // 如果需要反馈时... if (cmd.isReply()) { LoginSiteProduct product = new LoginSiteProduct(site.getNode(), success); replyProduct(product); } return useful(success); } /* (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#ending() */ @Override public boolean ending() { // TODO Auto-generated method stub return false; } }
UTF-8
Java
2,159
java
BankLoginSiteInvoker.java
Java
[ { "context": " * 注册站点调用器。<br>\n * BANK子站点向BANK站点注册\n * \n * @author scott.liang\n * @version 1.0 6/26/2018\n * @since laxcus 1.0\n *", "end": 390, "score": 0.9877093434333801, "start": 379, "tag": "USERNAME", "value": "scott.liang" } ]
null
[]
/** * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2009 laxcus.com. All rights reserved * * @license Laxcus Public License (LPL) */ package com.laxcus.bank.invoker; import com.laxcus.command.login.*; import com.laxcus.log.client.*; import com.laxcus.site.*; import com.laxcus.bank.pool.*; /** * 注册站点调用器。<br> * BANK子站点向BANK站点注册 * * @author scott.liang * @version 1.0 6/26/2018 * @since laxcus 1.0 */ public class BankLoginSiteInvoker extends BankInvoker { /** * 构造注册站点调用器,指定命令 * @param cmd 注册站点命令 */ public BankLoginSiteInvoker(LoginSite cmd) { super(cmd); } /* * (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#getCommand() */ @Override public LoginSite getCommand() { return (LoginSite) super.getCommand(); } /* (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#launch() */ @Override public boolean launch() { LoginSite cmd = getCommand(); Site site = cmd.getSite(); boolean success = false; // 注册到指定的管理池中 if (site.isAccount()) { success = AccountOnBankPool.getInstance().add(site); } else if (site.isHash()) { success = HashOnBankPool.getInstance().add(site); } else if (site.isGate()) { success = GateOnBankPool.getInstance().add(site); } else if (site.isEntrance()) { success = EntranceOnBankPool.getInstance().add(site); } else if(site.isLog()) { success = LogOnBankPool.getInstance().add(site); } // 备份BANK站点 else if(site.isBank()) { success = MonitorOnBankPool.getInstance().add(site); } // WATCH站点 else if (site.isWatch()) { success = WatchOnBankPool.getInstance().add(site); } Logger.debug(this, "launch", success, "login %s", site); // 如果需要反馈时... if (cmd.isReply()) { LoginSiteProduct product = new LoginSiteProduct(site.getNode(), success); replyProduct(product); } return useful(success); } /* (non-Javadoc) * @see com.laxcus.echo.invoke.EchoInvoker#ending() */ @Override public boolean ending() { // TODO Auto-generated method stub return false; } }
2,159
0.67075
0.6634
91
21.43956
19.154209
76
false
false
0
0
0
0
0
0
1.417582
false
false
3
cb1cc8eb838c481a3e6509d01af07b97820420c1
21,749,714,456,105
9b41389b1c766ced54d0e16e364407a4de24010a
/src/observer/Notifyer.java
bfc42a56d286a465a7eff8bdbbb3b5e0063920db
[]
no_license
carterrr/design_pattern_23
https://github.com/carterrr/design_pattern_23
387f27386bd716346b2b5166b681e13affde3a98
912c21560549f03ca20347c173504e134c927470
refs/heads/master
2022-01-13T08:35:37.563000
2022-01-04T02:04:34
2022-01-04T02:04:34
211,588,219
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package observer; import java.util.ArrayList; import java.util.List; /** * @author CarterChou at 2019/4/9 18:57 * @description 通知者 */ public class Notifyer { private List <Observer> observers = new ArrayList<>(); /** * 新增观察者 * @param observer */ public void attach(Observer observer) { observers.add(observer); } public void remove(Observer observer) { observers.remove(observer); } public void notifys() { for(Observer observer : observers) { observer.update() ; } } }
UTF-8
Java
589
java
Notifyer.java
Java
[ { "context": ".ArrayList;\nimport java.util.List;\n\n/**\n * @author CarterChou at 2019/4/9 18:57\n * @description 通知者\n */\npublic", "end": 96, "score": 0.9995617270469666, "start": 86, "tag": "NAME", "value": "CarterChou" } ]
null
[]
package observer; import java.util.ArrayList; import java.util.List; /** * @author CarterChou at 2019/4/9 18:57 * @description 通知者 */ public class Notifyer { private List <Observer> observers = new ArrayList<>(); /** * 新增观察者 * @param observer */ public void attach(Observer observer) { observers.add(observer); } public void remove(Observer observer) { observers.remove(observer); } public void notifys() { for(Observer observer : observers) { observer.update() ; } } }
589
0.595113
0.577661
31
17.483871
16.576063
59
false
false
0
0
0
0
0
0
0.225806
false
false
3
cfdf0bbecb201cc6cc00e75b42ebf539b35a6b0a
20,237,885,940,625
5324f7ffa796281f5ea248f0eb7cc33c64ccfcc6
/doctor-move-data/src/main/java/io/terminus/doctor/move/builder/pig/DoctorPigWeanInputBuilder.java
4ec75083deedc608466fef0f91138dc320cab246
[]
no_license
project-thinking/java8
https://github.com/project-thinking/java8
174796284a1b08e01cff0c9dcdb5815b2e3681b4
21b6b3d2a3798f55fd7ee6b2d51e2405b40e4872
refs/heads/master
2022-01-08T08:11:17.919000
2018-10-24T02:22:09
2018-10-24T02:22:09
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.terminus.doctor.move.builder.pig; import com.google.common.base.Strings; import io.terminus.doctor.event.dto.event.BasePigEventInputDto; import io.terminus.doctor.event.dto.event.sow.DoctorWeanDto; import io.terminus.doctor.event.model.DoctorBarn; import io.terminus.doctor.move.builder.DoctorBuilderCommonOperation; import io.terminus.doctor.move.dto.DoctorImportBasicData; import io.terminus.doctor.move.dto.DoctorImportPigEvent; import io.terminus.doctor.move.dto.DoctorMoveBasicData; import io.terminus.doctor.move.model.View_EventListPig; import io.terminus.doctor.move.model.View_EventListSow; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Map; /** * Created by xjn on 17/8/4. * 断奶 */ @Component public class DoctorPigWeanInputBuilder implements DoctorPigEventInputBuilder { @Autowired private DoctorBuilderCommonOperation builderCommonOperation; @Override public BasePigEventInputDto buildFromMove(DoctorMoveBasicData moveBasicData, View_EventListPig pigRawEvent) { View_EventListSow event = (View_EventListSow) pigRawEvent; DoctorWeanDto wean = new DoctorWeanDto(); builderCommonOperation.fillPigEventCommonInput(wean, moveBasicData, pigRawEvent); wean.setPartWeanDate(event.getEventAt()); //断奶日期 wean.setPartWeanRemark(event.getRemark()); wean.setPartWeanPigletsCount(event.getWeanCount()); //断奶数量 wean.setFarrowingLiveCount(event.getWeanCount()); wean.setPartWeanAvgWeight(event.getWeanWeight()); //断奶平均重量 return wean; } @Override public BasePigEventInputDto buildFromImport(DoctorImportBasicData importBasicData, DoctorImportPigEvent importPigEvent) { DoctorWeanDto wean = new DoctorWeanDto(); builderCommonOperation.fillPigEventCommonInput(wean, importBasicData, importPigEvent); wean.setPartWeanDate(importPigEvent.getEventAt()); //断奶日期 wean.setPartWeanRemark(importPigEvent.getRemark()); wean.setFarrowingLiveCount(importPigEvent.getHealthyCount() + importPigEvent.getWeakCount()); wean.setPartWeanPigletsCount(importPigEvent.getPartWeanPigletsCount()); //断奶数量 wean.setPartWeanAvgWeight(importPigEvent.getPartWeanAvgWeight()); //断奶平均重量 wean.setWeanPigletsCount(0); if (!Strings.isNullOrEmpty(importPigEvent.getWeanToBarn())) { Map<String, DoctorBarn> barnMap = importBasicData.getBarnMap(); DoctorBarn weanToBarn = barnMap.get(importPigEvent.getWeanToBarn()); wean.setChgLocationToBarnId(weanToBarn.getId()); } return wean; } }
UTF-8
Java
2,806
java
DoctorPigWeanInputBuilder.java
Java
[ { "context": "mponent;\n\nimport java.util.Map;\n\n/**\n * Created by xjn on 17/8/4.\n * 断奶\n */\n@Component\npublic class Doct", "end": 769, "score": 0.9995938539505005, "start": 766, "tag": "USERNAME", "value": "xjn" } ]
null
[]
package io.terminus.doctor.move.builder.pig; import com.google.common.base.Strings; import io.terminus.doctor.event.dto.event.BasePigEventInputDto; import io.terminus.doctor.event.dto.event.sow.DoctorWeanDto; import io.terminus.doctor.event.model.DoctorBarn; import io.terminus.doctor.move.builder.DoctorBuilderCommonOperation; import io.terminus.doctor.move.dto.DoctorImportBasicData; import io.terminus.doctor.move.dto.DoctorImportPigEvent; import io.terminus.doctor.move.dto.DoctorMoveBasicData; import io.terminus.doctor.move.model.View_EventListPig; import io.terminus.doctor.move.model.View_EventListSow; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Map; /** * Created by xjn on 17/8/4. * 断奶 */ @Component public class DoctorPigWeanInputBuilder implements DoctorPigEventInputBuilder { @Autowired private DoctorBuilderCommonOperation builderCommonOperation; @Override public BasePigEventInputDto buildFromMove(DoctorMoveBasicData moveBasicData, View_EventListPig pigRawEvent) { View_EventListSow event = (View_EventListSow) pigRawEvent; DoctorWeanDto wean = new DoctorWeanDto(); builderCommonOperation.fillPigEventCommonInput(wean, moveBasicData, pigRawEvent); wean.setPartWeanDate(event.getEventAt()); //断奶日期 wean.setPartWeanRemark(event.getRemark()); wean.setPartWeanPigletsCount(event.getWeanCount()); //断奶数量 wean.setFarrowingLiveCount(event.getWeanCount()); wean.setPartWeanAvgWeight(event.getWeanWeight()); //断奶平均重量 return wean; } @Override public BasePigEventInputDto buildFromImport(DoctorImportBasicData importBasicData, DoctorImportPigEvent importPigEvent) { DoctorWeanDto wean = new DoctorWeanDto(); builderCommonOperation.fillPigEventCommonInput(wean, importBasicData, importPigEvent); wean.setPartWeanDate(importPigEvent.getEventAt()); //断奶日期 wean.setPartWeanRemark(importPigEvent.getRemark()); wean.setFarrowingLiveCount(importPigEvent.getHealthyCount() + importPigEvent.getWeakCount()); wean.setPartWeanPigletsCount(importPigEvent.getPartWeanPigletsCount()); //断奶数量 wean.setPartWeanAvgWeight(importPigEvent.getPartWeanAvgWeight()); //断奶平均重量 wean.setWeanPigletsCount(0); if (!Strings.isNullOrEmpty(importPigEvent.getWeanToBarn())) { Map<String, DoctorBarn> barnMap = importBasicData.getBarnMap(); DoctorBarn weanToBarn = barnMap.get(importPigEvent.getWeanToBarn()); wean.setChgLocationToBarnId(weanToBarn.getId()); } return wean; } }
2,806
0.745448
0.743627
62
43.290321
32.367538
125
false
false
0
0
0
0
0
0
0.693548
false
false
3
f73175f8efb2b37a7c02ef82456b481bc6f65a7f
1,829,656,085,744
53d9c1d7c3cd76163bb15159ca39c728efa7b04e
/src/main/java/io/sf/carte/doc/style/css/CSSRule.java
6dbe13d9ed844b78cf505f5be9cd8ad75180d220
[ "W3C", "W3C-20150513", "W3C-19980720", "BSD-2-Clause", "BSD-3-Clause" ]
permissive
css4j/css4j
https://github.com/css4j/css4j
da4101afefdb7a85d20bd838e616dd531552ce1f
6753465dc12fa5c44cf42223e074aba4d74e526c
refs/heads/master
2023-09-01T21:17:38.414000
2023-08-25T19:57:34
2023-08-25T19:57:34
197,003,044
8
0
BSD-3-Clause
false
2023-07-23T19:44:16
2019-07-15T13:21:43
2023-06-10T19:21:55
2023-07-23T19:44:15
8,267
9
0
1
Java
false
false
/* * This software extends interfaces defined by CSS Object Model draft * (https://www.w3.org/TR/cssom-1/). * Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang). * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * * Copyright © 2018 Carlos Amengual. * * SPDX-License-Identifier: W3C-20150513 */ package io.sf.carte.doc.style.css; import java.io.IOException; import io.sf.carte.doc.StringList; import io.sf.carte.util.SimpleWriter; /** * A CSS rule. * */ public interface CSSRule extends org.w3c.dom.css.CSSRule { /** * Rule is a <code>CSSUnknownRule</code>. */ short UNKNOWN_RULE = org.w3c.dom.css.CSSRule.UNKNOWN_RULE; /** * Rule is a {@link CSSStyleRule}. */ short STYLE_RULE = org.w3c.dom.css.CSSRule.STYLE_RULE; /** * Rule is a <code>CSSImportRule</code>. */ short IMPORT_RULE = org.w3c.dom.css.CSSRule.IMPORT_RULE; /** * Rule is a {@link CSSMediaRule}. */ short MEDIA_RULE = org.w3c.dom.css.CSSRule.MEDIA_RULE; /** * Rule is a {@link CSSFontFaceRule}. */ short FONT_FACE_RULE = org.w3c.dom.css.CSSRule.FONT_FACE_RULE; /** * Rule is a {@link CSSPageRule}. */ short PAGE_RULE = org.w3c.dom.css.CSSRule.PAGE_RULE; /** * Rule is a {@link CSSKeyframesRule}. */ short KEYFRAMES_RULE = 7; /** * Rule is a {@link CSSKeyframeRule}. */ short KEYFRAME_RULE = 8; /** * Rule is a {@link CSSMarginRule}. */ short MARGIN_RULE = 9; /** * Rule is a {@link CSSNamespaceRule}. */ short NAMESPACE_RULE = 10; /** * Rule is a {@link CSSCounterStyleRule}. */ short COUNTER_STYLE_RULE = 11; /** * Rule is a {@link CSSSupportsRule}. */ short SUPPORTS_RULE = 12; short DOCUMENT_RULE = 13; /** * Rule is a {@link CSSFontFeatureValuesRule}. */ short FONT_FEATURE_VALUES_RULE = 14; /** * Rule is a {@code @viewport} rule. * <p> * Note: {@code @viewport} rules were * <a href="https://github.com/w3c/csswg-drafts/issues/4766">removed by W3C in * February 2020</a>. * </p> */ short VIEWPORT_RULE = 15; short REGION_STYLE_RULE = 16; short CUSTOM_MEDIA_RULE = 17; short PROPERTY_RULE = 18; /** * A minified parsable textual representation of the rule. This reflects the current state * of the rule and not its initial value. * * @return the minified textual representation of the rule. */ String getMinifiedCssText(); /** * If this rule is contained inside another rule, return that rule. If it is not nested * inside any other rules, return <code>null</code>. * * @return the containing rule, if any, otherwise <code>null</code>. */ @Override CSSRule getParentRule(); /** * Get the style sheet that contains this rule. * * @return the style sheet, or null if no sheet contains this rule. */ @Override CSSStyleSheet<? extends CSSRule> getParentStyleSheet(); /** * Get a list of the comments that preceded this rule, if any. * * @return the list of comments, or <code>null</code> if there were no preceding * comments or the parsing was specified to ignore comments. * @see CSSStyleSheet#parseStyleSheet(java.io.Reader, short) */ StringList getPrecedingComments(); /** * Get a list of the comments that immediately follow this rule, if any. * <p> * If the parsing mode was {@code COMMENTS_PRECEDING}, or was * {@code COMMENTS_AUTO} and the next comment happens after a newline character, * it shall be assigned to the next rule as a preceding comment. * * @return the list of comments, or <code>null</code> if there were no trailing * comments or the parsing was specified to ignore comments. * @see CSSStyleSheet#parseStyleSheet(java.io.Reader, short) */ StringList getTrailingComments(); /** * Write a serialization of this rule to the given simple writer, according to the given * context. * * @param wri * the simple writer object. * @param context * the formatting context. * @throws IOException * if an error happened while writing. */ void writeCssText(SimpleWriter wri, StyleFormattingContext context) throws IOException; }
UTF-8
Java
4,114
java
CSSRule.java
Java
[ { "context": "right-software-and-document\n *\n * Copyright © 2018 Carlos Amengual.\n *\n * SPDX-License-Identifier: W3C-20150513\n */\n", "end": 279, "score": 0.9998847246170044, "start": 264, "tag": "NAME", "value": "Carlos Amengual" } ]
null
[]
/* * This software extends interfaces defined by CSS Object Model draft * (https://www.w3.org/TR/cssom-1/). * Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang). * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * * Copyright © 2018 <NAME>. * * SPDX-License-Identifier: W3C-20150513 */ package io.sf.carte.doc.style.css; import java.io.IOException; import io.sf.carte.doc.StringList; import io.sf.carte.util.SimpleWriter; /** * A CSS rule. * */ public interface CSSRule extends org.w3c.dom.css.CSSRule { /** * Rule is a <code>CSSUnknownRule</code>. */ short UNKNOWN_RULE = org.w3c.dom.css.CSSRule.UNKNOWN_RULE; /** * Rule is a {@link CSSStyleRule}. */ short STYLE_RULE = org.w3c.dom.css.CSSRule.STYLE_RULE; /** * Rule is a <code>CSSImportRule</code>. */ short IMPORT_RULE = org.w3c.dom.css.CSSRule.IMPORT_RULE; /** * Rule is a {@link CSSMediaRule}. */ short MEDIA_RULE = org.w3c.dom.css.CSSRule.MEDIA_RULE; /** * Rule is a {@link CSSFontFaceRule}. */ short FONT_FACE_RULE = org.w3c.dom.css.CSSRule.FONT_FACE_RULE; /** * Rule is a {@link CSSPageRule}. */ short PAGE_RULE = org.w3c.dom.css.CSSRule.PAGE_RULE; /** * Rule is a {@link CSSKeyframesRule}. */ short KEYFRAMES_RULE = 7; /** * Rule is a {@link CSSKeyframeRule}. */ short KEYFRAME_RULE = 8; /** * Rule is a {@link CSSMarginRule}. */ short MARGIN_RULE = 9; /** * Rule is a {@link CSSNamespaceRule}. */ short NAMESPACE_RULE = 10; /** * Rule is a {@link CSSCounterStyleRule}. */ short COUNTER_STYLE_RULE = 11; /** * Rule is a {@link CSSSupportsRule}. */ short SUPPORTS_RULE = 12; short DOCUMENT_RULE = 13; /** * Rule is a {@link CSSFontFeatureValuesRule}. */ short FONT_FEATURE_VALUES_RULE = 14; /** * Rule is a {@code @viewport} rule. * <p> * Note: {@code @viewport} rules were * <a href="https://github.com/w3c/csswg-drafts/issues/4766">removed by W3C in * February 2020</a>. * </p> */ short VIEWPORT_RULE = 15; short REGION_STYLE_RULE = 16; short CUSTOM_MEDIA_RULE = 17; short PROPERTY_RULE = 18; /** * A minified parsable textual representation of the rule. This reflects the current state * of the rule and not its initial value. * * @return the minified textual representation of the rule. */ String getMinifiedCssText(); /** * If this rule is contained inside another rule, return that rule. If it is not nested * inside any other rules, return <code>null</code>. * * @return the containing rule, if any, otherwise <code>null</code>. */ @Override CSSRule getParentRule(); /** * Get the style sheet that contains this rule. * * @return the style sheet, or null if no sheet contains this rule. */ @Override CSSStyleSheet<? extends CSSRule> getParentStyleSheet(); /** * Get a list of the comments that preceded this rule, if any. * * @return the list of comments, or <code>null</code> if there were no preceding * comments or the parsing was specified to ignore comments. * @see CSSStyleSheet#parseStyleSheet(java.io.Reader, short) */ StringList getPrecedingComments(); /** * Get a list of the comments that immediately follow this rule, if any. * <p> * If the parsing mode was {@code COMMENTS_PRECEDING}, or was * {@code COMMENTS_AUTO} and the next comment happens after a newline character, * it shall be assigned to the next rule as a preceding comment. * * @return the list of comments, or <code>null</code> if there were no trailing * comments or the parsing was specified to ignore comments. * @see CSSStyleSheet#parseStyleSheet(java.io.Reader, short) */ StringList getTrailingComments(); /** * Write a serialization of this rule to the given simple writer, according to the given * context. * * @param wri * the simple writer object. * @param context * the formatting context. * @throws IOException * if an error happened while writing. */ void writeCssText(SimpleWriter wri, StyleFormattingContext context) throws IOException; }
4,105
0.669424
0.654099
166
23.76506
25.765373
91
false
false
0
0
0
0
0
0
0.993976
false
false
3
7219c186ac89ff93dc11d6738776710573aaf295
12,077,448,091,159
0cc4ebcaa10d8d1591c5169e90eecf200669dd7d
/src/main/java/br/noelen/facul/Dinamica/pilha/appPilhaDinamica.java
5eaa17b6843c2c7180c22bd0a63db5ece8e74577
[]
no_license
NoelenG/EstruturaDadosRevisao
https://github.com/NoelenG/EstruturaDadosRevisao
94fd1b23200a4b5264c67af50f8c2aed92c48af4
4f566b4a7161061471c872b35c93cdf5d007e5d8
refs/heads/master
2022-11-05T09:50:21.825000
2020-06-14T22:56:58
2020-06-14T22:56:58
271,147,139
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.noelen.facul.Dinamica.pilha; public class appPilhaDinamica { public static void main(String[] args) { PilhaDinamica pilha = new PilhaDinamica(); pilha.push("A"); pilha.push("B"); pilha.push("C"); System.out.println(pilha.show()); System.out.println("Valor no Topo: " + pilha.peek()); while(!pilha.isEmpty()){ System.out.println(pilha.pop().getName()); } } }
UTF-8
Java
466
java
appPilhaDinamica.java
Java
[]
null
[]
package br.noelen.facul.Dinamica.pilha; public class appPilhaDinamica { public static void main(String[] args) { PilhaDinamica pilha = new PilhaDinamica(); pilha.push("A"); pilha.push("B"); pilha.push("C"); System.out.println(pilha.show()); System.out.println("Valor no Topo: " + pilha.peek()); while(!pilha.isEmpty()){ System.out.println(pilha.pop().getName()); } } }
466
0.564378
0.564378
20
22.35
20.209589
61
false
false
0
0
0
0
0
0
0.4
false
false
3
874ed915a40366efefbb7d14eb7df35c29d7cfac
4,088,808,892,593
cca60901835b77d39b9fddeab78223bb653cbf56
/src/main/java/reviews/fullstack/national/parks/Trip.java
bfd9d3e3489e0f4521b98e979d6152c29604568d
[]
no_license
nenafay/natpark-reviews-full-stack
https://github.com/nenafay/natpark-reviews-full-stack
6641092aecad4947625b0323ef633a69f4732d3e
a603eb3c6221e652508e1d5f138a0cedab8b356f
refs/heads/master
2020-03-22T10:10:40.463000
2018-07-24T04:43:06
2018-07-24T04:43:06
139,885,867
0
0
null
false
2018-07-11T01:34:11
2018-07-05T18:20:39
2018-07-09T05:53:22
2018-07-11T01:33:43
17,770
0
0
1
Java
false
null
package reviews.fullstack.national.parks; import java.util.ArrayList; import java.util.Collection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity public class Trip { @Id @GeneratedValue private long id; private String name; private String description; @OneToMany(mappedBy = "trip") private Collection<Review> reviews; private String imgUrl; public Trip() { } public Trip(String name, String description, String imgUrl) { this.name = name; this.description = description; this.imgUrl = imgUrl; this.reviews = new ArrayList<Review>(); } public long getId() { return id; } public String getName() { return name; } public String getDescription() { return description; } public String getImgUrl() { return imgUrl; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (id ^ (id >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Trip other = (Trip) obj; if (id != other.id) return false; return true; } public Collection<Review> getReviews() { System.out.println(reviews); return reviews; } public void setReviews(Collection<Review> reviews) { this.reviews = reviews; } }
UTF-8
Java
1,469
java
Trip.java
Java
[]
null
[]
package reviews.fullstack.national.parks; import java.util.ArrayList; import java.util.Collection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity public class Trip { @Id @GeneratedValue private long id; private String name; private String description; @OneToMany(mappedBy = "trip") private Collection<Review> reviews; private String imgUrl; public Trip() { } public Trip(String name, String description, String imgUrl) { this.name = name; this.description = description; this.imgUrl = imgUrl; this.reviews = new ArrayList<Review>(); } public long getId() { return id; } public String getName() { return name; } public String getDescription() { return description; } public String getImgUrl() { return imgUrl; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (int) (id ^ (id >>> 32)); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Trip other = (Trip) obj; if (id != other.id) return false; return true; } public Collection<Review> getReviews() { System.out.println(reviews); return reviews; } public void setReviews(Collection<Review> reviews) { this.reviews = reviews; } }
1,469
0.684139
0.680735
85
16.282352
14.77248
62
false
false
0
0
0
0
0
0
1.576471
false
false
3
dcc81dd2f1b6dd48771061639428af686e3675d4
3,401,614,149,040
2b8f3475e497931bd8192e20bcf217970589dbf9
/ITP_Hotel-Backend/src/main/java/com/itp/hotel/repository/PaymentRepository.java
662c3127fbb7e1a2f9c3be298dafdcf059454a1b
[]
no_license
Anjali-Weerasinghe/Online-Hotel-Management-Syatem
https://github.com/Anjali-Weerasinghe/Online-Hotel-Management-Syatem
28d72ced915dbff6a1041e6d32d71096fccc572f
ae5a023b473708bb0d058791f24228d47c8673c8
refs/heads/master
2023-06-11T01:46:33.930000
2021-07-10T09:56:01
2021-07-10T09:56:01
384,665,092
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.itp.hotel.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.itp.hotel.model.Payment; public interface PaymentRepository extends JpaRepository<Payment, Integer> { }
UTF-8
Java
215
java
PaymentRepository.java
Java
[]
null
[]
package com.itp.hotel.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.itp.hotel.model.Payment; public interface PaymentRepository extends JpaRepository<Payment, Integer> { }
215
0.823256
0.823256
9
22.888889
28.081011
76
false
false
0
0
0
0
0
0
0.444444
false
false
3
3dc5771ecb14cd1cf3b192578b993e5606e83f9e
4,836,133,177,079
1a9846eeb89744f8fd8ec6917fb12b8be134fc08
/src/main/java/com/hongxin/utils/PageView.java
ccd32fce27ae83db0bc77e2d4947798f9978d205
[]
no_license
gaojun6854/hongxinCRM
https://github.com/gaojun6854/hongxinCRM
f23a2a66f8e487a993071226b60f5bd75a561bfd
bb3f6c32fa0f53d7d39c774fdbb79f133bc81f13
refs/heads/master
2021-01-16T22:02:13.824000
2016-10-13T05:33:00
2016-10-13T05:33:00
61,047,180
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hongxin.utils; import java.util.List; /** * 在Action里的调用方法 //这里必须要构造新对象,不然刚打开没有currentPage参数传递过来,如果不新建也行,第一次打开必须传递currentPage参数过来 private PageView<T>pageView=new PageView<T>(); public PageView<T> getPageView() { return pageView; } public void setPageView(PageView<T> pageView) { this.pageView = pageView; } int maxresult=1; int firstindex=(pageView.getCurrentPage()-1)*maxresult; QueryResult<T> Service.getScrollData(firstindex,maxresult, null, null, null); pageView.setQueryResult(maxresult,qr); request.put("pageView", pageView); */ public class PageView<T> { /** 分页数据 **/ private List<T> records; /** 页码开始索引 ,例如显示第1 2 3 4 5 6 7 8 9 ,开始索引为1 **/ private long startIndex; /** 页码结束索引 ,例如显示第1 2 3 4 5 6 7 8 9 ,结束索引为9 **/ private long endIndex; /** 总页数 ,没有0页,所以设置默认值为1 **/ private long totalPage = 1; /** 每页显示记录数 **/ private int maxResult = 10; /** 当前页 **/ private int currentPage = 1; /** 总记录数 **/ private long totalRecord; /** 工具条上显示的页码数量 **/ private int pageBarSize = 8; // 这只方法触发记录查询结果和总条数 public void setQueryResult(int maxResult,QueryResult<T> qr) { this.maxResult = maxResult; this.records = qr.getResultlist(); this.totalRecord = qr.getTotalrecord(); this.totalPage = this.totalRecord % this.maxResult == 0 ? this.totalRecord/ this.maxResult : this.totalRecord / this.maxResult + 1; /*****************************************************/ this.startIndex = currentPage - (pageBarSize % 2 == 0 ? pageBarSize / 2 - 1 : pageBarSize / 2); this.endIndex = currentPage + pageBarSize / 2; if (startIndex < 1) { startIndex = 1; if (totalPage >= pageBarSize) endIndex = pageBarSize; else endIndex = totalPage; } if (endIndex > totalPage) { endIndex = totalPage; if ((endIndex - pageBarSize) > 0) startIndex = endIndex - pageBarSize +1; //最后一页显示多小条页 else startIndex = 1; } } public List<T> getRecords() { return records; } public void setRecords(List<T> records) { this.records = records; } public long getStartIndex() { return startIndex; } public void setStartIndex(long startIndex) { this.startIndex = startIndex; } public long getEndIndex() { return endIndex; } public void setEndIndex(long endIndex) { this.endIndex = endIndex; } public long getTotalPage() { return totalPage; } public void setTotalPage(long totalPage) { this.totalPage = totalPage; } public int getMaxResult() { return maxResult; } public void setMaxResult(int maxResult) { this.maxResult = maxResult; } public int getCurrentPage() { return currentPage; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage<1?1:currentPage; //如果当前页为0,则显示第一页 } public long getTotalRecord() { return totalRecord; } public void setTotalRecord(long totalRecord) { this.totalRecord = totalRecord; } public int getPageBarSize() { return pageBarSize; } public void setPageBarSize(int pageBarSize) { this.pageBarSize = pageBarSize; } }
UTF-8
Java
3,502
java
PageView.java
Java
[]
null
[]
package com.hongxin.utils; import java.util.List; /** * 在Action里的调用方法 //这里必须要构造新对象,不然刚打开没有currentPage参数传递过来,如果不新建也行,第一次打开必须传递currentPage参数过来 private PageView<T>pageView=new PageView<T>(); public PageView<T> getPageView() { return pageView; } public void setPageView(PageView<T> pageView) { this.pageView = pageView; } int maxresult=1; int firstindex=(pageView.getCurrentPage()-1)*maxresult; QueryResult<T> Service.getScrollData(firstindex,maxresult, null, null, null); pageView.setQueryResult(maxresult,qr); request.put("pageView", pageView); */ public class PageView<T> { /** 分页数据 **/ private List<T> records; /** 页码开始索引 ,例如显示第1 2 3 4 5 6 7 8 9 ,开始索引为1 **/ private long startIndex; /** 页码结束索引 ,例如显示第1 2 3 4 5 6 7 8 9 ,结束索引为9 **/ private long endIndex; /** 总页数 ,没有0页,所以设置默认值为1 **/ private long totalPage = 1; /** 每页显示记录数 **/ private int maxResult = 10; /** 当前页 **/ private int currentPage = 1; /** 总记录数 **/ private long totalRecord; /** 工具条上显示的页码数量 **/ private int pageBarSize = 8; // 这只方法触发记录查询结果和总条数 public void setQueryResult(int maxResult,QueryResult<T> qr) { this.maxResult = maxResult; this.records = qr.getResultlist(); this.totalRecord = qr.getTotalrecord(); this.totalPage = this.totalRecord % this.maxResult == 0 ? this.totalRecord/ this.maxResult : this.totalRecord / this.maxResult + 1; /*****************************************************/ this.startIndex = currentPage - (pageBarSize % 2 == 0 ? pageBarSize / 2 - 1 : pageBarSize / 2); this.endIndex = currentPage + pageBarSize / 2; if (startIndex < 1) { startIndex = 1; if (totalPage >= pageBarSize) endIndex = pageBarSize; else endIndex = totalPage; } if (endIndex > totalPage) { endIndex = totalPage; if ((endIndex - pageBarSize) > 0) startIndex = endIndex - pageBarSize +1; //最后一页显示多小条页 else startIndex = 1; } } public List<T> getRecords() { return records; } public void setRecords(List<T> records) { this.records = records; } public long getStartIndex() { return startIndex; } public void setStartIndex(long startIndex) { this.startIndex = startIndex; } public long getEndIndex() { return endIndex; } public void setEndIndex(long endIndex) { this.endIndex = endIndex; } public long getTotalPage() { return totalPage; } public void setTotalPage(long totalPage) { this.totalPage = totalPage; } public int getMaxResult() { return maxResult; } public void setMaxResult(int maxResult) { this.maxResult = maxResult; } public int getCurrentPage() { return currentPage; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage<1?1:currentPage; //如果当前页为0,则显示第一页 } public long getTotalRecord() { return totalRecord; } public void setTotalRecord(long totalRecord) { this.totalRecord = totalRecord; } public int getPageBarSize() { return pageBarSize; } public void setPageBarSize(int pageBarSize) { this.pageBarSize = pageBarSize; } }
3,502
0.650316
0.636076
139
20.733812
21.790228
133
false
false
0
0
0
0
0
0
1.582734
false
false
3
8bc91f5d3302d8ff8b18716f4324ccc41a42ac5b
11,003,706,257,207
c056ff72e4df0d1a8d58042d7a055cd4e63b5484
/src/main/java/pl/henszke/jukebox/application/TrackRepository.java
9154f02b1237d3993afe6faa6e94b832b589cb61
[]
no_license
WojtekHenszke/jukebox
https://github.com/WojtekHenszke/jukebox
adf9ccec1573104192031187cd360caa93678dff
90e53584684d3c510309f4b46e7129bd458db060
refs/heads/master
2022-07-19T06:57:49.838000
2019-10-27T09:07:26
2019-10-27T09:07:26
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pl.henszke.jukebox.application; import pl.henszke.jukebox.model.Track; import org.springframework.data.repository.CrudRepository; public interface TrackRepository extends CrudRepository<Track,Integer> { }
UTF-8
Java
216
java
TrackRepository.java
Java
[]
null
[]
package pl.henszke.jukebox.application; import pl.henszke.jukebox.model.Track; import org.springframework.data.repository.CrudRepository; public interface TrackRepository extends CrudRepository<Track,Integer> { }
216
0.837963
0.837963
8
26
27.62698
72
false
false
0
0
0
0
0
0
0.5
false
false
3
7eaca4edbaed94c914f156cc5af66bf6c8f07d55
26,938,034,948,619
fff4808682afd6a5c3555d47d1382bc564f0b795
/matriz/CadastrandoTarefas.java
7168cf4b4940cd0a4fc98a29b6f5cd6d72672f3f
[ "MIT" ]
permissive
Mikael-GIT/LogicadeProgramacao
https://github.com/Mikael-GIT/LogicadeProgramacao
779c44283d8d4cd318bdde42d94155eb0539da56
a908971548ebf3c41c5676573bd4bba364319ee4
refs/heads/master
2023-02-13T15:41:40.266000
2021-01-04T18:36:57
2021-01-04T18:36:57
255,976,201
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package MatrizDe1Dimensao; import javax.swing.JOptionPane; public class CadastrandoTarefas { public static void main(String[] args) { String [] tarefas = new String[6]; for (int i = 1; i < tarefas.length; i++) { tarefas [i] = JOptionPane.showInputDialog( "Digite a " + i + "° tarefa mais importante do dia."); } System.out.println("Principais tarefas do dia: "); for (int j = 0; j < tarefas.length; j++) { System.out.println(tarefas[j]); } } }
WINDOWS-1252
Java
493
java
CadastrandoTarefas.java
Java
[]
null
[]
package MatrizDe1Dimensao; import javax.swing.JOptionPane; public class CadastrandoTarefas { public static void main(String[] args) { String [] tarefas = new String[6]; for (int i = 1; i < tarefas.length; i++) { tarefas [i] = JOptionPane.showInputDialog( "Digite a " + i + "° tarefa mais importante do dia."); } System.out.println("Principais tarefas do dia: "); for (int j = 0; j < tarefas.length; j++) { System.out.println(tarefas[j]); } } }
493
0.626016
0.617886
19
23.894737
20.66753
59
false
false
0
0
0
0
0
0
1.842105
false
false
3
8ffd076b66fa54f6b3c9bd6bf2a3b20a098a8d2e
721,554,562,629
36279ea25057a0776a2221304df0c64b18323696
/SecurityFrontend/src/main/java/com/niit/Controller/SupplierController.java
f679cf10e7f5356b845f110b756069d6307b9bc3
[]
no_license
vibhormehta07/ShopOn-Ecommerce
https://github.com/vibhormehta07/ShopOn-Ecommerce
bbae78c00722909dd7167babb1509a7dc4c5aea3
967c9bade3ce0a6913c922046d1e7b153ab9e3c0
refs/heads/master
2020-03-26T03:09:52.080000
2018-08-12T06:06:37
2018-08-12T06:06:37
144,442,280
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.niit.Controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.niit.dao.SupplierDAO; import com.niit.model.Supplier; @Controller public class SupplierController{ @Autowired SupplierDAO supplierDAO; boolean flag=false; @RequestMapping(value="/supplier") public String showSupplierPage(Model m) { flag=false; List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); m.addAttribute("flag",flag); return "Supplier"; } @RequestMapping(value="/Insertsupplier", method=RequestMethod.POST) public String insertsupplier(@RequestParam("supname")String supplierName,@RequestParam ("supaddr")String supplierAddr,Model m) { flag=false; Supplier supplier =new Supplier(); supplier.setSupplierName(supplierName) ; supplier.setSupplierAddr(supplierAddr) ; supplierDAO.addSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); return "Supplier"; } @RequestMapping(value="/deletesupplier/{supplierId}") public String deletesupplier(@PathVariable("supplierId") int supplierId,Model m) { flag=false; Supplier supplier=supplierDAO.getSupplier(supplierId); supplierDAO.deleteSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); return "Supplier"; } @RequestMapping(value="/editSupplier/{supplierId}") public String editsupplier(@PathVariable("supplierId") int supplierId,Model m) { flag=true; Supplier supplier=supplierDAO.getSupplier(supplierId); m.addAttribute("supplierData", supplier); m.addAttribute("flag",flag); return "Supplier"; } @RequestMapping(value="/updateSupplier/{supplierId}", method=RequestMethod.POST) public String updatesupplier(@PathVariable("supplierId") int supplierId,@RequestParam("supname") String supplierName,@RequestParam("supAddr") String supplierAddr,Model m) { System.out.println("update intiated"); Supplier supplier=supplierDAO.getSupplier(supplierId); supplier.setSupplierName(supplierName); supplier.setSupplierAddr(supplierAddr); supplierDAO.updateSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); System.out.println("update done"); return "Supplier"; } }
UTF-8
Java
2,808
java
SupplierController.java
Java
[]
null
[]
package com.niit.Controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.niit.dao.SupplierDAO; import com.niit.model.Supplier; @Controller public class SupplierController{ @Autowired SupplierDAO supplierDAO; boolean flag=false; @RequestMapping(value="/supplier") public String showSupplierPage(Model m) { flag=false; List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); m.addAttribute("flag",flag); return "Supplier"; } @RequestMapping(value="/Insertsupplier", method=RequestMethod.POST) public String insertsupplier(@RequestParam("supname")String supplierName,@RequestParam ("supaddr")String supplierAddr,Model m) { flag=false; Supplier supplier =new Supplier(); supplier.setSupplierName(supplierName) ; supplier.setSupplierAddr(supplierAddr) ; supplierDAO.addSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); return "Supplier"; } @RequestMapping(value="/deletesupplier/{supplierId}") public String deletesupplier(@PathVariable("supplierId") int supplierId,Model m) { flag=false; Supplier supplier=supplierDAO.getSupplier(supplierId); supplierDAO.deleteSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); return "Supplier"; } @RequestMapping(value="/editSupplier/{supplierId}") public String editsupplier(@PathVariable("supplierId") int supplierId,Model m) { flag=true; Supplier supplier=supplierDAO.getSupplier(supplierId); m.addAttribute("supplierData", supplier); m.addAttribute("flag",flag); return "Supplier"; } @RequestMapping(value="/updateSupplier/{supplierId}", method=RequestMethod.POST) public String updatesupplier(@PathVariable("supplierId") int supplierId,@RequestParam("supname") String supplierName,@RequestParam("supAddr") String supplierAddr,Model m) { System.out.println("update intiated"); Supplier supplier=supplierDAO.getSupplier(supplierId); supplier.setSupplierName(supplierName); supplier.setSupplierAddr(supplierAddr); supplierDAO.updateSupplier(supplier); List<Supplier> listSupplier=supplierDAO.listSupplier(); m.addAttribute("supplierlist", listSupplier); System.out.println("update done"); return "Supplier"; } }
2,808
0.766026
0.766026
79
34.506329
29.992773
173
false
false
0
0
0
0
0
0
0.78481
false
false
3
b2ae34b53b128a46ee6c7c226bf01413cad16524
24,816,321,086,580
1d065a36d249a5012d60626ba6b30ae8003515fa
/app/src/main/java/com/neelk/fbla2018/Question.java
02e1272f157249e084ebaad3e2313cabe9c7b206
[ "MIT" ]
permissive
neelkandlikar/Athena
https://github.com/neelkandlikar/Athena
bab26b9263076cac04577e8ccdad8a10f22b35a6
beaddb9ce695015a60813d0e6bc4eccf2450b58a
refs/heads/master
2021-08-16T07:18:54.543000
2020-05-01T21:19:39
2020-05-01T21:19:39
172,153,723
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.neelk.fbla2018; import java.util.HashMap; /* * Copyright © 2019 Neel Kandlikar. All rights reserved. */ public class Question { private String question; private String category; private char correctAnswer; private HashMap<Character, String> options; private boolean bonusQuestion; public Question(String question, String category, boolean bonusQuestion) { options = new HashMap<>(); this.question = question; this.category = category; this.bonusQuestion = bonusQuestion; } public void addOption(char option, String answer) { options.put(option, answer); } public void setCorrectAnswer(char correctAnswer) { this.correctAnswer = correctAnswer; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public char getCorrectAnswer() { return correctAnswer; } public HashMap<Character, String> getOptions() { return options; } public void setOptions(HashMap<Character, String> options) { this.options = options; } @Override public String toString() { return "Question=" + question + ", " + "Options= " + options + ", " + "correctAnswer=" + correctAnswer + ", " + "isBonusQuestion=" + bonusQuestion; } public boolean isBonusQuestion() { return bonusQuestion; } }
UTF-8
Java
1,617
java
Question.java
Java
[ { "context": "\nimport java.util.HashMap;\n\n/*\n * Copyright © 2019 Neel Kandlikar. All rights reserved.\n */\n\n\npublic class Question", "end": 93, "score": 0.9998905658721924, "start": 79, "tag": "NAME", "value": "Neel Kandlikar" } ]
null
[]
package com.neelk.fbla2018; import java.util.HashMap; /* * Copyright © 2019 <NAME>. All rights reserved. */ public class Question { private String question; private String category; private char correctAnswer; private HashMap<Character, String> options; private boolean bonusQuestion; public Question(String question, String category, boolean bonusQuestion) { options = new HashMap<>(); this.question = question; this.category = category; this.bonusQuestion = bonusQuestion; } public void addOption(char option, String answer) { options.put(option, answer); } public void setCorrectAnswer(char correctAnswer) { this.correctAnswer = correctAnswer; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public char getCorrectAnswer() { return correctAnswer; } public HashMap<Character, String> getOptions() { return options; } public void setOptions(HashMap<Character, String> options) { this.options = options; } @Override public String toString() { return "Question=" + question + ", " + "Options= " + options + ", " + "correctAnswer=" + correctAnswer + ", " + "isBonusQuestion=" + bonusQuestion; } public boolean isBonusQuestion() { return bonusQuestion; } }
1,609
0.639009
0.634056
69
22.405798
25.391611
155
false
false
0
0
0
0
0
0
0.463768
false
false
3
b970b205fad96622e8e9f2836721ea50a98b9476
8,718,783,666,418
4d4ed48d1a7118edbd8a3103bd88ea0fc393e1b2
/src/main/java/cc/ethon/coldspot/backend/cpp/CppClassNameUtil.java
b644955e4a5af4ef42d42a143499810d62e6f9c6
[]
no_license
Ethon/ColdSpot
https://github.com/Ethon/ColdSpot
6c9297b95f5694fbbfdb8b92df8003c6f356ae86
29905e5974bcb5959c8a75a208237928c864a0ab
refs/heads/master
2020-06-10T17:03:01.225000
2016-12-16T20:27:12
2016-12-16T20:27:12
75,927,717
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cc.ethon.coldspot.backend.cpp; import java.util.Arrays; import java.util.stream.Collectors; import cc.ethon.coldspot.common.ClassName; class CppClassNameUtil { public static String makeIncludeGuardName(ClassName name) { final String packagePart = Arrays.stream(name.getPackageParts()).map(part -> part.toUpperCase()).collect(Collectors.joining("_")); return packagePart + "_" + name.getName().toUpperCase() + "_HPP"; } public static String makeQualifiedName(ClassName name) { final String packagePart = Arrays.stream(name.getPackageParts()).collect(Collectors.joining("::")); return packagePart + "::" + name.getName(); } }
UTF-8
Java
650
java
CppClassNameUtil.java
Java
[]
null
[]
package cc.ethon.coldspot.backend.cpp; import java.util.Arrays; import java.util.stream.Collectors; import cc.ethon.coldspot.common.ClassName; class CppClassNameUtil { public static String makeIncludeGuardName(ClassName name) { final String packagePart = Arrays.stream(name.getPackageParts()).map(part -> part.toUpperCase()).collect(Collectors.joining("_")); return packagePart + "_" + name.getName().toUpperCase() + "_HPP"; } public static String makeQualifiedName(ClassName name) { final String packagePart = Arrays.stream(name.getPackageParts()).collect(Collectors.joining("::")); return packagePart + "::" + name.getName(); } }
650
0.744615
0.744615
20
31.5
36.562958
132
false
false
0
0
0
0
0
0
1
false
false
3
b6531a97af57595aef9607404cc8c190281cbcda
23,433,341,598,629
7f5a803864d455006b2d3caeff7204f01c1f081d
/Modularis/src/com/ril/service/GammeService.java
781f2551f54cf169aadd23b0b3aa10aafbe37882
[]
no_license
SebTuc/PFR_Madera_CesiLeMans
https://github.com/SebTuc/PFR_Madera_CesiLeMans
c298d0d73ea33222660ecc9bbb87f98af6b861a8
8f7afe72944c36025e1249d39a2edab26d812493
refs/heads/master
2020-03-24T23:02:51.005000
2019-04-09T20:57:12
2019-04-09T20:57:12
143,115,588
2
1
null
false
2019-04-09T20:57:13
2018-08-01T06:49:32
2019-04-02T16:25:14
2019-04-09T20:57:13
50,128
0
1
0
Java
false
false
package com.ril.service; import java.util.List; import com.ril.daoHibernate.GammeHome; import com.ril.model.Gamme; public class GammeService { public int addGamme(String nom) { GammeHome dao = new GammeHome(); if(nom != null) { Gamme gamme = new Gamme(nom); dao.persist(gamme); return gamme.getGammeId(); } else { return -1; } } public void editGamme(Gamme gamme) { GammeHome dao = new GammeHome(); if(gamme != null) { dao.merge(gamme); } } public void removeGammeById(Integer id) { GammeHome dao = new GammeHome(); if(id != null) { Gamme gamme = getGammeById(id); dao.remove(gamme); } } public void removeGamme(Gamme gamme) { GammeHome dao = new GammeHome(); if(gamme != null) { dao.remove(gamme); } } public Gamme getGammeById(Integer id) { GammeHome dao = new GammeHome(); return dao.findById(id); } public List<Gamme> getAllGammes(){ GammeHome dao = new GammeHome(); return dao.findAll(); } }
UTF-8
Java
1,045
java
GammeService.java
Java
[]
null
[]
package com.ril.service; import java.util.List; import com.ril.daoHibernate.GammeHome; import com.ril.model.Gamme; public class GammeService { public int addGamme(String nom) { GammeHome dao = new GammeHome(); if(nom != null) { Gamme gamme = new Gamme(nom); dao.persist(gamme); return gamme.getGammeId(); } else { return -1; } } public void editGamme(Gamme gamme) { GammeHome dao = new GammeHome(); if(gamme != null) { dao.merge(gamme); } } public void removeGammeById(Integer id) { GammeHome dao = new GammeHome(); if(id != null) { Gamme gamme = getGammeById(id); dao.remove(gamme); } } public void removeGamme(Gamme gamme) { GammeHome dao = new GammeHome(); if(gamme != null) { dao.remove(gamme); } } public Gamme getGammeById(Integer id) { GammeHome dao = new GammeHome(); return dao.findById(id); } public List<Gamme> getAllGammes(){ GammeHome dao = new GammeHome(); return dao.findAll(); } }
1,045
0.618182
0.617225
72
13.513889
14.136235
42
false
false
0
0
0
0
0
0
1.930556
false
false
3
704bc8294dcf8cfbe6f708e105a2878aa6db8919
25,958,782,387,928
8358d7d5a6bb840a352ba12adb23d15ea81cd3f5
/Problem65_ValidNumber.java
3de9b84efb8b11904ff92efb99a176ed75e7495c
[]
no_license
lancecm/leetcodes
https://github.com/lancecm/leetcodes
3fa38079321bad0c909917a4703a1324e8cddd15
6d0fa3bd40d81bfffc154be1bbf437eb5be1f915
refs/heads/master
2020-03-22T00:33:21.390000
2019-07-16T07:00:19
2019-07-16T07:00:19
139,252,100
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package LeetCode; /** * @author Srunkyo * @Date: 2018/8/24 * @Description: * Hard * * Validate if a given string is numeric. * * Some examples: * "0" => true * " 0.1 " => true * "abc" => false * "1 a" => false * "2e10" => true * * Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. * * Update (2015-02-10): * The signature of the C++ function had been updated. If you still see your function signature accepts a const char * argument, please click the reload button to reset your code definition. */ public class Problem65_ValidNumber { public boolean isNumber(String s) { s = s.trim(); boolean point = false; boolean e = false; boolean num = false; boolean numAfterE = false; for (int i = 0; i < s.length(); i++) { if ('0' <= s.charAt(i) && s.charAt(i) <= '9') { num = true; numAfterE = true; } else if (s.charAt(i) == '.') { if (e || point) return false; point = true; // 点的前面不能存在点或者E } else if (s.charAt(i) == 'e') { if (e || !num) return false; // e的前面必须存在数字且前面不能存在e numAfterE = false; e = true; } else if (s.charAt(i) == '+' || s.charAt(i) == '-') { if (i != 0 && s.charAt(i - 1) != 'e') { // -1. 正负号可以放在首位充当正负,或者在10e+19里面充当符号,共两种存在情况 return false; } } else return false; } return num && numAfterE; // 0e->false 9->true 最后要检查如果是xex,e的前后数字都要出现。如果是普通数字的话,本身没有遇到e改变flag,所以返回真值 } }
UTF-8
Java
1,935
java
Problem65_ValidNumber.java
Java
[ { "context": "package LeetCode;\n\n/**\n * @author Srunkyo\n * @Date: 2018/8/24\n * @Description:\n * Hard\n *\n ", "end": 41, "score": 0.9997012615203857, "start": 34, "tag": "NAME", "value": "Srunkyo" } ]
null
[]
package LeetCode; /** * @author Srunkyo * @Date: 2018/8/24 * @Description: * Hard * * Validate if a given string is numeric. * * Some examples: * "0" => true * " 0.1 " => true * "abc" => false * "1 a" => false * "2e10" => true * * Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before implementing one. * * Update (2015-02-10): * The signature of the C++ function had been updated. If you still see your function signature accepts a const char * argument, please click the reload button to reset your code definition. */ public class Problem65_ValidNumber { public boolean isNumber(String s) { s = s.trim(); boolean point = false; boolean e = false; boolean num = false; boolean numAfterE = false; for (int i = 0; i < s.length(); i++) { if ('0' <= s.charAt(i) && s.charAt(i) <= '9') { num = true; numAfterE = true; } else if (s.charAt(i) == '.') { if (e || point) return false; point = true; // 点的前面不能存在点或者E } else if (s.charAt(i) == 'e') { if (e || !num) return false; // e的前面必须存在数字且前面不能存在e numAfterE = false; e = true; } else if (s.charAt(i) == '+' || s.charAt(i) == '-') { if (i != 0 && s.charAt(i - 1) != 'e') { // -1. 正负号可以放在首位充当正负,或者在10e+19里面充当符号,共两种存在情况 return false; } } else return false; } return num && numAfterE; // 0e->false 9->true 最后要检查如果是xex,e的前后数字都要出现。如果是普通数字的话,本身没有遇到e改变flag,所以返回真值 } }
1,935
0.514731
0.493934
53
31.660378
34.565739
190
false
false
0
0
0
0
0
0
0.471698
false
false
3
1a4e92d69b8ad6195744ebc5810ed0ac17878944
26,560,077,798,935
f63d0bcf4ec32235dc9d2d0985031edb6508a537
/src/main/java/com/theerut/springj11/SpringJ11Application.java
50448eb4514498c95e2dcf8992ba46410843fd50
[]
no_license
fulloption55/spring-j11
https://github.com/fulloption55/spring-j11
c2fe88b444625c0307d821de02be75cf370c5d38
c06e361e84b07cbcd816a8b03e74ac52cd6c56a3
refs/heads/master
2022-12-24T17:05:29.923000
2020-10-01T04:29:25
2020-10-01T04:29:25
300,141,449
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.theerut.springj11; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringJ11Application { public static void main(String[] args) { SpringApplication.run(SpringJ11Application.class, args); } }
UTF-8
Java
332
java
SpringJ11Application.java
Java
[]
null
[]
package com.theerut.springj11; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringJ11Application { public static void main(String[] args) { SpringApplication.run(SpringJ11Application.class, args); } }
332
0.795181
0.777108
13
24.538462
24.749872
68
false
false
0
0
0
0
0
0
0.384615
false
false
3
7fdd11177e0d7149865061995e4164ac8b5217b6
15,822,659,590,062
37f38a0345abeda5f4145203fb02bac0feacb88e
/src/main/java/com/qouteall/immersive_portals/mixin_client/MixinCPlayerPacketRotationPacket.java
aae6ccb599d721dc601a4c4c7007950c565af956
[ "MIT" ]
permissive
Jack-Tommaney/ImmersivePortalsModForForge
https://github.com/Jack-Tommaney/ImmersivePortalsModForForge
4554d1501c93399a6d294735496a71098371dc74
e16b69739d63d53da7628aea4f4be26d6dbafbd4
refs/heads/master
2023-05-10T17:19:30.034000
2020-01-31T12:14:11
2020-01-31T12:14:11
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.qouteall.immersive_portals.mixin_client; import com.qouteall.immersive_portals.ducks.IEPlayerMoveC2SPacket; import net.minecraft.client.Minecraft; import net.minecraft.network.play.client.CPlayerPacket; import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @OnlyIn(Dist.CLIENT) @Mixin(value = CPlayerPacket.RotationPacket.class) public class MixinCPlayerPacketRotationPacket { @OnlyIn(Dist.CLIENT) @Inject( method = "<init>(FFZ)V", at = @At("RETURN") ) private void onConstruct(float float_1, float float_2, boolean boolean_1, CallbackInfo ci) { DimensionType dimension = Minecraft.getInstance().player.dimension; ((IEPlayerMoveC2SPacket) this).setPlayerDimension(dimension); assert dimension == Minecraft.getInstance().world.dimension.getType(); } }
UTF-8
Java
1,141
java
MixinCPlayerPacketRotationPacket.java
Java
[]
null
[]
package com.qouteall.immersive_portals.mixin_client; import com.qouteall.immersive_portals.ducks.IEPlayerMoveC2SPacket; import net.minecraft.client.Minecraft; import net.minecraft.network.play.client.CPlayerPacket; import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @OnlyIn(Dist.CLIENT) @Mixin(value = CPlayerPacket.RotationPacket.class) public class MixinCPlayerPacketRotationPacket { @OnlyIn(Dist.CLIENT) @Inject( method = "<init>(FFZ)V", at = @At("RETURN") ) private void onConstruct(float float_1, float float_2, boolean boolean_1, CallbackInfo ci) { DimensionType dimension = Minecraft.getInstance().player.dimension; ((IEPlayerMoveC2SPacket) this).setPlayerDimension(dimension); assert dimension == Minecraft.getInstance().world.dimension.getType(); } }
1,141
0.768624
0.764242
29
38.344826
26.513855
96
false
false
0
0
0
0
0
0
0.62069
false
false
3
06c933ab12441a5a9581b2ef4a4ee72174b17418
3,813,930,981,503
b727ddf6881725ba1af1f4ce563adfba1109d208
/src/oop/library/models/Magazine.java
e0fc7274ad50a87f5bd0b99a84c2c47dbba2de9d
[]
no_license
anaCap23/JavaBasic
https://github.com/anaCap23/JavaBasic
520c4b87d6730095fff57f98af812b6b10ed7ea4
3780812693e7cf7eb88f4fe122d311a31731ef2f
refs/heads/master
2020-03-30T09:24:48.780000
2019-03-11T12:58:37
2019-03-11T12:58:37
151,074,375
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package oop.library.models; import java.time.LocalDate; public class Magazine extends Edition { private LocalDate dateOfEdit; private String serialNumber; public Magazine(String year, String author, String path, String name, LocalDate dateOfEdit, String serialNumber) { super(year, author, path, name); this.dateOfEdit = dateOfEdit; this.serialNumber = serialNumber; } @Override public String toString() { return "[Magazine]" + " - " + getYear() + " - " + getAuthor() + " - " + getPath() + " - " + getName() + " - " + getDatoOfEdit() + " - " + getSerialNumber(); } public LocalDate getDatoOfEdit() { return dateOfEdit; } public void setDatoOfEdit(LocalDate datoOfEdit) { this.dateOfEdit = datoOfEdit; } public String getSerialNumber() { return serialNumber; } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } }
UTF-8
Java
997
java
Magazine.java
Java
[]
null
[]
package oop.library.models; import java.time.LocalDate; public class Magazine extends Edition { private LocalDate dateOfEdit; private String serialNumber; public Magazine(String year, String author, String path, String name, LocalDate dateOfEdit, String serialNumber) { super(year, author, path, name); this.dateOfEdit = dateOfEdit; this.serialNumber = serialNumber; } @Override public String toString() { return "[Magazine]" + " - " + getYear() + " - " + getAuthor() + " - " + getPath() + " - " + getName() + " - " + getDatoOfEdit() + " - " + getSerialNumber(); } public LocalDate getDatoOfEdit() { return dateOfEdit; } public void setDatoOfEdit(LocalDate datoOfEdit) { this.dateOfEdit = datoOfEdit; } public String getSerialNumber() { return serialNumber; } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } }
997
0.625878
0.625878
36
26.722221
28.493284
118
false
false
0
0
0
0
0
0
0.555556
false
false
3
c217941abeae49a8ef583aedfbe5daa875cae927
19,851,338,904,006
07490456008c59d78e549932164cbb4892512c23
/nsjp-dto/src/main/java/mx/gob/segob/nsjp/dto/relacion/CatRelacionDTO.java
a5787b404c9703233efa7dc2723a87102273cfa9
[]
no_license
RichichiDomotics/poder-judicial
https://github.com/RichichiDomotics/poder-judicial
80d713177aaa846c812a3822df53cd14b9e50871
a288862a3e50cfe6b943d5b353ccce5ed6e88e46
refs/heads/master
2016-09-06T21:52:39.734000
2015-03-28T06:02:59
2015-03-28T06:02:59
33,019,991
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Nombre del Programa : ConsultarRelacionesXCategoriaService.java * Autor : Jacob Lobaco * Compania : Ultrasist * Proyecto : NSJP Fecha: 12-jul-2011 * Marca de cambio : N/A * Descripcion General : N/A * Programa Dependient :N/A * Programa Subsecuente :N/A * Cond. de ejecucion :N/A * Dias de ejecucion :N/A Horario: N/A * MODIFICACIONES *------------------------------------------------------------------------------ * Autor :N/A * Compania :N/A * Proyecto :N/A Fecha: N/A * Modificacion :N/A *------------------------------------------------------------------------------ */ package mx.gob.segob.nsjp.dto.relacion; import mx.gob.segob.nsjp.dto.base.GenericDTO; /** * * @author Jacob Lobaco */ public class CatRelacionDTO extends GenericDTO{ /** * */ private static final long serialVersionUID = -8897792775463039588L; private Long catRelacionId; public CatRelacionDTO(long idCatRelacion) { this.catRelacionId = idCatRelacion; } public CatRelacionDTO() { } /** * Get the value of catRelacionId * * @return the value of catRelacionId */ public Long getCatRelacionId() { return catRelacionId; } /** * Set the value of catRelacionId * * @param catRelacionId new value of catRelacionId */ public void setCatRelacionId(Long catRelacionId) { this.catRelacionId = catRelacionId; } private String descripcionRelacion; /** * Get the value of descripcionRelacion * * @return the value of descripcionRelacion */ public String getDescripcionRelacion() { return descripcionRelacion; } /** * Set the value of descripcionRelacion * * @param descripcionRelacion new value of descripcionRelacion */ public void setDescripcionRelacion(String descripcionRelacion) { this.descripcionRelacion = descripcionRelacion; } private Long catCategoriaRelacionId; /** * Get the value of catCategoriaRelacionId * * @return the value of catCategoriaRelacionId */ public Long getCatCategoriaRelacionId() { return catCategoriaRelacionId; } /** * Set the value of catCategoriaRelacionId * * @param catCategoriaRelacionId new value of catCategoriaRelacionId */ public void setCatCategoriaRelacionId(Long catCategoriaRelacionId) { this.catCategoriaRelacionId = catCategoriaRelacionId; } private String desCategoriaRelacion; /** * Método de acceso al campo desCategoriaRelacion. * @return El valor del campo desCategoriaRelacion */ public String getDesCategoriaRelacion() { return desCategoriaRelacion; } /** * Asigna el valor al campo desCategoriaRelacion. * @param desCategoriaRelacion el valor desCategoriaRelacion a asignar */ public void setDesCategoriaRelacion(String desCategoriaRelacion) { this.desCategoriaRelacion = desCategoriaRelacion; } }
ISO-8859-2
Java
3,242
java
CatRelacionDTO.java
Java
[ { "context": "Service.java\n * Autor : Jacob Lobaco\n * Compania : Ultrasist\n ", "end": 121, "score": 0.9998680353164673, "start": 109, "tag": "NAME", "value": "Jacob Lobaco" }, { "context": "segob.nsjp.dto.base.GenericDTO;\n\n/**\n *\n * @author Jacob Lobaco\n */\npublic class CatRelacionDTO extends GenericDT", "end": 1000, "score": 0.9998688697814941, "start": 988, "tag": "NAME", "value": "Jacob Lobaco" } ]
null
[]
/** * Nombre del Programa : ConsultarRelacionesXCategoriaService.java * Autor : <NAME> * Compania : Ultrasist * Proyecto : NSJP Fecha: 12-jul-2011 * Marca de cambio : N/A * Descripcion General : N/A * Programa Dependient :N/A * Programa Subsecuente :N/A * Cond. de ejecucion :N/A * Dias de ejecucion :N/A Horario: N/A * MODIFICACIONES *------------------------------------------------------------------------------ * Autor :N/A * Compania :N/A * Proyecto :N/A Fecha: N/A * Modificacion :N/A *------------------------------------------------------------------------------ */ package mx.gob.segob.nsjp.dto.relacion; import mx.gob.segob.nsjp.dto.base.GenericDTO; /** * * @author <NAME> */ public class CatRelacionDTO extends GenericDTO{ /** * */ private static final long serialVersionUID = -8897792775463039588L; private Long catRelacionId; public CatRelacionDTO(long idCatRelacion) { this.catRelacionId = idCatRelacion; } public CatRelacionDTO() { } /** * Get the value of catRelacionId * * @return the value of catRelacionId */ public Long getCatRelacionId() { return catRelacionId; } /** * Set the value of catRelacionId * * @param catRelacionId new value of catRelacionId */ public void setCatRelacionId(Long catRelacionId) { this.catRelacionId = catRelacionId; } private String descripcionRelacion; /** * Get the value of descripcionRelacion * * @return the value of descripcionRelacion */ public String getDescripcionRelacion() { return descripcionRelacion; } /** * Set the value of descripcionRelacion * * @param descripcionRelacion new value of descripcionRelacion */ public void setDescripcionRelacion(String descripcionRelacion) { this.descripcionRelacion = descripcionRelacion; } private Long catCategoriaRelacionId; /** * Get the value of catCategoriaRelacionId * * @return the value of catCategoriaRelacionId */ public Long getCatCategoriaRelacionId() { return catCategoriaRelacionId; } /** * Set the value of catCategoriaRelacionId * * @param catCategoriaRelacionId new value of catCategoriaRelacionId */ public void setCatCategoriaRelacionId(Long catCategoriaRelacionId) { this.catCategoriaRelacionId = catCategoriaRelacionId; } private String desCategoriaRelacion; /** * Método de acceso al campo desCategoriaRelacion. * @return El valor del campo desCategoriaRelacion */ public String getDesCategoriaRelacion() { return desCategoriaRelacion; } /** * Asigna el valor al campo desCategoriaRelacion. * @param desCategoriaRelacion el valor desCategoriaRelacion a asignar */ public void setDesCategoriaRelacion(String desCategoriaRelacion) { this.desCategoriaRelacion = desCategoriaRelacion; } }
3,230
0.59457
0.586856
118
26.466103
24.574232
80
false
false
0
0
0
0
0
0
0.347458
false
false
3
f38a89a061bb14ae6f813c1325ba2edee033ee68
7,799,660,654,181
00dbb08b40396d71f9197bda2b7a0c0730d136e2
/src/com/github/scaronthesky/eternalwinterwars/view/scenes/gamescene/IGameScene.java
146e8ba95f65675a8be4caaa692481a7ae7e4efc
[ "MIT" ]
permissive
hinogi/eternalwinterwars
https://github.com/hinogi/eternalwinterwars
53e88fead25d629f3233e0a9af3db9d8fb7de4ab
0a8a285e9987385bb8e5aa65b8c65c7acd4b8367
refs/heads/master
2020-12-07T03:51:28.242000
2014-12-04T11:48:31
2014-12-04T11:48:31
26,909,094
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.github.scaronthesky.eternalwinterwars.view.scenes.gamescene; import java.util.List; import org.andengine.entity.IEntity; import org.andengine.entity.scene.Scene; import org.andengine.util.color.Color; import com.github.scaronthesky.eternalwinterwars.view.entities.board.Board; import com.github.scaronthesky.eternalwinterwars.view.entities.board.Mark; import com.github.scaronthesky.eternalwinterwars.view.entities.game.AGameBaseEntity; import com.github.scaronthesky.eternalwinterwars.view.entities.game.BuildingEntity; import com.github.scaronthesky.eternalwinterwars.view.entities.game.UnitEntity; import com.github.scaronthesky.eternalwinterwars.view.hud.gamehud.CoinEntity; /** * @author Manuel Seiche * @since 20.10.2014 * */ public interface IGameScene { /** * Changes the active player, shows animations etc. * * @param pPlayerIndex */ public void changePlayer(int pPlayerIndex); /** * Marks an area of Cells * * @param pSource * {@link UnitEntity} which is clicked * @param pCellsToMarkCoordinates * cells to mark (pX/pY left upper corner) * @param pMarkColor * the {@link Mark}'s color */ public void markCells(UnitEntity pSource, List<float[]> pCellsToMarkCoordinates, Color pMarkColor); public void showFogOfWar(int pPlayerIndex, List<float[]> pVisibleRectanglesCoordinates); public void exploreCell(int pPlayerIndex, float pX, float pY); public void hideFogOfWar(); /** * Removes the {@link Mark} */ public void removeMark(); /** * Moves a unit on the screen * * @param pUnit * target Unit * @param pTargetCoordinates * target coordinates */ public void move(UnitEntity pUnit, List<float[]> pTargetCoordinates); /** * Starts an attack * * @param pUnit * attacking {@link UnitEntity} * @param pGameBaseEntity * attacked {@link UnitEntity} or {@link BuildingEntity} * @param pDamageDone * damage done to the defending unit * @param pAttackedUnitOrBuildingKilled * true = the attacked Unit or Building has to be removed after * the attack */ public void attack(UnitEntity pUnitEntity, AGameBaseEntity pGameBaseEntity, int pDamageDone, boolean pAttackedUnitOrBuildingKilled); /** * Creates a Unit on the screen * * @param pUnit * Unit to create * @param pX * the Units X * @param pY * the Units Y */ public void create(UnitEntity pUnit, float pX, float pY); /** * Adds income to the actual Player's income-TextField * * @param pAppearCoordinates * source locations for coins * @param pNewCoinCount * new amount of coins to write to the {@link CoinEntity} */ public void addIncome(List<float[]> pAppearCoordinates, int pNewCoinCount); /** * f.e. shows a start animation */ public void start(); /** * f.e. shows a finishing animation */ public void finish(); /** * Shows a dialogue, which allows the selection of attack or cancel after * unit-movement * * @param pSourceUnitEntity * {@link UnitEntity} - Source */ public void showAttackOrCancelDialogue(UnitEntity pSourceUnitEntity); public boolean isLocked(); public void attachChildOnTop(IEntity pEntity); public void attachChildOnMidLayer(IEntity pEntity); public void setBoard(Board pBoard); public Board getBoard(); /** * @return Scene-Instance of implementing class */ public Scene getInstance(); public void exploreCells(int pPlayerIndex, List<float[]> pVisibleRectanglesAbsoluteCoordinates); }
UTF-8
Java
3,650
java
IGameScene.java
Java
[ { "context": "rwars.view.hud.gamehud.CoinEntity;\n\n/**\n * @author Manuel Seiche\n * @since 20.10.2014\n * \n */\npublic interface IGa", "end": 723, "score": 0.9998825788497925, "start": 710, "tag": "NAME", "value": "Manuel Seiche" } ]
null
[]
package com.github.scaronthesky.eternalwinterwars.view.scenes.gamescene; import java.util.List; import org.andengine.entity.IEntity; import org.andengine.entity.scene.Scene; import org.andengine.util.color.Color; import com.github.scaronthesky.eternalwinterwars.view.entities.board.Board; import com.github.scaronthesky.eternalwinterwars.view.entities.board.Mark; import com.github.scaronthesky.eternalwinterwars.view.entities.game.AGameBaseEntity; import com.github.scaronthesky.eternalwinterwars.view.entities.game.BuildingEntity; import com.github.scaronthesky.eternalwinterwars.view.entities.game.UnitEntity; import com.github.scaronthesky.eternalwinterwars.view.hud.gamehud.CoinEntity; /** * @author <NAME> * @since 20.10.2014 * */ public interface IGameScene { /** * Changes the active player, shows animations etc. * * @param pPlayerIndex */ public void changePlayer(int pPlayerIndex); /** * Marks an area of Cells * * @param pSource * {@link UnitEntity} which is clicked * @param pCellsToMarkCoordinates * cells to mark (pX/pY left upper corner) * @param pMarkColor * the {@link Mark}'s color */ public void markCells(UnitEntity pSource, List<float[]> pCellsToMarkCoordinates, Color pMarkColor); public void showFogOfWar(int pPlayerIndex, List<float[]> pVisibleRectanglesCoordinates); public void exploreCell(int pPlayerIndex, float pX, float pY); public void hideFogOfWar(); /** * Removes the {@link Mark} */ public void removeMark(); /** * Moves a unit on the screen * * @param pUnit * target Unit * @param pTargetCoordinates * target coordinates */ public void move(UnitEntity pUnit, List<float[]> pTargetCoordinates); /** * Starts an attack * * @param pUnit * attacking {@link UnitEntity} * @param pGameBaseEntity * attacked {@link UnitEntity} or {@link BuildingEntity} * @param pDamageDone * damage done to the defending unit * @param pAttackedUnitOrBuildingKilled * true = the attacked Unit or Building has to be removed after * the attack */ public void attack(UnitEntity pUnitEntity, AGameBaseEntity pGameBaseEntity, int pDamageDone, boolean pAttackedUnitOrBuildingKilled); /** * Creates a Unit on the screen * * @param pUnit * Unit to create * @param pX * the Units X * @param pY * the Units Y */ public void create(UnitEntity pUnit, float pX, float pY); /** * Adds income to the actual Player's income-TextField * * @param pAppearCoordinates * source locations for coins * @param pNewCoinCount * new amount of coins to write to the {@link CoinEntity} */ public void addIncome(List<float[]> pAppearCoordinates, int pNewCoinCount); /** * f.e. shows a start animation */ public void start(); /** * f.e. shows a finishing animation */ public void finish(); /** * Shows a dialogue, which allows the selection of attack or cancel after * unit-movement * * @param pSourceUnitEntity * {@link UnitEntity} - Source */ public void showAttackOrCancelDialogue(UnitEntity pSourceUnitEntity); public boolean isLocked(); public void attachChildOnTop(IEntity pEntity); public void attachChildOnMidLayer(IEntity pEntity); public void setBoard(Board pBoard); public Board getBoard(); /** * @return Scene-Instance of implementing class */ public Scene getInstance(); public void exploreCells(int pPlayerIndex, List<float[]> pVisibleRectanglesAbsoluteCoordinates); }
3,643
0.69726
0.695068
139
25.258993
24.520243
84
false
false
0
0
0
0
0
0
1.086331
false
false
3
a72e5288245ab8f54f610d13b7d00b9a7cfb93e4
15,092,515,140,893
ce06341daf6d1450ef3e0fc7d81d723310927f20
/spring-batch-in-memory-demo-master/src/main/java/com/example/batchdemo/BatchConfiguration.java
650e240f11408bb620a01d64528eac5f53fd4fb7
[]
no_license
Rafael-Romeu/springBatchEstudos
https://github.com/Rafael-Romeu/springBatchEstudos
2cc0bf16270b234f52682a20d50ccbfff580f85a
b9806fe0f33b872e0383f63013920dbdd88c9fb8
refs/heads/master
2020-09-05T08:48:12.205000
2019-11-06T17:18:31
2019-11-06T17:18:31
220,035,638
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.batchdemo; import javax.sql.DataSource; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.Bean; @EnableBatchProcessing @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) public class BatchConfiguration extends DefaultBatchConfigurer { @Autowired private JobBuilderFactory jobBuilderFactory; @Autowired private StepBuilderFactory stepBuilderFactory; @Autowired private Task1 task1; @Bean public Job jobBuild(Step step1) { return jobBuilderFactory.get("job").start(step1).build(); } @Bean public Step step1() { return stepBuilderFactory.get("Step1").tasklet(task1).build(); } @Override public void setDataSource(DataSource dataSource) { // Setar null para que o data source não seja utilizado no datasource super.setDataSource(null); } }
UTF-8
Java
1,450
java
BatchConfiguration.java
Java
[]
null
[]
package com.example.batchdemo; import javax.sql.DataSource; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.Bean; @EnableBatchProcessing @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) public class BatchConfiguration extends DefaultBatchConfigurer { @Autowired private JobBuilderFactory jobBuilderFactory; @Autowired private StepBuilderFactory stepBuilderFactory; @Autowired private Task1 task1; @Bean public Job jobBuild(Step step1) { return jobBuilderFactory.get("job").start(step1).build(); } @Bean public Step step1() { return stepBuilderFactory.get("Step1").tasklet(task1).build(); } @Override public void setDataSource(DataSource dataSource) { // Setar null para que o data source não seja utilizado no datasource super.setDataSource(null); } }
1,450
0.825397
0.820566
48
29.1875
29.473616
86
false
false
0
0
0
0
0
0
0.979167
false
false
3
e38f0a61243e458e20d0c649e82e3599fc1c9bac
32,839,319,947,285
5d58465b1f2427469ccbbbc7a276d2a3c6ba6832
/src/Client/ClientActions.java
0faf1c2d7da0db8928a99a3bbc6e5543bbf9f6a6
[]
no_license
Ifeo-A/Java_TCP_UDP_Chat
https://github.com/Ifeo-A/Java_TCP_UDP_Chat
03e688a249917768fb02ec567a6411ec902f28aa
31d6d7615cf7b446ba65f0fd53f8c217104c8236
refs/heads/master
2022-02-27T05:13:04.792000
2017-12-01T11:01:29
2017-12-01T11:01:29
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Client; import ChatGUI.ChatGUI; import javax.swing.JOptionPane; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; class ClientActions { private String ipAddress; private int portNumber; private PrintWriter pWOut = null; private Socket clientSocket; private ChatGUI clientGUI = new ChatGUI("Client", 800, 0); ClientActions(String ipAddress, int portNumber) { this.ipAddress = ipAddress; this.portNumber = portNumber; clientGUI.jBtnSend.addActionListener(new ClientSendMessage()); clientGUI.jTxtAreaSendMessageBox.addKeyListener(new sendKeyListener()); } public void runClient() { try { /* Open a socket */ clientSocket = new Socket(ipAddress, portNumber); pWOut = new PrintWriter(clientSocket.getOutputStream(), true); getFromServer(); pWOut.close(); clientSocket.close(); } catch (IOException e) { System.out.println("Something went wrong on the client"); e.printStackTrace(); JOptionPane.showMessageDialog(null, e); clientGUI.closeChatWindow(); } } private void getFromServer() { try { BufferedReader bRIn = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); String serverMessage; while ((serverMessage = bRIn.readLine()) != null) { String textInTextArea = clientGUI.jTxtAreaViewMessageBox.getText(); if (textInTextArea.isEmpty()) { clientGUI.jTxtAreaViewMessageBox.setText("Server: " + serverMessage); } else { clientGUI.jTxtAreaViewMessageBox.setText(textInTextArea + System.lineSeparator() + "Server: " + serverMessage); } System.out.println("From Server: " + serverMessage); } bRIn.close(); } catch (IOException e) { System.out.println("Something went wrong while receiving from the server"); } } private void sendToServer() { String clientMessage = clientGUI.jTxtAreaSendMessageBox.getText().trim(); pWOut.println(clientMessage); } private void updateMessageView() { String clientMessage = clientGUI.jTxtAreaSendMessageBox.getText().trim(); String textInTextArea = clientGUI.jTxtAreaViewMessageBox.getText(); if (textInTextArea.isEmpty()) { clientGUI.jTxtAreaViewMessageBox.setText("(You) Client: " + clientMessage); } else { clientGUI.jTxtAreaViewMessageBox.setText(textInTextArea + System.lineSeparator() + "(You) Client: " + clientMessage.trim()); } } public class ClientSendMessage implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if(!clientGUI.jTxtAreaSendMessageBox.getText().isEmpty()) { sendToServer(); updateMessageView(); clientGUI.clearSendMessageArea(); } } } public class sendKeyListener implements KeyListener { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_ENTER: if(!clientGUI.jTxtAreaSendMessageBox.getText().isEmpty()) { sendToServer(); updateMessageView(); clientGUI.clearSendMessageArea(); } break; } } } }
UTF-8
Java
4,224
java
ClientActions.java
Java
[]
null
[]
package Client; import ChatGUI.ChatGUI; import javax.swing.JOptionPane; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.Socket; class ClientActions { private String ipAddress; private int portNumber; private PrintWriter pWOut = null; private Socket clientSocket; private ChatGUI clientGUI = new ChatGUI("Client", 800, 0); ClientActions(String ipAddress, int portNumber) { this.ipAddress = ipAddress; this.portNumber = portNumber; clientGUI.jBtnSend.addActionListener(new ClientSendMessage()); clientGUI.jTxtAreaSendMessageBox.addKeyListener(new sendKeyListener()); } public void runClient() { try { /* Open a socket */ clientSocket = new Socket(ipAddress, portNumber); pWOut = new PrintWriter(clientSocket.getOutputStream(), true); getFromServer(); pWOut.close(); clientSocket.close(); } catch (IOException e) { System.out.println("Something went wrong on the client"); e.printStackTrace(); JOptionPane.showMessageDialog(null, e); clientGUI.closeChatWindow(); } } private void getFromServer() { try { BufferedReader bRIn = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); String serverMessage; while ((serverMessage = bRIn.readLine()) != null) { String textInTextArea = clientGUI.jTxtAreaViewMessageBox.getText(); if (textInTextArea.isEmpty()) { clientGUI.jTxtAreaViewMessageBox.setText("Server: " + serverMessage); } else { clientGUI.jTxtAreaViewMessageBox.setText(textInTextArea + System.lineSeparator() + "Server: " + serverMessage); } System.out.println("From Server: " + serverMessage); } bRIn.close(); } catch (IOException e) { System.out.println("Something went wrong while receiving from the server"); } } private void sendToServer() { String clientMessage = clientGUI.jTxtAreaSendMessageBox.getText().trim(); pWOut.println(clientMessage); } private void updateMessageView() { String clientMessage = clientGUI.jTxtAreaSendMessageBox.getText().trim(); String textInTextArea = clientGUI.jTxtAreaViewMessageBox.getText(); if (textInTextArea.isEmpty()) { clientGUI.jTxtAreaViewMessageBox.setText("(You) Client: " + clientMessage); } else { clientGUI.jTxtAreaViewMessageBox.setText(textInTextArea + System.lineSeparator() + "(You) Client: " + clientMessage.trim()); } } public class ClientSendMessage implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if(!clientGUI.jTxtAreaSendMessageBox.getText().isEmpty()) { sendToServer(); updateMessageView(); clientGUI.clearSendMessageArea(); } } } public class sendKeyListener implements KeyListener { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { switch (e.getKeyCode()) { case KeyEvent.VK_ENTER: if(!clientGUI.jTxtAreaSendMessageBox.getText().isEmpty()) { sendToServer(); updateMessageView(); clientGUI.clearSendMessageArea(); } break; } } } }
4,224
0.572206
0.571259
154
26.428572
27.114922
136
false
false
0
0
0
0
0
0
0.37013
false
false
3
73dda67de4148f2194dfdf49d48ef70b704b587d
21,294,447,902,234
486de2db87a6931145c797caa6c031d999ef035a
/syntax/gen-src/fr/umlv/robomastermind/grammar/parser/NonTerminalEnum.java
dc8bb248462281f4be8c6de248d032c17f70ca4b
[]
no_license
ileonicolas/robotmastermind
https://github.com/ileonicolas/robotmastermind
93972e587ed978089e3ffa92a90a5eecc35d01f3
75ce2d1c67fc198b204e44304ad124802346dacb
refs/heads/master
2021-01-01T19:11:26.654000
2012-11-13T12:38:14
2012-11-13T12:38:14
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package fr.umlv.robomastermind.grammar.parser; /** * This class is generated - please do not edit it */ public enum NonTerminalEnum { script, item, proc, block, instr, funcall, expr, item_star_0, id_star_1, id_star_1_sub, instr_star_2, number_optional_3, expr_star_4, expr_star_4_sub ; }
UTF-8
Java
295
java
NonTerminalEnum.java
Java
[]
null
[]
package fr.umlv.robomastermind.grammar.parser; /** * This class is generated - please do not edit it */ public enum NonTerminalEnum { script, item, proc, block, instr, funcall, expr, item_star_0, id_star_1, id_star_1_sub, instr_star_2, number_optional_3, expr_star_4, expr_star_4_sub ; }
295
0.708475
0.684746
22
12.454545
13.262137
52
false
false
0
0
0
0
0
0
0.681818
false
false
3
f801c0e9780ee09dbbc7f6d2810d9d6d57b4436b
28,020,366,707,133
7cb11f676f194c235dd197372bdc8d07a9a72faf
/CuriousDrive/CuriousDriveWebService/src/main/java/com/org/panthers/framework/busError.java
a0ef2a49155fb99f4633eac8a02c8e9cff9732be
[]
no_license
panan2215/PublicProjects
https://github.com/panan2215/PublicProjects
92abccbf4e8cead997decfd05979b3c4fd012a51
f3992e6403c942efaf1a13b50e04ee849d563935
refs/heads/master
2023-05-12T16:15:30.253000
2021-06-07T13:05:03
2021-06-07T13:05:03
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.org.panthers.framework; public class busError { public busMessage ibusMessage; }
UTF-8
Java
97
java
busError.java
Java
[]
null
[]
package com.org.panthers.framework; public class busError { public busMessage ibusMessage; }
97
0.783505
0.783505
7
12.857142
14.922932
35
false
false
0
0
0
0
0
0
0.428571
false
false
3
2a39a7de5d9f9971bae36bcaaf681ec2a4628c86
17,789,754,596,614
e4d2c16eae8bf941c8b4598c473bb4388b0e8bc7
/tr-mobile-app/src/com/menatwork/utils/ReflectionUtils.java
e93cd2f70d166ee603695d052de5d0fa9ab107cf
[]
no_license
aabdala/talent-radar
https://github.com/aabdala/talent-radar
9ca2889b32b2704d98e3fe803e3d55c7f4a553ad
92c19b894a85cf3c26db2c7a403ee12c7bec8911
refs/heads/master
2020-03-03T20:21:38.975000
2013-01-31T00:07:35
2013-01-31T00:07:35
32,165,893
1
0
null
true
2015-03-13T16:07:17
2015-03-13T16:07:17
2015-03-13T00:52:13
2015-03-13T00:55:31
0
0
0
0
null
null
null
package com.menatwork.utils; import java.lang.reflect.Method; public class ReflectionUtils { public static boolean isGetter(final Method method) { final String methodName = method.getName(); return methodName.startsWith("get") || methodName.startsWith("is"); } public static boolean isSetter(final Method method) { final String methodName = method.getName(); return methodName.startsWith("set"); } public static Method setterForGetter(final Method getter, final Class<?> type) { final String nameWithoutPrefix = getGetterNameWithoutPrefix(getter); final Method[] allMethods = type.getDeclaredMethods(); for (final Method method : allMethods) if (method.getName().equals("set" + nameWithoutPrefix)) return method; throw new RuntimeException("No setter found for " + getter.getName()); } private static String getGetterNameWithoutPrefix(final Method getter) { final String fullName = getter.getName(); if (fullName.startsWith("get")) return fullName.replaceFirst("get", ""); if (fullName.startsWith("is")) return fullName.replaceFirst("is", ""); return fullName; } }
UTF-8
Java
1,121
java
ReflectionUtils.java
Java
[]
null
[]
package com.menatwork.utils; import java.lang.reflect.Method; public class ReflectionUtils { public static boolean isGetter(final Method method) { final String methodName = method.getName(); return methodName.startsWith("get") || methodName.startsWith("is"); } public static boolean isSetter(final Method method) { final String methodName = method.getName(); return methodName.startsWith("set"); } public static Method setterForGetter(final Method getter, final Class<?> type) { final String nameWithoutPrefix = getGetterNameWithoutPrefix(getter); final Method[] allMethods = type.getDeclaredMethods(); for (final Method method : allMethods) if (method.getName().equals("set" + nameWithoutPrefix)) return method; throw new RuntimeException("No setter found for " + getter.getName()); } private static String getGetterNameWithoutPrefix(final Method getter) { final String fullName = getter.getName(); if (fullName.startsWith("get")) return fullName.replaceFirst("get", ""); if (fullName.startsWith("is")) return fullName.replaceFirst("is", ""); return fullName; } }
1,121
0.736842
0.736842
37
29.297297
24.733023
72
false
false
0
0
0
0
0
0
1.810811
false
false
3
97805e9da88493f57ad9fc6ed74d379629676c20
20,452,634,308,186
c32ddd97740c10c1f916eb2978ecf5c5b37dec60
/HolitaPolilla/src/Solution.java
ae39ec5e8b408dbb8ecf54571388de1234083a17
[]
no_license
kristalys47/DataPractica
https://github.com/kristalys47/DataPractica
3c9820cea945b342c818de382029a9c8c1c90473
12a4c3835d74e3a1ccb7f9e09ff7310b0cdd4573
refs/heads/master
2021-01-20T03:06:23.937000
2017-08-25T01:03:09
2017-08-25T01:03:09
101,348,011
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String timeConversion(String s) { // 07:05:45PM // 0123456789 array index int[] numbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int first = 0, second = 0, total = 0; if (s.charAt(8) == 'p' || s.charAt(8) == 'P') { for (int i = 0; i < numbers.length; i++) { if (((Integer) numbers[i]).toString().equals(s.substring(0, 1))) { first = numbers[i]; } if (((Integer) numbers[i]).toString().equalsIgnoreCase(s.substring(1, 2))) { second = numbers[i]; } } total = first * 10 + second+12; if (total == 24) { return "12" + s.substring(2, 8); } else if(total<10){ return "0"+((Integer) total).toString() + s.substring(2, 8); } else { return ((Integer) total).toString() + s.substring(2, 8); } } else { if (s.charAt(8) == 'a' || s.charAt(8) == 'A') { for (int i = 0; i < numbers.length; i++) { if (((Integer) numbers[i]).toString().equals(s.substring(0, 1))) { first = numbers[i]; } if (((Integer) numbers[i]).toString().equalsIgnoreCase(s.substring(1, 2))) { second = numbers[i]; } } total = first * 10 + second+12; if (total == 24) { return "00" + s.substring(2, 8); } } return s.substring(0, 8); } } public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); String result = timeConversion(s); System.out.println(result); } }
UTF-8
Java
1,581
java
Solution.java
Java
[]
null
[]
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String timeConversion(String s) { // 07:05:45PM // 0123456789 array index int[] numbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int first = 0, second = 0, total = 0; if (s.charAt(8) == 'p' || s.charAt(8) == 'P') { for (int i = 0; i < numbers.length; i++) { if (((Integer) numbers[i]).toString().equals(s.substring(0, 1))) { first = numbers[i]; } if (((Integer) numbers[i]).toString().equalsIgnoreCase(s.substring(1, 2))) { second = numbers[i]; } } total = first * 10 + second+12; if (total == 24) { return "12" + s.substring(2, 8); } else if(total<10){ return "0"+((Integer) total).toString() + s.substring(2, 8); } else { return ((Integer) total).toString() + s.substring(2, 8); } } else { if (s.charAt(8) == 'a' || s.charAt(8) == 'A') { for (int i = 0; i < numbers.length; i++) { if (((Integer) numbers[i]).toString().equals(s.substring(0, 1))) { first = numbers[i]; } if (((Integer) numbers[i]).toString().equalsIgnoreCase(s.substring(1, 2))) { second = numbers[i]; } } total = first * 10 + second+12; if (total == 24) { return "00" + s.substring(2, 8); } } return s.substring(0, 8); } } public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); String result = timeConversion(s); System.out.println(result); } }
1,581
0.543959
0.498419
64
23.703125
21.365627
81
false
false
0
0
0
0
0
0
3.359375
false
false
3
66801a698eb5cffee4ad6b185ab849ac313a2e3a
30,150,670,449,792
19a6ecbc71d30e289cde6e5992614b672f9912f3
/src/main/java/com/commerce/shared/DistinctCategory.java
18d3256330bfce7fc793ea7133d702022f9a4460
[ "MIT" ]
permissive
selimarslan/java-shopping-cart
https://github.com/selimarslan/java-shopping-cart
800a0715dad1d741c6bf4b911b5d3c9894731dda
3a239301c373386c953c46d67b807bbe79531110
refs/heads/master
2022-04-04T11:33:10.964000
2020-02-06T03:13:48
2020-02-06T03:13:48
237,612,571
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.commerce.shared; import com.commerce.category.Category; import java.util.Collection; import java.util.List; public interface DistinctCategory{ List<Category> getDistinctCategories(Collection<Category> singleLevelCategories); }
UTF-8
Java
246
java
DistinctCategory.java
Java
[]
null
[]
package com.commerce.shared; import com.commerce.category.Category; import java.util.Collection; import java.util.List; public interface DistinctCategory{ List<Category> getDistinctCategories(Collection<Category> singleLevelCategories); }
246
0.821138
0.821138
10
23.6
25.116528
85
false
false
0
0
0
0
0
0
0.5
false
false
3
61fb1f532bbec2c733399c08448c479f61eeafe7
21,242,908,262,528
077e663d84ef493c3de13d9027e790b4e808b19b
/src/main/java/ir/insurance/startup/service/impl/TakhfifTavafoghiServiceImpl.java
cebc641a44432ad2e53b0a419b0c1c195d4dafe6
[]
no_license
manisi/insureTech
https://github.com/manisi/insureTech
a34b8396ddc1986491a42dc006df6023329c68df
d62e8f74fc0edc31cd4e9e670ee52384685488a4
refs/heads/master
2022-07-29T10:03:44.745000
2019-12-28T18:41:56
2019-12-28T18:41:56
165,522,941
0
0
null
false
2022-07-07T12:19:54
2019-01-13T15:41:55
2019-12-28T18:42:09
2022-07-07T12:19:54
3,191
0
0
5
Java
false
false
package ir.insurance.startup.service.impl; import ir.insurance.startup.service.TakhfifTavafoghiService; import ir.insurance.startup.domain.TakhfifTavafoghi; import ir.insurance.startup.repository.TakhfifTavafoghiRepository; import ir.insurance.startup.service.dto.TakhfifTavafoghiDTO; import ir.insurance.startup.service.mapper.TakhfifTavafoghiMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Optional; /** * Service Implementation for managing TakhfifTavafoghi. */ @Service @Transactional public class TakhfifTavafoghiServiceImpl implements TakhfifTavafoghiService { private final Logger log = LoggerFactory.getLogger(TakhfifTavafoghiServiceImpl.class); private final TakhfifTavafoghiRepository takhfifTavafoghiRepository; private final TakhfifTavafoghiMapper takhfifTavafoghiMapper; public TakhfifTavafoghiServiceImpl(TakhfifTavafoghiRepository takhfifTavafoghiRepository, TakhfifTavafoghiMapper takhfifTavafoghiMapper) { this.takhfifTavafoghiRepository = takhfifTavafoghiRepository; this.takhfifTavafoghiMapper = takhfifTavafoghiMapper; } /** * Save a takhfifTavafoghi. * * @param takhfifTavafoghiDTO the entity to save * @return the persisted entity */ @Override public TakhfifTavafoghiDTO save(TakhfifTavafoghiDTO takhfifTavafoghiDTO) { log.debug("Request to save TakhfifTavafoghi : {}", takhfifTavafoghiDTO); TakhfifTavafoghi takhfifTavafoghi = takhfifTavafoghiMapper.toEntity(takhfifTavafoghiDTO); takhfifTavafoghi = takhfifTavafoghiRepository.save(takhfifTavafoghi); return takhfifTavafoghiMapper.toDto(takhfifTavafoghi); } /** * Get all the takhfifTavafoghis. * * @param pageable the pagination information * @return the list of entities */ @Override @Transactional(readOnly = true) public Page<TakhfifTavafoghiDTO> findAll(Pageable pageable) { log.debug("Request to get all TakhfifTavafoghis"); return takhfifTavafoghiRepository.findAll(pageable) .map(takhfifTavafoghiMapper::toDto); } /** * Get one takhfifTavafoghi by id. * * @param id the id of the entity * @return the entity */ @Override @Transactional(readOnly = true) public Optional<TakhfifTavafoghiDTO> findOne(Long id) { log.debug("Request to get TakhfifTavafoghi : {}", id); return takhfifTavafoghiRepository.findById(id) .map(takhfifTavafoghiMapper::toDto); } /** * Delete the takhfifTavafoghi by id. * * @param id the id of the entity */ @Override public void delete(Long id) { log.debug("Request to delete TakhfifTavafoghi : {}", id); takhfifTavafoghiRepository.deleteById(id); } }
UTF-8
Java
3,017
java
TakhfifTavafoghiServiceImpl.java
Java
[]
null
[]
package ir.insurance.startup.service.impl; import ir.insurance.startup.service.TakhfifTavafoghiService; import ir.insurance.startup.domain.TakhfifTavafoghi; import ir.insurance.startup.repository.TakhfifTavafoghiRepository; import ir.insurance.startup.service.dto.TakhfifTavafoghiDTO; import ir.insurance.startup.service.mapper.TakhfifTavafoghiMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Optional; /** * Service Implementation for managing TakhfifTavafoghi. */ @Service @Transactional public class TakhfifTavafoghiServiceImpl implements TakhfifTavafoghiService { private final Logger log = LoggerFactory.getLogger(TakhfifTavafoghiServiceImpl.class); private final TakhfifTavafoghiRepository takhfifTavafoghiRepository; private final TakhfifTavafoghiMapper takhfifTavafoghiMapper; public TakhfifTavafoghiServiceImpl(TakhfifTavafoghiRepository takhfifTavafoghiRepository, TakhfifTavafoghiMapper takhfifTavafoghiMapper) { this.takhfifTavafoghiRepository = takhfifTavafoghiRepository; this.takhfifTavafoghiMapper = takhfifTavafoghiMapper; } /** * Save a takhfifTavafoghi. * * @param takhfifTavafoghiDTO the entity to save * @return the persisted entity */ @Override public TakhfifTavafoghiDTO save(TakhfifTavafoghiDTO takhfifTavafoghiDTO) { log.debug("Request to save TakhfifTavafoghi : {}", takhfifTavafoghiDTO); TakhfifTavafoghi takhfifTavafoghi = takhfifTavafoghiMapper.toEntity(takhfifTavafoghiDTO); takhfifTavafoghi = takhfifTavafoghiRepository.save(takhfifTavafoghi); return takhfifTavafoghiMapper.toDto(takhfifTavafoghi); } /** * Get all the takhfifTavafoghis. * * @param pageable the pagination information * @return the list of entities */ @Override @Transactional(readOnly = true) public Page<TakhfifTavafoghiDTO> findAll(Pageable pageable) { log.debug("Request to get all TakhfifTavafoghis"); return takhfifTavafoghiRepository.findAll(pageable) .map(takhfifTavafoghiMapper::toDto); } /** * Get one takhfifTavafoghi by id. * * @param id the id of the entity * @return the entity */ @Override @Transactional(readOnly = true) public Optional<TakhfifTavafoghiDTO> findOne(Long id) { log.debug("Request to get TakhfifTavafoghi : {}", id); return takhfifTavafoghiRepository.findById(id) .map(takhfifTavafoghiMapper::toDto); } /** * Delete the takhfifTavafoghi by id. * * @param id the id of the entity */ @Override public void delete(Long id) { log.debug("Request to delete TakhfifTavafoghi : {}", id); takhfifTavafoghiRepository.deleteById(id); } }
3,017
0.739808
0.739145
89
32.898876
29.536892
142
false
false
0
0
0
0
0
0
0.359551
false
false
3
a1e6fb6f26cd47f48b1db47dbf7139325cceab4f
7,799,660,657,503
9cc85361662cb11863da921763ea3e038d101b43
/src/cn/dsscm/pojo/Order.java
7cfcdd82a8dfa1f6695ec4546c5a0c90a15524d1
[]
no_license
xieqiuxing/dsscm
https://github.com/xieqiuxing/dsscm
22ad07517d59c44b59dd0abb2b1dbd7432303d9f
fdaec3ae060ee183777bfc8f647adba8ab4e5844
refs/heads/master
2021-01-02T18:36:17.902000
2020-02-11T11:30:25
2020-02-11T11:30:25
239,745,879
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cn.dsscm.pojo; import java.io.Serializable; import java.util.Date; import java.util.List; public class Order implements Serializable { // 订单状态 public static int STATUS_INITIAL = 1; public static int STATUS_PASS = 2; public static int STATUS_PREPARE = 3; public static int STATUS_SEND = 4; public static int STATUS_RECEIVED = 5; public static int PAYTYPE_CASH = 1; public static int PAYTYPE_NET = 2; private Long id;// ID private String userName;// 真实姓名 private String customerPhone; // 顾客联系电话 private String userAddress;// 收货地址 private int proCount;// 商品数量 private Float cost;// 订单总计价格 private String serialNumber;// 订单号 private int status;// 订单状态 private int payType;// 付款方式 private Integer createdBy; // 创建者 private Date creationDate; // 创建时间 private Integer modifyBy; // 更新者 private Date modifyDate;// 更新时间 private List<Product> product; public Order() { super(); // TODO Auto-generated constructor stub } public Order(Long id, String userName, String customerPhone, String userAddress, int proCount, Float cost, String serialNumber, int status, int payType, Integer createdBy, Date creationDate) { super(); this.id = id; this.userName = userName; this.customerPhone = customerPhone; this.userAddress = userAddress; this.proCount = proCount; this.cost = cost; this.serialNumber = serialNumber; this.status = status; this.payType = payType; this.createdBy = createdBy; this.creationDate = creationDate; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getCustomerPhone() { return customerPhone; } public void setCustomerPhone(String customerPhone) { this.customerPhone = customerPhone; } public String getUserAddress() { return userAddress; } public void setUserAddress(String userAddress) { this.userAddress = userAddress; } public int getProCount() { return proCount; } public void setProCount(int proCount) { this.proCount = proCount; } public Float getCost() { return cost; } public void setCost(Float cost) { this.cost = cost; } public String getSerialNumber() { return serialNumber; } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getPayType() { return payType; } public void setPayType(int payType) { this.payType = payType; } public Integer getCreatedBy() { return createdBy; } public void setCreatedBy(Integer createdBy) { this.createdBy = createdBy; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Integer getModifyBy() { return modifyBy; } public void setModifyBy(Integer modifyBy) { this.modifyBy = modifyBy; } public Date getModifyDate() { return modifyDate; } public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; } public List<Product> getProduct() { return product; } public void setProduct(List<Product> product) { this.product = product; } @Override public String toString() { return "Order [id=" + id + ", userName=" + userName + ", customerPhone=" + customerPhone + ", userAddress=" + userAddress + ", proCount=" + proCount + ", cost=" + cost + ", serialNumber=" + serialNumber + ", status=" + status + ", payType=" + payType + ", createdBy=" + createdBy + ", creationDate=" + creationDate + ", modifyBy=" + modifyBy + ", modifyDate=" + modifyDate + ", product=" + product + "]"; } public String getDisplayStatus() { switch (this.status) { case 1: return "待审核"; case 2: return "审核通过"; case 3: return "配货"; case 4: return "卖家已发货"; case 5: return "已收货"; default: return "待审核"; } } }
UTF-8
Java
4,177
java
Order.java
Java
[ { "context": "private Long id;// ID\n\tprivate String userName;// 真实姓名\n\tprivate String customerPhone; // 顾客联系电话\n\tprivate", "end": 474, "score": 0.771033525466919, "start": 470, "tag": "USERNAME", "value": "真实姓名" }, { "context": "te) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.userName = userName;\n\t\tthis.customerPhone = customerPhone;\n\t\tthis.use", "end": 1203, "score": 0.9981613755226135, "start": 1195, "tag": "USERNAME", "value": "userName" }, { "context": " = id;\n\t}\n\n\tpublic String getUserName() {\n\t\treturn userName;\n\t}\n\n\tpublic void setUserName(String userName) {\n", "end": 1619, "score": 0.9897637367248535, "start": 1611, "tag": "USERNAME", "value": "userName" }, { "context": "turn userName;\n\t}\n\n\tpublic void setUserName(String userName) {\n\t\tthis.userName = userName;\n\t}\n\n\tpublic String", "end": 1665, "score": 0.9228748083114624, "start": 1657, "tag": "USERNAME", "value": "userName" }, { "context": "d setUserName(String userName) {\n\t\tthis.userName = userName;\n\t}\n\n\tpublic String getCustomerPhone() {\n\t\treturn", "end": 1695, "score": 0.991914689540863, "start": 1687, "tag": "USERNAME", "value": "userName" }, { "context": "g() {\n\t\treturn \"Order [id=\" + id + \", userName=\" + userName\n\t\t\t\t+ \", customerPhone=\" + customerPhone + \", use", "end": 3412, "score": 0.9991551637649536, "start": 3404, "tag": "USERNAME", "value": "userName" } ]
null
[]
package cn.dsscm.pojo; import java.io.Serializable; import java.util.Date; import java.util.List; public class Order implements Serializable { // 订单状态 public static int STATUS_INITIAL = 1; public static int STATUS_PASS = 2; public static int STATUS_PREPARE = 3; public static int STATUS_SEND = 4; public static int STATUS_RECEIVED = 5; public static int PAYTYPE_CASH = 1; public static int PAYTYPE_NET = 2; private Long id;// ID private String userName;// 真实姓名 private String customerPhone; // 顾客联系电话 private String userAddress;// 收货地址 private int proCount;// 商品数量 private Float cost;// 订单总计价格 private String serialNumber;// 订单号 private int status;// 订单状态 private int payType;// 付款方式 private Integer createdBy; // 创建者 private Date creationDate; // 创建时间 private Integer modifyBy; // 更新者 private Date modifyDate;// 更新时间 private List<Product> product; public Order() { super(); // TODO Auto-generated constructor stub } public Order(Long id, String userName, String customerPhone, String userAddress, int proCount, Float cost, String serialNumber, int status, int payType, Integer createdBy, Date creationDate) { super(); this.id = id; this.userName = userName; this.customerPhone = customerPhone; this.userAddress = userAddress; this.proCount = proCount; this.cost = cost; this.serialNumber = serialNumber; this.status = status; this.payType = payType; this.createdBy = createdBy; this.creationDate = creationDate; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getCustomerPhone() { return customerPhone; } public void setCustomerPhone(String customerPhone) { this.customerPhone = customerPhone; } public String getUserAddress() { return userAddress; } public void setUserAddress(String userAddress) { this.userAddress = userAddress; } public int getProCount() { return proCount; } public void setProCount(int proCount) { this.proCount = proCount; } public Float getCost() { return cost; } public void setCost(Float cost) { this.cost = cost; } public String getSerialNumber() { return serialNumber; } public void setSerialNumber(String serialNumber) { this.serialNumber = serialNumber; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getPayType() { return payType; } public void setPayType(int payType) { this.payType = payType; } public Integer getCreatedBy() { return createdBy; } public void setCreatedBy(Integer createdBy) { this.createdBy = createdBy; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Integer getModifyBy() { return modifyBy; } public void setModifyBy(Integer modifyBy) { this.modifyBy = modifyBy; } public Date getModifyDate() { return modifyDate; } public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; } public List<Product> getProduct() { return product; } public void setProduct(List<Product> product) { this.product = product; } @Override public String toString() { return "Order [id=" + id + ", userName=" + userName + ", customerPhone=" + customerPhone + ", userAddress=" + userAddress + ", proCount=" + proCount + ", cost=" + cost + ", serialNumber=" + serialNumber + ", status=" + status + ", payType=" + payType + ", createdBy=" + createdBy + ", creationDate=" + creationDate + ", modifyBy=" + modifyBy + ", modifyDate=" + modifyDate + ", product=" + product + "]"; } public String getDisplayStatus() { switch (this.status) { case 1: return "待审核"; case 2: return "审核通过"; case 3: return "配货"; case 4: return "卖家已发货"; case 5: return "已收货"; default: return "待审核"; } } }
4,177
0.693624
0.690647
197
19.461929
17.965698
69
false
false
0
0
0
0
0
0
1.695431
false
false
3
6411c21a41b8f7bf1abd477a6e5c19070310cab2
15,418,932,596,447
146e20626c10e8aa5feedb8daa0174e2d055e141
/Recursion/fibonacci.java
4f17974f1762421de637a5cb2cba0bf5b25bad2a
[]
no_license
dabloo26/DS-Java
https://github.com/dabloo26/DS-Java
aa1f9f2b2fba3024e7b6fd572d5a61539a1b6470
9113bf6b39daa1973faf6587f9ab68d057450da4
refs/heads/main
2023-07-09T06:55:38.402000
2021-08-04T23:30:25
2021-08-04T23:30:25
369,029,172
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; class fibonacci{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int ans=fibo(n); System.out.println(ans); } public static int fibo( int n){ if(n==0||n==1) return n; if(n<0) return -1; return fibo(n-1)+fibo(n-2); }}
UTF-8
Java
310
java
fibonacci.java
Java
[]
null
[]
import java.util.*; class fibonacci{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int ans=fibo(n); System.out.println(ans); } public static int fibo( int n){ if(n==0||n==1) return n; if(n<0) return -1; return fibo(n-1)+fibo(n-2); }}
310
0.622581
0.603226
22
12.181818
12.186566
38
false
false
0
0
0
0
0
0
0.454545
false
false
3
86758937283b92fc21bc63c715d7685a08a38824
16,320,875,781,769
313fdbb71ac735fe2374ca8e07d3041f378e336f
/trunk/v2.2_zy/commoncore/src/com/sinitek/sirm/common/web/tag/AbstractIncludeTag.java
7cc2bfbe3b1211b5ece698a14ba0263873ee25ef
[]
no_license
HFfay/sirmzy2.2
https://github.com/HFfay/sirmzy2.2
410351e2bf286080f8272409adba65b4855b43a9
ed691f1049d2bd1a28c4fe2122aa8d025ff94921
refs/heads/master
2017-11-11T17:02:26.968000
2017-03-06T09:23:22
2017-03-06T09:23:22
84,054,648
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sinitek.sirm.common.web.tag; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyTag; import javax.servlet.jsp.tagext.BodyTagSupport; /** * Created by IntelliJ IDEA. * User: 王志华 * Date: 14-11-9 * Time: 上午10:07 * To change this template use File | Settings | File Templates. */ abstract public class AbstractIncludeTag extends BodyTagSupport { /** * 添加参数 * @param name 参数名称 * @param value 参数值 */ abstract public void addParameter(String name, String value); /** * 清除参数 */ abstract public void clearParameters(); @Override public int doStartTag() throws JspException { this.clearParameters(); return BodyTag.EVAL_PAGE; } }
UTF-8
Java
783
java
AbstractIncludeTag.java
Java
[ { "context": "pport;\n\n/**\n * Created by IntelliJ IDEA.\n * User: 王志华\n * Date: 14-11-9\n * Time: 上午10:07\n * To change ", "end": 214, "score": 0.6838220953941345, "start": 213, "tag": "NAME", "value": "王" }, { "context": "port;\n\n/**\n * Created by IntelliJ IDEA.\n * User: 王志华\n * Date: 14-11-9\n * Time: 上午10:07\n * To change th", "end": 216, "score": 0.7334080338478088, "start": 214, "tag": "USERNAME", "value": "志华" } ]
null
[]
package com.sinitek.sirm.common.web.tag; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyTag; import javax.servlet.jsp.tagext.BodyTagSupport; /** * Created by IntelliJ IDEA. * User: 王志华 * Date: 14-11-9 * Time: 上午10:07 * To change this template use File | Settings | File Templates. */ abstract public class AbstractIncludeTag extends BodyTagSupport { /** * 添加参数 * @param name 参数名称 * @param value 参数值 */ abstract public void addParameter(String name, String value); /** * 清除参数 */ abstract public void clearParameters(); @Override public int doStartTag() throws JspException { this.clearParameters(); return BodyTag.EVAL_PAGE; } }
783
0.66891
0.656797
34
20.852942
20.37174
65
false
false
0
0
0
0
0
0
0.323529
false
false
3
d5b9513ef6745ffab3010c538af92dea8b923798
3,710,851,804,455
767a86c8b64724affeef190508d4f58fc5eade7c
/web/connectedcar/src/main/java/connected/car/sales/SalesServiceImpl.java
bb295ecc402bfa6dee3cdeea4585a7cff2d8b9fc
[]
no_license
So-Youn/ConnectedCar-Carnect
https://github.com/So-Youn/ConnectedCar-Carnect
cf38f54eed8fe502545ab00c44ce24e620c7638b
02b616a0037a1faca04c39114467abcfbf70f0b0
refs/heads/master
2022-12-17T07:49:06.054000
2020-09-22T14:06:09
2020-09-22T14:06:09
297,667,964
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package connected.car.sales; import java.util.List; import java.util.SortedMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import connected.car.expendable.ShopExpendableVO; @Service public class SalesServiceImpl implements SalesService { @Autowired @Qualifier("salesDao") SalesDAO dao; CalculatingSales calc; @Override public List<ShopExpendableVO> getExpendList(String shop_id) { return dao.getExpendList(shop_id); } @Override public int[] getAnnualSales(String shop_id) { calc = new CalculatingSales(); return calc.getAnnualSalesArray(dao.getAnnualSales(shop_id)); } @Override public SortedMap<String, Integer[]> getTypeSales(String shop_id) { calc = new CalculatingSales(); return calc.getTypeSalesArray(dao.getTypeSales(shop_id)); } }
UTF-8
Java
902
java
SalesServiceImpl.java
Java
[]
null
[]
package connected.car.sales; import java.util.List; import java.util.SortedMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import connected.car.expendable.ShopExpendableVO; @Service public class SalesServiceImpl implements SalesService { @Autowired @Qualifier("salesDao") SalesDAO dao; CalculatingSales calc; @Override public List<ShopExpendableVO> getExpendList(String shop_id) { return dao.getExpendList(shop_id); } @Override public int[] getAnnualSales(String shop_id) { calc = new CalculatingSales(); return calc.getAnnualSalesArray(dao.getAnnualSales(shop_id)); } @Override public SortedMap<String, Integer[]> getTypeSales(String shop_id) { calc = new CalculatingSales(); return calc.getTypeSalesArray(dao.getTypeSales(shop_id)); } }
902
0.786031
0.786031
36
24.055555
23.209127
67
false
false
0
0
0
0
0
0
1.111111
false
false
3
081b7f4c66d5856bcc4fbd6104b77add279c54f5
6,700,148,995,724
de44b2e67501eb0760dfad736afa94b048ae6c93
/TravelUS/src/main/java/com/bc004346/travelus/utility/NotificationHelper.java
68a6055686cad4ec65f5553ffc5f0e505b27d8f0
[]
no_license
bc004346/TravelUS
https://github.com/bc004346/TravelUS
fd23b7a42b83f86c0533075ac3cbe708742307d3
1796022669f1a02bddf7ec73fc6540471224468f
refs/heads/master
2016-08-07T14:11:10.564000
2015-07-12T00:57:09
2015-07-12T00:57:09
38,945,621
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.bc004346.travelus.utility; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import com.bc004346.travelus.BookTravelActivity; import com.bc004346.travelus.R; import com.bc004346.travelus.model.domain.DayTrip; import com.bc004346.travelus.model.domain.NotificationParameters; import java.io.Serializable; import java.util.ArrayList; /** * Created by Renats on 2/22/14. * System notification helper */ public class NotificationHelper { public static void displayNotification(NotificationParameters params) { Notification.Builder builder = new Notification.Builder(params.getContext()); builder.setContentTitle(params.getTitle()) .setContentText(params.getMessage()) .setSmallIcon(R.drawable.ic_launcher); if (params.getCallback() != null) { Intent resultIntent = new Intent(params.getContext(), params.getCallback()); resultIntent.putExtra(params.getExtraFlag(), params.getObject()); PendingIntent resultPendingIntent = PendingIntent.getActivity( params.getContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT ); builder.setContentIntent(resultPendingIntent); } Notification notification = builder.getNotification(); NotificationManager mgr = (NotificationManager) params.getContext().getSystemService(Context.NOTIFICATION_SERVICE); mgr.notify(params.getNotificationID(), notification); } public static void removeNotification(Context context, int notificationID) { NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mgr.cancel(notificationID); } }
UTF-8
Java
2,007
java
NotificationHelper.java
Java
[ { "context": "le;\nimport java.util.ArrayList;\n\n/**\n * Created by Renats on 2/22/14.\n * System notification helper\n */\npub", "end": 492, "score": 0.9949851036071777, "start": 486, "tag": "NAME", "value": "Renats" } ]
null
[]
package com.bc004346.travelus.utility; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import com.bc004346.travelus.BookTravelActivity; import com.bc004346.travelus.R; import com.bc004346.travelus.model.domain.DayTrip; import com.bc004346.travelus.model.domain.NotificationParameters; import java.io.Serializable; import java.util.ArrayList; /** * Created by Renats on 2/22/14. * System notification helper */ public class NotificationHelper { public static void displayNotification(NotificationParameters params) { Notification.Builder builder = new Notification.Builder(params.getContext()); builder.setContentTitle(params.getTitle()) .setContentText(params.getMessage()) .setSmallIcon(R.drawable.ic_launcher); if (params.getCallback() != null) { Intent resultIntent = new Intent(params.getContext(), params.getCallback()); resultIntent.putExtra(params.getExtraFlag(), params.getObject()); PendingIntent resultPendingIntent = PendingIntent.getActivity( params.getContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT ); builder.setContentIntent(resultPendingIntent); } Notification notification = builder.getNotification(); NotificationManager mgr = (NotificationManager) params.getContext().getSystemService(Context.NOTIFICATION_SERVICE); mgr.notify(params.getNotificationID(), notification); } public static void removeNotification(Context context, int notificationID) { NotificationManager mgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mgr.cancel(notificationID); } }
2,007
0.674639
0.656702
56
34.839287
27.994755
105
false
false
0
0
0
0
0
0
0.535714
false
false
3
8a8148bdb675c330dd395ad3d91ebd1b1ca48027
9,345,848,895,389
7f50acb8dd4565601c5e0e292b609f27b1423a6d
/src/main/java/org/remind/goku/utils/DateUtil.java
4b17d15f06e3bcd927d5a507e145b0d3dbdbcac1
[]
no_license
remind/goku
https://github.com/remind/goku
386e461138958f4b7455a1ccddbf53904567d7aa
6fa2d0e87330560f3ef4bb69278371de43736c71
refs/heads/master
2021-01-01T20:17:28.217000
2014-06-23T02:51:34
2014-06-23T02:51:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.remind.goku.utils; import java.text.SimpleDateFormat; import java.util.Date; public class DateUtil { public static String getCurrentByFormat(String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); Date d = new Date(); return sdf.format(d); } }
UTF-8
Java
281
java
DateUtil.java
Java
[]
null
[]
package org.remind.goku.utils; import java.text.SimpleDateFormat; import java.util.Date; public class DateUtil { public static String getCurrentByFormat(String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); Date d = new Date(); return sdf.format(d); } }
281
0.754448
0.754448
13
20.615385
19.068857
57
false
false
0
0
0
0
0
0
1.076923
false
false
3
8ab65e4d7ed384b2a2535acf44be73ddcbc324d4
5,755,256,185,765
41fc88e0b33e941a7cf77878e45b77c3140d8ebd
/Base/src/main/java/com/ray/domain/User.java
39c349368bb711ead94e0242943b51104c849266
[]
no_license
Rayooo/JavaFramework
https://github.com/Rayooo/JavaFramework
d01e377d19a81082ee61614e8cfea456ea44576d
71f93a602eecef05d7ac18dc16449cb8e278ab6e
refs/heads/master
2021-01-19T22:40:39.573000
2017-06-19T04:55:16
2017-06-19T04:55:16
88,840,428
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ray.domain; import com.ray.domain.base.BaseEntity; import java.io.Serializable; /** * 2017/5/2 16:46 CREATE TABLE mybatis.user ( id VARCHAR(100) PRIMARY KEY, username VARCHAR(28), password VARCHAR(255) ); */ public class User extends BaseEntity implements Serializable { private static final long serialVersionUID = 7565367228702877849L; private String userName; private String password; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
UTF-8
Java
738
java
User.java
Java
[ { "context": "ionUID = 7565367228702877849L;\n\n private String userName;\n\n private String password;\n\n public String", "end": 396, "score": 0.9340885281562805, "start": 388, "tag": "USERNAME", "value": "userName" }, { "context": "\n\n public String getUserName() {\n return userName;\n }\n\n public void setUserName(String userNa", "end": 486, "score": 0.9902807474136353, "start": 478, "tag": "USERNAME", "value": "userName" }, { "context": "serName;\n }\n\n public void setUserName(String userName) {\n this.userName = userName;\n }\n\n p", "end": 538, "score": 0.7381669878959656, "start": 530, "tag": "USERNAME", "value": "userName" }, { "context": "serName(String userName) {\n this.userName = userName;\n }\n\n public String getPassword() {\n ", "end": 574, "score": 0.9888632297515869, "start": 566, "tag": "USERNAME", "value": "userName" }, { "context": "assword(String password) {\n this.password = password;\n }\n}\n", "end": 728, "score": 0.837641179561615, "start": 720, "tag": "PASSWORD", "value": "password" } ]
null
[]
package com.ray.domain; import com.ray.domain.base.BaseEntity; import java.io.Serializable; /** * 2017/5/2 16:46 CREATE TABLE mybatis.user ( id VARCHAR(100) PRIMARY KEY, username VARCHAR(28), password VARCHAR(255) ); */ public class User extends BaseEntity implements Serializable { private static final long serialVersionUID = 7565367228702877849L; private String userName; private String password; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = <PASSWORD>; } }
740
0.680217
0.630081
41
17
18.390081
70
false
false
0
0
0
0
0
0
0.317073
false
false
3
665910a293150b0e2030dfff5675ab5b3e9396c7
9,938,554,366,526
b2b901c5e52084eb07ad29937765618d6967ac3e
/src/com/company/Main.java
3bed8c0612887cbc454f53ad5993a5e3f3675e2a
[]
no_license
AlekseyKiselyov/task4
https://github.com/AlekseyKiselyov/task4
e2af031119e902a76117ee06cf5c702708534f15
9530ff51db4be98b0ab3d3a2957b3366cf9f76ea
refs/heads/master
2023-07-01T21:22:14.210000
2021-08-06T11:09:25
2021-08-06T11:09:25
393,184,067
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.company; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) { String path = args[0]; ArrayList<Integer> nums = new ArrayList<Integer>(); try (BufferedReader reader = new BufferedReader(new FileReader(path))){ String string = reader.readLine(); while (string != null){ nums.add(Integer.parseInt(string)); string = reader.readLine(); } Collections.sort(nums); int median = getMedian(nums); int diff = 0; int steps = 0; for (int i: nums){ diff = Math.abs(median - i); steps += diff; } System.out.println(steps); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } static int getMedian(ArrayList<Integer> list){ int index; int median; if(list.size()%2 == 1){ index = list.size()/2; median = list.get(index); } else { index = (list.size()/2 - 1); median = Math.round((list.get(index) + list.get(index + 1))/2f); } return median; } }
UTF-8
Java
1,469
java
Main.java
Java
[]
null
[]
package com.company; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) { String path = args[0]; ArrayList<Integer> nums = new ArrayList<Integer>(); try (BufferedReader reader = new BufferedReader(new FileReader(path))){ String string = reader.readLine(); while (string != null){ nums.add(Integer.parseInt(string)); string = reader.readLine(); } Collections.sort(nums); int median = getMedian(nums); int diff = 0; int steps = 0; for (int i: nums){ diff = Math.abs(median - i); steps += diff; } System.out.println(steps); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } static int getMedian(ArrayList<Integer> list){ int index; int median; if(list.size()%2 == 1){ index = list.size()/2; median = list.get(index); } else { index = (list.size()/2 - 1); median = Math.round((list.get(index) + list.get(index + 1))/2f); } return median; } }
1,469
0.530293
0.523485
53
26.716982
18.558807
79
false
false
0
0
0
0
0
0
0.528302
false
false
3
e30db5a3d8654e40437450dbe3680e94626356c9
31,825,707,692,071
2a438ba0633c532038bfe7d83ff9e88ae7d7a9c1
/spring-boot-starter-data-jpa/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/MultipleJpaConfigurerAdapterTests.java
7912f242b60565033787e2c6f6a710803873e94d
[ "Apache-2.0" ]
permissive
spt-oss/spring-boot-plus_
https://github.com/spt-oss/spring-boot-plus_
8a7f3876d47c5f7c36583191d73ce08dfdb37fb8
21cf882098eff320b6f4b042a9d6a96daf1ae8e4
refs/heads/master
2021-10-15T08:13:48.450000
2018-12-30T15:08:18
2018-12-30T15:08:18
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * Copyright 2017-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.autoconfigure.orm.jpa; import static org.assertj.core.api.Assertions.assertThat; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.BarJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.BazJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.FooJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.example.bar.Bar; import org.springframework.boot.autoconfigure.orm.jpa.example.bar.BarRepository; import org.springframework.boot.autoconfigure.orm.jpa.example.baz.Baz; import org.springframework.boot.autoconfigure.orm.jpa.example.baz.BazRepository; import org.springframework.boot.autoconfigure.orm.jpa.example.foo.Foo; import org.springframework.boot.autoconfigure.orm.jpa.example.foo.FooRepository; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.EntityManagerFactoryInfo; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.PlatformTransactionManager; import com.zaxxer.hikari.HikariDataSource; /** * {@link Test}: {@link MultipleJpaConfigurer} */ @RunWith(SpringRunner.class) @SpringBootTest(classes = { /* @formatter:off */ FooJpaConfiguration.class, BarJpaConfiguration.class, BazJpaConfiguration.class /* @formatter:on */ }) @ActiveProfiles({ "test", "test-multiple-jpa-config" }) public class MultipleJpaConfigurerAdapterTests { /** * Foo */ private static final String FOO = "foo"; /** * Bar */ private static final String BAR = "bar"; /** * Baz */ private static final String BAZ = "baz"; /** * {@link DataSource} for {@link #FOO} */ @Autowired @Qualifier(FOO) private DataSource fooDataSource; /** * {@link DataSource} for {@link #BAR} */ @Autowired private DataSource barDataSource; /** * {@link DataSource} for {@link #BAZ} */ @Autowired private DataSource bazDataSource; /** * {@link PlatformTransactionManager} for {@link #FOO} */ @Autowired @Qualifier(FOO) private PlatformTransactionManager fooTransactionManager; /** * {@link PlatformTransactionManager} for {@link #BAR} */ @Autowired private PlatformTransactionManager barTransactionManager; /** * {@link PlatformTransactionManager} for {@link #BAZ} */ @Autowired private PlatformTransactionManager bazTransactionManager; /** * {@link EntityManagerFactory} for {@link #FOO} */ @Autowired @Qualifier("&entityManagerFactory") private LocalContainerEntityManagerFactoryBean fooEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired @Qualifier("&" + BAR + MultipleJpaConfigurerAdapter.ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) private LocalContainerEntityManagerFactoryBean barEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired @Qualifier("&" + BAZ + MultipleJpaConfigurerAdapter.ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) private LocalContainerEntityManagerFactoryBean bazEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #FOO} */ @Autowired @Qualifier(FOO) private EntityManagerFactory fooEntityManagerFactory; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired private EntityManagerFactory barEntityManagerFactory; /** * {@link EntityManagerFactory} for {@link #BAZ} */ @Autowired private EntityManagerFactory bazEntityManagerFactory; /** * {@link FooRepository} */ @Autowired private FooRepository fooRepository; /** * {@link BarRepository} */ @Autowired private BarRepository barRepository; /** * {@link BazRepository} */ @Autowired private BazRepository bazRepository; /** * {@link MultipleJpaConfigurerAdapter#dataSource()} */ @Test public void dataSource() { { HikariDataSource dataSource = (HikariDataSource) this.fooDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:foo"); assertThat(dataSource.getPoolName()).isEqualTo(FOO); } { HikariDataSource dataSource = (HikariDataSource) this.barDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:bar"); assertThat(dataSource.getPoolName()).isEqualTo(BAR); } { HikariDataSource dataSource = (HikariDataSource) this.bazDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:baz"); assertThat(dataSource.getPoolName()).isEqualTo(BAZ); } } /** * {@link MultipleJpaConfigurerAdapter#transactionManager()} */ @Test public void transactionManager() { { JpaTransactionManager transactionManager = (JpaTransactionManager) this.fooTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(FOO); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.fooEntityManagerFactory); } { JpaTransactionManager transactionManager = (JpaTransactionManager) this.barTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(BAR); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.barEntityManagerFactory); } { JpaTransactionManager transactionManager = (JpaTransactionManager) this.bazTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.bazEntityManagerFactory); } } /** * {@link MultipleJpaConfigurerAdapter#entityManagerFactory()} */ @Test public void entityManagerFactoryBean() { assertThat(this.fooEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(FOO); assertThat(this.fooEntityManagerFactoryBean.getDataSource()).isEqualTo(this.fooDataSource); assertThat(this.barEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(BAR); assertThat(this.barEntityManagerFactoryBean.getDataSource()).isEqualTo(this.barDataSource); assertThat(this.bazEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(this.bazEntityManagerFactoryBean.getDataSource()).isEqualTo(this.bazDataSource); } /** * {@link MultipleJpaConfigurerAdapter#entityManagerFactory()} */ @Test public void entityManagerFactory() { // Check proxy assertThat(this.fooEntityManagerFactory.getClass().getInterfaces()).contains(EntityManagerFactoryInfo.class); { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.fooEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(FOO); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.fooDataSource); } { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.barEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(BAR); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.barDataSource); } { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.bazEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.bazDataSource); } } /** * {@link EnableJpaRepositories} */ @Test public void jpaRepository() { assertThat(this.fooRepository.findAll()).isEmpty(); assertThat(this.barRepository.findAll()).isEmpty(); assertThat(this.bazRepository.findAll()).isEmpty(); assertThat(this.fooRepository.save(new Foo().setValue(FOO))).isEqualTo(new Foo(1L, FOO)); assertThat(this.barRepository.save(new Bar().setValue(BAR))).isEqualTo(new Bar(1L, BAR)); assertThat(this.bazRepository.save(new Baz().setValue(BAZ))).isEqualTo(new Baz(1L, BAZ)); assertThat(this.fooRepository.findAll()).isNotEmpty(); assertThat(this.barRepository.findAll()).isNotEmpty(); assertThat(this.bazRepository.findAll()).isNotEmpty(); } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#FOO} */ @Configuration protected static class FooJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean @Qualifier(FOO) @Override public DataSource dataSource() { return super.dataSource(); } @Bean @Qualifier(FOO) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean @Qualifier(FOO) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Foo.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = FooRepository.class /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#BAR} */ @Configuration protected static class BarJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean(BAR + DATASOURCE_BEAN_SUFFIX) @Override public DataSource dataSource() { return super.dataSource(); } @Bean(BAR + TRANSACTION_MANAGER_BEAN_SUFFIX) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean(BAR + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Bar.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = BarRepository.class, entityManagerFactoryRef = BAR + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX, transactionManagerRef = BAR + TRANSACTION_MANAGER_BEAN_SUFFIX /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#BAZ} */ @Configuration protected static class BazJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean(BAZ + DATASOURCE_BEAN_SUFFIX) @Override public DataSource dataSource() { return super.dataSource(); } @Bean(BAZ + TRANSACTION_MANAGER_BEAN_SUFFIX) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean(BAZ + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Baz.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = BazRepository.class, entityManagerFactoryRef = BAZ + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX, transactionManagerRef = BAZ + TRANSACTION_MANAGER_BEAN_SUFFIX /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } }
UTF-8
Java
12,685
java
MultipleJpaConfigurerAdapterTests.java
Java
[]
null
[]
/* * Copyright 2017-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.autoconfigure.orm.jpa; import static org.assertj.core.api.Assertions.assertThat; import javax.persistence.EntityManagerFactory; import javax.sql.DataSource; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.BarJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.BazJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.MultipleJpaConfigurerAdapterTests.FooJpaConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.example.bar.Bar; import org.springframework.boot.autoconfigure.orm.jpa.example.bar.BarRepository; import org.springframework.boot.autoconfigure.orm.jpa.example.baz.Baz; import org.springframework.boot.autoconfigure.orm.jpa.example.baz.BazRepository; import org.springframework.boot.autoconfigure.orm.jpa.example.foo.Foo; import org.springframework.boot.autoconfigure.orm.jpa.example.foo.FooRepository; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.EntityManagerFactoryInfo; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.PlatformTransactionManager; import com.zaxxer.hikari.HikariDataSource; /** * {@link Test}: {@link MultipleJpaConfigurer} */ @RunWith(SpringRunner.class) @SpringBootTest(classes = { /* @formatter:off */ FooJpaConfiguration.class, BarJpaConfiguration.class, BazJpaConfiguration.class /* @formatter:on */ }) @ActiveProfiles({ "test", "test-multiple-jpa-config" }) public class MultipleJpaConfigurerAdapterTests { /** * Foo */ private static final String FOO = "foo"; /** * Bar */ private static final String BAR = "bar"; /** * Baz */ private static final String BAZ = "baz"; /** * {@link DataSource} for {@link #FOO} */ @Autowired @Qualifier(FOO) private DataSource fooDataSource; /** * {@link DataSource} for {@link #BAR} */ @Autowired private DataSource barDataSource; /** * {@link DataSource} for {@link #BAZ} */ @Autowired private DataSource bazDataSource; /** * {@link PlatformTransactionManager} for {@link #FOO} */ @Autowired @Qualifier(FOO) private PlatformTransactionManager fooTransactionManager; /** * {@link PlatformTransactionManager} for {@link #BAR} */ @Autowired private PlatformTransactionManager barTransactionManager; /** * {@link PlatformTransactionManager} for {@link #BAZ} */ @Autowired private PlatformTransactionManager bazTransactionManager; /** * {@link EntityManagerFactory} for {@link #FOO} */ @Autowired @Qualifier("&entityManagerFactory") private LocalContainerEntityManagerFactoryBean fooEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired @Qualifier("&" + BAR + MultipleJpaConfigurerAdapter.ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) private LocalContainerEntityManagerFactoryBean barEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired @Qualifier("&" + BAZ + MultipleJpaConfigurerAdapter.ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) private LocalContainerEntityManagerFactoryBean bazEntityManagerFactoryBean; /** * {@link EntityManagerFactory} for {@link #FOO} */ @Autowired @Qualifier(FOO) private EntityManagerFactory fooEntityManagerFactory; /** * {@link EntityManagerFactory} for {@link #BAR} */ @Autowired private EntityManagerFactory barEntityManagerFactory; /** * {@link EntityManagerFactory} for {@link #BAZ} */ @Autowired private EntityManagerFactory bazEntityManagerFactory; /** * {@link FooRepository} */ @Autowired private FooRepository fooRepository; /** * {@link BarRepository} */ @Autowired private BarRepository barRepository; /** * {@link BazRepository} */ @Autowired private BazRepository bazRepository; /** * {@link MultipleJpaConfigurerAdapter#dataSource()} */ @Test public void dataSource() { { HikariDataSource dataSource = (HikariDataSource) this.fooDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:foo"); assertThat(dataSource.getPoolName()).isEqualTo(FOO); } { HikariDataSource dataSource = (HikariDataSource) this.barDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:bar"); assertThat(dataSource.getPoolName()).isEqualTo(BAR); } { HikariDataSource dataSource = (HikariDataSource) this.bazDataSource; assertThat(dataSource.getJdbcUrl()).startsWith("jdbc:h2:mem:baz"); assertThat(dataSource.getPoolName()).isEqualTo(BAZ); } } /** * {@link MultipleJpaConfigurerAdapter#transactionManager()} */ @Test public void transactionManager() { { JpaTransactionManager transactionManager = (JpaTransactionManager) this.fooTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(FOO); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.fooEntityManagerFactory); } { JpaTransactionManager transactionManager = (JpaTransactionManager) this.barTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(BAR); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.barEntityManagerFactory); } { JpaTransactionManager transactionManager = (JpaTransactionManager) this.bazTransactionManager; assertThat(transactionManager.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(transactionManager.getEntityManagerFactory()).isEqualTo(this.bazEntityManagerFactory); } } /** * {@link MultipleJpaConfigurerAdapter#entityManagerFactory()} */ @Test public void entityManagerFactoryBean() { assertThat(this.fooEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(FOO); assertThat(this.fooEntityManagerFactoryBean.getDataSource()).isEqualTo(this.fooDataSource); assertThat(this.barEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(BAR); assertThat(this.barEntityManagerFactoryBean.getDataSource()).isEqualTo(this.barDataSource); assertThat(this.bazEntityManagerFactoryBean.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(this.bazEntityManagerFactoryBean.getDataSource()).isEqualTo(this.bazDataSource); } /** * {@link MultipleJpaConfigurerAdapter#entityManagerFactory()} */ @Test public void entityManagerFactory() { // Check proxy assertThat(this.fooEntityManagerFactory.getClass().getInterfaces()).contains(EntityManagerFactoryInfo.class); { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.fooEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(FOO); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.fooDataSource); } { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.barEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(BAR); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.barDataSource); } { EntityManagerFactoryInfo entityManagerFactory = (EntityManagerFactoryInfo) this.bazEntityManagerFactory; assertThat(entityManagerFactory.getPersistenceUnitName()).isEqualTo(BAZ); assertThat(entityManagerFactory.getDataSource()).isEqualTo(this.bazDataSource); } } /** * {@link EnableJpaRepositories} */ @Test public void jpaRepository() { assertThat(this.fooRepository.findAll()).isEmpty(); assertThat(this.barRepository.findAll()).isEmpty(); assertThat(this.bazRepository.findAll()).isEmpty(); assertThat(this.fooRepository.save(new Foo().setValue(FOO))).isEqualTo(new Foo(1L, FOO)); assertThat(this.barRepository.save(new Bar().setValue(BAR))).isEqualTo(new Bar(1L, BAR)); assertThat(this.bazRepository.save(new Baz().setValue(BAZ))).isEqualTo(new Baz(1L, BAZ)); assertThat(this.fooRepository.findAll()).isNotEmpty(); assertThat(this.barRepository.findAll()).isNotEmpty(); assertThat(this.bazRepository.findAll()).isNotEmpty(); } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#FOO} */ @Configuration protected static class FooJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean @Qualifier(FOO) @Override public DataSource dataSource() { return super.dataSource(); } @Bean @Qualifier(FOO) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean @Qualifier(FOO) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Foo.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = FooRepository.class /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#BAR} */ @Configuration protected static class BarJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean(BAR + DATASOURCE_BEAN_SUFFIX) @Override public DataSource dataSource() { return super.dataSource(); } @Bean(BAR + TRANSACTION_MANAGER_BEAN_SUFFIX) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean(BAR + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Bar.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = BarRepository.class, entityManagerFactoryRef = BAR + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX, transactionManagerRef = BAR + TRANSACTION_MANAGER_BEAN_SUFFIX /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } /** * {@link MultipleJpaConfigurerAdapter} for {@link MultipleJpaConfigurerAdapterTests#BAZ} */ @Configuration protected static class BazJpaConfiguration extends MultipleJpaConfigurerAdapter { @Bean(BAZ + DATASOURCE_BEAN_SUFFIX) @Override public DataSource dataSource() { return super.dataSource(); } @Bean(BAZ + TRANSACTION_MANAGER_BEAN_SUFFIX) @Override public PlatformTransactionManager transactionManager() { return super.transactionManager(); } @Bean(BAZ + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX) @Override public LocalContainerEntityManagerFactoryBean entityManagerFactory() { return super.entityManagerFactory(); } @Override protected Class<?> basePackageClass() { return Baz.class; } /** * {@link Configuration} for {@link EnableJpaRepositories} */ @Configuration @EnableJpaRepositories( /* @formatter:off */ basePackageClasses = BazRepository.class, entityManagerFactoryRef = BAZ + ENTITY_MANAGER_FACTORY_BEAN_SUFFIX, transactionManagerRef = BAZ + TRANSACTION_MANAGER_BEAN_SUFFIX /* @formatter:on */ ) protected static class JpaRepositoryConfiguration { /* NOP */ } } }
12,685
0.754356
0.752858
447
27.378077
30.182484
111
false
false
0
0
0
0
0
0
1.785235
false
false
3
2f8864fa33d2931e21729d0c66adce99cfcfd4d9
7,258,494,781,067
3c67de51a9577128221c19dccf9d220b68762a43
/Components/component_ocr/src/main/java/com/sscf/investment/component/ocr/OcrCallback.java
233c34232d02c6ad1042c34bc02b3504de1abb4a
[]
no_license
w296365959/NF_Project02
https://github.com/w296365959/NF_Project02
670152a485e75fafbc340cbc6487edef03c8e840
a2b6f5a4dbb239891994c8f0895275d8dcd5330b
refs/heads/master
2020-03-17T03:28:45.510000
2019-04-23T16:28:41
2019-04-23T16:28:41
133,237,038
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sscf.investment.component.ocr; import com.sscf.investment.sdk.net.ocr.OcrHttpCallback; /** * Created by yorkeehuang on 2017/5/23. */ public interface OcrCallback extends OcrHttpCallback { void onOcrStart(); void onCompressSuccess(); }
UTF-8
Java
262
java
OcrCallback.java
Java
[ { "context": "nt.sdk.net.ocr.OcrHttpCallback;\n\n/**\n * Created by yorkeehuang on 2017/5/23.\n */\n\npublic interface OcrCallback e", "end": 130, "score": 0.9996645450592041, "start": 119, "tag": "USERNAME", "value": "yorkeehuang" } ]
null
[]
package com.sscf.investment.component.ocr; import com.sscf.investment.sdk.net.ocr.OcrHttpCallback; /** * Created by yorkeehuang on 2017/5/23. */ public interface OcrCallback extends OcrHttpCallback { void onOcrStart(); void onCompressSuccess(); }
262
0.744275
0.717557
14
17.714285
21.004858
55
false
false
0
0
0
0
0
0
0.285714
false
false
3
7726da592f67d82cf695410f9693e190b7088177
17,952,963,357,864
cf108f86ae8bf47beed52e9a19456db867d2d3fa
/org.eclipse.datatools.connectivity.sqm.core.ui/src/org/eclipse/datatools/connectivity/sqm/core/internal/ui/explorer/filter/ColumnLabelProvider.java
d8adaf96946ccff4b3ee552efccc7b2ce2686af1
[ "EPL-1.0", "Apache-2.0" ]
permissive
KangZhiDong/DataToolsPlatform
https://github.com/KangZhiDong/DataToolsPlatform
7aaabe8bfe9b3540b12be991a7b7ea2e8193e1ee
76be044c0c2a413f09e1f00bf4a4ce08c52be070
refs/heads/master
2020-05-09T21:20:10.681000
2019-04-16T06:29:04
2019-04-16T06:29:04
181,438,269
1
0
Apache-2.0
false
2019-04-15T08:08:45
2019-04-15T07:49:46
2019-04-15T08:08:01
2019-04-15T08:08:44
0
0
0
0
null
false
false
/******************************************************************************* * Copyright (c) 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: IBM Corporation - initial API and implementation ******************************************************************************/ package org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.filter; import org.eclipse.datatools.connectivity.sqm.internal.core.connection.Predicate; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; public class ColumnLabelProvider extends LabelProvider implements ITableLabelProvider { Predicate predicate; ColumnTable columnTable; public ColumnLabelProvider(ColumnTable columnTable) { this.columnTable = columnTable; } public String getColumnText(Object element, int columnIndex) { predicate = (Predicate) element; if (columnIndex == 0) return columnTable.getSQLOperator(predicate.getOperator()); else return predicate.getValue(); } public Image getColumnImage(Object element, int columnIndex) { return null; } }
UTF-8
Java
1,379
java
ColumnLabelProvider.java
Java
[]
null
[]
/******************************************************************************* * Copyright (c) 2008 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: IBM Corporation - initial API and implementation ******************************************************************************/ package org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.filter; import org.eclipse.datatools.connectivity.sqm.internal.core.connection.Predicate; import org.eclipse.jface.viewers.ITableLabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; public class ColumnLabelProvider extends LabelProvider implements ITableLabelProvider { Predicate predicate; ColumnTable columnTable; public ColumnLabelProvider(ColumnTable columnTable) { this.columnTable = columnTable; } public String getColumnText(Object element, int columnIndex) { predicate = (Predicate) element; if (columnIndex == 0) return columnTable.getSQLOperator(predicate.getOperator()); else return predicate.getValue(); } public Image getColumnImage(Object element, int columnIndex) { return null; } }
1,379
0.699782
0.693256
39
34.358974
30.354729
81
false
false
0
0
0
0
0
0
1.051282
false
false
3
9b29982815413cc8f0720581d11e4e2649f66636
28,905,129,947,995
4146f815702c7108a439c8cdd53db46139222766
/Chapter13/src/Example13_2.java
f666ec52ec153126c2accdad64327cd70c85a4ec
[]
no_license
NinaVictoria/JavaReview
https://github.com/NinaVictoria/JavaReview
3b1ff5a41f25fc1d65fed8bbc33e1fb1128705dc
1bf82421294acacd76bc8608ec0f6372f9954f3f
refs/heads/master
2022-11-10T21:50:39.146000
2020-07-07T13:01:29
2020-07-07T13:01:29
277,029,054
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.net.InetAddress; import java.net.UnknownHostException; /** * @author : Nina * @time : 2020/7/7 15:37 * @description : InetAddress */ public class Example13_2 { public static void main(String[] args) { try{ InetAddress address_1=InetAddress.getByName("www.taobao.com"); System.out.println(address_1.toString()); InetAddress address_2=InetAddress.getLocalHost(); System.out.println(address_2.toString()); } catch (UnknownHostException e) { e.printStackTrace(); } } }
UTF-8
Java
574
java
Example13_2.java
Java
[ { "context": "t java.net.UnknownHostException;\n\n/**\n * @author : Nina\n * @time : 2020/7/7 15:37\n * @description : InetA", "end": 89, "score": 0.9975016117095947, "start": 85, "tag": "NAME", "value": "Nina" } ]
null
[]
import java.net.InetAddress; import java.net.UnknownHostException; /** * @author : Nina * @time : 2020/7/7 15:37 * @description : InetAddress */ public class Example13_2 { public static void main(String[] args) { try{ InetAddress address_1=InetAddress.getByName("www.taobao.com"); System.out.println(address_1.toString()); InetAddress address_2=InetAddress.getLocalHost(); System.out.println(address_2.toString()); } catch (UnknownHostException e) { e.printStackTrace(); } } }
574
0.620209
0.590592
20
27.700001
21.26758
74
false
false
0
0
0
0
0
0
0.35
false
false
3
a312a3e1d06a0f554e98a7cc43f94994f344c405
2,087,354,157,856
561496b0940bcc705774cc7fd1bbeb6963644ba3
/com.agit.crm.user.management/src/main/java/com/agit/crm/user/management/application/impl/CompanyProfileImpl.java
8c6801acf174659afe07df0923627f075f707e60
[]
no_license
bellmit/POC-1
https://github.com/bellmit/POC-1
2e1cdeaaa383815a89065e4ba32d15b80e805436
3582bf815c2e14f407cb385a559476b6df688fef
refs/heads/master
2022-03-09T19:35:52.251000
2018-07-25T02:52:34
2018-07-25T02:52:34
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.agit.crm.user.management.application.impl; //package com.agit.crm.user.management.application.impl; // //import com.bitozen.skk.common.dto.usermanagement.CompanyProfileDTO; //import com.agit.crm.user.management.application.CompanyProfileService; //import com.agit.crm.user.management.domain.company.profile.CompanyProfile; //import com.agit.crm.user.management.domain.company.profile.CompanyProfileRepository; //import com.agit.crm.user.management.interfaces.web.facade.dto.assembler.companyprofile.CompanyProfileDTOAssembler; //import java.util.List; //import java.util.Map; //import org.apache.commons.lang.Validate; // ///** // * // * @author RBS // */ //public class CompanyProfileImpl implements CompanyProfileService { // // private CompanyProfileRepository companyProfileRepository; // private CompanyProfileDTOAssembler companyProfileDTOAssembler; // // public void setCompanyProfileRepository(CompanyProfileRepository companyProfileRepository) { // this.companyProfileRepository = companyProfileRepository; // } // // public void setCompanyProfileDTOAssembler(CompanyProfileDTOAssembler companyProfileDTOAssembler) { // this.companyProfileDTOAssembler = companyProfileDTOAssembler; // } // // @Override // public void saveOrUpdate(CompanyProfileDTO companyProfileDTO) { // CompanyProfile companyProfile = companyProfileRepository.findByID(companyProfileDTO.getFullname()); // if (companyProfile == null) { // companyProfile = companyProfileDTOAssembler.toDomain(companyProfileDTO); // } else { // /* update specification */ // companyProfile.assignNewCompanyProfile(companyProfileDTOAssembler.toDomain(companyProfileDTO)); // } // // companyProfileRepository.saveOrUpdate(companyProfile); // } // // @Override // public CompanyProfileDTO findByID(String fullname) { // Validate.notNull(companyProfileRepository); // CompanyProfile companyProfile = (CompanyProfile) companyProfileRepository.findByID(fullname); // if (companyProfile != null) { // return companyProfileDTOAssembler.toDTO(companyProfile); // } // // return null; // } // // @Override // public List<CompanyProfileDTO> findAllCompany() { // Validate.notNull(companyProfileRepository); // List<CompanyProfile> companyProfiles = (List<CompanyProfile>) companyProfileRepository.findAll(); // return companyProfileDTOAssembler.toDTO(companyProfiles); // } // // @Override // public void deleteData(CompanyProfileDTO companyProfile) { // CompanyProfile c = companyProfileDTOAssembler.toDomain(companyProfile); // companyProfileRepository.deleteData(c); // } // // @Override // public CompanyProfileDTO getDummy() { // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. // } // // @Override // public List<CompanyProfileDTO> findByParams(Map map) { // Validate.notNull(companyProfileRepository); // List<CompanyProfile> listCompanyProfile = companyProfileRepository.findByParams(map); // if (listCompanyProfile != null) { // return (List<CompanyProfileDTO>) companyProfileDTOAssembler.toDTO(listCompanyProfile); // } // return null; // } // //}
UTF-8
Java
3,472
java
CompanyProfileImpl.java
Java
[ { "context": "mons.lang.Validate;\r\n//\r\n///**\r\n// *\r\n// * @author RBS\r\n// */\r\n//public class CompanyProfileImpl impleme", "end": 677, "score": 0.9994155168533325, "start": 674, "tag": "USERNAME", "value": "RBS" } ]
null
[]
package com.agit.crm.user.management.application.impl; //package com.agit.crm.user.management.application.impl; // //import com.bitozen.skk.common.dto.usermanagement.CompanyProfileDTO; //import com.agit.crm.user.management.application.CompanyProfileService; //import com.agit.crm.user.management.domain.company.profile.CompanyProfile; //import com.agit.crm.user.management.domain.company.profile.CompanyProfileRepository; //import com.agit.crm.user.management.interfaces.web.facade.dto.assembler.companyprofile.CompanyProfileDTOAssembler; //import java.util.List; //import java.util.Map; //import org.apache.commons.lang.Validate; // ///** // * // * @author RBS // */ //public class CompanyProfileImpl implements CompanyProfileService { // // private CompanyProfileRepository companyProfileRepository; // private CompanyProfileDTOAssembler companyProfileDTOAssembler; // // public void setCompanyProfileRepository(CompanyProfileRepository companyProfileRepository) { // this.companyProfileRepository = companyProfileRepository; // } // // public void setCompanyProfileDTOAssembler(CompanyProfileDTOAssembler companyProfileDTOAssembler) { // this.companyProfileDTOAssembler = companyProfileDTOAssembler; // } // // @Override // public void saveOrUpdate(CompanyProfileDTO companyProfileDTO) { // CompanyProfile companyProfile = companyProfileRepository.findByID(companyProfileDTO.getFullname()); // if (companyProfile == null) { // companyProfile = companyProfileDTOAssembler.toDomain(companyProfileDTO); // } else { // /* update specification */ // companyProfile.assignNewCompanyProfile(companyProfileDTOAssembler.toDomain(companyProfileDTO)); // } // // companyProfileRepository.saveOrUpdate(companyProfile); // } // // @Override // public CompanyProfileDTO findByID(String fullname) { // Validate.notNull(companyProfileRepository); // CompanyProfile companyProfile = (CompanyProfile) companyProfileRepository.findByID(fullname); // if (companyProfile != null) { // return companyProfileDTOAssembler.toDTO(companyProfile); // } // // return null; // } // // @Override // public List<CompanyProfileDTO> findAllCompany() { // Validate.notNull(companyProfileRepository); // List<CompanyProfile> companyProfiles = (List<CompanyProfile>) companyProfileRepository.findAll(); // return companyProfileDTOAssembler.toDTO(companyProfiles); // } // // @Override // public void deleteData(CompanyProfileDTO companyProfile) { // CompanyProfile c = companyProfileDTOAssembler.toDomain(companyProfile); // companyProfileRepository.deleteData(c); // } // // @Override // public CompanyProfileDTO getDummy() { // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. // } // // @Override // public List<CompanyProfileDTO> findByParams(Map map) { // Validate.notNull(companyProfileRepository); // List<CompanyProfile> listCompanyProfile = companyProfileRepository.findByParams(map); // if (listCompanyProfile != null) { // return (List<CompanyProfileDTO>) companyProfileDTOAssembler.toDTO(listCompanyProfile); // } // return null; // } // //}
3,472
0.702189
0.702189
83
39.831326
36.398006
137
false
false
0
0
0
0
0
0
0.409639
false
false
3
7b66e9c603b56a2a93b46accd05bc6f166be9e1d
2,087,354,157,086
008c6289bab018d8a88daa3dbb2b16d48fb88298
/Week1_4_3.java
5c817c42059967dfa32240c0a2b8d51e4069e6bf
[]
no_license
liviv/Homework
https://github.com/liviv/Homework
2da6681c209737b01aae5ea1ef8956970d2b3bda
50ea13104f482bdf1e9edd5c0269017a21393a53
refs/heads/master
2021-01-10T23:04:50.371000
2016-10-13T13:33:31
2016-10-13T13:33:31
70,424,502
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
//4.3. Пользователь вводит число. Вывести на экран его удвоенное значение, если число делится на 7 нацело. package Week_1; import java.util.Scanner; public class Week1_4_3 { public static void main(String[] args) { Scanner slave = new Scanner (System.in); System.out.println("Enter a number"); int number = slave.nextInt(); if (number%7 == 0){System.out.println(number*2); } } }
WINDOWS-1251
Java
498
java
Week1_4_3.java
Java
[]
null
[]
//4.3. Пользователь вводит число. Вывести на экран его удвоенное значение, если число делится на 7 нацело. package Week_1; import java.util.Scanner; public class Week1_4_3 { public static void main(String[] args) { Scanner slave = new Scanner (System.in); System.out.println("Enter a number"); int number = slave.nextInt(); if (number%7 == 0){System.out.println(number*2); } } }
498
0.664269
0.640288
18
21.166666
26.930466
106
false
false
0
0
0
0
0
0
1.166667
false
false
3
84b914f6d37ec71f68d010576e96d0f1c47ed46e
26,474,178,454,971
70f0f1ffbb687eb8dc59a16e5b55ef1e29a7b6af
/src/com/study/mooc/proxy/dynamicproxy/SubjectImpl.java
00e6acdb0ff4bb44c1941a93557763c5340c8f5d
[]
no_license
jiangfuxing/huawei-exercise-test
https://github.com/jiangfuxing/huawei-exercise-test
08130387fd23af8027243afc1fb6f3581f1c90eb
8418cc021f632d6d1379c91eace0d117817848c6
refs/heads/master
2022-11-24T22:35:31.646000
2020-07-30T14:47:16
2020-07-30T14:47:16
283,248,931
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.study.mooc.proxy.dynamicproxy; public class SubjectImpl implements Subject,Teachable { @Override public void request() { System.out.println("SubjectImpl.request()"); } @Override public void requestOther() { System.out.println("SubjectImpl.requestOther()"); } }
UTF-8
Java
315
java
SubjectImpl.java
Java
[]
null
[]
package com.study.mooc.proxy.dynamicproxy; public class SubjectImpl implements Subject,Teachable { @Override public void request() { System.out.println("SubjectImpl.request()"); } @Override public void requestOther() { System.out.println("SubjectImpl.requestOther()"); } }
315
0.673016
0.673016
13
23.23077
21.24637
57
false
false
0
0
0
0
0
0
0.307692
false
false
3
d623ea8ed79c06fac60fc30249de7149e321289e
32,255,204,425,035
c22b5ca9bd2a863e870192f7e068337ea582dbfa
/net-demo/app/src/main/java/com/sjl/net/dowload/FileDownloader.java
761ce84122d898750c1c77f760f38414d6a57e22
[]
no_license
zhang-zhq/android-blog-demo
https://github.com/zhang-zhq/android-blog-demo
bccd7a717fbbabf3bedb1f324af4ccb57510c6e3
57ab3fe47147e08297b50bd5a9a5159e2c7fb2f7
refs/heads/master
2023-08-15T07:46:35.843000
2021-09-09T03:51:31
2021-09-09T03:51:31
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.sjl.net.dowload; import android.os.SystemClock; import com.sjl.net.RetrofitHelper; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.RandomAccessFile; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import io.reactivex.ObservableOnSubscribe; import io.reactivex.ObservableSource; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Function; import io.reactivex.schedulers.Schedulers; import okhttp3.ResponseBody; /** * 文件下载器 * * @author Kelly * @version 1.0.0 * @filename FileDownloader.java * @time 2018/7/25 16:04 * @copyright(C) 2018 song */ public class FileDownloader { static CompositeDisposable mDisposable = new CompositeDisposable(); /** * 下载文件法1(使用Handler更新UI) * * @param observable 下载被观察者 * @param destDir 下载目录 * @param fileName 文件名 * @param progressHandler 进度handler */ public static void downloadFile(Observable<ResponseBody> observable, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { final DownloadInfo downloadInfo = new DownloadInfo(); observable .subscribeOn(Schedulers.io()) .observeOn(Schedulers.io()) .subscribe(new Observer<ResponseBody>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(ResponseBody responseBody) { InputStream inputStream = null; long total = 0; long responseLength; FileOutputStream fos = null; try { byte[] buf = new byte[1024 * 8]; int len; responseLength = responseBody.contentLength(); inputStream = responseBody.byteStream(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); downloadInfo.setFile(file); downloadInfo.setFileSize(responseLength); fos = new FileOutputStream(file); int progress = 0; int lastProgress; long startTime = System.currentTimeMillis(); // 开始下载时获取开始时间 while ((len = inputStream.read(buf)) != -1) { fos.write(buf, 0, len); total += len; lastProgress = progress; progress = (int) (total * 100 / responseLength); long curTime = System.currentTimeMillis(); long usedTime = (curTime - startTime) / 1000; if (usedTime == 0) { usedTime = 1; } long speed = (total / usedTime); // 平均每秒下载速度 // 如果进度与之前进度相等,则不更新,如果更新太频繁,则会造成界面卡顿 if (progress > 0 && progress != lastProgress) { downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(total); downloadInfo.setUsedTime(usedTime); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_PROGRESS, downloadInfo); } } fos.flush(); downloadInfo.setFile(file); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_SUCCESS, downloadInfo); } catch (final Exception e) { downloadInfo.setErrorMsg(e); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_FAIL, downloadInfo); } finally { try { if (fos != null) { fos.close(); } } catch (Exception e) { e.printStackTrace(); } try { if (inputStream != null) { inputStream.close(); } } catch (Exception e) { e.printStackTrace(); } } } @Override public void onError(Throwable e) {//new Consumer<Throwable> downloadInfo.setErrorMsg(e); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_FAIL, downloadInfo); } @Override public void onComplete() {// new Action() } }); } /** * 下载文件法2(使用RXJava更新UI) * * @param observable * @param destDir * @param fileName * @param progressHandler */ public static void downloadFile2(Observable<ResponseBody> observable, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { final DownloadInfo downloadInfo = new DownloadInfo(); observable .flatMap(new Function<ResponseBody, ObservableSource<DownloadInfo>>() { @Override public ObservableSource<DownloadInfo> apply(final ResponseBody responseBody) throws Exception { return Observable.create(new ObservableOnSubscribe<DownloadInfo>() { @Override public void subscribe(ObservableEmitter<DownloadInfo> emitter) throws Exception { InputStream inputStream = null; long total = 0; long responseLength = 0; FileOutputStream fos = null; try { byte[] buf = new byte[1024 * 8]; int len = 0; responseLength = responseBody.contentLength(); inputStream = responseBody.byteStream(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); downloadInfo.setFile(file); downloadInfo.setFileSize(responseLength); fos = new FileOutputStream(file); int progress = 0; int lastProgress = 0; long startTime = System.currentTimeMillis(); // 开始下载时获取开始时间 while ((len = inputStream.read(buf)) != -1) { fos.write(buf, 0, len); total += len; lastProgress = progress; progress = (int) (total * 100 / responseLength); long curTime = System.currentTimeMillis(); long usedTime = (curTime - startTime) / 1000; if (usedTime == 0) { usedTime = 1; } long speed = (total / usedTime); // 平均每秒下载速度 // 如果进度与之前进度相等,则不更新,如果更新太频繁,则会造成界面卡顿 if (progress > 0 && progress != lastProgress) { downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(total); downloadInfo.setUsedTime(usedTime); if (!emitter.isDisposed()) { emitter.onNext(downloadInfo); } } } fos.flush(); downloadInfo.setFile(file); if (!emitter.isDisposed()) { emitter.onComplete(); } } catch (Exception e) { downloadInfo.setErrorMsg(e); if (!emitter.isDisposed()) { emitter.onError(e); } } finally { try { if (fos != null) { fos.close(); } } catch (Exception e) { e.printStackTrace(); } try { if (inputStream != null) { inputStream.close(); } } catch (Exception e) { e.printStackTrace(); } } } }); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<DownloadInfo>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(DownloadInfo downloadInfo) { progressHandler.onProgress(downloadInfo); } @Override public void onError(Throwable e) { progressHandler.onError(e); } @Override public void onComplete() { progressHandler.onCompleted(downloadInfo.getFile()); } }); } /** * 下载文件法3(多线程文件下载,使用RXJava更新UI) * * @param threadNum 下载线程数 * @param url * @param destDir * @param fileName * @param progressHandler */ public static void downloadFile3(final int threadNum, final String url, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { DownloadApi apiService = RetrofitHelper.getInstance().getApiService(DownloadApi.class); final DownloadInfo downloadInfo = new DownloadInfo(); Observable<ResponseBody> getFileSizeObservable = apiService.downLoad(url); final FileDownloadObservable[] fileDownloadObservables = new FileDownloadObservable[threadNum];//设置线程数量 //获取文件大小,分割文件下载 getFileSizeObservable .flatMap(new Function<ResponseBody, ObservableSource<DownloadInfo>>() { @Override public ObservableSource<DownloadInfo> apply(final ResponseBody responseBody) throws Exception { return Observable.create(new ObservableOnSubscribe<DownloadInfo>() { @Override public void subscribe(ObservableEmitter<DownloadInfo> emitter) throws Exception { long fileSize = responseBody.contentLength(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); if (file.exists()){ file.delete(); } downloadInfo.setFile(file); downloadInfo.setFileSize(fileSize); RandomAccessFile accessFile = new RandomAccessFile(file, "rwd"); //设置本地文件的长度和下载文件相同 accessFile.setLength(fileSize); accessFile.close(); //每条线程下载数据 long blockSize = ((fileSize % threadNum) == 0) ? (fileSize / threadNum) : (fileSize / threadNum + 1); //指定每条线程下载的区间 for (int i = 0; i < threadNum; i++) { int curThreadEndPosition = (int) ((i + 1) != threadNum ? ((i + 1) * blockSize - 1) : fileSize); FileDownloadObservable fileDownloadObservable = new FileDownloadObservable(url, file, (int) (i * blockSize), curThreadEndPosition); fileDownloadObservable.download(); fileDownloadObservables[i] = fileDownloadObservable; mDisposable.add(fileDownloadObservable.getDisposable()); } boolean finished = false; long startTime = System.currentTimeMillis(); int downloadSize; int progress; long usedTime; long curTime; boolean completed; int speed; //根据所有线程下载大小,计算下载进度、下载速率,下载用时 while (!finished && !emitter.isDisposed()) { downloadSize = 0; finished = true; for (int i = 0; i < fileDownloadObservables.length; i++) { downloadSize += fileDownloadObservables[i].getDownloadSize(); if (!fileDownloadObservables[i].isFinished()) { finished = false; } } progress = (int) ((downloadSize * 1.0 / fileSize) * 100); curTime = System.currentTimeMillis(); usedTime = (curTime - startTime) / 1000; if (usedTime == 0) usedTime = 1; speed = (int) (downloadSize / usedTime); downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(downloadSize); downloadInfo.setUsedTime(usedTime); //回显下载信息 if (!emitter.isDisposed()) { emitter.onNext(downloadInfo); } SystemClock.sleep(1000); } completed = true; if (!emitter.isDisposed()) { if (completed) { emitter.onComplete(); } else { emitter.onError(new RuntimeException("下载失败")); } } } }); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<DownloadInfo>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(DownloadInfo downloadInfo) { progressHandler.onProgress(downloadInfo); } @Override public void onError(Throwable e) { progressHandler.onError(e); } @Override public void onComplete() { progressHandler.onCompleted(downloadInfo.getFile()); } }); } public static void cancelDownload() { mDisposable.clear(); } }
UTF-8
Java
18,824
java
FileDownloader.java
Java
[ { "context": " okhttp3.ResponseBody;\n\n/**\n * 文件下载器\n *\n * @author Kelly\n * @version 1.0.0\n * @filename FileDownloader.jav", "end": 697, "score": 0.9982876777648926, "start": 692, "tag": "NAME", "value": "Kelly" } ]
null
[]
package com.sjl.net.dowload; import android.os.SystemClock; import com.sjl.net.RetrofitHelper; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.RandomAccessFile; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; import io.reactivex.ObservableOnSubscribe; import io.reactivex.ObservableSource; import io.reactivex.Observer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Function; import io.reactivex.schedulers.Schedulers; import okhttp3.ResponseBody; /** * 文件下载器 * * @author Kelly * @version 1.0.0 * @filename FileDownloader.java * @time 2018/7/25 16:04 * @copyright(C) 2018 song */ public class FileDownloader { static CompositeDisposable mDisposable = new CompositeDisposable(); /** * 下载文件法1(使用Handler更新UI) * * @param observable 下载被观察者 * @param destDir 下载目录 * @param fileName 文件名 * @param progressHandler 进度handler */ public static void downloadFile(Observable<ResponseBody> observable, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { final DownloadInfo downloadInfo = new DownloadInfo(); observable .subscribeOn(Schedulers.io()) .observeOn(Schedulers.io()) .subscribe(new Observer<ResponseBody>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(ResponseBody responseBody) { InputStream inputStream = null; long total = 0; long responseLength; FileOutputStream fos = null; try { byte[] buf = new byte[1024 * 8]; int len; responseLength = responseBody.contentLength(); inputStream = responseBody.byteStream(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); downloadInfo.setFile(file); downloadInfo.setFileSize(responseLength); fos = new FileOutputStream(file); int progress = 0; int lastProgress; long startTime = System.currentTimeMillis(); // 开始下载时获取开始时间 while ((len = inputStream.read(buf)) != -1) { fos.write(buf, 0, len); total += len; lastProgress = progress; progress = (int) (total * 100 / responseLength); long curTime = System.currentTimeMillis(); long usedTime = (curTime - startTime) / 1000; if (usedTime == 0) { usedTime = 1; } long speed = (total / usedTime); // 平均每秒下载速度 // 如果进度与之前进度相等,则不更新,如果更新太频繁,则会造成界面卡顿 if (progress > 0 && progress != lastProgress) { downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(total); downloadInfo.setUsedTime(usedTime); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_PROGRESS, downloadInfo); } } fos.flush(); downloadInfo.setFile(file); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_SUCCESS, downloadInfo); } catch (final Exception e) { downloadInfo.setErrorMsg(e); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_FAIL, downloadInfo); } finally { try { if (fos != null) { fos.close(); } } catch (Exception e) { e.printStackTrace(); } try { if (inputStream != null) { inputStream.close(); } } catch (Exception e) { e.printStackTrace(); } } } @Override public void onError(Throwable e) {//new Consumer<Throwable> downloadInfo.setErrorMsg(e); progressHandler.sendMessage(DownloadProgressHandler.DOWNLOAD_FAIL, downloadInfo); } @Override public void onComplete() {// new Action() } }); } /** * 下载文件法2(使用RXJava更新UI) * * @param observable * @param destDir * @param fileName * @param progressHandler */ public static void downloadFile2(Observable<ResponseBody> observable, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { final DownloadInfo downloadInfo = new DownloadInfo(); observable .flatMap(new Function<ResponseBody, ObservableSource<DownloadInfo>>() { @Override public ObservableSource<DownloadInfo> apply(final ResponseBody responseBody) throws Exception { return Observable.create(new ObservableOnSubscribe<DownloadInfo>() { @Override public void subscribe(ObservableEmitter<DownloadInfo> emitter) throws Exception { InputStream inputStream = null; long total = 0; long responseLength = 0; FileOutputStream fos = null; try { byte[] buf = new byte[1024 * 8]; int len = 0; responseLength = responseBody.contentLength(); inputStream = responseBody.byteStream(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); downloadInfo.setFile(file); downloadInfo.setFileSize(responseLength); fos = new FileOutputStream(file); int progress = 0; int lastProgress = 0; long startTime = System.currentTimeMillis(); // 开始下载时获取开始时间 while ((len = inputStream.read(buf)) != -1) { fos.write(buf, 0, len); total += len; lastProgress = progress; progress = (int) (total * 100 / responseLength); long curTime = System.currentTimeMillis(); long usedTime = (curTime - startTime) / 1000; if (usedTime == 0) { usedTime = 1; } long speed = (total / usedTime); // 平均每秒下载速度 // 如果进度与之前进度相等,则不更新,如果更新太频繁,则会造成界面卡顿 if (progress > 0 && progress != lastProgress) { downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(total); downloadInfo.setUsedTime(usedTime); if (!emitter.isDisposed()) { emitter.onNext(downloadInfo); } } } fos.flush(); downloadInfo.setFile(file); if (!emitter.isDisposed()) { emitter.onComplete(); } } catch (Exception e) { downloadInfo.setErrorMsg(e); if (!emitter.isDisposed()) { emitter.onError(e); } } finally { try { if (fos != null) { fos.close(); } } catch (Exception e) { e.printStackTrace(); } try { if (inputStream != null) { inputStream.close(); } } catch (Exception e) { e.printStackTrace(); } } } }); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<DownloadInfo>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(DownloadInfo downloadInfo) { progressHandler.onProgress(downloadInfo); } @Override public void onError(Throwable e) { progressHandler.onError(e); } @Override public void onComplete() { progressHandler.onCompleted(downloadInfo.getFile()); } }); } /** * 下载文件法3(多线程文件下载,使用RXJava更新UI) * * @param threadNum 下载线程数 * @param url * @param destDir * @param fileName * @param progressHandler */ public static void downloadFile3(final int threadNum, final String url, final String destDir, final String fileName, final DownloadProgressHandler progressHandler) { DownloadApi apiService = RetrofitHelper.getInstance().getApiService(DownloadApi.class); final DownloadInfo downloadInfo = new DownloadInfo(); Observable<ResponseBody> getFileSizeObservable = apiService.downLoad(url); final FileDownloadObservable[] fileDownloadObservables = new FileDownloadObservable[threadNum];//设置线程数量 //获取文件大小,分割文件下载 getFileSizeObservable .flatMap(new Function<ResponseBody, ObservableSource<DownloadInfo>>() { @Override public ObservableSource<DownloadInfo> apply(final ResponseBody responseBody) throws Exception { return Observable.create(new ObservableOnSubscribe<DownloadInfo>() { @Override public void subscribe(ObservableEmitter<DownloadInfo> emitter) throws Exception { long fileSize = responseBody.contentLength(); File dir = new File(destDir); if (!dir.exists()) { dir.mkdirs(); } final File file = new File(destDir, fileName); if (file.exists()){ file.delete(); } downloadInfo.setFile(file); downloadInfo.setFileSize(fileSize); RandomAccessFile accessFile = new RandomAccessFile(file, "rwd"); //设置本地文件的长度和下载文件相同 accessFile.setLength(fileSize); accessFile.close(); //每条线程下载数据 long blockSize = ((fileSize % threadNum) == 0) ? (fileSize / threadNum) : (fileSize / threadNum + 1); //指定每条线程下载的区间 for (int i = 0; i < threadNum; i++) { int curThreadEndPosition = (int) ((i + 1) != threadNum ? ((i + 1) * blockSize - 1) : fileSize); FileDownloadObservable fileDownloadObservable = new FileDownloadObservable(url, file, (int) (i * blockSize), curThreadEndPosition); fileDownloadObservable.download(); fileDownloadObservables[i] = fileDownloadObservable; mDisposable.add(fileDownloadObservable.getDisposable()); } boolean finished = false; long startTime = System.currentTimeMillis(); int downloadSize; int progress; long usedTime; long curTime; boolean completed; int speed; //根据所有线程下载大小,计算下载进度、下载速率,下载用时 while (!finished && !emitter.isDisposed()) { downloadSize = 0; finished = true; for (int i = 0; i < fileDownloadObservables.length; i++) { downloadSize += fileDownloadObservables[i].getDownloadSize(); if (!fileDownloadObservables[i].isFinished()) { finished = false; } } progress = (int) ((downloadSize * 1.0 / fileSize) * 100); curTime = System.currentTimeMillis(); usedTime = (curTime - startTime) / 1000; if (usedTime == 0) usedTime = 1; speed = (int) (downloadSize / usedTime); downloadInfo.setSpeed(speed); downloadInfo.setProgress(progress); downloadInfo.setCurrentSize(downloadSize); downloadInfo.setUsedTime(usedTime); //回显下载信息 if (!emitter.isDisposed()) { emitter.onNext(downloadInfo); } SystemClock.sleep(1000); } completed = true; if (!emitter.isDisposed()) { if (completed) { emitter.onComplete(); } else { emitter.onError(new RuntimeException("下载失败")); } } } }); } }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<DownloadInfo>() { @Override public void onSubscribe(Disposable d) { mDisposable.add(d); } @Override public void onNext(DownloadInfo downloadInfo) { progressHandler.onProgress(downloadInfo); } @Override public void onError(Throwable e) { progressHandler.onError(e); } @Override public void onComplete() { progressHandler.onCompleted(downloadInfo.getFile()); } }); } public static void cancelDownload() { mDisposable.clear(); } }
18,824
0.403407
0.398602
390
45.958973
30.435698
169
false
false
0
0
0
0
0
0
0.494872
false
false
3
4aef4df808672ae9b4bdca183ce2e3de21d527ca
20,796,231,715,875
8b6a2e0b4d3945fcabff07e66102fe18cd28ca95
/src/main/java/com/ss/ita/util/UserName.java
dfae47d0df6d9e79623da60c9b7c7a82da44ec44
[]
no_license
Lv-567-TAQC/CodeWars567
https://github.com/Lv-567-TAQC/CodeWars567
a3c1c6347568080033933d6baafde3142acbabcb
db2c100d046a11e8b37135445f2cb31394477b67
refs/heads/main
2023-03-04T02:26:50.932000
2021-02-16T09:51:08
2021-02-16T09:51:08
331,597,371
0
4
null
false
2021-02-16T09:51:09
2021-01-21T10:48:34
2021-02-16T08:43:01
2021-02-16T09:51:08
386
0
1
0
Java
false
false
package com.ss.ita.util; public enum UserName{ NNN7(1L, "Nnn7", "Iaroslav Tereshko"), ANDRIIKAPUSTIAK(2L, "andriikapustiak", "Andrii Kapustiak"), KHRYSTIASH(3L, "khrystiash", "Khrystyna Shalavylo"), KUDERIAVETSNATA(4L, "kuderiavetsnata", "Kuderiavets Natalia"), NATALIAA0223(5L, "nataliia0223", "Nataliia Koval"), ROMANKHVALBOTA(6L, "romankhvalbota", "Roman Khvalbota"), VLADISLAVSHEVCHUK(7L, "vladislavshevchuk", "Shevchuk Vladislav"); private final Long id; private final String gitHubNick; private final String fullName; UserName(Long id, String gitHubNick, String fullName) { this.id = id; this.gitHubNick = gitHubNick; this.fullName = fullName; } public String getGitHubNick() { return gitHubNick; } public Long getId() { return id; } public String getName() { return fullName; } public static UserName getById(Long id) { for(UserName user: values()) { if(user.id.equals(id)) { return user; } } return null; } }
UTF-8
Java
1,145
java
UserName.java
Java
[ { "context": "ackage com.ss.ita.util;\n\npublic enum UserName{\n NNN7(1L, \"Nnn7\", \"Iaroslav Tereshko\"),\n ANDRIIKAPUS", "end": 56, "score": 0.9920371174812317, "start": 52, "tag": "USERNAME", "value": "NNN7" }, { "context": "ss.ita.util;\n\npublic enum UserName{\n NNN7(1L, \"Nnn7\", \"Iaroslav Tereshko\"),\n ANDRIIKAPUSTIAK(2L, \"", "end": 66, "score": 0.9975552558898926, "start": 62, "tag": "USERNAME", "value": "Nnn7" }, { "context": "til;\n\npublic enum UserName{\n NNN7(1L, \"Nnn7\", \"Iaroslav Tereshko\"),\n ANDRIIKAPUSTIAK(2L, \"andriikapustiak\", \"An", "end": 87, "score": 0.9998956322669983, "start": 70, "tag": "NAME", "value": "Iaroslav Tereshko" }, { "context": "me{\n NNN7(1L, \"Nnn7\", \"Iaroslav Tereshko\"),\n ANDRIIKAPUSTIAK(2L, \"andriikapustiak\", \"Andrii Kapustiak\"),\n K", "end": 110, "score": 0.8607389330863953, "start": 95, "tag": "USERNAME", "value": "ANDRIIKAPUSTIAK" }, { "context": "\", \"Iaroslav Tereshko\"),\n ANDRIIKAPUSTIAK(2L, \"andriikapustiak\", \"Andrii Kapustiak\"),\n KHRYSTIASH(3L, \"khryst", "end": 131, "score": 0.9940919876098633, "start": 116, "tag": "USERNAME", "value": "andriikapustiak" }, { "context": "ko\"),\n ANDRIIKAPUSTIAK(2L, \"andriikapustiak\", \"Andrii Kapustiak\"),\n KHRYSTIASH(3L, \"khrystiash\", \"Khrystyna Sh", "end": 151, "score": 0.9998862743377686, "start": 135, "tag": "NAME", "value": "Andrii Kapustiak" }, { "context": "AK(2L, \"andriikapustiak\", \"Andrii Kapustiak\"),\n KHRYSTIASH(3L, \"khrystiash\", \"Khrystyna Shalavylo\"),\n KUD", "end": 169, "score": 0.8685964345932007, "start": 159, "tag": "USERNAME", "value": "KHRYSTIASH" }, { "context": "ustiak\", \"Andrii Kapustiak\"),\n KHRYSTIASH(3L, \"khrystiash\", \"Khrystyna Shalavylo\"),\n KUDERIAVETSNATA(4L,", "end": 185, "score": 0.9938281774520874, "start": 175, "tag": "USERNAME", "value": "khrystiash" }, { "context": "ii Kapustiak\"),\n KHRYSTIASH(3L, \"khrystiash\", \"Khrystyna Shalavylo\"),\n KUDERIAVETSNATA(4L, \"kuderiavetsnata\", \"Ku", "end": 208, "score": 0.9998835325241089, "start": 189, "tag": "NAME", "value": "Khrystyna Shalavylo" }, { "context": "SH(3L, \"khrystiash\", \"Khrystyna Shalavylo\"),\n KUDERIAVETSNATA(4L, \"kuderiavetsnata\", \"Kuderiavets N", "end": 219, "score": 0.4084146022796631, "start": 217, "tag": "NAME", "value": "UD" }, { "context": "(3L, \"khrystiash\", \"Khrystyna Shalavylo\"),\n KUDERIAVETSNATA(4L, \"kuderiavetsnata\", \"Kuderiavets Natalia\"),\n ", "end": 231, "score": 0.6303785443305969, "start": 219, "tag": "USERNAME", "value": "ERIAVETSNATA" }, { "context": " \"Khrystyna Shalavylo\"),\n KUDERIAVETSNATA(4L, \"kuderiavetsnata\", \"Kuderiavets Natalia\"),\n NATALIAA0223(5L, \"n", "end": 252, "score": 0.994872510433197, "start": 237, "tag": "USERNAME", "value": "kuderiavetsnata" }, { "context": "lo\"),\n KUDERIAVETSNATA(4L, \"kuderiavetsnata\", \"Kuderiavets Natalia\"),\n NATALIAA0223(5L, \"nataliia0223\", \"Nataliia", "end": 275, "score": 0.9998146295547485, "start": 256, "tag": "NAME", "value": "Kuderiavets Natalia" }, { "context": "a\", \"Kuderiavets Natalia\"),\n NATALIAA0223(5L, \"nataliia0223\", \"Nataliia Koval\"),\n ROMANKHVALBOTA(6L, \"roma", "end": 313, "score": 0.9668000340461731, "start": 301, "tag": "USERNAME", "value": "nataliia0223" }, { "context": " Natalia\"),\n NATALIAA0223(5L, \"nataliia0223\", \"Nataliia Koval\"),\n ROMANKHVALBOTA(6L, \"romankhvalbota\", \"Roma", "end": 331, "score": 0.999885618686676, "start": 317, "tag": "NAME", "value": "Nataliia Koval" }, { "context": "IAA0223(5L, \"nataliia0223\", \"Nataliia Koval\"),\n ROMANKHVALBOTA(6L, \"romankhvalbota\", \"Roman Khvalbota\"),\n VLA", "end": 353, "score": 0.6970419883728027, "start": 339, "tag": "USERNAME", "value": "ROMANKHVALBOTA" }, { "context": "0223\", \"Nataliia Koval\"),\n ROMANKHVALBOTA(6L, \"romankhvalbota\", \"Roman Khvalbota\"),\n VLADISLAVSHEVCHUK(7L, \"", "end": 373, "score": 0.9964241981506348, "start": 359, "tag": "USERNAME", "value": "romankhvalbota" }, { "context": "oval\"),\n ROMANKHVALBOTA(6L, \"romankhvalbota\", \"Roman Khvalbota\"),\n VLADISLAVSHEVCHUK(7L, \"vladislavshevchuk\",", "end": 392, "score": 0.999894917011261, "start": 377, "tag": "NAME", "value": "Roman Khvalbota" }, { "context": "BOTA(6L, \"romankhvalbota\", \"Roman Khvalbota\"),\n VLADISLAVSHEVCHUK(7L, \"vladislavshevchuk\", \"Shevchuk Vladislav\");\n ", "end": 417, "score": 0.6325135231018066, "start": 400, "tag": "USERNAME", "value": "VLADISLAVSHEVCHUK" }, { "context": "\", \"Roman Khvalbota\"),\n VLADISLAVSHEVCHUK(7L, \"vladislavshevchuk\", \"Shevchuk Vladislav\");\n \n \n private fi", "end": 440, "score": 0.9979604482650757, "start": 423, "tag": "USERNAME", "value": "vladislavshevchuk" }, { "context": ",\n VLADISLAVSHEVCHUK(7L, \"vladislavshevchuk\", \"Shevchuk Vladislav\");\n \n \n private final Long id;\n priva", "end": 462, "score": 0.9998894929885864, "start": 444, "tag": "NAME", "value": "Shevchuk Vladislav" } ]
null
[]
package com.ss.ita.util; public enum UserName{ NNN7(1L, "Nnn7", "<NAME>"), ANDRIIKAPUSTIAK(2L, "andriikapustiak", "<NAME>"), KHRYSTIASH(3L, "khrystiash", "<NAME>"), KUDERIAVETSNATA(4L, "kuderiavetsnata", "<NAME>"), NATALIAA0223(5L, "nataliia0223", "<NAME>"), ROMANKHVALBOTA(6L, "romankhvalbota", "<NAME>"), VLADISLAVSHEVCHUK(7L, "vladislavshevchuk", "<NAME>"); private final Long id; private final String gitHubNick; private final String fullName; UserName(Long id, String gitHubNick, String fullName) { this.id = id; this.gitHubNick = gitHubNick; this.fullName = fullName; } public String getGitHubNick() { return gitHubNick; } public Long getId() { return id; } public String getName() { return fullName; } public static UserName getById(Long id) { for(UserName user: values()) { if(user.id.equals(id)) { return user; } } return null; } }
1,069
0.603493
0.588646
43
25.627907
20.230099
69
false
false
0
0
0
0
0
0
0.813953
false
false
3
b85e70ff41f269bd69c6e2bfe46d9212e46ad9f1
24,275,155,178,926
8ff1884610d1756659efb39a3e65bab1124c5de3
/medialistings-repository-client/src/main/java/com/pressassociation/tv/medialistings/client/MedialistingsClient.java
2d92c410dee3700dc12b26c24661b308edc9840e
[]
no_license
Darpholgshon/medialistings-repository
https://github.com/Darpholgshon/medialistings-repository
aaf39537507781bf08035e0ff55277b0e27a4a8f
4c45539d7b93fccc9ac3d093e36fc4e2f28c8b2d
refs/heads/master
2016-08-04T01:44:17.060000
2015-02-16T12:01:55
2015-02-16T12:01:55
30,584,509
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.pressassociation.tv.medialistings.client; import com.pressassociation.tv.medialistings.model.Category; import java.util.List; import java.util.concurrent.CompletableFuture; /** * */ public interface MedialistingsClient { /** * @param id The database identifier for the category. * * @return Requested Example Object */ CompletableFuture<Category> getCategory(long id); /** * @param description A unique string that describes the category. * * @return Requested Category Object */ CompletableFuture<Category> getCategoryByDescription(String description); /** * @return List of Category Objects */ CompletableFuture<List<Category>> listCategories(); }
UTF-8
Java
712
java
MedialistingsClient.java
Java
[]
null
[]
package com.pressassociation.tv.medialistings.client; import com.pressassociation.tv.medialistings.model.Category; import java.util.List; import java.util.concurrent.CompletableFuture; /** * */ public interface MedialistingsClient { /** * @param id The database identifier for the category. * * @return Requested Example Object */ CompletableFuture<Category> getCategory(long id); /** * @param description A unique string that describes the category. * * @return Requested Category Object */ CompletableFuture<Category> getCategoryByDescription(String description); /** * @return List of Category Objects */ CompletableFuture<List<Category>> listCategories(); }
712
0.734551
0.734551
31
21.967741
24.544212
75
false
false
0
0
0
0
0
0
0.225806
false
false
3
80c88b3b372a1fd80cce2c9c7e52766566c504c7
10,445,360,480,169
a8a488abc33db6e4a56419150a94ed91b33de396
/product-cat/src/main/java/com/product/productcat/enums/SizeEnum.java
29a3aa8e222a701fbc853257f12e5da384e98616
[]
no_license
varunadhikari/prod-cat
https://github.com/varunadhikari/prod-cat
94b072dc8c3d8a122414943560e9d2765e7ada90
c8e3b1e5b3af8005499911105f259d03ef3047ab
refs/heads/main
2023-05-29T14:15:18.364000
2021-06-22T06:37:09
2021-06-22T06:37:09
379,166,841
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.product.productcat.enums; public enum SizeEnum { XS,S,M,L,XL,XXL,XXXl }
UTF-8
Java
91
java
SizeEnum.java
Java
[]
null
[]
package com.product.productcat.enums; public enum SizeEnum { XS,S,M,L,XL,XXL,XXXl }
91
0.703297
0.703297
5
16.200001
14.019986
37
false
false
0
0
0
0
0
0
1.6
false
false
3
101611cac879e2231f115747c8959a9299d2e06c
29,291,676,976,854
d4caf6382751541d8d14a639f0cabc2fb9a21f13
/src/main/java/org/alArbiyaHotelManagement/model/NotificationDeliveryBoy.java
5f6993190a5b6738f2f1046436d20dd0974e1c1a
[]
no_license
iyashiyas/alArbiyaHotelManagement
https://github.com/iyashiyas/alArbiyaHotelManagement
24661326b90bb5b6578dc140703d5fa3dc04dc3c
d9fa509d284933329644db27f2c9637a52e5cab1
refs/heads/master
2021-01-12T17:42:41.140000
2017-05-24T07:27:09
2017-05-24T07:27:09
71,627,373
0
1
null
false
2016-10-23T12:17:20
2016-10-22T08:43:01
2016-10-22T08:53:23
2016-10-23T12:17:20
1,416
0
0
0
Java
null
null
package org.alArbiyaHotelManagement.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "NOTIFICATIONDELIVERYBOY") public class NotificationDeliveryBoy { @Id @GeneratedValue @Column(name="NOTIFICATION_ID") private long id; @Column(name="ROOM_ID") private long roomId; @Column(name="ORDER_ID") private long orderId; @Column(name="READ_STATUS") private String readStatus; @Column(name="ORDER_STATUS") private String orderStatus; @Column(name="DELIVERY_BOY_ID") private long deliveryBoyId; @Column(name="DELIVERY_BOY_NAME") private String deliveryBoyName; public long getId() { return id; } public void setId(long id) { this.id = id; } public long getRoomId() { return roomId; } public void setRoomId(long roomId) { this.roomId = roomId; } public long getOrderId() { return orderId; } public void setOrderId(long orderId) { this.orderId = orderId; } public String getReadStatus() { return readStatus; } public void setReadStatus(String readStatus) { this.readStatus = readStatus; } public String getOrderStatus() { return orderStatus; } public void setOrderStatus(String orderStatus) { this.orderStatus = orderStatus; } public long getDeliveryBoyId() { return deliveryBoyId; } public void setDeliveryBoyId(long deliveryBoyId) { this.deliveryBoyId = deliveryBoyId; } public String getDeliveryBoyName() { return deliveryBoyName; } public void setDeliveryBoyName(String deliveryBoyName) { this.deliveryBoyName = deliveryBoyName; } }
UTF-8
Java
1,682
java
NotificationDeliveryBoy.java
Java
[]
null
[]
package org.alArbiyaHotelManagement.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "NOTIFICATIONDELIVERYBOY") public class NotificationDeliveryBoy { @Id @GeneratedValue @Column(name="NOTIFICATION_ID") private long id; @Column(name="ROOM_ID") private long roomId; @Column(name="ORDER_ID") private long orderId; @Column(name="READ_STATUS") private String readStatus; @Column(name="ORDER_STATUS") private String orderStatus; @Column(name="DELIVERY_BOY_ID") private long deliveryBoyId; @Column(name="DELIVERY_BOY_NAME") private String deliveryBoyName; public long getId() { return id; } public void setId(long id) { this.id = id; } public long getRoomId() { return roomId; } public void setRoomId(long roomId) { this.roomId = roomId; } public long getOrderId() { return orderId; } public void setOrderId(long orderId) { this.orderId = orderId; } public String getReadStatus() { return readStatus; } public void setReadStatus(String readStatus) { this.readStatus = readStatus; } public String getOrderStatus() { return orderStatus; } public void setOrderStatus(String orderStatus) { this.orderStatus = orderStatus; } public long getDeliveryBoyId() { return deliveryBoyId; } public void setDeliveryBoyId(long deliveryBoyId) { this.deliveryBoyId = deliveryBoyId; } public String getDeliveryBoyName() { return deliveryBoyName; } public void setDeliveryBoyName(String deliveryBoyName) { this.deliveryBoyName = deliveryBoyName; } }
1,682
0.736029
0.736029
95
16.705263
16.04656
57
false
false
0
0
0
0
0
0
1.136842
false
false
3
c49c7854ec38d12de07ca7fbb45c1d8277a434a8
33,217,277,131,691
29c3f56710477869a34aef8675fc043ca672df4b
/java_hometasks/spring-homework-1/src/main/java/com/example/springhomework1/homework/GreetingIfNotLogined.java
d4c1ce4137b8e42d0414be90bda3cad8a8724145
[]
no_license
Yurii-Chornii/LLab_Intent
https://github.com/Yurii-Chornii/LLab_Intent
3b4d7cf1b6a01c0c6fbcf8ff1e1d03c8bea74a24
4b355a5c936a6bf07a9301e7ae7d495d65cb129a
refs/heads/master
2023-04-02T11:27:42.373000
2021-04-13T08:12:18
2021-04-13T08:12:18
341,829,993
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.springhomework1.homework; public class GreetingIfNotLogined implements Greeting { @Override public String sayHello() { return "Hello, not logined user!"; } }
UTF-8
Java
200
java
GreetingIfNotLogined.java
Java
[]
null
[]
package com.example.springhomework1.homework; public class GreetingIfNotLogined implements Greeting { @Override public String sayHello() { return "Hello, not logined user!"; } }
200
0.71
0.705
9
21.222221
20.697706
55
false
false
0
0
0
0
0
0
0.333333
false
false
3
34a9b0ca9382120f225d1bcca68cb7531c0fa9d8
30,794,915,524,719
d51dfb59f984eb36c81d6a8e3daaed6bbf17e3ec
/crm_web/src/main/java/com/crm/service/impl/ICustomerServeImpl.java
c0b9500daefbc7bd877de1a0fdad06294ae1252b
[]
no_license
520XJ/crm
https://github.com/520XJ/crm
ba8d9753e18b78f958afb0ce6bb601bf55e0875d
db0c3c9d144d3f48d788fd32dd918b248e3463e5
refs/heads/master
2021-09-07T07:23:32.520000
2018-02-19T14:51:18
2018-02-19T14:51:18
116,572,833
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.crm.service.impl; import com.crm.dao.CustomerServeDao; import com.crm.model.CustomerServe; import com.crm.service.ICustomerServeService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class ICustomerServeImpl implements ICustomerServeService{ @Autowired private CustomerServeDao customerServeDao; @Override public Map<String, Object> queryCustomerServesByParams(CustomerServe customerServe) { PageHelper.startPage(customerServe.getPage(), customerServe.getRows()); Map<String,Object> parms = new HashMap<>(); parms.put("isValid", 1); parms.put("state", customerServe.getState()); List<CustomerServe> list = customerServeDao.find(parms); PageInfo<CustomerServe> pageInfo = new PageInfo<>(list); Map<String, Object> map = new HashMap<>(); map.put("total", pageInfo.getTotal()); map.put("rows", pageInfo.getList()); return map; } }
UTF-8
Java
1,183
java
ICustomerServeImpl.java
Java
[]
null
[]
package com.crm.service.impl; import com.crm.dao.CustomerServeDao; import com.crm.model.CustomerServe; import com.crm.service.ICustomerServeService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class ICustomerServeImpl implements ICustomerServeService{ @Autowired private CustomerServeDao customerServeDao; @Override public Map<String, Object> queryCustomerServesByParams(CustomerServe customerServe) { PageHelper.startPage(customerServe.getPage(), customerServe.getRows()); Map<String,Object> parms = new HashMap<>(); parms.put("isValid", 1); parms.put("state", customerServe.getState()); List<CustomerServe> list = customerServeDao.find(parms); PageInfo<CustomerServe> pageInfo = new PageInfo<>(list); Map<String, Object> map = new HashMap<>(); map.put("total", pageInfo.getTotal()); map.put("rows", pageInfo.getList()); return map; } }
1,183
0.726965
0.72612
41
27.853659
25.485109
89
false
false
0
0
0
0
0
0
0.731707
false
false
3
ed274c24ef351ca493ac9ccd086f2d4dd8a7938f
15,831,249,483,227
c19cb77e3958a194046d6f84ca97547cc3a223c3
/core/src/main/jdk1.1/java/security/AlgorithmParametersSpi.java
59519a343c91bf3dc8048b0e02cbf0e9b9b29b6c
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
bcgit/bc-java
https://github.com/bcgit/bc-java
1b6092bc5d2336ec26ebd6da6eeaea6600b4c70a
62b03c0f704ebd243fe5f2d701aef4edd77bba6e
refs/heads/main
2023-09-04T00:48:33.995000
2023-08-30T05:33:42
2023-08-30T05:33:42
10,416,648
1,984
1,021
MIT
false
2023-08-26T05:14:28
2013-06-01T02:38:42
2023-08-25T23:28:27
2023-08-24T12:11:48
66,399
2,000
1,072
224
Java
false
false
package java.security; import java.io.IOException; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.InvalidParameterSpecException; public abstract class AlgorithmParametersSpi extends Object { public AlgorithmParametersSpi() { } protected abstract byte[] engineGetEncoded() throws IOException; protected abstract byte[] engineGetEncoded(String format) throws IOException; protected abstract AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec) throws InvalidParameterSpecException; protected abstract void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException; protected abstract void engineInit(byte[] params) throws IOException; protected abstract void engineInit(byte[] params, String format) throws IOException; protected abstract String engineToString(); }
UTF-8
Java
919
java
AlgorithmParametersSpi.java
Java
[]
null
[]
package java.security; import java.io.IOException; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.InvalidParameterSpecException; public abstract class AlgorithmParametersSpi extends Object { public AlgorithmParametersSpi() { } protected abstract byte[] engineGetEncoded() throws IOException; protected abstract byte[] engineGetEncoded(String format) throws IOException; protected abstract AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec) throws InvalidParameterSpecException; protected abstract void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException; protected abstract void engineInit(byte[] params) throws IOException; protected abstract void engineInit(byte[] params, String format) throws IOException; protected abstract String engineToString(); }
919
0.773667
0.773667
26
34.307693
24.766245
85
false
false
0
0
0
0
0
0
0.461538
false
false
3
5fbc93cde705fd4c0592e909d0ca558bc4c2df80
18,227,841,251,077
8756b59996c0f4009d128a9b213ed1f3b908251f
/src/main/java/com/imedcare/project/etbj/xsefs/xsefsjl/mapper/TbEtXsefsjlMapper.java
509a85139ab51fef844682c45808020f6b830bc9
[]
no_license
sunshixiong789/McHealth
https://github.com/sunshixiong789/McHealth
2949b5e44392d8e1e283df52b544a9e46492263f
8cccfc567be5e097a905fc15084a8ded11802a98
refs/heads/master
2022-07-22T13:29:56.376000
2020-01-19T03:08:43
2020-01-19T03:08:43
232,002,359
0
0
null
false
2022-07-06T20:46:26
2020-01-06T01:39:21
2020-01-19T03:08:57
2022-07-06T20:46:26
3,625
0
0
6
HTML
false
false
package com.imedcare.project.etbj.xsefs.xsefsjl.mapper; import com.imedcare.project.etbj.xsefs.xsefsjl.domain.TbEtXsefsjl; import com.imedcare.project.etbj.xsefs.xsefsjl.domain.TbEtXsefsjlVo; import java.util.List; /** * 新生儿访视记录Mapper接口 * * @author 黄维业 * @date 2019-11-12 */ public interface TbEtXsefsjlMapper { /** * 查询新生儿访视记录 * * @param id 新生儿访视记录ID * @return 新生儿访视记录 */ public TbEtXsefsjlVo selectTbEtXsefsjlById(Long id); /** * 查询新生儿访视记录列表 * * @param tbEtXsefsjl 新生儿访视记录 * @return 新生儿访视记录集合 */ public List<TbEtXsefsjlVo> selectTbEtXsefsjlList(TbEtXsefsjlVo tbEtXsefsjl); /** * 新增新生儿访视记录 * * @param tbEtXsefsjl 新生儿访视记录 * @return 结果 */ public int insertTbEtXsefsjl(TbEtXsefsjl tbEtXsefsjl); /** * 修改新生儿访视记录 * * @param tbEtXsefsjl 新生儿访视记录 * @return 结果 */ public int updateTbEtXsefsjl(TbEtXsefsjl tbEtXsefsjl); /** * 删除新生儿访视记录 * * @param id 新生儿访视记录ID * @return 结果 */ public int deleteTbEtXsefsjlById(Long id); /** * 批量删除新生儿访视记录 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteTbEtXsefsjlByIds(String[] ids); }
UTF-8
Java
1,511
java
TbEtXsefsjlMapper.java
Java
[ { "context": "util.List;\n\n/**\n * 新生儿访视记录Mapper接口\n * \n * @author 黄维业\n * @date 2019-11-12\n */\npublic interface TbEtXsef", "end": 259, "score": 0.9992645382881165, "start": 256, "tag": "NAME", "value": "黄维业" } ]
null
[]
package com.imedcare.project.etbj.xsefs.xsefsjl.mapper; import com.imedcare.project.etbj.xsefs.xsefsjl.domain.TbEtXsefsjl; import com.imedcare.project.etbj.xsefs.xsefsjl.domain.TbEtXsefsjlVo; import java.util.List; /** * 新生儿访视记录Mapper接口 * * @author 黄维业 * @date 2019-11-12 */ public interface TbEtXsefsjlMapper { /** * 查询新生儿访视记录 * * @param id 新生儿访视记录ID * @return 新生儿访视记录 */ public TbEtXsefsjlVo selectTbEtXsefsjlById(Long id); /** * 查询新生儿访视记录列表 * * @param tbEtXsefsjl 新生儿访视记录 * @return 新生儿访视记录集合 */ public List<TbEtXsefsjlVo> selectTbEtXsefsjlList(TbEtXsefsjlVo tbEtXsefsjl); /** * 新增新生儿访视记录 * * @param tbEtXsefsjl 新生儿访视记录 * @return 结果 */ public int insertTbEtXsefsjl(TbEtXsefsjl tbEtXsefsjl); /** * 修改新生儿访视记录 * * @param tbEtXsefsjl 新生儿访视记录 * @return 结果 */ public int updateTbEtXsefsjl(TbEtXsefsjl tbEtXsefsjl); /** * 删除新生儿访视记录 * * @param id 新生儿访视记录ID * @return 结果 */ public int deleteTbEtXsefsjlById(Long id); /** * 批量删除新生儿访视记录 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteTbEtXsefsjlByIds(String[] ids); }
1,511
0.622276
0.615819
63
18.666666
19.4667
80
false
false
0
0
0
0
0
0
0.15873
false
false
3
66bd577c9f9f301cf4c2a73d81d4758113b3c96a
14,585,708,983,635
6dc6bf9c5b7b50c1f6a650623a8f91948d20c438
/src/main/java/cinema/jpa/model/Screening.java
7a82f3a85de25fd5a6bd7730fe3d46b008e0fc51
[]
no_license
Shachty/MovieTheater
https://github.com/Shachty/MovieTheater
011cb357c6cdf2f4a90aae3327b308a46de257c5
b34914488e947473ac156f36cbad446e8cf7cd79
refs/heads/master
2021-01-01T19:30:30.151000
2015-06-15T17:25:25
2015-06-15T17:25:25
35,163,193
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cinema.jpa.model; import javax.persistence.*; import java.util.Calendar; @Entity @Table(name = "CINEMA_Screening") public class Screening { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToOne private Movie movie; @OneToOne private Theater theater; private Calendar screeningTime; public Long getId() { return this.id; } public Movie getMovie() { return this.movie; } public Theater getTheater() { return this.theater; } public void setId(Long param) { this.id = param; } public void setMovie(Movie param) { this.movie = param; } public void setTheater(Theater param) { this.theater = param; } public void setScreeningTime(Calendar time) { this.screeningTime = time; } public Calendar getScreeningTime() { return this.screeningTime; } }
UTF-8
Java
942
java
Screening.java
Java
[]
null
[]
package cinema.jpa.model; import javax.persistence.*; import java.util.Calendar; @Entity @Table(name = "CINEMA_Screening") public class Screening { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToOne private Movie movie; @OneToOne private Theater theater; private Calendar screeningTime; public Long getId() { return this.id; } public Movie getMovie() { return this.movie; } public Theater getTheater() { return this.theater; } public void setId(Long param) { this.id = param; } public void setMovie(Movie param) { this.movie = param; } public void setTheater(Theater param) { this.theater = param; } public void setScreeningTime(Calendar time) { this.screeningTime = time; } public Calendar getScreeningTime() { return this.screeningTime; } }
942
0.626327
0.626327
50
17.84
15.233332
51
false
false
0
0
0
0
0
0
0.3
false
false
3
579544128e85eee85d6125f10abd1cea794682da
34,900,904,257,322
a36dce4b6042356475ae2e0f05475bd6aed4391b
/2005/julypersistenceEJB/ejbModule/com/hps/july/persistence/EJSRemoteCMPInwayBillHome_643a3105.java
93195ce3cd3968142282093a15ad4843ac7ae0dd
[]
no_license
ildar66/WSAD_NRI
https://github.com/ildar66/WSAD_NRI
b21dbee82de5d119b0a507654d269832f19378bb
2a352f164c513967acf04d5e74f36167e836054f
refs/heads/master
2020-12-02T23:59:09.795000
2017-07-01T09:25:27
2017-07-01T09:25:27
95,954,234
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.hps.july.persistence; import com.ibm.ejs.container.*; /** * EJSRemoteCMPInwayBillHome_643a3105 */ public class EJSRemoteCMPInwayBillHome_643a3105 extends EJSWrapper implements com.hps.july.persistence.InwayBillHome { /** * EJSRemoteCMPInwayBillHome_643a3105 */ public EJSRemoteCMPInwayBillHome_643a3105() throws java.rmi.RemoteException { super(); } /** * getDeployedSupport */ public com.ibm.ejs.container.EJSDeployedSupport getDeployedSupport() { return container.getEJSDeployedSupport(this); } /** * putDeployedSupport */ public void putDeployedSupport(com.ibm.ejs.container.EJSDeployedSupport support) { container.putEJSDeployedSupport(support); return; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 0, _EJS_s); _EJS_result = beanRef.create(argDocument); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 0, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.lang.Integer argFrom, java.lang.Integer argTo, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argBlankNumber, java.lang.String argState, java.lang.Boolean argProcessSource, java.lang.Boolean argProcessDestination, java.lang.Integer argCurrency) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 1, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argFrom, argTo, argBlankDate, argBlankindex, argBlankNumber, argState, argProcessSource, argProcessDestination, argCurrency); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 1, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.lang.Integer argFrom, java.lang.Integer argTo, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argBlankNumber, java.lang.String argState, java.lang.Boolean argProcessSource, java.lang.Boolean argProcessDestination, java.lang.Integer argCurrency, java.lang.String argRepresentativeType) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 2, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argFrom, argTo, argBlankDate, argBlankindex, argBlankNumber, argState, argProcessSource, argProcessDestination, argCurrency, argRepresentativeType); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 2, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argState) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 3, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argBlankDate, argBlankindex, argState); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 3, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findByPrimaryKey */ public com.hps.july.persistence.InwayBill findByPrimaryKey(com.hps.july.persistence.DocumentKey key) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 4, _EJS_s); _EJS_result = beanRef.findByPrimaryKey(key); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 4, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findByQBE */ public java.util.Enumeration findByQBE(java.lang.Boolean isStorage, java.lang.Integer storage, java.sql.Date startDate, java.sql.Date endDate, java.lang.Boolean isCordocnum, java.lang.String cordocnum, java.lang.Boolean isOwner, java.lang.Integer owner, java.lang.Boolean isSupplier, java.lang.Integer supplier, java.lang.Boolean isDActOnly, java.lang.Integer order) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 5, _EJS_s); _EJS_result = beanRef.findByQBE(isStorage, storage, startDate, endDate, isCordocnum, cordocnum, isOwner, owner, isSupplier, supplier, isDActOnly, order); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 5, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillByCurrency */ public java.util.Enumeration findInwayBillByCurrency(com.hps.july.persistence.CurrencyKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 6, _EJS_s); _EJS_result = beanRef.findInwayBillByCurrency(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 6, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillsByRepresentative */ public java.util.Enumeration findInwayBillsByRepresentative(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 7, _EJS_s); _EJS_result = beanRef.findInwayBillsByRepresentative(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 7, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillstorManagersByDActStorManager */ public java.util.Enumeration findInwayBillstorManagersByDActStorManager(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 8, _EJS_s); _EJS_result = beanRef.findInwayBillstorManagersByDActStorManager(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 8, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBilltechstufByDActTechStuf */ public java.util.Enumeration findInwayBilltechstufByDActTechStuf(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 9, _EJS_s); _EJS_result = beanRef.findInwayBilltechstufByDActTechStuf(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 9, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * getEJBMetaData */ public javax.ejb.EJBMetaData getEJBMetaData() throws java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); javax.ejb.EJBMetaData _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 10, _EJS_s); _EJS_result = beanRef.getEJBMetaData(); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 10, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * getHomeHandle */ public javax.ejb.HomeHandle getHomeHandle() throws java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); javax.ejb.HomeHandle _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 11, _EJS_s); _EJS_result = beanRef.getHomeHandle(); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 11, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * remove */ public void remove(java.lang.Object arg0) throws java.rmi.RemoteException, javax.ejb.RemoveException { EJSDeployedSupport _EJS_s = getDeployedSupport(); try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 12, _EJS_s); beanRef.remove(arg0); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.RemoveException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 12, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return ; } /** * remove */ public void remove(javax.ejb.Handle arg0) throws java.rmi.RemoteException, javax.ejb.RemoveException { EJSDeployedSupport _EJS_s = getDeployedSupport(); try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 13, _EJS_s); beanRef.remove(arg0); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.RemoveException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 13, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return ; } }
UTF-8
Java
15,364
java
EJSRemoteCMPInwayBillHome_643a3105.java
Java
[]
null
[]
package com.hps.july.persistence; import com.ibm.ejs.container.*; /** * EJSRemoteCMPInwayBillHome_643a3105 */ public class EJSRemoteCMPInwayBillHome_643a3105 extends EJSWrapper implements com.hps.july.persistence.InwayBillHome { /** * EJSRemoteCMPInwayBillHome_643a3105 */ public EJSRemoteCMPInwayBillHome_643a3105() throws java.rmi.RemoteException { super(); } /** * getDeployedSupport */ public com.ibm.ejs.container.EJSDeployedSupport getDeployedSupport() { return container.getEJSDeployedSupport(this); } /** * putDeployedSupport */ public void putDeployedSupport(com.ibm.ejs.container.EJSDeployedSupport support) { container.putEJSDeployedSupport(support); return; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 0, _EJS_s); _EJS_result = beanRef.create(argDocument); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 0, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.lang.Integer argFrom, java.lang.Integer argTo, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argBlankNumber, java.lang.String argState, java.lang.Boolean argProcessSource, java.lang.Boolean argProcessDestination, java.lang.Integer argCurrency) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 1, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argFrom, argTo, argBlankDate, argBlankindex, argBlankNumber, argState, argProcessSource, argProcessDestination, argCurrency); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 1, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.lang.Integer argFrom, java.lang.Integer argTo, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argBlankNumber, java.lang.String argState, java.lang.Boolean argProcessSource, java.lang.Boolean argProcessDestination, java.lang.Integer argCurrency, java.lang.String argRepresentativeType) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 2, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argFrom, argTo, argBlankDate, argBlankindex, argBlankNumber, argState, argProcessSource, argProcessDestination, argCurrency, argRepresentativeType); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 2, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * create */ public com.hps.july.persistence.InwayBill create(int argDocument, java.lang.Integer argOwner, java.sql.Date argBlankDate, int argBlankindex, java.lang.String argState) throws javax.ejb.CreateException, java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 3, _EJS_s); _EJS_result = beanRef.create(argDocument, argOwner, argBlankDate, argBlankindex, argState); } catch (javax.ejb.CreateException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 3, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findByPrimaryKey */ public com.hps.july.persistence.InwayBill findByPrimaryKey(com.hps.july.persistence.DocumentKey key) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); com.hps.july.persistence.InwayBill _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 4, _EJS_s); _EJS_result = beanRef.findByPrimaryKey(key); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 4, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findByQBE */ public java.util.Enumeration findByQBE(java.lang.Boolean isStorage, java.lang.Integer storage, java.sql.Date startDate, java.sql.Date endDate, java.lang.Boolean isCordocnum, java.lang.String cordocnum, java.lang.Boolean isOwner, java.lang.Integer owner, java.lang.Boolean isSupplier, java.lang.Integer supplier, java.lang.Boolean isDActOnly, java.lang.Integer order) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 5, _EJS_s); _EJS_result = beanRef.findByQBE(isStorage, storage, startDate, endDate, isCordocnum, cordocnum, isOwner, owner, isSupplier, supplier, isDActOnly, order); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 5, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillByCurrency */ public java.util.Enumeration findInwayBillByCurrency(com.hps.july.persistence.CurrencyKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 6, _EJS_s); _EJS_result = beanRef.findInwayBillByCurrency(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 6, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillsByRepresentative */ public java.util.Enumeration findInwayBillsByRepresentative(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 7, _EJS_s); _EJS_result = beanRef.findInwayBillsByRepresentative(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 7, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBillstorManagersByDActStorManager */ public java.util.Enumeration findInwayBillstorManagersByDActStorManager(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 8, _EJS_s); _EJS_result = beanRef.findInwayBillstorManagersByDActStorManager(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 8, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * findInwayBilltechstufByDActTechStuf */ public java.util.Enumeration findInwayBilltechstufByDActTechStuf(com.hps.july.persistence.WorkerKey inKey) throws java.rmi.RemoteException, javax.ejb.FinderException { EJSDeployedSupport _EJS_s = getDeployedSupport(); java.util.Enumeration _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 9, _EJS_s); _EJS_result = beanRef.findInwayBilltechstufByDActTechStuf(inKey); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.FinderException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 9, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * getEJBMetaData */ public javax.ejb.EJBMetaData getEJBMetaData() throws java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); javax.ejb.EJBMetaData _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 10, _EJS_s); _EJS_result = beanRef.getEJBMetaData(); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 10, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * getHomeHandle */ public javax.ejb.HomeHandle getHomeHandle() throws java.rmi.RemoteException { EJSDeployedSupport _EJS_s = getDeployedSupport(); javax.ejb.HomeHandle _EJS_result = null; try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 11, _EJS_s); _EJS_result = beanRef.getHomeHandle(); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 11, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return _EJS_result; } /** * remove */ public void remove(java.lang.Object arg0) throws java.rmi.RemoteException, javax.ejb.RemoveException { EJSDeployedSupport _EJS_s = getDeployedSupport(); try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 12, _EJS_s); beanRef.remove(arg0); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.RemoveException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 12, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return ; } /** * remove */ public void remove(javax.ejb.Handle arg0) throws java.rmi.RemoteException, javax.ejb.RemoveException { EJSDeployedSupport _EJS_s = getDeployedSupport(); try { com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105 beanRef = (com.hps.july.persistence.EJSCMPInwayBillHomeBean_643a3105)container.preInvoke(this, 13, _EJS_s); beanRef.remove(arg0); } catch (java.rmi.RemoteException ex) { _EJS_s.setUncheckedException(ex); } catch (javax.ejb.RemoveException ex) { _EJS_s.setCheckedException(ex); throw ex; } catch (Throwable ex) { _EJS_s.setUncheckedException(ex); throw new java.rmi.RemoteException("bean method raised unchecked exception", ex); } finally { try{ container.postInvoke(this, 13, _EJS_s); } finally { putDeployedSupport(_EJS_s); } } return ; } }
15,364
0.730604
0.713421
453
32.916115
51.732689
462
false
false
0
0
0
0
0
0
2.84989
false
false
3
30d03282c8c752d1bc6dc9cf3d6b81fd8064c2f1
12,902,081,815,806
449ae14862d9803277babe446f7f030fe9b0f15e
/overlog-paxos/src/PerfRunner.java
85aa1dedc1b6030ee7273635fba85ddfdea4d46d
[]
no_license
declarativitydotnet/declarativity
https://github.com/declarativitydotnet/declarativity
863ea58bed1c0efc57573d75b73e0006eca3f280
75096fb78264c517cd00e8486467c010038434cb
refs/heads/master
2021-01-10T11:58:00.700000
2015-12-08T17:44:39
2015-12-08T17:44:39
47,607,520
9
3
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.LinkedList; import java.util.List; public class PerfRunner { private final int nClients; private final List<PaxosClient> clients; public PerfRunner(int nClients) { this.nClients = nClients; this.clients = new LinkedList<PaxosClient>(); for (int i = 0; i < this.nClients; i++) { this.clients.add(new PaxosClient(i, this.nClients)); } } public void run() { for (PaxosClient c : this.clients) { c.start(); } } }
UTF-8
Java
454
java
PerfRunner.java
Java
[]
null
[]
import java.util.LinkedList; import java.util.List; public class PerfRunner { private final int nClients; private final List<PaxosClient> clients; public PerfRunner(int nClients) { this.nClients = nClients; this.clients = new LinkedList<PaxosClient>(); for (int i = 0; i < this.nClients; i++) { this.clients.add(new PaxosClient(i, this.nClients)); } } public void run() { for (PaxosClient c : this.clients) { c.start(); } } }
454
0.682819
0.680617
22
19.636364
17.688068
55
false
false
0
0
0
0
0
0
1.590909
false
false
3
0122bc676246823900f0d857119ac8846d6a3d39
35,278,861,373,596
aa725a71ef8b9a4661b3f1cdacaeb16d0666c463
/src/main/java/br/com/uft/scicumulus/graph/EnableResizeAndDrag.java
458ae8fd4aa1771721d4aaf3fd8122d1d58cd192
[]
no_license
fredsilva/tcc
https://github.com/fredsilva/tcc
c8ad52cea2f9a77a3124cab5127fd423aa7abae7
4419989ee667006c2e451babf6c051928ad8355a
refs/heads/master
2021-01-10T11:43:35.727000
2016-01-01T21:03:06
2016-01-01T21:03:06
49,285,455
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.com.uft.scicumulus.graph; import br.com.uft.scicumulus.enums.ResizeZone; import javafx.geometry.Point2D; import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Region; import javafx.scene.shape.Rectangle; /** * * @author Thaylon Guede Santos * @email thaylon_guedes@hotmail.com */ public class EnableResizeAndDrag { ResizeZone resizeZone; private final int RESIZE_MARGIN = 6; private double initX; private double initY; private Point2D dragAnchor; private Node node; private boolean dragging; double initLayoutX; double initLayoutY; public EnableResizeAndDrag(Node node) { this.node = node; } public static void make(Node node) { EnableResizeAndDrag resizeAndDrag = new EnableResizeAndDrag(node); resizeAndDrag.init(); } private void init() { node.addEventHandler(MouseEvent.MOUSE_MOVED, (MouseEvent me) -> { //resizeZone = ResizeZone.getResizeZone(node, RESIZE_MARGIN, me); if (resizeZone != null) { node.setCursor(resizeZone.getMouseCursor()); } else { node.setCursor(Cursor.HAND); } }); node.addEventHandler(MouseEvent.MOUSE_DRAGGED, (MouseEvent me) -> { dragging = true; if (resizeZone == null) { moverNode(me); } else { resizeNode(me); } me.consume(); }); node.addEventHandler(MouseEvent.MOUSE_ENTERED, (MouseEvent me) -> { node.toFront(); if (!dragging) { node.setCursor(Cursor.HAND); } }); node.addEventHandler(MouseEvent.MOUSE_PRESSED, (MouseEvent me) -> { //System.out.println(node.getId()); dragAnchor = new Point2D(me.getSceneX(), me.getSceneY()); if (resizeZone != null) { initX = node.getBoundsInParent().getWidth(); initY = node.getBoundsInParent().getHeight(); initLayoutX = node.getLayoutX(); initLayoutY = node.getLayoutY(); } else { initX = node.getLayoutX(); initY = node.getLayoutY(); } me.consume(); }); node.addEventHandler(MouseEvent.MOUSE_RELEASED, (MouseEvent me) -> { dragging = false; node.setCursor(Cursor.HAND); }); } private void resizeNode(MouseEvent me) { switch (resizeZone) { case E: resizeX(me, true); break; case N: resizeY(me, false); break; case S: resizeY(me, true); break; case W: resizeX(me, false); break; case NE: resizeX(me, true); resizeY(me, false); break; case NW: resizeX(me, false); resizeY(me, false); break; case SW: resizeX(me, false); resizeY(me, true); break; case SE: resizeX(me, true); resizeY(me, true); break; } } private void moverNode(MouseEvent me) { node.setCursor(Cursor.MOVE); double dragX = me.getSceneX() - dragAnchor.getX(); double dragY = me.getSceneY() - dragAnchor.getY(); double newXPosition = initX + dragX; double newYPosition = initY + dragY; node.setLayoutX(newXPosition); node.setLayoutY(newYPosition); } private void resizeX(MouseEvent me, boolean mantemLayout) { double espacoMovido = me.getSceneX() - dragAnchor.getX(); if (!mantemLayout) { espacoMovido = espacoMovido * -1; } double newWidth = initX + espacoMovido; setNewSize(newWidth, espacoMovido, mantemLayout, true); } private void resizeY(MouseEvent me, boolean mantemLayout) { double espacoMovido = me.getSceneY() - dragAnchor.getY(); if (!mantemLayout) { espacoMovido = espacoMovido * -1; } double newHeight = initY + espacoMovido; setNewSize(newHeight, espacoMovido, mantemLayout, false); } private void setNewSize(double newValue, double espacoMovido, boolean manterLayout, boolean isX) { if (node instanceof Region) { Region region = (Region) node; if (isX) { region.setPrefWidth(newValue); } else { region.setPrefHeight(newValue); } } else if (node instanceof Rectangle) { Rectangle rectangle = (Rectangle) node; if (isX) { rectangle.setWidth(newValue); } else { rectangle.setHeight(newValue); } } else { System.err.println("Objeto não tem resize conhecido: " + node); } if (!manterLayout) { if (isX) { node.setLayoutX(initLayoutX - espacoMovido); } else { node.setLayoutY(initLayoutY - espacoMovido); } } } }
UTF-8
Java
5,363
java
EnableResizeAndDrag.java
Java
[ { "context": "t javafx.scene.shape.Rectangle;\n\n/**\n *\n * @author Thaylon Guede Santos\n * @email thaylon_guedes@hotmail.com\n */\npublic c", "end": 320, "score": 0.9998878240585327, "start": 300, "tag": "NAME", "value": "Thaylon Guede Santos" }, { "context": "\n\n/**\n *\n * @author Thaylon Guede Santos\n * @email thaylon_guedes@hotmail.com\n */\npublic class EnableResizeAndDrag {\n\n Resiz", "end": 357, "score": 0.9999336004257202, "start": 331, "tag": "EMAIL", "value": "thaylon_guedes@hotmail.com" } ]
null
[]
package br.com.uft.scicumulus.graph; import br.com.uft.scicumulus.enums.ResizeZone; import javafx.geometry.Point2D; import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Region; import javafx.scene.shape.Rectangle; /** * * @author <NAME> * @email <EMAIL> */ public class EnableResizeAndDrag { ResizeZone resizeZone; private final int RESIZE_MARGIN = 6; private double initX; private double initY; private Point2D dragAnchor; private Node node; private boolean dragging; double initLayoutX; double initLayoutY; public EnableResizeAndDrag(Node node) { this.node = node; } public static void make(Node node) { EnableResizeAndDrag resizeAndDrag = new EnableResizeAndDrag(node); resizeAndDrag.init(); } private void init() { node.addEventHandler(MouseEvent.MOUSE_MOVED, (MouseEvent me) -> { //resizeZone = ResizeZone.getResizeZone(node, RESIZE_MARGIN, me); if (resizeZone != null) { node.setCursor(resizeZone.getMouseCursor()); } else { node.setCursor(Cursor.HAND); } }); node.addEventHandler(MouseEvent.MOUSE_DRAGGED, (MouseEvent me) -> { dragging = true; if (resizeZone == null) { moverNode(me); } else { resizeNode(me); } me.consume(); }); node.addEventHandler(MouseEvent.MOUSE_ENTERED, (MouseEvent me) -> { node.toFront(); if (!dragging) { node.setCursor(Cursor.HAND); } }); node.addEventHandler(MouseEvent.MOUSE_PRESSED, (MouseEvent me) -> { //System.out.println(node.getId()); dragAnchor = new Point2D(me.getSceneX(), me.getSceneY()); if (resizeZone != null) { initX = node.getBoundsInParent().getWidth(); initY = node.getBoundsInParent().getHeight(); initLayoutX = node.getLayoutX(); initLayoutY = node.getLayoutY(); } else { initX = node.getLayoutX(); initY = node.getLayoutY(); } me.consume(); }); node.addEventHandler(MouseEvent.MOUSE_RELEASED, (MouseEvent me) -> { dragging = false; node.setCursor(Cursor.HAND); }); } private void resizeNode(MouseEvent me) { switch (resizeZone) { case E: resizeX(me, true); break; case N: resizeY(me, false); break; case S: resizeY(me, true); break; case W: resizeX(me, false); break; case NE: resizeX(me, true); resizeY(me, false); break; case NW: resizeX(me, false); resizeY(me, false); break; case SW: resizeX(me, false); resizeY(me, true); break; case SE: resizeX(me, true); resizeY(me, true); break; } } private void moverNode(MouseEvent me) { node.setCursor(Cursor.MOVE); double dragX = me.getSceneX() - dragAnchor.getX(); double dragY = me.getSceneY() - dragAnchor.getY(); double newXPosition = initX + dragX; double newYPosition = initY + dragY; node.setLayoutX(newXPosition); node.setLayoutY(newYPosition); } private void resizeX(MouseEvent me, boolean mantemLayout) { double espacoMovido = me.getSceneX() - dragAnchor.getX(); if (!mantemLayout) { espacoMovido = espacoMovido * -1; } double newWidth = initX + espacoMovido; setNewSize(newWidth, espacoMovido, mantemLayout, true); } private void resizeY(MouseEvent me, boolean mantemLayout) { double espacoMovido = me.getSceneY() - dragAnchor.getY(); if (!mantemLayout) { espacoMovido = espacoMovido * -1; } double newHeight = initY + espacoMovido; setNewSize(newHeight, espacoMovido, mantemLayout, false); } private void setNewSize(double newValue, double espacoMovido, boolean manterLayout, boolean isX) { if (node instanceof Region) { Region region = (Region) node; if (isX) { region.setPrefWidth(newValue); } else { region.setPrefHeight(newValue); } } else if (node instanceof Rectangle) { Rectangle rectangle = (Rectangle) node; if (isX) { rectangle.setWidth(newValue); } else { rectangle.setHeight(newValue); } } else { System.err.println("Objeto não tem resize conhecido: " + node); } if (!manterLayout) { if (isX) { node.setLayoutX(initLayoutX - espacoMovido); } else { node.setLayoutY(initLayoutY - espacoMovido); } } } }
5,330
0.532078
0.530959
172
30.174419
20.670837
102
false
false
0
0
0
0
0
0
0.697674
false
false
3
44dc9f561f16e595d29bd62a242c71cc4eaf0a30
15,487,652,119,318
6cbf9d599eaa3a319149a96ea003c1ff332d26e6
/gateway_service/src/main/java/com/xiehua/request/UserRequest.java
573427be932093fe19fa7f439206f5a36739f46f
[]
no_license
zhouhuashan/xiehua_gateway
https://github.com/zhouhuashan/xiehua_gateway
4069fe940106a5f12a59cf40ea704f4a06210663
1c36463db52c292b912a62ce3ef10a87f9d6953f
refs/heads/master
2020-04-20T07:32:56.532000
2019-01-18T08:06:27
2019-01-18T08:06:27
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.xiehua.request; import java.io.Serializable; public class UserRequest implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private String accept; private String acceptEncoding; private String acceptLanguage; private String cacheControl; private String connection; private String cookie; private String host; private String upgradeInsecureRequests; private String userAgent; private String referer; public UserRequest() { // TODO Auto-generated constructor stub } public String getAccept() { return accept; } public void setAccept(String accept) { this.accept = accept; } public String getAcceptEncoding() { return acceptEncoding; } public void setAcceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; } public String getAcceptLanguage() { return acceptLanguage; } public void setAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; } public String getCacheControl() { return cacheControl; } public void setCacheControl(String cacheControl) { this.cacheControl = cacheControl; } public String getConnection() { return connection; } public void setConnection(String connection) { this.connection = connection; } public String getCookie() { return cookie; } public void setCookie(String cookie) { this.cookie = cookie; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getUpgradeInsecureRequests() { return upgradeInsecureRequests; } public void setUpgradeInsecureRequests(String upgradeInsecureRequests) { this.upgradeInsecureRequests = upgradeInsecureRequests; } public String getUserAgent() { return userAgent; } public void setUserAgent(String userAgent) { this.userAgent = userAgent; } public String getReferer() { return referer; } public void setReferer(String referer) { this.referer = referer; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserRequest that = (UserRequest) o; if (accept != null ? !accept.equals(that.accept) : that.accept != null) return false; if (acceptEncoding != null ? !acceptEncoding.equals(that.acceptEncoding) : that.acceptEncoding != null) return false; if (acceptLanguage != null ? !acceptLanguage.equals(that.acceptLanguage) : that.acceptLanguage != null) return false; if (cacheControl != null ? !cacheControl.equals(that.cacheControl) : that.cacheControl != null) return false; if (connection != null ? !connection.equals(that.connection) : that.connection != null) return false; if (cookie != null ? !cookie.equals(that.cookie) : that.cookie != null) return false; if (host != null ? !host.equals(that.host) : that.host != null) return false; if (upgradeInsecureRequests != null ? !upgradeInsecureRequests.equals(that.upgradeInsecureRequests) : that.upgradeInsecureRequests != null) return false; if (userAgent != null ? !userAgent.equals(that.userAgent) : that.userAgent != null) return false; return referer != null ? referer.equals(that.referer) : that.referer == null; } @Override public int hashCode() { int result = accept != null ? accept.hashCode() : 0; result = 31 * result + (acceptEncoding != null ? acceptEncoding.hashCode() : 0); result = 31 * result + (acceptLanguage != null ? acceptLanguage.hashCode() : 0); result = 31 * result + (cacheControl != null ? cacheControl.hashCode() : 0); result = 31 * result + (connection != null ? connection.hashCode() : 0); result = 31 * result + (cookie != null ? cookie.hashCode() : 0); result = 31 * result + (host != null ? host.hashCode() : 0); result = 31 * result + (upgradeInsecureRequests != null ? upgradeInsecureRequests.hashCode() : 0); result = 31 * result + (userAgent != null ? userAgent.hashCode() : 0); result = 31 * result + (referer != null ? referer.hashCode() : 0); return result; } }
UTF-8
Java
4,047
java
UserRequest.java
Java
[]
null
[]
package com.xiehua.request; import java.io.Serializable; public class UserRequest implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private String accept; private String acceptEncoding; private String acceptLanguage; private String cacheControl; private String connection; private String cookie; private String host; private String upgradeInsecureRequests; private String userAgent; private String referer; public UserRequest() { // TODO Auto-generated constructor stub } public String getAccept() { return accept; } public void setAccept(String accept) { this.accept = accept; } public String getAcceptEncoding() { return acceptEncoding; } public void setAcceptEncoding(String acceptEncoding) { this.acceptEncoding = acceptEncoding; } public String getAcceptLanguage() { return acceptLanguage; } public void setAcceptLanguage(String acceptLanguage) { this.acceptLanguage = acceptLanguage; } public String getCacheControl() { return cacheControl; } public void setCacheControl(String cacheControl) { this.cacheControl = cacheControl; } public String getConnection() { return connection; } public void setConnection(String connection) { this.connection = connection; } public String getCookie() { return cookie; } public void setCookie(String cookie) { this.cookie = cookie; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getUpgradeInsecureRequests() { return upgradeInsecureRequests; } public void setUpgradeInsecureRequests(String upgradeInsecureRequests) { this.upgradeInsecureRequests = upgradeInsecureRequests; } public String getUserAgent() { return userAgent; } public void setUserAgent(String userAgent) { this.userAgent = userAgent; } public String getReferer() { return referer; } public void setReferer(String referer) { this.referer = referer; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserRequest that = (UserRequest) o; if (accept != null ? !accept.equals(that.accept) : that.accept != null) return false; if (acceptEncoding != null ? !acceptEncoding.equals(that.acceptEncoding) : that.acceptEncoding != null) return false; if (acceptLanguage != null ? !acceptLanguage.equals(that.acceptLanguage) : that.acceptLanguage != null) return false; if (cacheControl != null ? !cacheControl.equals(that.cacheControl) : that.cacheControl != null) return false; if (connection != null ? !connection.equals(that.connection) : that.connection != null) return false; if (cookie != null ? !cookie.equals(that.cookie) : that.cookie != null) return false; if (host != null ? !host.equals(that.host) : that.host != null) return false; if (upgradeInsecureRequests != null ? !upgradeInsecureRequests.equals(that.upgradeInsecureRequests) : that.upgradeInsecureRequests != null) return false; if (userAgent != null ? !userAgent.equals(that.userAgent) : that.userAgent != null) return false; return referer != null ? referer.equals(that.referer) : that.referer == null; } @Override public int hashCode() { int result = accept != null ? accept.hashCode() : 0; result = 31 * result + (acceptEncoding != null ? acceptEncoding.hashCode() : 0); result = 31 * result + (acceptLanguage != null ? acceptLanguage.hashCode() : 0); result = 31 * result + (cacheControl != null ? cacheControl.hashCode() : 0); result = 31 * result + (connection != null ? connection.hashCode() : 0); result = 31 * result + (cookie != null ? cookie.hashCode() : 0); result = 31 * result + (host != null ? host.hashCode() : 0); result = 31 * result + (upgradeInsecureRequests != null ? upgradeInsecureRequests.hashCode() : 0); result = 31 * result + (userAgent != null ? userAgent.hashCode() : 0); result = 31 * result + (referer != null ? referer.hashCode() : 0); return result; } }
4,047
0.709909
0.702743
154
25.285715
29.704981
141
false
false
0
0
0
0
0
0
1.5
false
false
3
e02a175beffa3a46cce10923e0e7ab92cee8a202
15,487,652,122,205
816e53ced1f741006ed5dd568365aba0ec03f0cf
/TeamBattle/src/minecraft/net/minecraft/client/renderer/entity/RenderBoat.java
32de9c055d683df5645f0d50f2525ee04de44ffa
[]
no_license
TeamBattleClient/TeamBattleRemake
https://github.com/TeamBattleClient/TeamBattleRemake
ad4eb8379ebc673ef1e58d0f2c1a34e900bd85fe
859afd1ff2cd7527abedfbfe0b3d1dae09d5cbbc
refs/heads/master
2021-03-12T19:41:51.521000
2015-03-08T21:34:32
2015-03-08T21:34:32
31,624,440
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.minecraft.client.renderer.entity; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBoat; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityBoat; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class RenderBoat extends Render { private static final ResourceLocation boatTextures = new ResourceLocation( "textures/entity/boat.png"); /** instance of ModelBoat for rendering */ protected ModelBase modelBoat; public RenderBoat() { shadowSize = 0.5F; modelBoat = new ModelBoat(); } /** * Actually renders the given argument. This is a synthetic bridge method, * always casting down its argument and then handing it off to a worker * function which does the actual work. In all probabilty, the class Render * is generic (Render<T extends Entity) and this method has signature public * void doRender(T entity, double d, double d1, double d2, float f, float * f1). But JAD is pre 1.5 so doesn't do that. */ @Override public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityBoat) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } /** * Actually renders the given argument. This is a synthetic bridge method, * always casting down its argument and then handing it off to a worker * function which does the actual work. In all probabilty, the class Render * is generic (Render<T extends Entity) and this method has signature public * void doRender(T entity, double d, double d1, double d2, float f, float * f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(EntityBoat p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { GL11.glPushMatrix(); GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); final float var10 = p_76986_1_.getTimeSinceHit() - p_76986_9_; float var11 = p_76986_1_.getDamageTaken() - p_76986_9_; if (var11 < 0.0F) { var11 = 0.0F; } if (var10 > 0.0F) { GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); } final float var12 = 0.75F; GL11.glScalef(var12, var12, var12); GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); bindEntityTexture(p_76986_1_); GL11.glScalef(-1.0F, -1.0F, 1.0F); modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } /** * Returns the location of an entity's texture. Doesn't seem to be called * unless you call Render.bindEntityTexture. */ @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityBoat) p_110775_1_); } /** * Returns the location of an entity's texture. Doesn't seem to be called * unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityBoat p_110775_1_) { return boatTextures; } }
UTF-8
Java
3,200
java
RenderBoat.java
Java
[]
null
[]
package net.minecraft.client.renderer.entity; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBoat; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityBoat; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; public class RenderBoat extends Render { private static final ResourceLocation boatTextures = new ResourceLocation( "textures/entity/boat.png"); /** instance of ModelBoat for rendering */ protected ModelBase modelBoat; public RenderBoat() { shadowSize = 0.5F; modelBoat = new ModelBoat(); } /** * Actually renders the given argument. This is a synthetic bridge method, * always casting down its argument and then handing it off to a worker * function which does the actual work. In all probabilty, the class Render * is generic (Render<T extends Entity) and this method has signature public * void doRender(T entity, double d, double d1, double d2, float f, float * f1). But JAD is pre 1.5 so doesn't do that. */ @Override public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityBoat) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } /** * Actually renders the given argument. This is a synthetic bridge method, * always casting down its argument and then handing it off to a worker * function which does the actual work. In all probabilty, the class Render * is generic (Render<T extends Entity) and this method has signature public * void doRender(T entity, double d, double d1, double d2, float f, float * f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(EntityBoat p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { GL11.glPushMatrix(); GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_); GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); final float var10 = p_76986_1_.getTimeSinceHit() - p_76986_9_; float var11 = p_76986_1_.getDamageTaken() - p_76986_9_; if (var11 < 0.0F) { var11 = 0.0F; } if (var10 > 0.0F) { GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); } final float var12 = 0.75F; GL11.glScalef(var12, var12, var12); GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); bindEntityTexture(p_76986_1_); GL11.glScalef(-1.0F, -1.0F, 1.0F); modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } /** * Returns the location of an entity's texture. Doesn't seem to be called * unless you call Render.bindEntityTexture. */ @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityBoat) p_110775_1_); } /** * Returns the location of an entity's texture. Doesn't seem to be called * unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityBoat p_110775_1_) { return boatTextures; } }
3,200
0.701875
0.605
92
33.782608
27.072296
77
false
false
0
0
0
0
0
0
2.097826
false
false
3
1ad68977af1ad814b0430ed9b0b36b2f0e8f221d
15,487,652,118,505
e12a79fc59634736c35cfe7896712fe444a32cb1
/advanced/Minecraft_v1_8_R3.java
39875794abb6e4460c17291508a82eb3b3000e92
[ "MIT" ]
permissive
zSwert/EduardLib
https://github.com/zSwert/EduardLib
93698cacef0f4678dc999e546e51141e4293fd25
be269eb90df81bd4bc67dc1587a061db055fc9b5
refs/heads/master
2020-08-14T07:55:14.516000
2019-08-11T09:46:22
2019-08-11T09:46:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package net.eduard.api.lib.advanced; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Field; import java.net.URL; import java.net.URLConnection; import java.util.UUID; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.google.gson.JsonObject; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import net.eduard.api.lib.modules.Extra; import net.minecraft.server.v1_8_R3.EntityPlayer; import net.minecraft.server.v1_8_R3.IChatBaseComponent; import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayInClientCommand; import net.minecraft.server.v1_8_R3.PacketPlayInClientCommand.EnumClientCommand; import net.minecraft.server.v1_8_R3.PacketPlayOutChat; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityHeadRotation; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction; public class Minecraft_v1_8_R3 implements Minecraft { @Override public void sendPacket(Object packet, Player player) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket((Packet<?>) packet); } @Override public void setHeadSkin(ItemStack head, String texture, String signature) { // TODO Auto-generated method stub } @Override public void performRespawn(Player player) { ((CraftPlayer) player).getHandle().playerConnection .a(new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN)); } @Override public void setPlayerSkin(Player player, String newSkin) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final GameProfile playerProfile = entityPlayer.getProfile(); // playerProfile.getProperties().clear(); String uuid = Extra.getPlayerUUIDByName(newSkin); System.out.println(uuid); JsonObject skinProperty = Extra.getSkinProperty(uuid); System.out.println(skinProperty); String name = skinProperty.get("name").getAsString(); String skin = skinProperty.get("value").getAsString(); String signature = skinProperty.get("signature").getAsString(); try { playerProfile.getProperties().put("textures", new Property(name, skin, signature)); } catch (Exception e) { e.printStackTrace(); } respawnPlayer(player); } public static boolean setSkin(GameProfile profile, UUID uuid) { try { URLConnection connection = (URLConnection) new URL(String .format("https://sessionserver.mojang.com/session/minecraft/profile/%s?unsigned=false", "" + uuid)) .openConnection(); // if (connection.getResponseCode() == HttpsURLConnection.HTTP_OK) { String reply = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine(); String skin = reply.split("\"value\":\"")[1].split("\"")[0]; String signature = reply.split("\"signature\":\"")[1].split("\"")[0]; profile.getProperties().put("textures", new Property("textures", skin, signature)); // return true; // } else { // System.out.println("Connection could not be opened (Response code " + connection.getResponseCode() + ", " + connection.getResponseMessage() + ")"); // return false; // } } catch (IOException e) { e.printStackTrace(); return false; } return false; } @Override public void setPlayerName(Player player, String newName) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final GameProfile playerProfile = entityPlayer.getProfile(); removeFromTab(player); try { final Field field = playerProfile.getClass().getDeclaredField("name"); field.setAccessible(true); field.set(playerProfile, newName); field.setAccessible(false); entityPlayer.getClass().getDeclaredField("displayName").set(entityPlayer, newName); entityPlayer.getClass().getDeclaredField("listName").set(entityPlayer, newName); } catch (Exception e) { e.printStackTrace(); } respawnPlayer(player); } @Override public void respawnPlayer(Player player) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(new int[] { entityPlayer.getId() }); final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer); final PacketPlayOutPlayerInfo addPlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) player).getHandle()); final PacketPlayOutEntityMetadata metadata = new PacketPlayOutEntityMetadata(entityPlayer.getId(), entityPlayer.getDataWatcher(), true); final PacketPlayOutEntityHeadRotation headRotation = new PacketPlayOutEntityHeadRotation(entityPlayer, (byte) MathHelper.d(entityPlayer.getHeadRotation() * 256.0f / 360.0f)); final PacketPlayOutPlayerInfo removePlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle()); sendPacketsToOthers(player, removePlayerInfo, addPlayerInfo, destroy, spawn, metadata, headRotation); } @Override public void removeFromTab(Player playerRemoved) { final PacketPlayOutPlayerInfo removePlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) playerRemoved).getHandle()); sendPacketsToOthers(playerRemoved, removePlayerInfo); } @Override public void addToTab(Player playerToAdd) { final PacketPlayOutPlayerInfo addPlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) playerToAdd).getHandle()); final PacketPlayOutPlayerInfo updatePlayerInfo = new PacketPlayOutPlayerInfo( EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, ((CraftPlayer) playerToAdd).getHandle()); sendPacketsToOthers(playerToAdd, addPlayerInfo, updatePlayerInfo); } @Override public void sendActionBar(Player player, String message) { IChatBaseComponent chatBaseComponent = ChatSerializer.a("" + message); PacketPlayOutChat packetPlayOutChat = new PacketPlayOutChat(chatBaseComponent, (byte) 2); sendPacket(packetPlayOutChat, player); } }
UTF-8
Java
6,502
java
Minecraft_v1_8_R3.java
Java
[]
null
[]
package net.eduard.api.lib.advanced; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Field; import java.net.URL; import java.net.URLConnection; import java.util.UUID; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import com.google.gson.JsonObject; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import net.eduard.api.lib.modules.Extra; import net.minecraft.server.v1_8_R3.EntityPlayer; import net.minecraft.server.v1_8_R3.IChatBaseComponent; import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; import net.minecraft.server.v1_8_R3.PacketPlayInClientCommand; import net.minecraft.server.v1_8_R3.PacketPlayInClientCommand.EnumClientCommand; import net.minecraft.server.v1_8_R3.PacketPlayOutChat; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityHeadRotation; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction; public class Minecraft_v1_8_R3 implements Minecraft { @Override public void sendPacket(Object packet, Player player) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket((Packet<?>) packet); } @Override public void setHeadSkin(ItemStack head, String texture, String signature) { // TODO Auto-generated method stub } @Override public void performRespawn(Player player) { ((CraftPlayer) player).getHandle().playerConnection .a(new PacketPlayInClientCommand(EnumClientCommand.PERFORM_RESPAWN)); } @Override public void setPlayerSkin(Player player, String newSkin) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final GameProfile playerProfile = entityPlayer.getProfile(); // playerProfile.getProperties().clear(); String uuid = Extra.getPlayerUUIDByName(newSkin); System.out.println(uuid); JsonObject skinProperty = Extra.getSkinProperty(uuid); System.out.println(skinProperty); String name = skinProperty.get("name").getAsString(); String skin = skinProperty.get("value").getAsString(); String signature = skinProperty.get("signature").getAsString(); try { playerProfile.getProperties().put("textures", new Property(name, skin, signature)); } catch (Exception e) { e.printStackTrace(); } respawnPlayer(player); } public static boolean setSkin(GameProfile profile, UUID uuid) { try { URLConnection connection = (URLConnection) new URL(String .format("https://sessionserver.mojang.com/session/minecraft/profile/%s?unsigned=false", "" + uuid)) .openConnection(); // if (connection.getResponseCode() == HttpsURLConnection.HTTP_OK) { String reply = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine(); String skin = reply.split("\"value\":\"")[1].split("\"")[0]; String signature = reply.split("\"signature\":\"")[1].split("\"")[0]; profile.getProperties().put("textures", new Property("textures", skin, signature)); // return true; // } else { // System.out.println("Connection could not be opened (Response code " + connection.getResponseCode() + ", " + connection.getResponseMessage() + ")"); // return false; // } } catch (IOException e) { e.printStackTrace(); return false; } return false; } @Override public void setPlayerName(Player player, String newName) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final GameProfile playerProfile = entityPlayer.getProfile(); removeFromTab(player); try { final Field field = playerProfile.getClass().getDeclaredField("name"); field.setAccessible(true); field.set(playerProfile, newName); field.setAccessible(false); entityPlayer.getClass().getDeclaredField("displayName").set(entityPlayer, newName); entityPlayer.getClass().getDeclaredField("listName").set(entityPlayer, newName); } catch (Exception e) { e.printStackTrace(); } respawnPlayer(player); } @Override public void respawnPlayer(Player player) { final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle(); final PacketPlayOutEntityDestroy destroy = new PacketPlayOutEntityDestroy(new int[] { entityPlayer.getId() }); final PacketPlayOutNamedEntitySpawn spawn = new PacketPlayOutNamedEntitySpawn(entityPlayer); final PacketPlayOutPlayerInfo addPlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) player).getHandle()); final PacketPlayOutEntityMetadata metadata = new PacketPlayOutEntityMetadata(entityPlayer.getId(), entityPlayer.getDataWatcher(), true); final PacketPlayOutEntityHeadRotation headRotation = new PacketPlayOutEntityHeadRotation(entityPlayer, (byte) MathHelper.d(entityPlayer.getHeadRotation() * 256.0f / 360.0f)); final PacketPlayOutPlayerInfo removePlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle()); sendPacketsToOthers(player, removePlayerInfo, addPlayerInfo, destroy, spawn, metadata, headRotation); } @Override public void removeFromTab(Player playerRemoved) { final PacketPlayOutPlayerInfo removePlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) playerRemoved).getHandle()); sendPacketsToOthers(playerRemoved, removePlayerInfo); } @Override public void addToTab(Player playerToAdd) { final PacketPlayOutPlayerInfo addPlayerInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, ((CraftPlayer) playerToAdd).getHandle()); final PacketPlayOutPlayerInfo updatePlayerInfo = new PacketPlayOutPlayerInfo( EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, ((CraftPlayer) playerToAdd).getHandle()); sendPacketsToOthers(playerToAdd, addPlayerInfo, updatePlayerInfo); } @Override public void sendActionBar(Player player, String message) { IChatBaseComponent chatBaseComponent = ChatSerializer.a("" + message); PacketPlayOutChat packetPlayOutChat = new PacketPlayOutChat(chatBaseComponent, (byte) 2); sendPacket(packetPlayOutChat, player); } }
6,502
0.76884
0.759459
165
38.406059
33.910561
162
false
false
0
0
0
0
0
0
2.024242
false
false
3
0d509be23f3d70e6facdbd13268563fdeca629cc
7,550,552,525,113
af3b6e95f1781bff551cd5595fd4c8eab5d03922
/0423/src/WrapperMain.java
e98b557a8045ba62e3352b6321296f565707c42b
[]
no_license
yooreka/chisong1
https://github.com/yooreka/chisong1
e33a9d6c7f9970404507b81e07bf738a6e26ccc1
7e210494ff23f47b1e81fb6d13b061ee0469bfd2
refs/heads/master
2023-04-30T21:37:44.818000
2020-06-08T09:40:15
2020-06-08T09:40:15
254,320,744
0
0
null
false
2023-04-14T17:59:44
2020-04-09T08:57:28
2020-06-08T09:40:28
2023-04-14T17:59:44
8,374
0
0
4
Java
false
false
import java.math.BigDecimal; import java.util.Scanner; public class WrapperMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { try { System.out.println("정수입력"); String input = sc.nextLine(); //문자열을 정수로 변환 int num = Integer.parseInt(input); System.out.println("num :" + num); break; } catch (Exception e) { System.out.println("숫자만 입력하세요"); } } sc.close(); //숫자로 된 문자열을 생성자에 대입해서 BigDecimal //인스턴스 2개 만들기 BigDecimal a1 = new BigDecimal("10"); BigDecimal a2 = new BigDecimal("20"); //더하기 BigDecimal result = a1.add(a2); //정수로 저장하기 int n = result.intValue(); System.out.println(result); } }
UTF-8
Java
870
java
WrapperMain.java
Java
[]
null
[]
import java.math.BigDecimal; import java.util.Scanner; public class WrapperMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { try { System.out.println("정수입력"); String input = sc.nextLine(); //문자열을 정수로 변환 int num = Integer.parseInt(input); System.out.println("num :" + num); break; } catch (Exception e) { System.out.println("숫자만 입력하세요"); } } sc.close(); //숫자로 된 문자열을 생성자에 대입해서 BigDecimal //인스턴스 2개 만들기 BigDecimal a1 = new BigDecimal("10"); BigDecimal a2 = new BigDecimal("20"); //더하기 BigDecimal result = a1.add(a2); //정수로 저장하기 int n = result.intValue(); System.out.println(result); } }
870
0.588158
0.576316
38
18
15.568186
50
false
false
0
0
0
0
0
0
2.026316
false
false
3
d81a69a9bb56eaab6e1d24b7006324a7fc41f440
35,682,588,302,703
ff919ffda7a7feb59968b23957fc581b3deb6ef6
/src/main/java/org/spacedrones/components/AbstractBusComponent.java
f24ef6f3f15666dc794812c32e99b1d958b6517e
[]
no_license
snclucas/spacedrones
https://github.com/snclucas/spacedrones
b3270db2ae01181973b0583f316fac4aab4f1f57
dbf1c43196ab915bfbd80d53a1537fa950bb5863
refs/heads/master
2021-01-01T19:49:24.941000
2018-11-18T17:45:39
2018-11-18T17:45:39
98,697,913
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.spacedrones.components; import org.spacedrones.Configuration; import org.spacedrones.components.comms.Status; import org.spacedrones.components.computers.SystemComputer; import org.spacedrones.exceptions.ComponentConfigurationException; import org.spacedrones.physics.Unit; import org.spacedrones.software.Message; import org.spacedrones.software.SystemMessage; import org.spacedrones.spacecraft.BusComponentSpecification; import org.spacedrones.status.SystemStatus; import org.spacedrones.status.SystemStatusMessage; public abstract class AbstractBusComponent implements SpacecraftBusComponent { protected boolean online = false; private final String name; private final String id; private SystemComputer systemComputer; private final BusComponentSpecification busResourceSpecification; private double currentPower; private double currentCPUThroughput; public AbstractBusComponent(String name, BusComponentSpecification busSpec) { this.name = name; this.busResourceSpecification = busSpec; this.currentPower = busSpec.getNominalPower(Unit.MW); this.currentCPUThroughput = busSpec.getNominalCPUThroughout(Unit.MFLOPs); this.id = Configuration.getUUID(); } @Override public Message recieveBusMessage(Message message) { String replyMessage = "Message recieved by: " + name() + ":\n " + message.getMessage(); return new SystemMessage(null, this, replyMessage); } public final SystemStatusMessage registerSystemComputer(SystemComputer systemComputer) { this.systemComputer = systemComputer; return new SystemStatusMessage(this, this.name + " registered with " + systemComputer.name(), Status.INFO); } public BusComponentSpecification getBusResourceSpecification() { return busResourceSpecification; } @Override public final String id() { return this.id; } @Override public boolean isOnline() { return this.online; } @Override public String name() { return this.name; } @Override public double getMass(Unit unit) { return busResourceSpecification.getMass(unit); } @Override public double getVolume(Unit unit) { return busResourceSpecification.getVolume(unit); } public void setVolume(double volume) { busResourceSpecification.setVolume(volume); } @Override public double getNominalPower(Unit unit) { return busResourceSpecification.getNominalPower(unit); } @Override public double getNominalCPUThroughput(Unit unit) { return busResourceSpecification.getNominalCPUThroughout(unit); } @Override public double getMaximumPower(Unit unit) { return busResourceSpecification.getMaximumOperationalPower(unit); } @Override public double getMaximumCPUThroughput(Unit unit) { return busResourceSpecification.getMaximumOperationalCPUThroughput(unit); } @Override public double getCurrentPower(Unit unit) { return currentPower * (online ? 1 : 0) / unit.value(); } @Override public double getCurrentCPUThroughput(Unit unit) { return currentCPUThroughput * (online ? 1 : 0) / unit.value(); } public SystemComputer getSystemComputer() { if(!isRegisteredWithSystemComputer()) throw new ComponentConfigurationException(this.name + " is not registered with the computer"); return systemComputer; } public boolean isRegisteredWithSystemComputer() { return this.systemComputer != null; } @Override public String toString() { return name(); } @Override public SystemStatus online() { SystemStatus systemStatus = new SystemStatus(this); online = this.isRegisteredWithSystemComputer(); if(online) { systemStatus.addSystemMessage(name() + " online.", Status.OK); } else { systemStatus.addSystemMessage(name() + " not registered with system computer.", Status.CRITICAL); } return systemStatus; } }
UTF-8
Java
3,789
java
AbstractBusComponent.java
Java
[]
null
[]
package org.spacedrones.components; import org.spacedrones.Configuration; import org.spacedrones.components.comms.Status; import org.spacedrones.components.computers.SystemComputer; import org.spacedrones.exceptions.ComponentConfigurationException; import org.spacedrones.physics.Unit; import org.spacedrones.software.Message; import org.spacedrones.software.SystemMessage; import org.spacedrones.spacecraft.BusComponentSpecification; import org.spacedrones.status.SystemStatus; import org.spacedrones.status.SystemStatusMessage; public abstract class AbstractBusComponent implements SpacecraftBusComponent { protected boolean online = false; private final String name; private final String id; private SystemComputer systemComputer; private final BusComponentSpecification busResourceSpecification; private double currentPower; private double currentCPUThroughput; public AbstractBusComponent(String name, BusComponentSpecification busSpec) { this.name = name; this.busResourceSpecification = busSpec; this.currentPower = busSpec.getNominalPower(Unit.MW); this.currentCPUThroughput = busSpec.getNominalCPUThroughout(Unit.MFLOPs); this.id = Configuration.getUUID(); } @Override public Message recieveBusMessage(Message message) { String replyMessage = "Message recieved by: " + name() + ":\n " + message.getMessage(); return new SystemMessage(null, this, replyMessage); } public final SystemStatusMessage registerSystemComputer(SystemComputer systemComputer) { this.systemComputer = systemComputer; return new SystemStatusMessage(this, this.name + " registered with " + systemComputer.name(), Status.INFO); } public BusComponentSpecification getBusResourceSpecification() { return busResourceSpecification; } @Override public final String id() { return this.id; } @Override public boolean isOnline() { return this.online; } @Override public String name() { return this.name; } @Override public double getMass(Unit unit) { return busResourceSpecification.getMass(unit); } @Override public double getVolume(Unit unit) { return busResourceSpecification.getVolume(unit); } public void setVolume(double volume) { busResourceSpecification.setVolume(volume); } @Override public double getNominalPower(Unit unit) { return busResourceSpecification.getNominalPower(unit); } @Override public double getNominalCPUThroughput(Unit unit) { return busResourceSpecification.getNominalCPUThroughout(unit); } @Override public double getMaximumPower(Unit unit) { return busResourceSpecification.getMaximumOperationalPower(unit); } @Override public double getMaximumCPUThroughput(Unit unit) { return busResourceSpecification.getMaximumOperationalCPUThroughput(unit); } @Override public double getCurrentPower(Unit unit) { return currentPower * (online ? 1 : 0) / unit.value(); } @Override public double getCurrentCPUThroughput(Unit unit) { return currentCPUThroughput * (online ? 1 : 0) / unit.value(); } public SystemComputer getSystemComputer() { if(!isRegisteredWithSystemComputer()) throw new ComponentConfigurationException(this.name + " is not registered with the computer"); return systemComputer; } public boolean isRegisteredWithSystemComputer() { return this.systemComputer != null; } @Override public String toString() { return name(); } @Override public SystemStatus online() { SystemStatus systemStatus = new SystemStatus(this); online = this.isRegisteredWithSystemComputer(); if(online) { systemStatus.addSystemMessage(name() + " online.", Status.OK); } else { systemStatus.addSystemMessage(name() + " not registered with system computer.", Status.CRITICAL); } return systemStatus; } }
3,789
0.771972
0.770916
145
25.131035
26.401478
111
false
false
0
0
0
0
0
0
1.158621
false
false
3
c0e79bffb760ea69eda30cd676f05089c5c1a0c2
2,551,210,599,985
cc1eced0827e970cb1b65ffc78f653462bc6eac3
/src/queue/array_queue/ArrayUnboundedQueueTestMain.java
1cb884dc70193cb693c7596d45a81755848f94ef
[]
no_license
rolendSunq/javaDataStructure
https://github.com/rolendSunq/javaDataStructure
842a3847cf131ed2fe794a099b033a3324c433ac
dd1d7e56fbce69a3c2f30f84e7f52d825c3ca38c
refs/heads/master
2016-08-05T06:32:30.397000
2015-04-18T16:20:37
2015-04-22T12:52:14
24,135,221
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package queue.array_queue; public class ArrayUnboundedQueueTestMain { public static void main(String[] args) { ArrayUnboundedQueue<Integer> queue = new ArrayUnboundedQueue<Integer>(5); System.out.println("큐는 비었습니까? " + queue.isEmpty()); queue.enqueue(4); System.out.println(queue.toString()); queue.enqueue(6); System.out.println(queue.toString()); queue.enqueue(8); System.out.println(queue.toString()); queue.enqueue(2); System.out.println(queue.toString()); queue.enqueue(3); System.out.println(queue.toString()); System.out.println("\n큐는 비었습니까? " + queue.isEmpty() + "\n"); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); System.out.println("큐는 비었습니까? " + queue.isEmpty()); } }
UHC
Java
1,040
java
ArrayUnboundedQueueTestMain.java
Java
[]
null
[]
package queue.array_queue; public class ArrayUnboundedQueueTestMain { public static void main(String[] args) { ArrayUnboundedQueue<Integer> queue = new ArrayUnboundedQueue<Integer>(5); System.out.println("큐는 비었습니까? " + queue.isEmpty()); queue.enqueue(4); System.out.println(queue.toString()); queue.enqueue(6); System.out.println(queue.toString()); queue.enqueue(8); System.out.println(queue.toString()); queue.enqueue(2); System.out.println(queue.toString()); queue.enqueue(3); System.out.println(queue.toString()); System.out.println("\n큐는 비었습니까? " + queue.isEmpty() + "\n"); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); queue.dequeue(); System.out.println(queue.toString()); System.out.println("큐는 비었습니까? " + queue.isEmpty()); } }
1,040
0.674349
0.668337
33
28.242424
18.692131
75
false
false
0
0
0
0
0
0
2.333333
false
false
3
3e8df284b76efcef43cdaa8e92fe71ef9ff61a0c
21,431,886,841,343
114fb922fda1a339a452c3e1a4ba031e81aabd7e
/src/main/java/no/ica/fraf/xml/InvoiceCreatorFactoryImpl.java
799847e244a7eb9ea6d885fc960c59709f27c5d8
[]
no_license
abrekka/fraf
https://github.com/abrekka/fraf
bfb788b0db784925c998dcc844957657efa79fae
f8995ff2b0fece657017224a112f79cf3eb11e7d
refs/heads/master
2021-01-22T14:45:09.740000
2015-07-31T09:07:00
2015-07-31T09:07:00
39,994,857
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package no.ica.fraf.xml; import no.ica.fraf.common.SystemEnum; import no.ica.fraf.common.SystemType; import no.ica.fraf.dao.MvaDAO; import no.ica.fraf.gui.FrafMain; import no.ica.fraf.model.BokfSelskap; import no.ica.fraf.service.FakturaTekstVManager; import com.google.inject.Inject; public class InvoiceCreatorFactoryImpl implements InvoiceCreatorFactory { //private InvoiceManagerInterface invoiceManagerInterface; private MvaDAO mvaDAO; private FakturaTekstVManager fakturaTekstVManager; @Inject public InvoiceCreatorFactoryImpl(final MvaDAO aMvaDAO,final FakturaTekstVManager aFakturaTekstVManager){ //invoiceManagerInterface=aInvoiceManagerInterface; mvaDAO=aMvaDAO; fakturaTekstVManager=aFakturaTekstVManager; } public InvoiceCreator create(SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap//, //MvaDAO mvaDAO, //FakturaTekstVManager fakturaTekstVManager ) { return SystemType.getSystemType(FrafMain.isStandalone()).isStandalone() ? getStandaloneInvoiceCreator( system,invoiceManager, bokfSelskap) : getIntegratedInvoiceCreator(system, invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } private InvoiceCreator getStandaloneInvoiceCreator( SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap //, MvaDAO mvaDAO, //FakturaTekstVManager fakturaTekstVManager ) { return system.getStandaloneCreatorIntegrated(invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } private InvoiceCreator getIntegratedInvoiceCreator( SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap, MvaDAO mvaDAO, FakturaTekstVManager fakturaTekstVManager) { return system.getInvoiceCreatorIntegrated(invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } }
UTF-8
Java
1,907
java
InvoiceCreatorFactoryImpl.java
Java
[]
null
[]
package no.ica.fraf.xml; import no.ica.fraf.common.SystemEnum; import no.ica.fraf.common.SystemType; import no.ica.fraf.dao.MvaDAO; import no.ica.fraf.gui.FrafMain; import no.ica.fraf.model.BokfSelskap; import no.ica.fraf.service.FakturaTekstVManager; import com.google.inject.Inject; public class InvoiceCreatorFactoryImpl implements InvoiceCreatorFactory { //private InvoiceManagerInterface invoiceManagerInterface; private MvaDAO mvaDAO; private FakturaTekstVManager fakturaTekstVManager; @Inject public InvoiceCreatorFactoryImpl(final MvaDAO aMvaDAO,final FakturaTekstVManager aFakturaTekstVManager){ //invoiceManagerInterface=aInvoiceManagerInterface; mvaDAO=aMvaDAO; fakturaTekstVManager=aFakturaTekstVManager; } public InvoiceCreator create(SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap//, //MvaDAO mvaDAO, //FakturaTekstVManager fakturaTekstVManager ) { return SystemType.getSystemType(FrafMain.isStandalone()).isStandalone() ? getStandaloneInvoiceCreator( system,invoiceManager, bokfSelskap) : getIntegratedInvoiceCreator(system, invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } private InvoiceCreator getStandaloneInvoiceCreator( SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap //, MvaDAO mvaDAO, //FakturaTekstVManager fakturaTekstVManager ) { return system.getStandaloneCreatorIntegrated(invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } private InvoiceCreator getIntegratedInvoiceCreator( SystemEnum system, InvoiceManagerInterface invoiceManager, BokfSelskap bokfSelskap, MvaDAO mvaDAO, FakturaTekstVManager fakturaTekstVManager) { return system.getInvoiceCreatorIntegrated(invoiceManager, bokfSelskap, mvaDAO, fakturaTekstVManager); } }
1,907
0.790771
0.790771
56
32.05357
25.744223
105
false
false
0
0
0
0
0
0
2.357143
false
false
3
5c2ef1739c6511f43ec6b8882279505403f40cc1
7,825,430,476,811
c170f8be9beb923291db3481ebbaf3ccc350af09
/src/main/java/com/vtradex/wms/server/model/base/Contact.java
9eef8e9b6e4720692990745130e377120134b82c
[]
no_license
xxjsb001/odd
https://github.com/xxjsb001/odd
81cdf2f43a7f58ff51ff28f5d18aa73df410f802
6ba70bc47cf60efcddafce7f9db9cf97349a1cea
refs/heads/master
2021-08-08T01:42:35.308000
2017-11-09T09:45:45
2017-11-09T09:45:45
110,095,526
0
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.vtradex.wms.server.model.base; import com.vtradex.thorn.server.model.DomainModel; /** * @category 联系方式 * @author peng.lei * @version 1.0 * @created 15-二月-2011 10:06:35 */ public class Contact extends DomainModel{ /** */ private static final long serialVersionUID = 1L; /** 联系人*/ private String contactName; /** 联系电话*/ private String telephone; /** 手机号*/ private String mobile; /** 传真号码*/ private String fax; /** 邮箱账号*/ private String email; /** 国家*/ private String country; /** 省份*/ private String province; /** 城市*/ private String city; /** 联系地址*/ private String address; /** 邮编*/ private String postCode; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getContactName() { return contactName; } public void setContactName(String contactName) { this.contactName = contactName; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getPostCode() { return postCode; } public void setPostCode(String postCode) { this.postCode = postCode; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public Contact() {} public void finalize() throws Throwable { } }
UTF-8
Java
2,020
java
Contact.java
Java
[ { "context": "del.DomainModel;\n\n/**\n * @category 联系方式\n * @author peng.lei\n * @version 1.0\n * @created 15-二月-2011 10:06:35\n ", "end": 137, "score": 0.9848517775535583, "start": 129, "tag": "NAME", "value": "peng.lei" } ]
null
[]
package com.vtradex.wms.server.model.base; import com.vtradex.thorn.server.model.DomainModel; /** * @category 联系方式 * @author peng.lei * @version 1.0 * @created 15-二月-2011 10:06:35 */ public class Contact extends DomainModel{ /** */ private static final long serialVersionUID = 1L; /** 联系人*/ private String contactName; /** 联系电话*/ private String telephone; /** 手机号*/ private String mobile; /** 传真号码*/ private String fax; /** 邮箱账号*/ private String email; /** 国家*/ private String country; /** 省份*/ private String province; /** 城市*/ private String city; /** 联系地址*/ private String address; /** 邮编*/ private String postCode; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getContactName() { return contactName; } public void setContactName(String contactName) { this.contactName = contactName; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getPostCode() { return postCode; } public void setPostCode(String postCode) { this.postCode = postCode; } public String getProvince() { return province; } public void setProvince(String province) { this.province = province; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public Contact() {} public void finalize() throws Throwable { } }
2,020
0.683265
0.675565
121
15.107438
14.59469
50
false
false
0
0
0
0
0
0
1.140496
false
false
3
3d8432820651380027759de7ad81483d3e97d2b7
35,304,631,189,289
bb664f3cf0da9d434ec9c6359e54d7352af38dd5
/reflect/src/main/java/com/future/works/reflect/CognizantReflectApplication.java
ef929b99fc780c9780319d6e40b46d2586d59799
[]
no_license
sathya27works/reflect-middle-quiz
https://github.com/sathya27works/reflect-middle-quiz
51d22f086f01ced343200ceee9d7a84ad948f695
58b00aa9be9eaa08d559cfb8237c48f61012ab02
refs/heads/master
2023-08-03T17:32:29.347000
2020-08-12T14:42:18
2020-08-12T14:42:18
265,662,731
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.future.works.reflect; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; @EnableCircuitBreaker @SpringBootApplication @EnableAutoConfiguration(exclude = { WebMvcAutoConfiguration.class }) public class CognizantReflectApplication { public static void main(String[] args) { SpringApplication.run(CognizantReflectApplication.class, args); } }
UTF-8
Java
661
java
CognizantReflectApplication.java
Java
[]
null
[]
package com.future.works.reflect; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; @EnableCircuitBreaker @SpringBootApplication @EnableAutoConfiguration(exclude = { WebMvcAutoConfiguration.class }) public class CognizantReflectApplication { public static void main(String[] args) { SpringApplication.run(CognizantReflectApplication.class, args); } }
661
0.854766
0.854766
18
35.666668
29.884964
82
false
false
0
0
0
0
0
0
0.666667
false
false
3
5e23635d94e68dd560c473946443af46218dad38
35,459,250,009,577
62d0d184380343d345317d637cf8b29881b50814
/app/src/main/java/fr/easydog/activities/utils/Action.java
d0e18c7451b3aba6f13b1894d40b1528c9197d08
[]
no_license
MathiasDeveloper/easydog
https://github.com/MathiasDeveloper/easydog
a7b49bf077c5e899f34f56430ca24be6407fcfa0
35956b46b051adccb87edba91df2585ea924f5d6
refs/heads/master
2022-12-01T00:48:41.354000
2020-08-14T09:10:04
2020-08-14T09:10:04
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package fr.easydog.activities.utils; /** * Action class */ public class Action { /** * Const for String edit */ public static final String EDIT = "edit"; }
UTF-8
Java
178
java
Action.java
Java
[]
null
[]
package fr.easydog.activities.utils; /** * Action class */ public class Action { /** * Const for String edit */ public static final String EDIT = "edit"; }
178
0.606742
0.606742
11
15.181818
14.904655
46
false
false
0
0
0
0
0
0
0.181818
false
false
3
8d5e287d3c539f15e04be0e4def9a307d29c73eb
9,131,100,513,684
eb84a00a09e4814098948aeb08a994b0bfdc37a0
/src/java/Model/Pedidos.java
984e602b93eb3064c4ecbdff6305cc9f84bfd5a9
[]
no_license
Unicaes/ParcialPWM
https://github.com/Unicaes/ParcialPWM
69c4440d31df12141aa26ef8fcfd783abbb6aa73
ec831374dc2257545bef5239a83b14d0568fe28f
refs/heads/master
2023-08-26T06:35:46.133000
2021-10-15T23:40:45
2021-10-15T23:40:45
417,665,583
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 Model; import java.util.Date; /** * * @author bryan */ public class Pedidos { int idpedido,idcliente; Date fecha; double total; String estado; }
UTF-8
Java
359
java
Pedidos.java
Java
[ { "context": " Model;\n\nimport java.util.Date;\n\n/**\n *\n * @author bryan\n */\npublic class Pedidos {\n int idpedido,idcli", "end": 248, "score": 0.9989970326423645, "start": 243, "tag": "USERNAME", "value": "bryan" } ]
null
[]
/* * 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 Model; import java.util.Date; /** * * @author bryan */ public class Pedidos { int idpedido,idcliente; Date fecha; double total; String estado; }
359
0.690808
0.690808
19
17.894737
20.455072
79
false
false
0
0
0
0
0
0
0.526316
false
false
3
b3f58acdd28b0f34f1e2846f366e1b337e9b70bf
9,131,100,514,381
d86e08d910453d3662e3b2dc195e5c6a990c6850
/back/src/main/java/com/heeexy/example/service/DockerService.java
aa58c187a29f65813326cc04bf945a441d2776cc
[ "MIT" ]
permissive
Mrkoalay/SpringBoot-Shiro-Vue
https://github.com/Mrkoalay/SpringBoot-Shiro-Vue
a14e79b732738351892f583892cb5ba0bef452f2
721b73a31a22c20b184b2028d4d2134a977bfe27
refs/heads/master
2020-04-13T08:55:24.108000
2019-07-19T08:40:39
2019-07-19T08:40:39
163,096,232
1
0
null
true
2018-12-25T16:11:54
2018-12-25T16:11:54
2018-12-24T06:25:25
2018-11-17T08:15:00
311
0
0
0
null
false
null
package com.heeexy.example.service; import com.github.dockerjava.api.model.Container; import com.heeexy.example.entity.CdKey; import com.heeexy.example.entity.MyContainer; import com.heeexy.example.service.impl.CdKeyServiceImpl; import com.heeexy.example.util.Docker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.Arrays; @Service public class DockerService { @Autowired private Docker docker; private static final Logger logger = LoggerFactory.getLogger(DockerService.class); @Value("${wechat.docker.image-name}") private String imageName; @Value("${spring.redis.host}") private String redisHost; @Value("${spring.redis.port}") private Integer redisPort; @Value("${spring.redis.password}") private String redisAuth; @Value("${wechat.protocol.host}") private String wechatProtocolHost; @Value("${wechat.protocol.ws-port}") private String wechatWsPort; @Value("${wechat.protocol.http-port}") private String wechatHttpPort; @Async("taskExecutor") public void runContainer(CdKey cdKey) { String cdkey = cdKey.getCdkey(); Container container = docker.getContainerByNames(cdkey); if (container == null) { logger.info("=====>开始启动容器 " + cdkey); createContainer(cdKey); } else if (!docker.isRunning(container)) { logger.info("=====>容器已经停止,正在重启 " + cdkey); restartContainer(cdKey); } } private void restartContainer(CdKey cdKey) { docker.removeContainerByNames(cdKey.getCdkey()); createContainer(cdKey); logger.info("=====>容器启动完成 " + cdKey.getCdkey()); } private void createContainer(CdKey cdKey) { String cdkey = cdKey.getCdkey(); String image = imageName; String[] envs = new String[]{"CDKEY=" + cdkey, "REDIS_HOST=" + redisHost, "REDIS_PORT=" + redisPort, "REDIS_AUTH=" + redisAuth, "PROTOCOL_HOST=" + wechatProtocolHost, "WEBSOCKET_PORT=" + wechatWsPort, "HTTP_PORT=" + wechatHttpPort}; System.out.println(Arrays.toString(envs)); docker.Run(new MyContainer(cdkey, image, envs)); logger.info("=====>容器启动完成 " + cdkey); } }
UTF-8
Java
2,513
java
DockerService.java
Java
[]
null
[]
package com.heeexy.example.service; import com.github.dockerjava.api.model.Container; import com.heeexy.example.entity.CdKey; import com.heeexy.example.entity.MyContainer; import com.heeexy.example.service.impl.CdKeyServiceImpl; import com.heeexy.example.util.Docker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.Arrays; @Service public class DockerService { @Autowired private Docker docker; private static final Logger logger = LoggerFactory.getLogger(DockerService.class); @Value("${wechat.docker.image-name}") private String imageName; @Value("${spring.redis.host}") private String redisHost; @Value("${spring.redis.port}") private Integer redisPort; @Value("${spring.redis.password}") private String redisAuth; @Value("${wechat.protocol.host}") private String wechatProtocolHost; @Value("${wechat.protocol.ws-port}") private String wechatWsPort; @Value("${wechat.protocol.http-port}") private String wechatHttpPort; @Async("taskExecutor") public void runContainer(CdKey cdKey) { String cdkey = cdKey.getCdkey(); Container container = docker.getContainerByNames(cdkey); if (container == null) { logger.info("=====>开始启动容器 " + cdkey); createContainer(cdKey); } else if (!docker.isRunning(container)) { logger.info("=====>容器已经停止,正在重启 " + cdkey); restartContainer(cdKey); } } private void restartContainer(CdKey cdKey) { docker.removeContainerByNames(cdKey.getCdkey()); createContainer(cdKey); logger.info("=====>容器启动完成 " + cdKey.getCdkey()); } private void createContainer(CdKey cdKey) { String cdkey = cdKey.getCdkey(); String image = imageName; String[] envs = new String[]{"CDKEY=" + cdkey, "REDIS_HOST=" + redisHost, "REDIS_PORT=" + redisPort, "REDIS_AUTH=" + redisAuth, "PROTOCOL_HOST=" + wechatProtocolHost, "WEBSOCKET_PORT=" + wechatWsPort, "HTTP_PORT=" + wechatHttpPort}; System.out.println(Arrays.toString(envs)); docker.Run(new MyContainer(cdkey, image, envs)); logger.info("=====>容器启动完成 " + cdkey); } }
2,513
0.678615
0.6778
73
32.630138
25.982874
135
false
false
0
0
0
0
0
0
0.616438
false
false
3
e2817eef472a52d2ff72dd42379fe3bb9993e826
867,583,429,624
b49f538d0ab1f81435feb30d7864d69d51a7c509
/dspace-core/src/main/java/org/dspace/orm/entity/HarvestedCollection.java
6a37f6a45eb4281e64152116d23c462d0df63c97
[]
no_license
lyncode/DSpace-Spring
https://github.com/lyncode/DSpace-Spring
c599a80e7b62593ff88ef38e5e10f5996ee8b3d2
9417f788ee80ec696805aa1463631f59be03ccdb
refs/heads/master
2020-06-04T15:21:22.231000
2013-07-02T22:01:35
2013-07-02T22:01:35
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.orm.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; import org.dspace.orm.dao.content.DSpaceObjectType; import org.springframework.beans.factory.annotation.Configurable; /** * @author Miguel Pinto <mpinto@lyncode.com> * @version $Revision$ */ @Entity @Table(name = "harvested_collection") @SequenceGenerator(name="harvested_collection_gen", sequenceName="harvested_collection_seq") @Configurable public class HarvestedCollection extends DSpaceObject{ private Collection collection; private Integer harvestType; private String oaiSource; private Integer oaiSet; private String harvestMessage; private Integer harvestStatus; private String metadataConfig; private Date harvestStartTime; private Date lastHarvested; @Id @Column(name = "id") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="harvested_collection_gen") public int getID() { return id; } @Override @Transient public DSpaceObjectType getType() { return DSpaceObjectType.HARVESTED_ITEM; } @Column(name = "last_harvested", nullable = true) public Date getLastHarvested() { return lastHarvested; } public void setLastHarvested(Date lastHarvested) { this.lastHarvested = lastHarvested; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "collection_id", nullable = true) public Collection getCollection() { return collection; } public void setCollection(Collection collection) { this.collection = collection; } @Column(name = "harvest_start_time", nullable = true) public Date getHarvestStartTime() { return harvestStartTime; } public void setHarvestStartTime(Date harvestStartTime) { this.harvestStartTime = harvestStartTime; } @Column(name = "harvest_type", nullable = true) public Integer getHarvestType() { return harvestType; } public void setHarvestType(Integer harvestType) { this.harvestType = harvestType; } @Column(name = "oai_source", nullable = true) public String getOaiSource() { return oaiSource; } public void setOaiSource(String oaiSource) { this.oaiSource = oaiSource; } @Column(name = "oai_set_id", nullable = true) public Integer getOaiSet() { return oaiSet; } public void setOaiSet(Integer oaiSet) { this.oaiSet = oaiSet; } @Column(name = "harvest_message", nullable = true) public String getHarvestMessage() { return harvestMessage; } public void setHarvestMessage(String harvestMessage) { this.harvestMessage = harvestMessage; } @Column(name = "metadata_config_id", nullable = true) public Integer getHarvestStatus() { return harvestStatus; } public void setHarvestStatus(Integer harvestStatus) { this.harvestStatus = harvestStatus; } @Column(name = "harvest_status", nullable = true) public String getMetadataConfig() { return metadataConfig; } public void setMetadataConfig(String metadataConfig) { this.metadataConfig = metadataConfig; } }
UTF-8
Java
3,732
java
HarvestedCollection.java
Java
[ { "context": "actory.annotation.Configurable;\r\n\r\n/**\r\n * @author Miguel Pinto <mpinto@lyncode.com>\r\n * @version $Revision$\r\n */", "end": 845, "score": 0.9998601675033569, "start": 833, "tag": "NAME", "value": "Miguel Pinto" }, { "context": "on.Configurable;\r\n\r\n/**\r\n * @author Miguel Pinto <mpinto@lyncode.com>\r\n * @version $Revision$\r\n */\r\n\r\n\r\n@Entity\r\n@Tabl", "end": 865, "score": 0.9999318718910217, "start": 847, "tag": "EMAIL", "value": "mpinto@lyncode.com" } ]
null
[]
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.orm.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; import org.dspace.orm.dao.content.DSpaceObjectType; import org.springframework.beans.factory.annotation.Configurable; /** * @author <NAME> <<EMAIL>> * @version $Revision$ */ @Entity @Table(name = "harvested_collection") @SequenceGenerator(name="harvested_collection_gen", sequenceName="harvested_collection_seq") @Configurable public class HarvestedCollection extends DSpaceObject{ private Collection collection; private Integer harvestType; private String oaiSource; private Integer oaiSet; private String harvestMessage; private Integer harvestStatus; private String metadataConfig; private Date harvestStartTime; private Date lastHarvested; @Id @Column(name = "id") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="harvested_collection_gen") public int getID() { return id; } @Override @Transient public DSpaceObjectType getType() { return DSpaceObjectType.HARVESTED_ITEM; } @Column(name = "last_harvested", nullable = true) public Date getLastHarvested() { return lastHarvested; } public void setLastHarvested(Date lastHarvested) { this.lastHarvested = lastHarvested; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "collection_id", nullable = true) public Collection getCollection() { return collection; } public void setCollection(Collection collection) { this.collection = collection; } @Column(name = "harvest_start_time", nullable = true) public Date getHarvestStartTime() { return harvestStartTime; } public void setHarvestStartTime(Date harvestStartTime) { this.harvestStartTime = harvestStartTime; } @Column(name = "harvest_type", nullable = true) public Integer getHarvestType() { return harvestType; } public void setHarvestType(Integer harvestType) { this.harvestType = harvestType; } @Column(name = "oai_source", nullable = true) public String getOaiSource() { return oaiSource; } public void setOaiSource(String oaiSource) { this.oaiSource = oaiSource; } @Column(name = "oai_set_id", nullable = true) public Integer getOaiSet() { return oaiSet; } public void setOaiSet(Integer oaiSet) { this.oaiSet = oaiSet; } @Column(name = "harvest_message", nullable = true) public String getHarvestMessage() { return harvestMessage; } public void setHarvestMessage(String harvestMessage) { this.harvestMessage = harvestMessage; } @Column(name = "metadata_config_id", nullable = true) public Integer getHarvestStatus() { return harvestStatus; } public void setHarvestStatus(Integer harvestStatus) { this.harvestStatus = harvestStatus; } @Column(name = "harvest_status", nullable = true) public String getMetadataConfig() { return metadataConfig; } public void setMetadataConfig(String metadataConfig) { this.metadataConfig = metadataConfig; } }
3,715
0.713023
0.713023
148
23.216217
21.194893
92
false
false
0
0
0
0
0
0
0.925676
false
false
3
85f18b8e0aef2bdf9c878d8b019a72ddd551f4be
867,583,427,902
837205a72b567dfac46d7bbf1ba98cffe202e005
/javaStudy/src/greedy/Q1789.java
8e0209df99a39e6cc78e46fd333799f797f0b63e
[]
no_license
sungkong/Java
https://github.com/sungkong/Java
e110d82a37767aa21e04b383dc66f9e4f7ebfdaf
efdc2d239b319a29bb613fd8fc3c8b8b3d466567
refs/heads/master
2023-08-23T10:54:08.725000
2021-11-07T11:42:41
2021-11-07T11:42:41
368,877,573
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package greedy; import java.util.Arrays; import java.util.Scanner; public class Q1789{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); int sum = 0; int num = 1; int count = 0; // 1부터 숫자를 계속 더하면서 합이 s보다 커지면 그 차이만큼의 수를 빼주면 되므로 -1 while(true) { sum += num; num++; count++; if(sum > s) { break; } } System.out.print(count-1); // 다른 방법 // Scanner sc = new Scanner(System.in); // long s = sc.nextLong(); // long sum = 0; // int i = 0; // while(true) { // i++; // sum += i; // if(sum == s) { // break; // } else if(sum > s) { // i--; // break; // } // } // System.out.println(i); } }
UTF-8
Java
884
java
Q1789.java
Java
[]
null
[]
package greedy; import java.util.Arrays; import java.util.Scanner; public class Q1789{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int s = sc.nextInt(); int sum = 0; int num = 1; int count = 0; // 1부터 숫자를 계속 더하면서 합이 s보다 커지면 그 차이만큼의 수를 빼주면 되므로 -1 while(true) { sum += num; num++; count++; if(sum > s) { break; } } System.out.print(count-1); // 다른 방법 // Scanner sc = new Scanner(System.in); // long s = sc.nextLong(); // long sum = 0; // int i = 0; // while(true) { // i++; // sum += i; // if(sum == s) { // break; // } else if(sum > s) { // i--; // break; // } // } // System.out.println(i); } }
884
0.454434
0.439655
40
19.299999
12.584117
59
false
false
0
0
0
0
0
0
1.875
false
false
3
62a6ce5084158020d95becbb6061f8e3b5d237f3
34,291,018,900,180
428ba3fd00829263c008eb764f3b9d1763cf4ae9
/visfull/visfull-service/src/main/java/com/visfull/bz/dao/impl/CityDaoImpl.java
1a7bbae51c442194f63eec9e6a5c6d454be58c27
[]
no_license
bingoyang/bingo
https://github.com/bingoyang/bingo
76b1260996f63beb25c850d73513535b7cf1c02e
098b01ff6e375dcdef426cee14ea0a835ad2e7bd
refs/heads/master
2021-01-17T14:46:07.117000
2013-04-19T09:22:59
2013-04-19T09:22:59
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.visfull.bz.dao.impl; import java.util.ArrayList; import java.util.List; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import com.visfull.bz.dao.CityDao; import com.visfull.bz.domain.City; @Repository public class CityDaoImpl extends HibernateBaseDaoImpl<City,Integer> implements CityDao { public void save(City object) { // TODO Auto-generated method stub } public City findByPK(Integer pk) { // TODO Auto-generated method stub return null; } public void update(City d) { // TODO Auto-generated method stub } public void saveOrUpdate(City d) { // TODO Auto-generated method stub } public void deleteByPK(Integer pk) { // TODO Auto-generated method stub } public List<City> findCitiesByProvinceId(Integer provinceId) { List<City> result = new ArrayList<City>(); Criteria criteria = getSession().createCriteria(City.class); criteria.add(Restrictions.eq("provinceId", provinceId)); criteria.setProjection(null); result = criteria.list(); return result; } }
UTF-8
Java
1,097
java
CityDaoImpl.java
Java
[]
null
[]
package com.visfull.bz.dao.impl; import java.util.ArrayList; import java.util.List; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.springframework.stereotype.Repository; import com.visfull.bz.dao.CityDao; import com.visfull.bz.domain.City; @Repository public class CityDaoImpl extends HibernateBaseDaoImpl<City,Integer> implements CityDao { public void save(City object) { // TODO Auto-generated method stub } public City findByPK(Integer pk) { // TODO Auto-generated method stub return null; } public void update(City d) { // TODO Auto-generated method stub } public void saveOrUpdate(City d) { // TODO Auto-generated method stub } public void deleteByPK(Integer pk) { // TODO Auto-generated method stub } public List<City> findCitiesByProvinceId(Integer provinceId) { List<City> result = new ArrayList<City>(); Criteria criteria = getSession().createCriteria(City.class); criteria.add(Restrictions.eq("provinceId", provinceId)); criteria.setProjection(null); result = criteria.list(); return result; } }
1,097
0.751139
0.751139
50
20.940001
21.527109
88
false
false
0
0
0
0
0
0
1.06
false
false
3
dae6281e26c026a5bc0018530cde1a26880afd70
35,115,652,641,463
e07ddcf01ffb459ae7636e2ee746d4b9933876f7
/Solution22.java
f96df44800a741db38271a16a98cfa33688e4e53
[ "Apache-2.0" ]
permissive
harshisubhramanyam/Evenoddpro-java
https://github.com/harshisubhramanyam/Evenoddpro-java
15ca5afc4a80905bece41f2d65e4540ae2955834
2b7c1a9a43439042b486f4194ce567a215495802
refs/heads/main
2023-07-11T11:08:03.427000
2021-08-15T05:53:43
2021-08-15T05:53:43
381,190,914
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
public class Solution { public int reverseBits(int n) { int result = 0; for (int i = 0; i < 32; i ++) { int a = n & 1; int reversea = a << (31 - i); result = result | reversea; n = n >> 1; } return result; } }
UTF-8
Java
293
java
Solution22.java
Java
[]
null
[]
public class Solution { public int reverseBits(int n) { int result = 0; for (int i = 0; i < 32; i ++) { int a = n & 1; int reversea = a << (31 - i); result = result | reversea; n = n >> 1; } return result; } }
293
0.412969
0.385666
12
23.416666
13.35077
43
false
false
0
0
0
0
0
0
0.75
false
false
3
cb2c68973334e8a75e3927881af3a439fdeb09a3
34,943,853,945,292
04157cb8d029274ae61faea4709ad029535c0dcb
/src/com/wolfk/controller/Test.java
7167eb0b9fab740f2552817db0f013182eb69a1f
[]
no_license
fsyxjwxw/wolfK
https://github.com/fsyxjwxw/wolfK
7cb85cb6be79b6d6a4c6b5e71b8e74436d876280
c1d0a3e95a44468d2c02da863cd533b7df7d8ded
refs/heads/master
2020-06-15T07:56:01.695000
2019-07-05T03:27:31
2019-07-05T03:27:31
195,242,591
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.wolfk.controller; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.wolfk.pojo.UserTestPojo; import com.wolfk.service.UserTestService; /** * @author Redfield * * @date 2019Äê7ÔÂ4ÈÕ */ @Controller public class Test { UserTestService userTestService; public Test(UserTestService userTestService) { super(); this.userTestService = userTestService; } //selectAllUserInformation @RequestMapping("showUsersTest") @ResponseBody public List<UserTestPojo> showUsersTest() { return userTestService.selectUsers(); } }
UTF-8
Java
739
java
Test.java
Java
[ { "context": ".wolfk.service.UserTestService;\r\n\r\n/**\r\n * @author Redfield\r\n *\r\n * @date 2019Äê7ÔÂ4ÈÕ\r\n */\r\n@Controller\r\npub", "end": 344, "score": 0.8443267941474915, "start": 336, "tag": "NAME", "value": "Redfield" } ]
null
[]
package com.wolfk.controller; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.wolfk.pojo.UserTestPojo; import com.wolfk.service.UserTestService; /** * @author Redfield * * @date 2019Äê7ÔÂ4ÈÕ */ @Controller public class Test { UserTestService userTestService; public Test(UserTestService userTestService) { super(); this.userTestService = userTestService; } //selectAllUserInformation @RequestMapping("showUsersTest") @ResponseBody public List<UserTestPojo> showUsersTest() { return userTestService.selectUsers(); } }
739
0.757162
0.748977
32
20.90625
19.328346
62
false
false
0
0
0
0
0
0
0.78125
false
false
3
476a9abc3ec98c58a051cf0ca3c257491d95cd5a
19,610,820,711,755
1b1e088f33be325b1eeaf1a47024e1c3e75f3b99
/Factory3/app/src/main/java/mx/edu/utng/factory/Trapecio.java
07c96041b7a45fde43b1c8de1c286a0dbbdc8605
[]
no_license
rgtacho/ProjectsAndroid
https://github.com/rgtacho/ProjectsAndroid
e550760ced96ac4f79cf7b46e23b8ed4ee4e1009
8d1d22efba6d54920417f8b522bbb6f50194f77b
refs/heads/master
2016-09-13T23:21:45.181000
2016-09-07T17:13:34
2016-09-07T17:13:34
56,903,852
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package mx.edu.utng.factory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; /** * Created by qas on 30/08/16. */ public class Trapecio implements Figura{ @Override public void dibujar(Canvas canvas) { Paint paint = new Paint(); paint.setColor(Color.rgb(78, 172, 140)); paint.setStyle(Paint.Style.FILL); Path path = new Path(); float mitadAncho = canvas.getWidth()/2; float mitadAlto = canvas.getHeight()/2; path.moveTo(mitadAncho*0.75f, mitadAlto*0.75f); path.lineTo(mitadAncho*0.5f, mitadAlto*1.5f); path.lineTo(mitadAncho*1.5f, mitadAlto*1.5f); path.lineTo(mitadAncho*1.25f, mitadAlto*0.75f); path.lineTo(mitadAncho*0.75f, mitadAlto*0.75f); path.close(); canvas.drawPath(path, paint); } }
UTF-8
Java
896
java
Trapecio.java
Java
[ { "context": ";\nimport android.graphics.Path;\n\n/**\n * Created by qas on 30/08/16.\n */\npublic class Trapecio implements", "end": 176, "score": 0.9990350008010864, "start": 173, "tag": "USERNAME", "value": "qas" } ]
null
[]
package mx.edu.utng.factory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; /** * Created by qas on 30/08/16. */ public class Trapecio implements Figura{ @Override public void dibujar(Canvas canvas) { Paint paint = new Paint(); paint.setColor(Color.rgb(78, 172, 140)); paint.setStyle(Paint.Style.FILL); Path path = new Path(); float mitadAncho = canvas.getWidth()/2; float mitadAlto = canvas.getHeight()/2; path.moveTo(mitadAncho*0.75f, mitadAlto*0.75f); path.lineTo(mitadAncho*0.5f, mitadAlto*1.5f); path.lineTo(mitadAncho*1.5f, mitadAlto*1.5f); path.lineTo(mitadAncho*1.25f, mitadAlto*0.75f); path.lineTo(mitadAncho*0.75f, mitadAlto*0.75f); path.close(); canvas.drawPath(path, paint); } }
896
0.648438
0.601563
35
24.6
20.255793
55
false
false
0
0
0
0
0
0
0.771429
false
false
3
878ffef855bb377163b431482e2eeb6858ef421d
6,700,149,036,011
5145808fc4d18a03d5067f6dce2f514977ebe7e9
/gemsfx/src/main/java/com/dlsc/gemsfx/treeview/link/StraightLineLink.java
9a1a7cb50d2a33f1520e24145d82670176c9a0cd
[ "Apache-2.0" ]
permissive
dlsc-software-consulting-gmbh/GemsFX
https://github.com/dlsc-software-consulting-gmbh/GemsFX
8e66072ca33fa115407e78be1923a935bf5e235a
031b41020db7ac1fe99234796b5f4f4aad862201
refs/heads/master
2023-08-31T11:00:59.489000
2023-08-25T15:39:11
2023-08-25T15:39:11
207,596,279
359
47
Apache-2.0
false
2023-09-14T13:41:16
2019-09-10T15:30:17
2023-09-12T06:44:54
2023-09-14T13:41:14
27,691
338
44
10
Java
false
false
package com.dlsc.gemsfx.treeview.link; import com.dlsc.gemsfx.treeview.TreeNodeView; import javafx.scene.Node; import javafx.scene.shape.Line; import java.util.ArrayList; import java.util.List; public class StraightLineLink<T> extends AbstractLinkStrategy<T> { @Override protected ArrayList<Node> drawLink(TreeNodeView.LayoutDirection direction, double maxDimensionInLine, double startX, double startY, double endX, double endY, double vgap, double hgap) { Line line = new Line(startX, startY, endX, endY); line.getStyleClass().add("link-line"); Node arrow = createSimpleArrow(); arrow.setRotate(calculateAngle()); return new ArrayList<>(List.of(line, arrow)); } }
UTF-8
Java
724
java
StraightLineLink.java
Java
[]
null
[]
package com.dlsc.gemsfx.treeview.link; import com.dlsc.gemsfx.treeview.TreeNodeView; import javafx.scene.Node; import javafx.scene.shape.Line; import java.util.ArrayList; import java.util.List; public class StraightLineLink<T> extends AbstractLinkStrategy<T> { @Override protected ArrayList<Node> drawLink(TreeNodeView.LayoutDirection direction, double maxDimensionInLine, double startX, double startY, double endX, double endY, double vgap, double hgap) { Line line = new Line(startX, startY, endX, endY); line.getStyleClass().add("link-line"); Node arrow = createSimpleArrow(); arrow.setRotate(calculateAngle()); return new ArrayList<>(List.of(line, arrow)); } }
724
0.727901
0.727901
23
30.47826
39.996597
189
false
false
0
0
0
0
0
0
0.956522
false
false
3
ae28ecd9f6e1b63b02b61d3bee25e9987be0f5f4
35,665,408,452,699
b09a3ce780bae794b50d9bc32a4361e43e2e0e22
/src/main/java/rab/fz/demo/service/converter/StringToEmployeeConverter.java
ffb55c54d69cbc5b3984ef2789ba22a2f185203d
[]
no_license
Filipx21/19_HomeTasker
https://github.com/Filipx21/19_HomeTasker
44fdda44cc00807b3e3940200a3f3d48a27cbb22
f7f79d229596afc30686ad88f419369ea80c8a72
refs/heads/master
2018-12-07T18:55:26.217000
2018-10-07T20:43:21
2018-10-07T20:43:21
148,059,779
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package rab.fz.demo.service.converter; //import org.springframework.core.convert.converter.Converter; //import org.springframework.stereotype.Component; //import rab.fz.demo.person.Person; // //@Component //public class StringToEmployeeConverter implements Converter<String, Person> { // private HomeTaskerRepository homeTaskerRepository; // // public StringToEmployeeConverter(HomeTaskerRepository homeTaskerRepository) { // this.homeTaskerRepository = homeTaskerRepository; // } // // @Override // public Person convert(String from) { // String[] data = from.split(" "); // return homeTaskerRepository.find(data[0], data[1]); // } //}
UTF-8
Java
677
java
StringToEmployeeConverter.java
Java
[]
null
[]
package rab.fz.demo.service.converter; //import org.springframework.core.convert.converter.Converter; //import org.springframework.stereotype.Component; //import rab.fz.demo.person.Person; // //@Component //public class StringToEmployeeConverter implements Converter<String, Person> { // private HomeTaskerRepository homeTaskerRepository; // // public StringToEmployeeConverter(HomeTaskerRepository homeTaskerRepository) { // this.homeTaskerRepository = homeTaskerRepository; // } // // @Override // public Person convert(String from) { // String[] data = from.split(" "); // return homeTaskerRepository.find(data[0], data[1]); // } //}
677
0.722304
0.71935
21
31.285715
27.552794
83
false
false
0
0
0
0
0
0
0.47619
false
false
3
9aadabcdf89787d518cdf5a0b57530dc2f800701
12,309,376,336,547
d0a479e9c43751125a535350923ae04f079535ab
/back/src/main/java/com/restauranteAnalisis/Restaruanteback/Repository/ITipoTransaccionRepository.java
af7edc484fe33a1b7e7ec8f0700b01b9973a9899
[]
no_license
Lizzy-1201/Restaurante_Backend1
https://github.com/Lizzy-1201/Restaurante_Backend1
3b0d76ef8c64e506292facf542ed0d554f314dfe
914d6d91d1bc7edca2de528b016e3971efbfcdba
refs/heads/main
2023-01-01T15:40:21.854000
2020-10-31T19:55:54
2020-10-31T19:55:54
308,796,056
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.restauranteAnalisis.Restaruanteback.Repository; import org.springframework.data.jpa.repository.JpaRepository; import com.restauranteAnalisis.Restaruanteback.Entity.TipoTransaccion; public interface ITipoTransaccionRepository extends JpaRepository<TipoTransaccion, Integer>{ }
UTF-8
Java
291
java
ITipoTransaccionRepository.java
Java
[]
null
[]
package com.restauranteAnalisis.Restaruanteback.Repository; import org.springframework.data.jpa.repository.JpaRepository; import com.restauranteAnalisis.Restaruanteback.Entity.TipoTransaccion; public interface ITipoTransaccionRepository extends JpaRepository<TipoTransaccion, Integer>{ }
291
0.876289
0.876289
8
35.375
36.324707
92
false
false
0
0
0
0
0
0
0.5
false
false
3
21dce9ad34f45c309be9f78ac82a0ead4f8cc8f0
6,734,508,780,539
a4f0e79eb6877243d2764eee119346888e1a95e3
/src/test/java/_012_alg/_001_排序算法/_004_归并排序.java
5abc714a1e0311746a263069459f29e675dd2fbb
[]
no_license
Haimiandiaodiao/spring-boot-test
https://github.com/Haimiandiaodiao/spring-boot-test
8e48d28e29698c949f0aada29160737ec953282c
a311e6e3502679d047a97c003b414bac9987154c
refs/heads/master
2021-05-04T16:10:26.168000
2019-01-10T17:03:44
2019-01-10T17:03:44
120,245,387
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package _012_alg._001_排序算法; import com.google.common.collect.Lists; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; /** * @Author Dyy <br/> * @Description <br/> * @Date 2019/1/10 11:40 PM<br/> */ public class _004_归并排序 { /** *归并排序的核心思想在于合并的算法 使用双指针方法进行移动 */ @Test public void 归并排序(){ int[] iniData = {4, 5, 2, 41, 4, 234, 2, 51, 31, 3, 23, 1,2322,1,23,52,223,52,34,234,1,114123,5,134}; if(iniData == null || iniData.length == 0 ){ System.out.println("不能处理数据为空的数据"); return ; } //这里使用临时变量来存放以已经排序好的 int[] tempData = new int[iniData.length]; mergeSore(iniData,tempData,0,iniData.length-1); System.out.println("排序之后的数据:"+ Arrays.toString(iniData)); } public void mergeSore(int[] initData,int[] tempData, int startIndex,int endIndex){ if(startIndex != endIndex){ //除以2 int mid = (startIndex + endIndex) >> 1; //接着分 //左边 mergeSore(initData,tempData,startIndex,mid); //右边 mergeSore(initData,tempData,mid+1,endIndex); //合并的操纵 megerOp(initData,tempData,startIndex,endIndex,mid); } } public void megerOp(int[] initData,int[] tempData,int startIndex,int endIndex,int midIndex){ //元素存放的起始位置是最左端的位置start //控制合并两端的起始位置 int partionFistIndex = startIndex; int partionSecondIndex = midIndex+1; int setIndex = startIndex; while(true){ if(partionFistIndex == (midIndex+1) && partionSecondIndex == (endIndex+1)){ //当两个都移动到分子分区的尾部时就不再移动指针了 break; } //1.第一部分到头但是第二部分不到头 //2.第二部分到头但是第一部分不到头 //3.第一部分不到头第二部分不到头 //1 if(partionFistIndex == midIndex+1 && partionSecondIndex != endIndex+1){ tempData[setIndex] = initData[partionSecondIndex]; setIndex++; partionSecondIndex++; } //2 if(partionFistIndex != midIndex+1 && partionSecondIndex == endIndex+1){ tempData[setIndex] = initData[partionFistIndex]; setIndex++; partionFistIndex++; } //3 if (partionFistIndex != midIndex+1 && partionSecondIndex != endIndex+1){ if(initData[partionFistIndex] <= initData[partionSecondIndex]){ tempData[setIndex] = initData[partionFistIndex]; setIndex++; partionFistIndex++; }else{ tempData[setIndex] = initData[partionSecondIndex]; setIndex++; partionSecondIndex++; } } } //将排序后的数组复制回去 System.arraycopy(tempData,startIndex,initData,startIndex,endIndex-startIndex+1); cleanArrays(tempData); } public void cleanArrays(int[] arrays){ for (int i = 0; i < arrays.length; i++) { arrays[i] = 0; } } }
UTF-8
Java
3,514
java
_004_归并排序.java
Java
[ { "context": "rrayList;\nimport java.util.Arrays;\n\n/**\n * @Author Dyy <br/>\n * @Description <br/>\n * @Date 2019/1/10 11", "end": 165, "score": 0.9985978007316589, "start": 162, "tag": "USERNAME", "value": "Dyy" } ]
null
[]
package _012_alg._001_排序算法; import com.google.common.collect.Lists; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; /** * @Author Dyy <br/> * @Description <br/> * @Date 2019/1/10 11:40 PM<br/> */ public class _004_归并排序 { /** *归并排序的核心思想在于合并的算法 使用双指针方法进行移动 */ @Test public void 归并排序(){ int[] iniData = {4, 5, 2, 41, 4, 234, 2, 51, 31, 3, 23, 1,2322,1,23,52,223,52,34,234,1,114123,5,134}; if(iniData == null || iniData.length == 0 ){ System.out.println("不能处理数据为空的数据"); return ; } //这里使用临时变量来存放以已经排序好的 int[] tempData = new int[iniData.length]; mergeSore(iniData,tempData,0,iniData.length-1); System.out.println("排序之后的数据:"+ Arrays.toString(iniData)); } public void mergeSore(int[] initData,int[] tempData, int startIndex,int endIndex){ if(startIndex != endIndex){ //除以2 int mid = (startIndex + endIndex) >> 1; //接着分 //左边 mergeSore(initData,tempData,startIndex,mid); //右边 mergeSore(initData,tempData,mid+1,endIndex); //合并的操纵 megerOp(initData,tempData,startIndex,endIndex,mid); } } public void megerOp(int[] initData,int[] tempData,int startIndex,int endIndex,int midIndex){ //元素存放的起始位置是最左端的位置start //控制合并两端的起始位置 int partionFistIndex = startIndex; int partionSecondIndex = midIndex+1; int setIndex = startIndex; while(true){ if(partionFistIndex == (midIndex+1) && partionSecondIndex == (endIndex+1)){ //当两个都移动到分子分区的尾部时就不再移动指针了 break; } //1.第一部分到头但是第二部分不到头 //2.第二部分到头但是第一部分不到头 //3.第一部分不到头第二部分不到头 //1 if(partionFistIndex == midIndex+1 && partionSecondIndex != endIndex+1){ tempData[setIndex] = initData[partionSecondIndex]; setIndex++; partionSecondIndex++; } //2 if(partionFistIndex != midIndex+1 && partionSecondIndex == endIndex+1){ tempData[setIndex] = initData[partionFistIndex]; setIndex++; partionFistIndex++; } //3 if (partionFistIndex != midIndex+1 && partionSecondIndex != endIndex+1){ if(initData[partionFistIndex] <= initData[partionSecondIndex]){ tempData[setIndex] = initData[partionFistIndex]; setIndex++; partionFistIndex++; }else{ tempData[setIndex] = initData[partionSecondIndex]; setIndex++; partionSecondIndex++; } } } //将排序后的数组复制回去 System.arraycopy(tempData,startIndex,initData,startIndex,endIndex-startIndex+1); cleanArrays(tempData); } public void cleanArrays(int[] arrays){ for (int i = 0; i < arrays.length; i++) { arrays[i] = 0; } } }
3,514
0.538068
0.508637
103
29.349514
25.932589
109
false
false
0
0
0
0
0
0
0.825243
false
false
3
60073762493b836912c9c81ef83e1a03b73203f3
8,993,661,556,647
7bb1bcfca3948ed0009e4700ea394a6b6f7804b7
/src/main/java/co/mega/vs/entity/LogFileInfo.java
767836e721e6f43a1eca45d596549522817e4da1
[]
no_license
partitionlcj/vision-server
https://github.com/partitionlcj/vision-server
066079fd936dccc5119ba08f6c9766338ee937fc
7eedbc438db6f4647a8c927f2f2744594cb08a0a
refs/heads/master
2023-05-13T17:41:29.658000
2021-03-16T07:06:41
2021-03-16T07:06:41
374,328,324
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package co.mega.vs.entity; public class LogFileInfo { private byte[] file; private boolean isImage; private String vehicleId; private String requestId; public LogFileInfo(byte[] file, boolean isImage, String vehicleId, String requestId) { this.file = file; this.isImage = isImage; this.vehicleId = vehicleId; this.requestId = requestId; } public byte[] getFile() { return file; } public void setFile(byte[] file) { this.file = file; } public boolean isImage() { return isImage; } public void setImage(boolean image) { isImage = image; } public String getVehicleId() { return vehicleId; } public void setVehicleId(String vehicleId) { this.vehicleId = vehicleId; } public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } }
UTF-8
Java
989
java
LogFileInfo.java
Java
[]
null
[]
package co.mega.vs.entity; public class LogFileInfo { private byte[] file; private boolean isImage; private String vehicleId; private String requestId; public LogFileInfo(byte[] file, boolean isImage, String vehicleId, String requestId) { this.file = file; this.isImage = isImage; this.vehicleId = vehicleId; this.requestId = requestId; } public byte[] getFile() { return file; } public void setFile(byte[] file) { this.file = file; } public boolean isImage() { return isImage; } public void setImage(boolean image) { isImage = image; } public String getVehicleId() { return vehicleId; } public void setVehicleId(String vehicleId) { this.vehicleId = vehicleId; } public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } }
989
0.607685
0.607685
51
18.392157
18.321827
90
false
false
0
0
0
0
0
0
0.392157
false
false
3
994f1aaf1828b076dd80c10e69359db723c6d416
21,062,519,665,421
531ef8007babf2dd0ae317a3bc99777ac575f872
/app/src/main/java/com/stevenkcolin/xiaobaiju/util/GeoUtil.java
0e517b489ad4a5a57c0fd917397450f2870a05d4
[]
no_license
stevenkcolin/xiaobaiju2
https://github.com/stevenkcolin/xiaobaiju2
334624590986832a30dae30e6471b5770b553979
c95cad8b8abb9c5e4bc72e280d15066b79d9186b
refs/heads/master
2021-01-10T03:29:07.129000
2016-03-18T08:01:31
2016-03-18T08:01:31
47,020,541
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.stevenkcolin.xiaobaiju.util; import android.content.Context; import android.location.Address; import android.location.Criteria; import android.location.Geocoder; import android.location.Location; import android.location.LocationManager; import android.util.Log; import java.io.IOException; import java.util.List; /** * Created by Pengfei on 2015/12/28. */ public class GeoUtil { private static Geocoder geocoder; /** * 获取所在城市 * @param context * @return String - city name * @throws IOException */ public static String getCity(Context context) throws IOException { String cityName = ""; Double[] coordinate = getCoordinate(context); double lat = 0; double lng = 0; List<Address> addList = null; if (coordinate != null) { lat = coordinate[0]; lng = coordinate[1]; } try { addList = geocoder.getFromLocation(lat, lng, 1); //解析经纬度 } catch (IOException e) { Log.e("GeoUtil.class", e.getMessage(), e); throw e; } if (addList != null && addList.size() > 0) { for (int i = 0; i < addList.size(); i++) { Address add = addList.get(i); cityName += add.getLocality(); } } if(cityName.length() != 0){ return cityName.substring(0, (cityName.length() - 1)); } else { return cityName; } } /** * 获取经纬度 * @return array of string. {latitude, longitude} */ public static Double[] getCoordinate(Context context){ Location location = getLocationObj(context); if (location == null) { Log.e("GeoUtil.class", "Cannot get location"); return null; } return new Double[]{location.getLatitude(), location.getLongitude()}; } private static Location getLocationObj(Context context) throws SecurityException{ try { geocoder = new Geocoder(context); //用于获取Location对象,以及其他 LocationManager locationManager; String serviceName = Context.LOCATION_SERVICE; //实例化一个LocationManager对象 locationManager = (LocationManager) context.getSystemService(serviceName); //provider的类型 String provider = LocationManager.NETWORK_PROVIDER; Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); //高精度 criteria.setAltitudeRequired(false); //不要求海拔 criteria.setBearingRequired(false); //不要求方位 criteria.setCostAllowed(false); //不允许有话费 criteria.setPowerRequirement(Criteria.POWER_LOW); //低功耗 //通过最后一次的地理位置来获得Location对象 Location location = locationManager.getLastKnownLocation(provider); return location; } catch (SecurityException e) { Log.e("GeoUtil.class", e.getMessage(), e); throw e; } } }
UTF-8
Java
3,190
java
GeoUtil.java
Java
[ { "context": "package com.stevenkcolin.xiaobaiju.util;\n\nimport android.content.Context;\n", "end": 24, "score": 0.995937168598175, "start": 12, "tag": "USERNAME", "value": "stevenkcolin" }, { "context": "ception;\nimport java.util.List;\n\n/**\n * Created by Pengfei on 2015/12/28.\n */\npublic class GeoUtil {\n\n pr", "end": 353, "score": 0.811281144618988, "start": 346, "tag": "USERNAME", "value": "Pengfei" } ]
null
[]
package com.stevenkcolin.xiaobaiju.util; import android.content.Context; import android.location.Address; import android.location.Criteria; import android.location.Geocoder; import android.location.Location; import android.location.LocationManager; import android.util.Log; import java.io.IOException; import java.util.List; /** * Created by Pengfei on 2015/12/28. */ public class GeoUtil { private static Geocoder geocoder; /** * 获取所在城市 * @param context * @return String - city name * @throws IOException */ public static String getCity(Context context) throws IOException { String cityName = ""; Double[] coordinate = getCoordinate(context); double lat = 0; double lng = 0; List<Address> addList = null; if (coordinate != null) { lat = coordinate[0]; lng = coordinate[1]; } try { addList = geocoder.getFromLocation(lat, lng, 1); //解析经纬度 } catch (IOException e) { Log.e("GeoUtil.class", e.getMessage(), e); throw e; } if (addList != null && addList.size() > 0) { for (int i = 0; i < addList.size(); i++) { Address add = addList.get(i); cityName += add.getLocality(); } } if(cityName.length() != 0){ return cityName.substring(0, (cityName.length() - 1)); } else { return cityName; } } /** * 获取经纬度 * @return array of string. {latitude, longitude} */ public static Double[] getCoordinate(Context context){ Location location = getLocationObj(context); if (location == null) { Log.e("GeoUtil.class", "Cannot get location"); return null; } return new Double[]{location.getLatitude(), location.getLongitude()}; } private static Location getLocationObj(Context context) throws SecurityException{ try { geocoder = new Geocoder(context); //用于获取Location对象,以及其他 LocationManager locationManager; String serviceName = Context.LOCATION_SERVICE; //实例化一个LocationManager对象 locationManager = (LocationManager) context.getSystemService(serviceName); //provider的类型 String provider = LocationManager.NETWORK_PROVIDER; Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); //高精度 criteria.setAltitudeRequired(false); //不要求海拔 criteria.setBearingRequired(false); //不要求方位 criteria.setCostAllowed(false); //不允许有话费 criteria.setPowerRequirement(Criteria.POWER_LOW); //低功耗 //通过最后一次的地理位置来获得Location对象 Location location = locationManager.getLastKnownLocation(provider); return location; } catch (SecurityException e) { Log.e("GeoUtil.class", e.getMessage(), e); throw e; } } }
3,190
0.589145
0.583224
97
30.340206
22.74597
86
false
false
0
0
0
0
0
0
0.57732
false
false
3
3a450822beaaf99f9ef93d2f7dd103c0fee11a37
36,799,279,809,167
436e65e10ef0f094852d679448fbfdc990c5b9d2
/src/main/java/com/example/JavaTutorial/data/UniversityRepository.java
5e2c5e3f7cb0dd2f76fd39873332beef863a00a2
[]
no_license
ches993/JavaTutorial
https://github.com/ches993/JavaTutorial
78a919263e2a8e3626d9f1f72aed715d11afebf8
12914287e8b9b2a13cf451a690a348426d4ef8d6
refs/heads/master
2021-06-28T11:18:34.699000
2020-01-18T12:57:45
2020-01-18T12:57:45
233,443,201
1
0
null
false
2021-06-04T02:25:10
2020-01-12T19:03:36
2020-01-18T12:58:35
2021-06-04T02:25:09
63
0
0
1
Java
false
false
package com.example.JavaTutorial.data; import com.example.JavaTutorial.model.Student; import com.example.JavaTutorial.model.University; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @Repository public interface UniversityRepository extends JpaRepository<University, Long> { University findUniversityByUniversityName(@Param(value = "universityName")String universityName); }
UTF-8
Java
506
java
UniversityRepository.java
Java
[]
null
[]
package com.example.JavaTutorial.data; import com.example.JavaTutorial.model.Student; import com.example.JavaTutorial.model.University; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @Repository public interface UniversityRepository extends JpaRepository<University, Long> { University findUniversityByUniversityName(@Param(value = "universityName")String universityName); }
506
0.839921
0.839921
16
30.625
32.273975
101
false
false
0
0
0
0
0
0
0.5
false
false
3
3ee2d2eed60113fd99a423112ced8dfee5f3ffed
36,051,955,503,231
3ef2ed250a14ac0033237941c7c257fde806fd0f
/Capstone Dec 14/Thendral Suganya/Book.java
f98692b1c516b9e9df1e2a3e81208bebb4cb6e5a
[]
no_license
CohortTwo/Java_SE_I_Capstone
https://github.com/CohortTwo/Java_SE_I_Capstone
e16373724f02d6008053602a985906740e376365
eddac725e7e577635fe696f0c71dcc70c58a02ae
refs/heads/main
2023-05-31T01:42:02.789000
2021-06-15T06:06:38
2021-06-15T06:06:38
321,079,920
1
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 Books; /** * * @author tthen */ public class Book { private int bno; private String stitle; private int custid; private String sauthor; public Book(){ } public Book(int bno,String stitle,int custid,String sauthor){ this.bno = bno; this.stitle = stitle; this.custid=custid; this.sauthor=sauthor; } public int getbno() { return bno; } public void setbno(int bno) { this.bno = bno; } public int getcustid() { return custid; } public void setcustid(int custid) { this.custid = custid; } public String getstitle() { return stitle; } public void setstitle(String stitle) { this.stitle = stitle; } public String getsauthor() { return sauthor; } public void setsauthor(int bno) { this.sauthor = sauthor; } }
UTF-8
Java
1,178
java
Book.java
Java
[ { "context": "ditor.\r\n */\r\npackage Books;\r\n\r\n/**\r\n *\r\n * @author tthen\r\n */\r\npublic class Book {\r\n private int bno;\r\n", "end": 233, "score": 0.9996755123138428, "start": 228, "tag": "USERNAME", "value": "tthen" } ]
null
[]
/* * 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 Books; /** * * @author tthen */ public class Book { private int bno; private String stitle; private int custid; private String sauthor; public Book(){ } public Book(int bno,String stitle,int custid,String sauthor){ this.bno = bno; this.stitle = stitle; this.custid=custid; this.sauthor=sauthor; } public int getbno() { return bno; } public void setbno(int bno) { this.bno = bno; } public int getcustid() { return custid; } public void setcustid(int custid) { this.custid = custid; } public String getstitle() { return stitle; } public void setstitle(String stitle) { this.stitle = stitle; } public String getsauthor() { return sauthor; } public void setsauthor(int bno) { this.sauthor = sauthor; } }
1,178
0.55348
0.55348
66
15.878788
16.476351
79
false
false
0
0
0
0
0
0
0.348485
false
false
3
ebe4d595870ef5d75a8988c2d3d46a19ba833052
687,194,831,963
4fa1008a296029878a590bad9c539d7783de8d43
/trabalhoOO/src/game/teste/TestarPlayer.java
771bafcf7a5d12e79c5768345f2b9a3f5f8676a5
[]
no_license
TrabalhoDeOO/Grupo09
https://github.com/TrabalhoDeOO/Grupo09
e56fd66393b0a610246ffe13aa8a348b2b608726
b7e771fc40a2bd30aaf398db9cc89c31683eae21
refs/heads/master
2021-01-10T19:37:38.857000
2014-01-23T00:44:59
2014-01-23T00:44:59
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package game.teste; import static org.junit.Assert.*; import java.util.ArrayList; //import game.entidade.Arma; import game.entidade.Item; import game.entidade.Player; import game.entidade.grimorio.Grimorio; import game.entidade.grimorio.GrimorioItens; import game.framework.ObjectId; import org.junit.After; import org.junit.Before; import org.junit.Test; public class TestarPlayer { @Before public void setUp() throws Exception { System.out.println("Testando...\n"); } @After public void tearDown() throws Exception { System.out.println("Finalizado...\n"); } @Test public void testGetAtk() { String hm = "homem"; String ml = "mulher", in = "Alien"; String nome = "Bob"; int lvl = 1; Player player= new Player("Jõao", hm, 1, 60 ,60, null, ObjectId.Player); player.setAtk(3); player.setDef(3); player.setLvl(lvl); player.setHp(5); player.setHp(8); player.setJump(10); player.setSexo(hm); player.setNome(nome); player.setSpeed(10); player.setXp(25); player= new Player("Jõao", hm, 1, 60 ,60, null, ObjectId.Player); player.validaPlayer(hm); player.validaPlayer(ml); player.validaPlayer(in); System.out.println(player.getStatus()); player.addXp(250); GrimorioItens grimorio = new GrimorioItens(); Item vest = grimorio.getGrimorioItens().get(44); Item arma = grimorio.getGrimorioItens().get(26); Item cons = grimorio.getGrimorioItens().get(14); ArrayList<Item> item = new ArrayList<Item>(); player.adicionaItem(vest); player.adicionaItem(arma); for(int i=0;i<6;i++){ player.adicionaItem(cons); item.add(cons); } player.setMochila(item); item.remove(0); player.setMochila(item); item = player.getMochila(); player.listarMochila(); int hp = player.hp; player.setHp(hp-7); for(int i=0;i<3;i++) player.verificarItem(cons); player.addDinheiro(998); player.addDinheiro(3); player.addDinheiro(1); player.removeDinheiro(998); player.removeDinheiro(2); System.out.println(player.getStatus() + " \n"+ player.getArma()); player.setLvl(10); System.out.printf("%s %s\nLvl: %d Atk: %d\nDef: %d Hp: %d/%d\nJump: %d Speed: %d\n" + "Concha: %d\nRoupa: %s\nArma: %s Xp: %d/%d", player.getNome(), player.getSexo(), player.getLvl(), player.getAtk(), player.getDef(), player.getHp(), player.getHpMax(), player.getJump(), player.getSpeed(), player.getConcha(), player.getRoupa(), player.getArma(), player.getXp(), player.getXpMax() ); assertEquals(player.getDef(), 24); } @Test public void testGetConcha() { boolean ver=false; Player bob = new Player(ObjectId.Player); bob = new Player("Bob","homem",15, 60 ,60, null, ObjectId.Player); bob.setConcha(100); System.out.println(bob.getStatus()); System.out.println("Conchas Bob "+bob.getConcha()); Grimorio gri = new Grimorio(); int concha = gri.getGrimorioInimigos().get(5).getLoot().getConchas(); gri.getGrimorioInimigos().get(5).getLoot().listarLoot(); System.out.println("Conchas: "+concha); bob.addDinheiro(concha); concha = gri.getGrimorioInimigos().get(5).getLoot().getItem().getValor(); System.out.println("Você vai comprar 1:\n"+gri.getGrimorioInimigos().get(5).getLoot().getItem()); //bob.setConcha(1); bob.removeDinheiro(concha); System.out.println("Conchas Bob "+bob.getConcha()); if(bob.getConcha()!=0){ ver=true; } assertTrue(ver); } }
WINDOWS-1252
Java
3,424
java
TestarPlayer.java
Java
[ { "context": "ing ml = \"mulher\", in = \"Alien\";\n\t\tString nome = \"Bob\";\n\t\tint lvl = 1;\n\t\tPlayer player= new Player(\"Jõa", "end": 693, "score": 0.9997522234916687, "start": 690, "tag": "NAME", "value": "Bob" }, { "context": "Bob\";\n\t\tint lvl = 1;\n\t\tPlayer player= new Player(\"Jõao\", hm, 1, 60 ,60, null, ObjectId.Player);\n\t\t\n\t\tpla", "end": 744, "score": 0.99980229139328, "start": 740, "tag": "NAME", "value": "Jõao" }, { "context": "tJump(10);\t\t\n\t\tplayer.setSexo(hm); player.setNome(nome); player.setSpeed(10);\n\t\tplayer.setXp(25);\n\t\t\n\t\tp", "end": 946, "score": 0.9671134352684021, "start": 942, "tag": "NAME", "value": "nome" }, { "context": "10);\n\t\tplayer.setXp(25);\n\t\t\n\t\tplayer= new Player(\"Jõao\", hm, 1, 60 ,60, null, ObjectId.Player);\n\t\t\n\t\tpla", "end": 1019, "score": 0.9998254776000977, "start": 1015, "tag": "NAME", "value": "Jõao" }, { "context": " new Player(ObjectId.Player);\n\t\tbob = new Player(\"Bob\",\"homem\",15, 60 ,60, null, ObjectId.Player);\n\t\tbo", "end": 2661, "score": 0.7992238998413086, "start": 2658, "tag": "NAME", "value": "Bob" }, { "context": "layer(ObjectId.Player);\n\t\tbob = new Player(\"Bob\",\"homem\",15, 60 ,60, null, ObjectId.Player);\n\t\tbob.setCon", "end": 2669, "score": 0.9693506360054016, "start": 2664, "tag": "USERNAME", "value": "homem" } ]
null
[]
package game.teste; import static org.junit.Assert.*; import java.util.ArrayList; //import game.entidade.Arma; import game.entidade.Item; import game.entidade.Player; import game.entidade.grimorio.Grimorio; import game.entidade.grimorio.GrimorioItens; import game.framework.ObjectId; import org.junit.After; import org.junit.Before; import org.junit.Test; public class TestarPlayer { @Before public void setUp() throws Exception { System.out.println("Testando...\n"); } @After public void tearDown() throws Exception { System.out.println("Finalizado...\n"); } @Test public void testGetAtk() { String hm = "homem"; String ml = "mulher", in = "Alien"; String nome = "Bob"; int lvl = 1; Player player= new Player("Jõao", hm, 1, 60 ,60, null, ObjectId.Player); player.setAtk(3); player.setDef(3); player.setLvl(lvl); player.setHp(5); player.setHp(8); player.setJump(10); player.setSexo(hm); player.setNome(nome); player.setSpeed(10); player.setXp(25); player= new Player("Jõao", hm, 1, 60 ,60, null, ObjectId.Player); player.validaPlayer(hm); player.validaPlayer(ml); player.validaPlayer(in); System.out.println(player.getStatus()); player.addXp(250); GrimorioItens grimorio = new GrimorioItens(); Item vest = grimorio.getGrimorioItens().get(44); Item arma = grimorio.getGrimorioItens().get(26); Item cons = grimorio.getGrimorioItens().get(14); ArrayList<Item> item = new ArrayList<Item>(); player.adicionaItem(vest); player.adicionaItem(arma); for(int i=0;i<6;i++){ player.adicionaItem(cons); item.add(cons); } player.setMochila(item); item.remove(0); player.setMochila(item); item = player.getMochila(); player.listarMochila(); int hp = player.hp; player.setHp(hp-7); for(int i=0;i<3;i++) player.verificarItem(cons); player.addDinheiro(998); player.addDinheiro(3); player.addDinheiro(1); player.removeDinheiro(998); player.removeDinheiro(2); System.out.println(player.getStatus() + " \n"+ player.getArma()); player.setLvl(10); System.out.printf("%s %s\nLvl: %d Atk: %d\nDef: %d Hp: %d/%d\nJump: %d Speed: %d\n" + "Concha: %d\nRoupa: %s\nArma: %s Xp: %d/%d", player.getNome(), player.getSexo(), player.getLvl(), player.getAtk(), player.getDef(), player.getHp(), player.getHpMax(), player.getJump(), player.getSpeed(), player.getConcha(), player.getRoupa(), player.getArma(), player.getXp(), player.getXpMax() ); assertEquals(player.getDef(), 24); } @Test public void testGetConcha() { boolean ver=false; Player bob = new Player(ObjectId.Player); bob = new Player("Bob","homem",15, 60 ,60, null, ObjectId.Player); bob.setConcha(100); System.out.println(bob.getStatus()); System.out.println("Conchas Bob "+bob.getConcha()); Grimorio gri = new Grimorio(); int concha = gri.getGrimorioInimigos().get(5).getLoot().getConchas(); gri.getGrimorioInimigos().get(5).getLoot().listarLoot(); System.out.println("Conchas: "+concha); bob.addDinheiro(concha); concha = gri.getGrimorioInimigos().get(5).getLoot().getItem().getValor(); System.out.println("Você vai comprar 1:\n"+gri.getGrimorioInimigos().get(5).getLoot().getItem()); //bob.setConcha(1); bob.removeDinheiro(concha); System.out.println("Conchas Bob "+bob.getConcha()); if(bob.getConcha()!=0){ ver=true; } assertTrue(ver); } }
3,424
0.676703
0.657702
129
25.519381
23.137306
99
false
false
0
0
0
0
0
0
2.573643
false
false
3
b003eab7576f555ef1078ec6e316965c2cb96b0a
36,713,380,470,837
b62a63aad042ef4b05308be67e669f79dfabf828
/src/Reconstructor.java
f8c07f991f7f9b820f5a41b7f49d319963b1fc7e
[]
no_license
harouts/DNA_Reconstructor
https://github.com/harouts/DNA_Reconstructor
bbd70ad9df49b8538bb8450a143ae4850cf5b33f
f9b7191ef7c1c48bea7481f132ee608d99bb45da
refs/heads/master
2021-01-02T09:18:25.270000
2017-08-03T03:37:10
2017-08-03T03:37:10
99,187,972
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.awt.Dimension; import java.util.Scanner; import java.util.Stack; import org.jgrapht.graph.DefaultEdge; import org.jgrapht.graph.DirectedPseudograph; public class Reconstructor { public static void main(String[] args) throws InterruptedException { Scanner sc = new Scanner(System.in); String sequence = sc.next(); int k = 3; Stack<String> edgeStack = fragment(sequence, k); DirectedPseudograph<String, DefaultEdge> graph = new DirectedPseudograph<String, DefaultEdge>(DefaultEdge.class); //Populate graph while (!edgeStack.isEmpty()) { String temp = edgeStack.pop(); String v1 = temp.substring(0, k - 1); String v2 = temp.substring(1, k); graph.addVertex(v1); graph.addVertex(v2); graph.addEdge(v1, v2); } System.out.println("Vertices: " + graph.vertexSet()); System.out.println("Edges: " + graph.edgeSet()); System.out.println("Path: " + findEulerPath(graph)); } public static Stack<String> fragment(String s, int k){ Stack<String> stack = new Stack<String>(); for (int i = 0; i <= s.length() - k; i++) { stack.push(s.substring(i, i+k)); } return stack; } private static String findEulerPath(DirectedPseudograph<String, DefaultEdge> graph) { Stack<String> stack = new Stack<String>(); Stack<String> pathStack = new Stack<String>(); String currentVertex = ""; String temp = ""; StringBuilder finalPath = new StringBuilder(); for (String s: graph.vertexSet()) { if (graph.outDegreeOf(s) - graph.inDegreeOf(s) == 1) { currentVertex = s; } } //System.out.println("Outside of while loop, Current vertex: " + currentVertex); while (!stack.isEmpty() || graph.outDegreeOf(currentVertex) != 0) { if (graph.outDegreeOf(currentVertex) != 0) { //sets temp to one of currentVertex's neighbors //System.out.println("edges of current vertex : " + graph.edgesOf(currentVertex)); temp = graph.getEdgeTarget(graph.outgoingEdgesOf(currentVertex).iterator().next()); //System.out.println("in while loop temp vertex: " + temp); stack.push(currentVertex); //System.out.println("in while loop Current vertex: " + currentVertex); graph.removeEdge(currentVertex, temp); currentVertex = temp; //System.out.println("in while loop current should be temp Current vertex: " + currentVertex); } else { pathStack.push(currentVertex); //System.out.println(currentVertex); currentVertex = stack.pop(); } } pathStack.push(currentVertex); finalPath.append(pathStack.pop()); while (!pathStack.isEmpty()) { finalPath.append(pathStack.pop().charAt(1)); } return finalPath.toString(); } }
UTF-8
Java
2,644
java
Reconstructor.java
Java
[]
null
[]
import java.awt.Dimension; import java.util.Scanner; import java.util.Stack; import org.jgrapht.graph.DefaultEdge; import org.jgrapht.graph.DirectedPseudograph; public class Reconstructor { public static void main(String[] args) throws InterruptedException { Scanner sc = new Scanner(System.in); String sequence = sc.next(); int k = 3; Stack<String> edgeStack = fragment(sequence, k); DirectedPseudograph<String, DefaultEdge> graph = new DirectedPseudograph<String, DefaultEdge>(DefaultEdge.class); //Populate graph while (!edgeStack.isEmpty()) { String temp = edgeStack.pop(); String v1 = temp.substring(0, k - 1); String v2 = temp.substring(1, k); graph.addVertex(v1); graph.addVertex(v2); graph.addEdge(v1, v2); } System.out.println("Vertices: " + graph.vertexSet()); System.out.println("Edges: " + graph.edgeSet()); System.out.println("Path: " + findEulerPath(graph)); } public static Stack<String> fragment(String s, int k){ Stack<String> stack = new Stack<String>(); for (int i = 0; i <= s.length() - k; i++) { stack.push(s.substring(i, i+k)); } return stack; } private static String findEulerPath(DirectedPseudograph<String, DefaultEdge> graph) { Stack<String> stack = new Stack<String>(); Stack<String> pathStack = new Stack<String>(); String currentVertex = ""; String temp = ""; StringBuilder finalPath = new StringBuilder(); for (String s: graph.vertexSet()) { if (graph.outDegreeOf(s) - graph.inDegreeOf(s) == 1) { currentVertex = s; } } //System.out.println("Outside of while loop, Current vertex: " + currentVertex); while (!stack.isEmpty() || graph.outDegreeOf(currentVertex) != 0) { if (graph.outDegreeOf(currentVertex) != 0) { //sets temp to one of currentVertex's neighbors //System.out.println("edges of current vertex : " + graph.edgesOf(currentVertex)); temp = graph.getEdgeTarget(graph.outgoingEdgesOf(currentVertex).iterator().next()); //System.out.println("in while loop temp vertex: " + temp); stack.push(currentVertex); //System.out.println("in while loop Current vertex: " + currentVertex); graph.removeEdge(currentVertex, temp); currentVertex = temp; //System.out.println("in while loop current should be temp Current vertex: " + currentVertex); } else { pathStack.push(currentVertex); //System.out.println(currentVertex); currentVertex = stack.pop(); } } pathStack.push(currentVertex); finalPath.append(pathStack.pop()); while (!pathStack.isEmpty()) { finalPath.append(pathStack.pop().charAt(1)); } return finalPath.toString(); } }
2,644
0.685703
0.68003
85
30.105883
26.619331
115
false
false
0
0
0
0
0
0
2.658823
false
false
3
62253f3d6fe529ffb8d37e5081a82dcefa20e5cb
33,792,802,728,081
512428d204b09a898c2b1b85fbff9a0689b11546
/src/main/java/com/sirene/Dao/TelefonoDao.java
c553f60dbb2afb731e41b0b6fa6463c53e3306fb
[]
no_license
jinmi16/SIRENE
https://github.com/jinmi16/SIRENE
b8aee285d08adea0ba7dfe5eaa6ef981907637d3
e6a6f1f6817bc3341682ec46c77f30c010c5912e
refs/heads/master
2021-01-10T23:04:11.147000
2016-10-09T20:17:04
2016-10-09T20:17:04
70,427,785
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 com.sirene.Dao; import com.sirene.Bean.Telefono; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import javax.swing.DefaultListModel; /** * * @author Jinmi */ public interface TelefonoDao { ArrayList<Telefono> listaTelefono(DefaultListModel modLista); void registrarTel(Telefono t, int idcli); void registrarTel2(Telefono t, int idcli, Connection cn) throws SQLException ; void registrarListTelefonos(ArrayList<Telefono> lst, int idcli); void registrarListTelefonos2(ArrayList<Telefono> lst, int idcli, Connection cn) throws SQLException; ArrayList<Telefono> listarTelfCliente(int idcli); void modificarTelf(int id,String t,String newT); void eliminarTelf(int id,String t); }
UTF-8
Java
958
java
TelefonoDao.java
Java
[ { "context": "t javax.swing.DefaultListModel;\n\n/**\n *\n * @author Jinmi\n */\npublic interface TelefonoDao {\n \n Arra", "end": 390, "score": 0.9975690245628357, "start": 385, "tag": "USERNAME", "value": "Jinmi" } ]
null
[]
/* * 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 com.sirene.Dao; import com.sirene.Bean.Telefono; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import javax.swing.DefaultListModel; /** * * @author Jinmi */ public interface TelefonoDao { ArrayList<Telefono> listaTelefono(DefaultListModel modLista); void registrarTel(Telefono t, int idcli); void registrarTel2(Telefono t, int idcli, Connection cn) throws SQLException ; void registrarListTelefonos(ArrayList<Telefono> lst, int idcli); void registrarListTelefonos2(ArrayList<Telefono> lst, int idcli, Connection cn) throws SQLException; ArrayList<Telefono> listarTelfCliente(int idcli); void modificarTelf(int id,String t,String newT); void eliminarTelf(int id,String t); }
958
0.753653
0.751566
29
32.034481
28.560261
105
false
false
0
0
0
0
0
0
0.896552
false
false
3
7868225ddc5d60efd9832f1fb0e739c6f309e709
7,129,645,779,143
4a28b78d4273f852f39247d13e70822ef0bde1d8
/src/main/java/com/cuarentena/web/controller/LoginController.java
c4683afdcca5ac57fa09d7e28c0e17651db6a4ef
[]
no_license
RubenSuarez/cuarentena
https://github.com/RubenSuarez/cuarentena
486fc2dd70c98c7485e01dc4f9e8005588eb22ca
10645258e6f86f1e353e65823bb71ddb789e4f5d
refs/heads/master
2022-12-08T21:59:55.786000
2020-08-30T21:09:14
2020-08-30T21:09:14
261,335,393
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cuarentena.web.controller; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.cuarentena.web.form.UserForm; import com.cuarentena.web.model.User; import com.cuarentena.web.services.UserService; @Controller @RequestMapping(value="/login") public class LoginController { @Autowired private UserService userService; @RequestMapping(value= "", method = RequestMethod.GET) public String login(Model model, @ModelAttribute User user) { return "login"; } // @RequestMapping(value= {"login", "login/"}, method = RequestMethod.POST) // public String login2(Model model, @Valid @ModelAttribute("user") UserForm user, BindingResult result) { // String estado = userService.validarPass(user); // String[] estados = {"acceso permitido","password invalido","email invalido"}; // if(estado == estados[0]) { // return "welcome"; // } // else if(estado == estados[1]) { // model.addAttribute("texto","contraseña incorrecta"); // return "login"; // } // else { // model.addAttribute("texto","el email ingresado no se encuentra registrado"); // return "login"; // } // if(result.hasErrors()) { // return "login"; // } else { // return "welcome"; // } // } @RequestMapping(value= "/register", method = RequestMethod.GET) public String signUp(Model model) { model.addAttribute("user", new UserForm()); return "sign-up"; } @RequestMapping(value= "/register", method = RequestMethod.POST) public String addUser(@Valid @ModelAttribute("user") UserForm user, BindingResult result, Model model) { if(result.hasErrors()) { return "sign-up"; } userService.create(user); return "welcome"; } }
UTF-8
Java
2,030
java
LoginController.java
Java
[]
null
[]
package com.cuarentena.web.controller; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.cuarentena.web.form.UserForm; import com.cuarentena.web.model.User; import com.cuarentena.web.services.UserService; @Controller @RequestMapping(value="/login") public class LoginController { @Autowired private UserService userService; @RequestMapping(value= "", method = RequestMethod.GET) public String login(Model model, @ModelAttribute User user) { return "login"; } // @RequestMapping(value= {"login", "login/"}, method = RequestMethod.POST) // public String login2(Model model, @Valid @ModelAttribute("user") UserForm user, BindingResult result) { // String estado = userService.validarPass(user); // String[] estados = {"acceso permitido","password invalido","email invalido"}; // if(estado == estados[0]) { // return "welcome"; // } // else if(estado == estados[1]) { // model.addAttribute("texto","contraseña incorrecta"); // return "login"; // } // else { // model.addAttribute("texto","el email ingresado no se encuentra registrado"); // return "login"; // } // if(result.hasErrors()) { // return "login"; // } else { // return "welcome"; // } // } @RequestMapping(value= "/register", method = RequestMethod.GET) public String signUp(Model model) { model.addAttribute("user", new UserForm()); return "sign-up"; } @RequestMapping(value= "/register", method = RequestMethod.POST) public String addUser(@Valid @ModelAttribute("user") UserForm user, BindingResult result, Model model) { if(result.hasErrors()) { return "sign-up"; } userService.create(user); return "welcome"; } }
2,030
0.726466
0.724988
67
29.283583
26.913242
106
false
false
0
0
0
0
0
0
1.835821
false
false
3