blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
57a2d4aad34fe0ad72fd5f3ff29d89cf853fd887
4a8bcabcbc16ff973075c5c100cdbb18f09dd857
/src/main/java/br/com/alura/loja/modelo/CategoriaId.java
8f9e173cd2d97495f0813a23a9865bcdb659b46b
[]
no_license
davipbl/AluraJPA
0230cc656dbe8902a91de2086247d892459cc81b
8526e4f60ebabd8fb1e668cdb3065b1fadb85504
refs/heads/master
2023-04-10T20:20:01.759793
2021-04-06T21:00:10
2021-04-06T21:00:10
354,982,569
0
0
null
null
null
null
UTF-8
Java
false
false
711
java
package br.com.alura.loja.modelo; import javax.persistence.Embeddable; import javax.persistence.EmbeddedId; import java.io.Serializable; @Embeddable public class CategoriaId implements Serializable { public static final long serialVersionUID = 1L; private String nome; private String tipo; public CategoriaId() { } public CategoriaId(String nome, String tipo) { this.nome = nome; this.tipo = tipo; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } }
[ "davipbl@gmail.com" ]
davipbl@gmail.com
6ceeba0b0ae3b8cdd7646917dc780a17538d0100
2e30d10ba2d1013329f1b0f86df4bdfd052a83e2
/src/com/bit2016/paint/main/PaintApp.java
8acedc7ce87d7523b918a82627b8310060528551
[]
no_license
splendorbass/chapter02-3
fdc7b84c4f5d0c32ecfc4d56f263593f79e069e4
ea33f0b4c78f6553649738e53bb41a0be3c3b417
refs/heads/master
2021-01-18T13:24:10.127663
2016-09-21T05:56:42
2016-09-21T05:56:42
68,582,115
0
0
null
null
null
null
UTF-8
Java
false
false
2,443
java
package com.bit2016.paint.main; import com.bit2016.paint.i.Drawable; import com.bit2016.paint.i.Resizable; import com.bit2016.paint.point.ColorPoint; import com.bit2016.paint.point.Point; import com.bit2016.paint.shape.Circle; import com.bit2016.paint.shape.Rectangle; import com.bit2016.paint.shape.Shape; import com.bit2016.paint.shape.Triangle; public class PaintApp { public static void main(String[] args) { Point point = new Point(); point.setX(100); point.setY(1000); point.show(); Point point2 = new Point(200 , 200); point2.show(true); point2.show(false); Point point3 = new ColorPoint(50, 50, "red"); point3.show(); point3.show(false); point3.show(true); Drawable rectangle = new Rectangle(); draw( rectangle ); draw( new Circle() ); draw( new Triangle() ); draw( new Rectangle() ); draw( new ColorPoint(200,100,"white") ); resize( new Circle( 10 ) ); // instanceof test Circle c10 = new Circle(); System.out.println( c10 instanceof Circle ); // 오류 instanceof 는 상속관계에 있는 클래스만 확인할 수 있다. //System.out.println( c10 instanceof Rectangle ); System.out.println( c10 instanceof Shape ); // instanceof는 모든 인터페이스에 구현관계를 확인할수 있다. System.out.println( c10 instanceof Drawable ); System.out.println( c10 instanceof Resizable ); Rectangle rect = new Rectangle(); System.out.println( rect instanceof Rectangle ); System.out.println( rect instanceof Shape ); System.out.println( rect instanceof Drawable ); System.out.println( rect instanceof Resizable ); resize2( new Rectangle() ); // Shape circle = new Circle(); // //circle.draw(); // draw(circle); // // Shape triangle = new Triangle(); // triangle.draw(); // // draw( new Pentagon() ); } public static void draw( Drawable drawable ){ drawable.draw(); } public static void resize2( Drawable drawable ){ if( drawable instanceof Resizable == false){ return; } Resizable re = (Resizable)drawable; re.resize( 0.8 ); } public static void resize( Resizable resizable){ Shape shape = (Shape)resizable; double area = shape.calculateArea(); System.out.println(area); resizable.resize(0.5); } // public static void draw( Shape shape ){ // shape.draw(); // // } }
[ "bit-user@bit" ]
bit-user@bit
2d540441b8b6f895ae95e143ba6a701dd883a79a
3a26f1a75747e49ab35fa560df0256530b489174
/app/src/main/java/com/qianchen/sportsbuddy/RequestAdapter.java
3a787b653947abb61845cea7ecf14a3264c1623b
[]
no_license
happyWinner/SportsBuddy
75a43571ad973880a23209a282a72c503533eb78
2b515ff9058d4dc4ef8f778995699b9867dee52c
refs/heads/master
2021-01-18T14:11:01.679305
2014-08-05T02:42:28
2014-08-05T02:42:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,315
java
package com.qianchen.sportsbuddy; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.TextView; import com.parse.ParseException; import com.parse.ParseImageView; import com.parse.ParseQuery; import com.parse.ParseUser; import java.util.List; /** * {@link RequestAdapter} exposes a list of teams to a {@link android.widget.ListView}. * * Created by Qian Chen on 7/31/2014. */ public class RequestAdapter extends BaseAdapter { private Context context; private List<Request> requests; public RequestAdapter(Context context, List<Request> requests) { this.context = context; this.requests = requests; } @Override public int getCount() { return requests.size(); } @Override public Object getItem(int position) { return requests.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater.inflate(R.layout.list_item_request, null); } Request request = requests.get(position); if (request != null) { ((Button) view.findViewById(R.id.button_ignore)).setOnClickListener(new IgnoreListener(position)); ((Button) view.findViewById(R.id.button_approve)).setOnClickListener(new ApproveListener(position)); ((TextView) view.findViewById(R.id.text_user_name)).setText(request.getUserName()); ParseImageView imageView = (ParseImageView) view.findViewById(R.id.image_user_avatar); ParseQuery<ParseUser> query = ParseUser.getQuery(); ParseUser user; try { user = query.get(request.getUserID()); } catch (ParseException e) { // todo user default avatar return view; } imageView.setParseFile(user.getParseFile("avatar")); imageView.loadInBackground(); } return view; } class ApproveListener implements View.OnClickListener { int position; public ApproveListener(int position) { this.position = position; } @Override public void onClick(View v) { Request request = requests.remove(position); try { // update team member info ParseQuery<Team> teamQuery = ParseQuery.getQuery("Team"); Team team = teamQuery.get(request.getTeamID()); team.addMember(request.getUserID()); team.saveInBackground(); // upload an ApprovedRequest instance ApprovedRequest approvedRequest = new ApprovedRequest(); approvedRequest.setUserID(request.getUserID()); approvedRequest.setTeamID(request.getTeamID()); approvedRequest.saveInBackground(); // ParseQuery<ParseUser> userQuery = ParseUser.getQuery(); // ParseUser newMember = userQuery.get(request.getUserID()); // List<String> teamsId = newMember.getList("teamsJoined"); // if (teamsId == null) { // teamsId = new ArrayList<String>(); // } // teamsId.add(request.getTeamID()); // newMember.put("teamsJoined", teamsId); // newMember.saveInBackground(); } catch (ParseException e) { //todo } request.deleteInBackground(); notifyDataSetChanged(); } } class IgnoreListener implements View.OnClickListener { int position; public IgnoreListener(int position) { this.position = position; } @Override public void onClick(View v) { Request request = requests.remove(position); request.deleteInBackground(); notifyDataSetChanged(); } } }
[ "happyqianchen@gmail.com" ]
happyqianchen@gmail.com
cb3fd7c1982b35fe6c413edb019359eefa6a246f
f562205ff2ee4c7be53599384c7728fe9654f291
/app/src/main/java/com/zhanghao/gankio/api/FirService.java
8bff7a65e09261b5fe9740f3c085e81cff0a2fb4
[]
no_license
lh983758011/MyGank
6f004f4ac0808159e1880ac233e63553b04e4069
64e45a250d7c3d6268bfa487d26edcd9430891c9
refs/heads/master
2021-01-21T09:49:54.415854
2017-05-18T05:51:17
2017-05-18T05:51:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
484
java
package com.zhanghao.gankio.api; import com.zhanghao.gankio.entity.AppInfo; import io.reactivex.Observable; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Streaming; import retrofit2.http.Url; /** * Created by zhanghao on 2017/5/9. */ public interface FirService { @GET("apps/latest/?api_token=") Call<AppInfo> getAppBuildInfo(); @GET @Streaming Call<ResponseBody> downloadNewApk(@Url String url); }
[ "281079145@qq.com" ]
281079145@qq.com
dcdd0048081a21906bc600107fbf6c81b84e5f1c
d81f128a33dd66a11b74e929cb6637b4d73b1c09
/Saffron_OSGI/Gateway/g2021/src/main/java/com/pcs/device/gateway/G2021/config/package-info.java
43036333c7dd3f266c71dd16891b62581d2f0458
[]
no_license
deepakdinakaran86/poc
f56e146f01b66fd5231b3e16d1e5bf55ae4405c6
9aa4f845d3355f6ce8c5e205d42d66a369f671bb
refs/heads/master
2020-04-03T10:05:08.550330
2016-08-11T06:57:57
2016-08-11T06:57:57
65,439,459
0
1
null
null
null
null
UTF-8
Java
false
false
87
java
/** * */ /** * @author pcseg171 * */ package com.pcs.device.gateway.G2021.config;
[ "PCSEG288@pcs.com" ]
PCSEG288@pcs.com
19c92133f1ac6c75f4e7e55e8984edbabb1930d6
23660c6e64b76c3375ae868534548b185b369aca
/开发者挑战项目/狼人杀/源代码/app/src/main/java/com/netease/audioroom/demo/activity/VoiceRoomBaseActivity.java
f678defec296f93f773dbeea0ab3460a4e30f3a9
[ "MIT" ]
permissive
outmanchen/Developer-Challenge-2021
04d60f8d10b6284bfd7a5022f9122f6a5a6b4a19
1921e40d8b5db27a4c8e0d9695f32b3dc87c0fa7
refs/heads/main
2023-04-26T11:08:39.674018
2021-05-26T08:33:05
2021-05-26T08:33:05
370,955,452
1
0
MIT
2021-05-26T08:06:32
2021-05-26T08:06:31
null
UTF-8
Java
false
false
28,192
java
package com.netease.audioroom.demo.activity; import android.graphics.Color; import android.graphics.Rect; import android.os.Bundle; import android.text.TextUtils; import android.view.MotionEvent; import android.view.View; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.SeekBar; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.gyf.immersionbar.ImmersionBar; import com.netease.audioroom.demo.BuildConfig; import com.netease.audioroom.demo.R; import com.netease.audioroom.demo.adapter.MessageListAdapter; import com.netease.audioroom.demo.adapter.SeatAdapter; import com.netease.audioroom.demo.base.BaseActivity; import com.netease.audioroom.demo.base.adapter.BaseAdapter; import com.netease.audioroom.demo.cache.DemoCache; import com.netease.audioroom.demo.dialog.ChatRoomAudioDialog; import com.netease.audioroom.demo.dialog.ChatRoomMixerDialog; import com.netease.audioroom.demo.dialog.ChatRoomMoreDialog; import com.netease.audioroom.demo.dialog.ChoiceDialog; import com.netease.audioroom.demo.dialog.MusicMenuDialog; import com.netease.audioroom.demo.dialog.NoticeDialog; import com.netease.audioroom.demo.dialog.NotificationDialog; import com.netease.audioroom.demo.http.ChatRoomNetConstants; import com.netease.audioroom.demo.model.AccountInfo; import com.netease.audioroom.demo.util.InputUtils; import com.netease.audioroom.demo.util.Network; import com.netease.audioroom.demo.util.ScreenUtil; import com.netease.audioroom.demo.util.ToastHelper; import com.netease.audioroom.demo.util.ViewUtils; import com.netease.audioroom.demo.widget.HeadImageView; import com.netease.audioroom.demo.widget.SingingControlView; import com.netease.audioroom.demo.widget.VerticalItemDecoration; import com.netease.audioroom.demo.widget.VolumeSetup; import com.netease.yunxin.nertc.nertcvoiceroom.model.NERtcVoiceRoom; import com.netease.yunxin.nertc.nertcvoiceroom.model.NERtcVoiceRoomDef.RoomCallback; import com.netease.yunxin.nertc.nertcvoiceroom.model.VoiceRoomInfo; import com.netease.yunxin.nertc.nertcvoiceroom.model.VoiceRoomMessage; import com.netease.yunxin.nertc.nertcvoiceroom.model.VoiceRoomSeat; import com.netease.yunxin.nertc.nertcvoiceroom.model.VoiceRoomUser; import com.netease.yunxin.nertc.nertcvoiceroom.model.ktv.MusicChangeListener; import com.netease.yunxin.nertc.nertcvoiceroom.model.ktv.MusicOrderedItem; import com.netease.yunxin.nertc.nertcvoiceroom.model.ktv.MusicSing; import java.util.Collections; import java.util.List; /** * 主播与观众基础页,包含所有的通用UI元素 */ public abstract class VoiceRoomBaseActivity extends BaseActivity implements RoomCallback, ViewTreeObserver.OnGlobalLayoutListener { public static final String TAG = "AudioRoom"; public static final String EXTRA_VOICE_ROOM_INFO = "extra_voice_room_info"; private static final int KEY_BOARD_MIN_SIZE = ScreenUtil.dip2px(DemoCache.getContext(), 80); protected static final int MORE_ITEM_MICRO_PHONE = 0; // protected static final int MORE_ITEM_SPEAKER = 1; protected static final int MORE_ITEM_EAR_BACK = 2 - 1; protected static final int MORE_ITEM_MIXER = 3 - 1; protected static final int MORE_ITEM_AUDIO = 4 - 1; protected static final int MORE_ITEM_FINISH = 5 - 1; protected NERtcVoiceRoom voiceRoom; /** * 混音文件信息 */ protected List<ChatRoomAudioDialog.MusicItem> audioMixingMusicInfos; protected ChatRoomMoreDialog.OnItemClickListener onMoreItemClickListener = (dialog, itemView, item) -> { switch (item.id) { case MORE_ITEM_MICRO_PHONE: { item.enable = !voiceRoom.isLocalAudioMute(); toggleMuteLocalAudio(); break; } // case MORE_ITEM_SPEAKER: { // item.enable = !voiceRoom.isRoomAudioMute(); // toggleMuteRoomAudio(); // break; // } case MORE_ITEM_EAR_BACK: { item.enable = !voiceRoom.isEarBackEnable(); enableEarback(item.enable); break; } case MORE_ITEM_MIXER: { if (dialog != null && dialog.isShowing()) { dialog.dismiss(); } showChatRoomMixerDialog(); break; } case MORE_ITEM_AUDIO: { if (dialog != null && dialog.isShowing()) { dialog.dismiss(); } new ChatRoomAudioDialog(VoiceRoomBaseActivity.this, voiceRoom, audioMixingMusicInfos).show(); break; } case MORE_ITEM_FINISH: { if (dialog != null && dialog.isShowing()) { dialog.dismiss(); } doLeaveRoom(); break; } } return true; }; //ktv protected SingingControlView singView; protected ConstraintLayout clyAnchorView; protected MusicMenuDialog musicMenuDialog; protected MusicChangeListener musicChangeListener; protected TextView tvOrderMusic; protected TextView tvOrderedNum; protected boolean isKtvModel; //主播基础信息 protected HeadImageView ivAnchorAvatar; protected ImageView ivAnchorAudioCloseHint; protected ImageView ivAnchorSiniging; protected TextView tvAnchorNick; protected TextView tvRoomName; protected TextView tvMemberCount; private ImageView ivAnchorVolume; // 各种控制开关 protected FrameLayout settingsContainer; protected ImageView ivLocalAudioSwitch; protected ImageView ivRoomAudioSwitch; protected TextView tvInput; protected ImageView ivSettingSwitch; protected EditText edtInput; protected View more; //聊天室队列(麦位) protected RecyclerView recyclerView; protected SeatAdapter seatAdapter; //消息列表 protected RecyclerView rcyChatMsgList; private LinearLayoutManager msgLayoutManager; protected MessageListAdapter msgAdapter; private int rootViewVisibleHeight; private View rootView; private View announcement; private BaseAdapter.ItemClickListener<VoiceRoomSeat> itemClickListener = this::onSeatItemClick; private BaseAdapter.ItemLongClickListener<VoiceRoomSeat> itemLongClickListener = this::onSeatItemLongClick; protected VoiceRoomInfo voiceRoomInfo; protected String anchorUserId; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 屏幕常亮 getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); voiceRoomInfo = (VoiceRoomInfo) getIntent().getSerializableExtra(EXTRA_VOICE_ROOM_INFO); if (voiceRoomInfo == null) { ToastHelper.showToast("聊天室信息不能为空"); finish(); return; } isKtvModel = voiceRoomInfo.getRoomType() == ChatRoomNetConstants.ROOM_TYPE_KTV; ImmersionBar.with(this).statusBarDarkFont(false).init(); initVoiceRoom(); initViews(); } private void initSingView() { singView.setVoiceRoom(voiceRoom); singView.setUserInfo(createUser()); singView.setControlCallBack(() -> showChatRoomMixerDialog()); musicChangeListener = new MusicChangeListener() { @Override public void onListChange(List<MusicOrderedItem> musicList, boolean isInit) { if (musicList == null || musicList.size() == 0) { singView.noSongOrdered(); tvOrderedNum.setVisibility(View.GONE); updateSeat(""); voiceRoom.getAudioPlay().onSingFinish(true, false); singView.cancelReady(); } else { tvOrderedNum.setVisibility(View.VISIBLE); voiceRoom.getAudioPlay().onSingStart(); tvOrderedNum.setText(String.valueOf(musicList.size())); if (musicList.size() > 1) { singView.updateNextSong(musicList.get(1)); } else { singView.updateNextSong(null); } } } @Override public void onSongChange(MusicOrderedItem music, boolean isMy, boolean isInit) { if (music == null) { return; } singView.cancelReady(); if (music.countTimeSec <= 0) { singView.onMusicSing(music, isMy, true); } else { singView.onReady(music, isMy); voiceRoom.getAudioPlay().onSingFinish(false, true); } updateSeat(music.userId); } @Override public void onError(String msg) { ToastHelper.showToast(msg); } }; } protected void updateSeat(String userId) { seatAdapter.setSingUser(userId); if (!TextUtils.isEmpty(anchorUserId) && !TextUtils.isEmpty(userId) && TextUtils.equals(userId, anchorUserId)) { ivAnchorSiniging.setVisibility(View.VISIBLE); } else { ivAnchorSiniging.setVisibility(View.GONE); } } private void initViews() { findBaseView(); setupBaseViewInner(); setupBaseView(); rootView = getWindow().getDecorView(); rootView.getViewTreeObserver().addOnGlobalLayoutListener(this); requestLivePermission(); } @Override protected void onDestroy() { if (rootView != null) { rootView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } MusicSing.shareInstance().removeMusicChangeListener(musicChangeListener); MusicSing.shareInstance().reset(); super.onDestroy(); } @Override public void onBackPressed() { if (settingsContainer.getVisibility() == View.VISIBLE) { settingsContainer.setVisibility(View.GONE); return; } leaveRoom(); super.onBackPressed(); } @Override protected void onResume() { super.onResume(); if (Network.getInstance().isConnected()) { loadSuccess(); } else { showNetError(); } } @Override public void onGlobalLayout() { int preHeight = rootViewVisibleHeight; //获取当前根视图在屏幕上显示的大小 Rect r = new Rect(); rootView.getWindowVisibleDisplayFrame(r); rootViewVisibleHeight = r.height(); if (preHeight == 0 || preHeight == rootViewVisibleHeight) { return; } //根视图显示高度变大超过KEY_BOARD_MIN_SIZE,可以看作软键盘隐藏了 if (rootViewVisibleHeight - preHeight >= KEY_BOARD_MIN_SIZE) { scrollToBottom(); return; } } private void findBaseView() { View baseAudioView = findViewById(R.id.rl_base_audio_ui); if (baseAudioView == null) { throw new IllegalStateException("xml layout must include base_audio_ui.xml layout"); } if (isKtvModel) { baseAudioView.setBackgroundResource(R.drawable.ktv_bg_image); } int barHeight = ImmersionBar.getStatusBarHeight(this); baseAudioView.setPadding(baseAudioView.getPaddingLeft(), baseAudioView.getPaddingTop() + barHeight, baseAudioView.getPaddingRight(), baseAudioView.getPaddingBottom()); singView = baseAudioView.findViewById(R.id.sing_view); clyAnchorView = baseAudioView.findViewById(R.id.cly_anchor_layout); ivAnchorAvatar = baseAudioView.findViewById(R.id.iv_liver_avatar); ivAnchorAudioCloseHint = baseAudioView.findViewById(R.id.iv_liver_audio_close_hint); ivAnchorSiniging = baseAudioView.findViewById(R.id.iv_anchor_singing); tvAnchorNick = baseAudioView.findViewById(R.id.tv_liver_nick); tvRoomName = baseAudioView.findViewById(R.id.tv_chat_room_name); tvMemberCount = baseAudioView.findViewById(R.id.tv_chat_room_member_count); settingsContainer = findViewById(R.id.settings_container); tvOrderMusic = findViewById(R.id.tv_order_music); tvOrderedNum = findViewById(R.id.tv_ordered_num); settingsContainer.setOnClickListener(view -> settingsContainer.setVisibility(View.GONE)); ivSettingSwitch = baseAudioView.findViewById(R.id.iv_settings); ivSettingSwitch.setOnClickListener(view -> settingsContainer.setVisibility(View.VISIBLE)); findViewById(R.id.settings_action_container).setOnClickListener(view -> { }); SeekBar skRecordingVolume = settingsContainer.findViewById(R.id.recording_volume_control); skRecordingVolume.setOnSeekBarChangeListener(new VolumeSetup() { @Override protected void onVolume(int volume) { setAudioCaptureVolume(volume); } }); SwitchCompat switchEarBack = settingsContainer.findViewById(R.id.ear_back); switchEarBack.setChecked(false); switchEarBack.setOnCheckedChangeListener((buttonView, isChecked) -> enableEarback(isChecked)); more = baseAudioView.findViewById(R.id.iv_room_more); more.setOnClickListener(v -> new ChatRoomMoreDialog(VoiceRoomBaseActivity.this, getMoreItems()) .registerOnItemClickListener(getMoreItemClickListener()).show()); ivLocalAudioSwitch = baseAudioView.findViewById(R.id.iv_local_audio_switch); ivLocalAudioSwitch.setOnClickListener(view -> toggleMuteLocalAudio()); ivRoomAudioSwitch = baseAudioView.findViewById(R.id.iv_room_audio_switch); ivRoomAudioSwitch.setOnClickListener(view -> toggleMuteRoomAudio()); baseAudioView.findViewById(R.id.iv_leave_room).setOnClickListener(view -> doLeaveRoom()); ivAnchorVolume = baseAudioView.findViewById(R.id.circle); recyclerView = baseAudioView.findViewById(R.id.recyclerview_seat); rcyChatMsgList = baseAudioView.findViewById(R.id.rcy_chat_message_list); tvInput = baseAudioView.findViewById(R.id.tv_input_text); tvInput.setOnClickListener(v -> InputUtils.showSoftInput(VoiceRoomBaseActivity.this, edtInput)); edtInput = baseAudioView.findViewById(R.id.edt_input_text); edtInput.setOnEditorActionListener((v, actionId, event) -> { InputUtils.hideSoftInput(VoiceRoomBaseActivity.this, edtInput); sendTextMessage(); return true; }); InputUtils.registerSoftInputListener(this, new InputUtils.InputParamHelper() { @Override public int getHeight() { return baseAudioView.getHeight(); } @Override public EditText getInputView() { return edtInput; } }); announcement = baseAudioView.findViewById(R.id.tv_chat_room_announcement); announcement.setOnClickListener(v -> { NoticeDialog noticeDialog = new NoticeDialog(); noticeDialog.show(getSupportFragmentManager(), noticeDialog.TAG); }); } protected void doLeaveRoom() { leaveRoom(); } private void setupBaseViewInner() { String name = voiceRoomInfo.getName(); name = TextUtils.isEmpty(name) ? voiceRoomInfo.getRoomId() : name; tvRoomName.setText(name); String count = "在线" + voiceRoomInfo.getOnlineUserCount() + "人"; tvMemberCount.setText(count); if (isKtvModel) { setKtvView(); LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); recyclerView.setLayoutManager(layoutManager); seatAdapter = new SeatAdapter(null, this, true); initSingView(); } else { recyclerView.setLayoutManager(new GridLayoutManager(this, 4)); seatAdapter = new SeatAdapter(null, this); } recyclerView.setAdapter(seatAdapter); seatAdapter.setItemClickListener(itemClickListener); seatAdapter.setItemLongClickListener(itemLongClickListener); msgLayoutManager = new LinearLayoutManager(this); rcyChatMsgList.setLayoutManager(msgLayoutManager); msgAdapter = new MessageListAdapter(null, this); rcyChatMsgList.addItemDecoration(new VerticalItemDecoration(Color.TRANSPARENT, ScreenUtil.dip2px(this, 5))); rcyChatMsgList.setAdapter(msgAdapter); } /** * 设置KTV布局 */ private void setKtvView() { tvOrderMusic.setVisibility(View.VISIBLE); tvOrderMusic.setOnClickListener((view) -> { showMusicMenuDialog(); }); ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(clyAnchorView); constraintSet.setVisibility(R.id.sing_view, ConstraintSet.VISIBLE); constraintSet.clear(R.id.cly_anchor_avatar); constraintSet.constrainHeight(R.id.cly_anchor_avatar, ConstraintSet.WRAP_CONTENT); constraintSet.constrainWidth(R.id.cly_anchor_avatar, ConstraintSet.WRAP_CONTENT); constraintSet.connect(R.id.cly_anchor_avatar, ConstraintSet.TOP, R.id.sing_view, ConstraintSet.BOTTOM); constraintSet.connect(R.id.cly_anchor_avatar, ConstraintSet.START, R.id.sing_view, ConstraintSet.START); constraintSet.clear(R.id.tv_liver_nick); constraintSet.constrainHeight(R.id.tv_liver_nick, ConstraintSet.WRAP_CONTENT); constraintSet.constrainWidth(R.id.tv_liver_nick, ScreenUtil.dip2px(this, 40)); constraintSet.connect(R.id.tv_liver_nick, ConstraintSet.TOP, R.id.cly_anchor_avatar, ConstraintSet.BOTTOM, ScreenUtil.dip2px(this, 10)); constraintSet.connect(R.id.tv_liver_nick, ConstraintSet.START, R.id.cly_anchor_avatar, ConstraintSet.START); constraintSet.connect(R.id.tv_liver_nick, ConstraintSet.END, R.id.cly_anchor_avatar, ConstraintSet.END); constraintSet.clear(R.id.recyclerview_seat); constraintSet.constrainHeight(R.id.recyclerview_seat, ConstraintSet.WRAP_CONTENT); constraintSet.constrainWidth(R.id.recyclerview_seat, ConstraintSet.MATCH_CONSTRAINT); constraintSet.connect(R.id.recyclerview_seat, ConstraintSet.START, R.id.cly_anchor_avatar, ConstraintSet.END, ScreenUtil.dip2px(this, 10)); constraintSet.connect(R.id.recyclerview_seat, ConstraintSet.END, R.id.sing_view, ConstraintSet.END); constraintSet.connect(R.id.recyclerview_seat, ConstraintSet.TOP, R.id.cly_anchor_avatar, ConstraintSet.TOP); constraintSet.applyTo(clyAnchorView); ConstraintLayout clyAnchorAvatar = findViewById(R.id.cly_anchor_avatar); ConstraintSet constraintSetAvatar = new ConstraintSet(); constraintSetAvatar.clone(clyAnchorAvatar); constraintSetAvatar.constrainWidth(R.id.circle, ScreenUtil.dip2px(this, 40)); constraintSetAvatar.constrainHeight(R.id.circle, ScreenUtil.dip2px(this, 40)); constraintSetAvatar.constrainWidth(R.id.frame, ScreenUtil.dip2px(this, 40)); constraintSetAvatar.constrainHeight(R.id.frame, ScreenUtil.dip2px(this, 40)); constraintSetAvatar.applyTo(clyAnchorAvatar); singView.setOrder((view) -> showMusicMenuDialog()); } protected void scrollToBottom() { msgLayoutManager.scrollToPosition(msgAdapter.getItemCount() - 1); } protected abstract int getContentViewID(); protected abstract void setupBaseView(); protected abstract void onSeatItemClick(VoiceRoomSeat model, int position); protected abstract boolean onSeatItemLongClick(VoiceRoomSeat model, int position); @NonNull protected List<ChatRoomMoreDialog.MoreItem> getMoreItems() { return Collections.emptyList(); } protected ChatRoomMoreDialog.OnItemClickListener getMoreItemClickListener() { return onMoreItemClickListener; } // // NERtcVoiceRoom call // protected void initVoiceRoom() { NERtcVoiceRoom.setAccountMapper(AccountInfo::accountToVoiceUid); NERtcVoiceRoom.setMessageTextBuilder(messageTextBuilder); voiceRoom = NERtcVoiceRoom.sharedInstance(this); voiceRoom.init(BuildConfig.NERTC_APP_KEY, this); voiceRoom.initRoom(voiceRoomInfo, createUser()); } @Override protected void showNetError() { super.showNetError(); if (isKtvModel) { voiceRoom.getAudioPlay().pauseKtvMusic(); } } @Override protected void loadSuccess() { super.loadSuccess(); if (isKtvModel && singView != null && !singView.getPaused()) { voiceRoom.getAudioPlay().resumeKtvMusic(); } } protected final void enterRoom(boolean anchorMode) { voiceRoom.enterRoom(anchorMode); } protected final void leaveRoom() { voiceRoom.leaveRoom(); } protected final void toggleMuteLocalAudio() { boolean muted = voiceRoom.muteLocalAudio(!voiceRoom.isLocalAudioMute()); if (muted) { ToastHelper.showToast("话筒已关闭"); } else { ToastHelper.showToast("话筒已打开"); } } protected final void toggleMuteRoomAudio() { boolean muted = voiceRoom.muteRoomAudio(!voiceRoom.isRoomAudioMute()); if (muted) { ToastHelper.showToast("已关闭“聊天室声音”"); } else { ToastHelper.showToast("已打开“聊天室声音”"); } ivRoomAudioSwitch.setSelected(muted); } protected void setAudioCaptureVolume(int volume) { voiceRoom.setAudioCaptureVolume(volume); } protected void enableEarback(boolean enable) { voiceRoom.enableEarback(enable); } private void sendTextMessage() { String content = edtInput.getText().toString().trim(); if (TextUtils.isEmpty(content)) { ToastHelper.showToast("请输入消息内容"); return; } voiceRoom.sendTextMessage(content); } // // RoomCallback // @Override public void onEnterRoom(boolean success) { if (!success) { ToastHelper.showToast("进入聊天室失败"); finish(); } else { loadSuccess(); if (isKtvModel) { MusicSing.shareInstance().addMusicChangeListener(musicChangeListener); } } } @Override public void onLeaveRoom() { finish(); } @Override public void onRoomDismiss() { if (isKtvModel) { voiceRoom.getAudioPlay().onSingFinish(true, false); } ChoiceDialog dialog = new NotificationDialog(this).setTitle("通知").setContent("该房间已被主播解散").setPositive("知道了", v -> { leaveRoom(); if (voiceRoomInfo .isSupportCDN()) { finish(); } }); dialog.setCancelable(false); dialog.show(); } @Override public void onOnlineUserCount(int onlineUserCount) { String count = "在线" + onlineUserCount + "人"; tvMemberCount.setText(count); } @Override public void onAnchorInfo(VoiceRoomUser user) { ivAnchorAvatar.loadAvatar(user.avatar); tvAnchorNick.setText(user.nick); anchorUserId = user.account; } @Override public void onAnchorMute(boolean muted) { ivAnchorAudioCloseHint.setImageResource(muted ? R.drawable.icon_seat_close_micro : R.drawable.icon_seat_open_micro); } @Override public void onAnchorVolume(int volume) { showVolume(ivAnchorVolume, volume); } @Override public void onMute(boolean muted) { ivLocalAudioSwitch.setSelected(muted); } @Override public void updateSeats(List<VoiceRoomSeat> seats) { seatAdapter.setItems(seats); } @Override public void onMusicStateChange(int type) { singView.onMusicStateChange(type); } @Override public void updateSeat(VoiceRoomSeat seat) { seatAdapter.updateItem(seat.getIndex(), seat); } @Override public void onSeatVolume(VoiceRoomSeat seat, int volume) { if (recyclerView == null) { recyclerView = findViewById(R.id.rl_base_audio_ui).findViewById(R.id.recyclerview_seat); } if (recyclerView.getLayoutManager() == null) { recyclerView.setLayoutManager(new GridLayoutManager(this, 4)); } View itemView = recyclerView.getLayoutManager().findViewByPosition(seat.getIndex()); if (itemView != null) { ImageView circle = itemView.findViewById(R.id.circle); showVolume(circle, volume); } } @Override public void onVoiceRoomMessage(VoiceRoomMessage message) { msgAdapter.appendItem(message); scrollToBottom(); } private static void showVolume(ImageView view, int volume) { volume = toStepVolume(volume); if (volume == 0) { view.setVisibility(View.INVISIBLE); } else { view.setVisibility(View.VISIBLE); } } private static int toStepVolume(int volume) { int step = 0; volume /= 40; while (volume > 0) { step++; volume /= 2; } if (step > 8) { step = 8; } return step; } private static final VoiceRoomMessage.MessageTextBuilder messageTextBuilder = new VoiceRoomMessage.MessageTextBuilder() { @Override public String roomEvent(String nick, boolean enter) { String who = "“" + nick + "”"; String action = enter ? "进了房间" : "离开了房间"; return who + action; } @Override public String seatEvent(VoiceRoomSeat seat, boolean enter) { VoiceRoomUser user = seat.getUser(); String nick = user != null ? user.getNick() : ""; String who = "“" + nick + "”"; String action = enter ? "进入了麦位" : "退出了麦位"; int position = seat.getIndex() + 1; return who + action + position; } @Override public String musicEvent(String nick, boolean isPause) { String who = "“" + nick + "”"; String action = isPause ? "暂停音乐" : "恢复演唱"; return who + action; } }; @Override public boolean dispatchTouchEvent(MotionEvent ev) { int x = (int) ev.getRawX(); int y = (int) ev.getRawY(); // 键盘区域外点击收起键盘 if (!ViewUtils.isInView(edtInput, x, y)) { InputUtils.hideSoftInput(VoiceRoomBaseActivity.this, edtInput); } return super.dispatchTouchEvent(ev); } private void showMusicMenuDialog() { if (musicMenuDialog == null) { musicMenuDialog = new MusicMenuDialog(); } musicMenuDialog.setUser(createUser()); musicMenuDialog.show(getSupportFragmentManager(), musicMenuDialog.TAG); } /** * 显示调音台 */ public void showChatRoomMixerDialog() { new ChatRoomMixerDialog(VoiceRoomBaseActivity.this, voiceRoom, isKtvModel).show(); } }
[ "1254750354@qq.com" ]
1254750354@qq.com
aa49f85ed8af08a1cebac8619da8dc37b4469df5
ed537029a3f7ebce8f09fff64e2b40e09202f4c1
/src/pkgfinal/IPayment.java
0c1b77baee8c82d1c032225242dbf2d8ffeb4c9a
[]
no_license
Nmudang/cn332Final
1afad0818b476d500d81c2bc863f6631cd9c39eb
74775717f493cf55f5007d96723a3df865c670f4
refs/heads/main
2023-05-06T09:00:53.537932
2021-06-01T09:03:59
2021-06-01T09:03:59
372,766,176
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package pkgfinal; /* * 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. */ /** * * @author User */ public interface IPayment { public void Payment(float amount); }
[ "kanokgorn261999@gmail.com" ]
kanokgorn261999@gmail.com
839ec8ac295612857d19aa168295ce2ab47df53c
f26c4ce1736cbd8763a66563a8d7b77175a669f8
/src/main/java/com/lzf/code/babasport/service/ImgService.java
046ebd75a978a9b76eb9aa89a978f89bc643efea
[]
no_license
15706058532/docker-maven-spring-boot-demo
a299cb2ab498ecfcd24b5b5e188a7f536fc76882
293a92b3245480d7ca53ce63e63b0f16cffdf103
refs/heads/master
2020-04-13T05:57:32.903433
2018-12-24T17:11:16
2018-12-24T17:11:16
163,007,888
0
0
null
null
null
null
UTF-8
Java
false
false
175
java
package com.lzf.code.babasport.service; /** * 写点注释 * <br/> * Created in 2018-12-22 20:08:15 * <br/> * * @author Li zhenfeng */ public interface ImgService { }
[ "15706058532@163.com" ]
15706058532@163.com
788c6f67c60ed2f34ec60fd6c5590aa9acfcff96
1398124f4db580ca10d77f9401e826ffc258eb70
/ringtail-registry/src/main/java/org/yannis/ringtail/registry/Registry.java
1760d693d057f52ef8821ac57fd9d58d21d91a94
[]
no_license
YannisZhao/ringtail
6a34c90a793e2ca83f71c2b94c16e6a8c9921b0d
16caee50ab066bd9ed261b032623bc837c3f7c21
refs/heads/master
2021-04-15T16:16:22.700707
2016-07-07T14:19:25
2016-07-07T14:19:25
60,256,013
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package org.yannis.ringtail.registry; /** * Created by yannis on 6/29/16. */ public interface Registry { void register(); void unregister(); }
[ "yanjun.zhao@lianshang.com" ]
yanjun.zhao@lianshang.com
b87e06f179d728a97fe10f78f6bb1390ef275a68
eaf586526e645545f20c4480b92bb4a384f29231
/backend/src/main/java/com/sorrentino/workdev/services/excptions/ResourceEntityNotFoundException.java
7df8e001352f72be229103de8a14010e3103e72a
[]
no_license
SorrentinoFabiano/work-dev
26376e2c947d260cd3e784191e17df00d878e189
fda4d469b25bc48f83856547a904e6f1b4956828
refs/heads/master
2023-05-08T03:59:56.408643
2021-05-28T11:01:23
2021-05-28T11:01:23
367,446,721
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package com.sorrentino.workdev.services.excptions; public class ResourceEntityNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; public ResourceEntityNotFoundException(String msg) { super(msg); } }
[ "fabiano.sorrentino@gmail.com" ]
fabiano.sorrentino@gmail.com
29c5ffba862f69fe74e6c35df3993f4f9db60d0b
5741045375dcbbafcf7288d65a11c44de2e56484
/reddit-decompilada/com/reddit/frontpage/presentation/listing/common/RedditModeratorLinkActions$onModerateLockComments$2.java
2cf3b6215071972d270a15cfcad418eb253fd017
[]
no_license
miarevalo10/ReporteReddit
18dd19bcec46c42ff933bb330ba65280615c281c
a0db5538e85e9a081bf268cb1590f0eeb113ed77
refs/heads/master
2020-03-16T17:42:34.840154
2018-05-11T10:16:04
2018-05-11T10:16:04
132,843,706
0
0
null
null
null
null
UTF-8
Java
false
false
1,905
java
package com.reddit.frontpage.presentation.listing.common; import com.reddit.datalibrary.frontpage.requests.models.v2.Listable; import com.reddit.frontpage.presentation.listing.model.LinkPresentationModel; import kotlin.Metadata; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; @Metadata(bv = {1, 0, 2}, d1 = {"\u0000\f\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0000\u001a\u0002H\u0001\"\b\b\u0000\u0010\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u0002H\u0001H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"<anonymous>", "T", "Lcom/reddit/datalibrary/frontpage/requests/models/v2/Listable;", "it", "invoke", "(Lcom/reddit/datalibrary/frontpage/requests/models/v2/Listable;)Lcom/reddit/datalibrary/frontpage/requests/models/v2/Listable;"}, k = 3, mv = {1, 1, 9}) /* compiled from: RedditModeratorLinkActions.kt */ final class RedditModeratorLinkActions$onModerateLockComments$2 extends Lambda implements Function1<T, T> { final /* synthetic */ boolean f36598a; RedditModeratorLinkActions$onModerateLockComments$2(boolean z) { this.f36598a = z; super(1); } public final /* synthetic */ Object mo6492a(Object obj) { Listable listable = (Listable) obj; Intrinsics.m26847b(listable, "it"); return LinkPresentationModel.m34743a((LinkPresentationModel) listable, null, null, null, 0, null, 0, null, null, null, 0, null, null, null, null, false, null, false, 0, null, false, null, null, this.f36598a, false, null, false, null, null, null, false, null, null, false, null, null, null, null, null, null, false, null, false, null, null, 0, false, 0, null, false, 0, null, null, false, false, false, false, false, null, null, null, null, null, null, null, false, false, null, null, null, false, null, false, false, false, null, null, null, -4194305, -1, 8191, null); } }
[ "mi.arevalo10@uniandes.edu.co" ]
mi.arevalo10@uniandes.edu.co
53bd5620e6795a160b146a716c31ee3e613ce06e
4019dea517d181c3b6b074bbf58c544160763c15
/connect-file-pulse-api/src/main/java/io/streamthoughts/kafka/connect/filepulse/source/StateListener.java
0b98d085634aa3fc96eba297d20a42f4551ac77a
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
imperio-wxm/kafka-connect-file-pulse
0001ad168a7630b4fffeeec7eed982a8ece794e0
cfcec16e5ad4c13c1bd2ef3d6063fb754dd3ab04
refs/heads/master
2021-02-15T07:40:35.484231
2020-01-24T11:52:35
2020-01-24T12:20:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,066
java
/* * Copyright 2019 StreamThoughts. * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.streamthoughts.kafka.connect.filepulse.source; interface StateListener { /** * This method is invoked when a file is scheduled by the task. * @see FileRecordsPollingConsumer * * @param context the file context. */ void onScheduled(final FileContext context); /** * This method is invoked when a file can't be scheduled. * @see FileRecordsPollingConsumer * * @param context the file context. */ void onInvalid(final FileContext context); /** * This method is invoked when a source file is starting to be read. * @see FileRecordsPollingConsumer * * @param context the file context. */ void onStart(final FileContext context); /** * This method is invoked when a source file processing is completed. * @see FileRecordsPollingConsumer * * @param context the file context. */ void onCompleted(final FileContext context); /** * This method is invoked when an error occurred while processing a source file. * @see FileRecordsPollingConsumer * * @param context the file context. */ void onFailure(final FileContext context, final Throwable t); }
[ "florian.hussonnois@gmail.com" ]
florian.hussonnois@gmail.com
cd2c7671e17ca6e2bd66cd15a4a7be8f78195117
38b8b55be465972960f1e8db790fbad97d39e389
/src/rolesannotation/JsonSerializationProcessor.java
cf526ab48d31878d3d2b43a9c90de82b9a9701e9
[]
no_license
GlorimarCastro/AutomaticRolesAnnotation
e6f143ea09bb9a144dcfae4ac5523c52ed69bfb1
ac8c7497ac142a051cbbb531b13e4ec9a8a03e1f
refs/heads/master
2021-01-10T17:33:06.687419
2015-06-05T21:16:05
2015-06-05T21:16:05
36,953,085
0
0
null
null
null
null
UTF-8
Java
false
false
7,408
java
package rolesannotation; /* * #%L * Wikidata Toolkit Examples * %% * Copyright (C) 2014 - 2015 Wikidata Toolkit Developers * %% * 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. * #L% */ import java.io.BufferedOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; import org.wikidata.wdtk.datamodel.helpers.Datamodel; import org.wikidata.wdtk.datamodel.helpers.DatamodelConverter; import org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessor; import org.wikidata.wdtk.datamodel.interfaces.ItemDocument; import org.wikidata.wdtk.datamodel.interfaces.ItemIdValue; import org.wikidata.wdtk.datamodel.interfaces.PropertyDocument; import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; import org.wikidata.wdtk.datamodel.interfaces.Statement; import org.wikidata.wdtk.datamodel.interfaces.StatementGroup; import org.wikidata.wdtk.datamodel.interfaces.Value; import org.wikidata.wdtk.datamodel.interfaces.ValueSnak; import org.wikidata.wdtk.datamodel.json.jackson.JacksonObjectFactory; import org.wikidata.wdtk.datamodel.json.jackson.JsonSerializer; /** * This example illustrates how to create a JSON serialization of some of the * data found in a dump. It uses a {@link DatamodelConverter} with filter * settings to eliminate some of the data. * <p> * As an example, the program only serializes data for people who were born in * Dresden, Germany. This can be changed by modifying the code in * {@link #includeDocument(ItemDocument)}. * * @author Markus Kroetzsch * */ public class JsonSerializationProcessor implements EntityDocumentProcessor { static final String OUTPUT_FILE_NAME = "json-serialization-example.json.gz"; final JsonSerializer jsonSerializer; /** * Object used to make simplified copies of Wikidata documents for * re-serialization in JSON. */ final DatamodelConverter datamodelConverter; /** * Runs the example program. * * @param args * @throws IOException * if there was a problem in writing the output file */ public static void main(String[] args) throws IOException { ExampleHelpers.configureLogging(); JsonSerializationProcessor.printDocumentation(); JsonSerializationProcessor jsonSerializationProcessor = new JsonSerializationProcessor(); ExampleHelpers .processEntitiesFromWikidataDump(jsonSerializationProcessor); // jsonSerializationProcessor.close(); } /** * Constructor. Initializes various helper objects we use for the JSON * serialization, and opens the file that we want to write to. * * @throws IOException * if there is a problem opening the output file */ public JsonSerializationProcessor() throws IOException { // The converter is used to copy selected parts of the data. We use this // to remove some parts from the documents we serialize. The converter // uses a JacksonObjectFactory to be sure that we create objects for // which we know how to write JSON. A similar converter without the // filtering enabled would also be used to create JSON-serializable // objects from any other implementation of the Wikidata Toolkit // datamodel. this.datamodelConverter = new DatamodelConverter( new JacksonObjectFactory()); // Do not copy references at all: this.datamodelConverter.setOptionDeepCopyReferences(false); // Only copy English labels, descriptions, and aliases: this.datamodelConverter.setOptionLanguageFilter(Collections .singleton("en")); // Only copy statements of some properties: Set<PropertyIdValue> propertyFilter = new HashSet<>(); propertyFilter.add(Datamodel.makeWikidataPropertyIdValue("P18")); // image propertyFilter.add(Datamodel.makeWikidataPropertyIdValue("P106")); // occupation propertyFilter.add(Datamodel.makeWikidataPropertyIdValue("P569")); // birthdate this.datamodelConverter.setOptionPropertyFilter(propertyFilter); // Do not copy any sitelinks: this.datamodelConverter.setOptionSiteLinkFilter(Collections .<String> emptySet()); // The (compressed) file we write to. OutputStream outputStream = new GzipCompressorOutputStream( new BufferedOutputStream( ExampleHelpers .openExampleFileOuputStream(OUTPUT_FILE_NAME))); this.jsonSerializer = new JsonSerializer(outputStream); this.jsonSerializer.open(); } @Override public void processItemDocument(ItemDocument itemDocument) { if (includeDocument(itemDocument)) { this.jsonSerializer.processItemDocument(this.datamodelConverter .copy(itemDocument)); } } @Override public void processPropertyDocument(PropertyDocument propertyDocument) { // we do not serialize any properties } /** * Prints some basic documentation about this program. */ public static void printDocumentation() { System.out .println("********************************************************************"); System.out.println("*** Wikidata Toolkit: JsonSerializationProcessor"); System.out.println("*** "); System.out .println("*** This program will download and process dumps from Wikidata."); System.out .println("*** It will filter the data and store the results in a new JSON file."); System.out.println("*** See source code for further details."); System.out .println("********************************************************************"); } /** * Closes the output. Should be called after the JSON serialization was * finished. * * @throws IOException * if there was a problem closing the output */ public void close() throws IOException { System.out.println("Serialized " + this.jsonSerializer.getEntityDocumentCount() + " item documents to JSON file " + OUTPUT_FILE_NAME + "."); this.jsonSerializer.close(); } /** * Returns true if the given document should be included in the * serialization. * * @param itemDocument * the document to check * @return true if the document should be serialized */ private boolean includeDocument(ItemDocument itemDocument) { for (StatementGroup sg : itemDocument.getStatementGroups()) { // "P19" is "place of birth" on Wikidata if (!"P19".equals(sg.getProperty().getId())) { continue; } for (Statement s : sg.getStatements()) { if (s.getClaim().getMainSnak() instanceof ValueSnak) { Value v = ((ValueSnak) s.getClaim().getMainSnak()) .getValue(); // "Q1731" is "Dresden" on Wikidata if (v instanceof ItemIdValue && "Q1731".equals(((ItemIdValue) v).getId())) { return true; } } } } return false; } }
[ "gl26163@489318-G52-CAST.mitll.ad.local" ]
gl26163@489318-G52-CAST.mitll.ad.local
739449367ad3f6904f9b19d23b94f63ba14ad3a4
6cebe1177fac010c1541665dc1f1a5ca00f679a4
/src/CalculateDependencies.java
07f9a85c197ba7543d93fe54053ce3a1ced6665f
[]
no_license
ysj-17/OrderDependency
e872d64494c103c06839a33bcd2be3c522d933f4
99baca64f04058b8cf8dadba9c9d9b318e8e2fa9
refs/heads/master
2020-08-27T18:12:17.004758
2019-12-12T11:25:57
2019-12-12T11:25:57
217,455,690
0
0
null
null
null
null
UTF-8
Java
false
false
4,254
java
import java.io.PrintWriter; import java.util.*; public class CalculateDependencies { private String orderFile; private String dependencyFile; private String writeFile = "output.txt"; // Default value unless changed private FileOrders fileOrders; private FileDependencies fileDependencies; private HashMap<Integer,Orders> orderMap; private Dependencies dependencies; private ArrayList<String> completedDependencies = new ArrayList<>(); private TrieTree trieTree; private ArrayList<Object> formattedTree = new ArrayList<>(); public CalculateDependencies(){}; // Function sets Order File name public void setOrderFile(String filename){ this.orderFile = filename; } // Function sets Dependency File name public void setDependencyFile(String filename){ this.dependencyFile = filename; } // Function can change output file name public void changeDefaultWriteFile(String filename){ this.writeFile = filename; } public HashMap<Integer,Orders> getOrderMap(){ return orderMap; } public Dependencies getDependencies(){ return dependencies; } public ArrayList<String> getCompletedDependencies(){ return completedDependencies; } // Function reads Order and Dependency files // Can throw own Exceptions public void readOrderAndDependencyFiles(){ fileOrders = new FileOrders(orderFile); fileDependencies = new FileDependencies(dependencyFile); if (fileOrders != null && fileDependencies != null){ orderMap = fileOrders.readData(); dependencies = fileDependencies.readData(); TrieTree.DEPENDENCY_SIZE = findOrderSize(); } } public int findOrderSize(){ int maxOrder = 0; for (Map.Entry<Integer,Orders> entry : orderMap.entrySet()) { maxOrder = Math.max(maxOrder,entry.getKey()); } return maxOrder + 1; } public void makeDependencyTree(){ if (orderMap == null || dependencies == null) return; trieTree = new TrieTree(); // Sort orderMap TreeMap<Integer,Orders> sortedOrders = new TreeMap<>(orderMap); for (Map.Entry<Integer,Orders> entry :sortedOrders.entrySet()) { if (dependencies.getDependencies(entry.getValue().getId()) != null) { for (int depend : dependencies.getDependencies(entry.getValue().getId())) { trieTree.insert(entry.getKey(),depend); } } } combineOrdersAndDependencies(); formattedTree = trieTree.formatTree(); } public void combineOrdersAndDependencies(){ for (Map.Entry<Integer,Orders> entry :orderMap.entrySet()){ trieTree.combineOrdersAndDependencies(entry.getKey()); } } public void writeOAndDToFile() { try { PrintWriter writer = new PrintWriter(writeFile,"UTF-8"); writeDependencyTree(writer); writer.close(); } catch (Exception e){ e.printStackTrace(); } } private void writeDependencyTree(PrintWriter writer){ int level = 0; for (Object obj : formattedTree){ if (obj instanceof Integer){ writer.println("Id: "+obj+", Name: "+orderMap.get(obj).getName()); } else if (obj instanceof ArrayList){ if (((ArrayList) obj).size() > 0){ writer.println("Dependencies"); writeDependencyLevels((ArrayList)obj,level+1,writer); } } } } private void writeDependencyLevels(ArrayList<Object> list, int level, PrintWriter writer){ int gap = 3 * level; for (Object obj : list){ if (obj instanceof Integer) { writer.printf("%"+gap+"s"+"Id: " + obj + ", Name: " + orderMap.get(obj).getName()+"\n"," "); } else if (obj instanceof ArrayList){ if (((ArrayList) obj).size() > 0) writer.printf("%"+gap+"s"+"Dependencies\n"," "); writeDependencyLevels((ArrayList)obj,level+1,writer); } } } }
[ "jyoon339@gatech.edu" ]
jyoon339@gatech.edu
a80f8abfef8391136520e5a746520a9566a52a95
f36d24bb0021581d778ab6f6bf158df4cffe59a1
/src/main/java/tool/flyers/Flyers.java
9b9b1ae7a3192ca8570d2c52fb4ad77a2a37f00c
[]
no_license
laborercode/flyers
faf48508c670303b6a301669df98e2bf765efeb7
5d1c143039ed7ac9e042153186511cca933b709d
refs/heads/master
2021-01-09T20:33:24.836131
2016-08-15T04:33:51
2016-08-15T04:33:51
63,409,934
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
package tool.flyers; import java.util.ArrayList; import java.util.List; import java.util.Map; import de.neuland.jade4j.Jade4J; import tool.flyers.model.ExcelReader; import tool.flyers.model.ItemGenerator; import tool.flyers.model.ModelBuilder; import tool.flyers.model.ModelReader; public class Flyers { public static void main(String[] args) { OptionParser optionParser = new OptionParser(); FlyersContext context = optionParser.parse(args); ItemGenerator generator = new ItemGenerator("Item"); // read Items from resource ModelBuilder builder = new ModelBuilder(); ModelReader reader = new ExcelReader(); List<Object> items = new ArrayList<Object>(); for(String field : reader.names()) { generator.addField(field); } try { for(String[] valueArr : reader.values()) { Object obj = generator.newInstance(valueArr); items.add(obj); } builder.add("items", items); Map<String, Object> model = builder.build(); // render String htmlStr = Jade4J.render(context.getJadeFileName(), model); HtmlWriter writer = new HtmlWriter(context.getBaseDir(), context.getHtmlFileName()); writer.write(htmlStr); } catch (Exception e) { e.printStackTrace(); } } }
[ "laborercode@naver.com" ]
laborercode@naver.com
658845f936c2b19b25ede7a58fbdfc9ba3287428
fc6c869ee0228497e41bf357e2803713cdaed63e
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/appbrand/n/f.java
210416bf363405399996f2d24fb14b7c4b78c25d
[]
no_license
hyb1234hi/reverse-wechat
cbd26658a667b0c498d2a26a403f93dbeb270b72
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
refs/heads/master
2020-09-26T10:12:47.484174
2017-11-16T06:54:20
2017-11-16T06:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,901
java
package com.tencent.mm.plugin.appbrand.n; import com.tencent.gmtrace.GMTrace; public final class f { /* Error */ public static <T> T a(Class<?> paramClass, String paramString, Object paramObject, Class<?>[] paramArrayOfClass, Object[] paramArrayOfObject, T paramT) { // Byte code: // 0: ldc2_w 9 // 3: ldc 11 // 5: invokestatic 17 com/tencent/gmtrace/GMTrace:i (JI)V // 8: aload_2 // 9: ifnonnull +13 -> 22 // 12: new 19 java/lang/IllegalArgumentException // 15: dup // 16: ldc 21 // 18: invokespecial 25 java/lang/IllegalArgumentException:<init> (Ljava/lang/String;)V // 21: athrow // 22: aload_2 // 23: invokevirtual 29 java/lang/Object:getClass ()Ljava/lang/Class; // 26: astore 6 // 28: aconst_null // 29: astore 7 // 31: aload 6 // 33: ifnull +70 -> 103 // 36: aload 6 // 38: aload_1 // 39: aload_3 // 40: invokevirtual 35 java/lang/Class:getDeclaredMethod (Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; // 43: astore 8 // 45: aload 6 // 47: invokevirtual 38 java/lang/Class:getSuperclass ()Ljava/lang/Class; // 50: astore 6 // 52: aload 8 // 54: astore 7 // 56: goto -25 -> 31 // 59: astore 8 // 61: aload 7 // 63: astore 8 // 65: aload_0 // 66: aload 6 // 68: if_acmpne +12 -> 80 // 71: aload 6 // 73: aload_1 // 74: aload_3 // 75: invokevirtual 35 java/lang/Class:getDeclaredMethod (Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; // 78: astore 8 // 80: aload 6 // 82: invokevirtual 38 java/lang/Class:getSuperclass ()Ljava/lang/Class; // 85: astore 6 // 87: aload 8 // 89: astore 7 // 91: goto -60 -> 31 // 94: astore_0 // 95: aload 6 // 97: invokevirtual 38 java/lang/Class:getSuperclass ()Ljava/lang/Class; // 100: pop // 101: aload_0 // 102: athrow // 103: aload 7 // 105: ifnonnull +14 -> 119 // 108: ldc2_w 9 // 111: ldc 11 // 113: invokestatic 41 com/tencent/gmtrace/GMTrace:o (JI)V // 116: aload 5 // 118: areturn // 119: aload 7 // 121: iconst_1 // 122: invokevirtual 47 java/lang/reflect/Method:setAccessible (Z)V // 125: aload 7 // 127: aload_2 // 128: aload 4 // 130: invokevirtual 51 java/lang/reflect/Method:invoke (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; // 133: astore_0 // 134: ldc2_w 9 // 137: ldc 11 // 139: invokestatic 41 com/tencent/gmtrace/GMTrace:o (JI)V // 142: aload_0 // 143: areturn // 144: astore_0 // 145: ldc 53 // 147: aload_0 // 148: ldc 55 // 150: iconst_0 // 151: anewarray 4 java/lang/Object // 154: invokestatic 61 com/tencent/mm/sdk/platformtools/w:printErrStackTrace (Ljava/lang/String;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Object;)V // 157: ldc2_w 9 // 160: ldc 11 // 162: invokestatic 41 com/tencent/gmtrace/GMTrace:o (JI)V // 165: aload 5 // 167: areturn // 168: astore 8 // 170: aload 7 // 172: astore 8 // 174: goto -94 -> 80 // Local variable table: // start length slot name signature // 0 177 0 paramClass Class<?> // 0 177 1 paramString String // 0 177 2 paramObject Object // 0 177 3 paramArrayOfClass Class<?>[] // 0 177 4 paramArrayOfObject Object[] // 0 177 5 paramT T // 26 70 6 localClass Class // 29 142 7 localObject1 Object // 43 10 8 localMethod java.lang.reflect.Method // 59 1 8 localException1 Exception // 63 25 8 localObject2 Object // 168 1 8 localException2 Exception // 172 1 8 localObject3 Object // Exception table: // from to target type // 36 45 59 java/lang/Exception // 36 45 94 finally // 71 80 94 finally // 119 134 144 java/lang/Exception // 71 80 168 java/lang/Exception } public static <T> T a(String paramString, Object paramObject, Class<?>[] paramArrayOfClass, Object[] paramArrayOfObject, T paramT) { GMTrace.i(20015218688000L, 149125); paramString = a(null, paramString, paramObject, paramArrayOfClass, paramArrayOfObject, paramT); GMTrace.o(20015218688000L, 149125); return paramString; } public static <T> T e(String paramString, Object paramObject, T paramT) { GMTrace.i(20015352905728L, 149126); paramString = a(null, paramString, paramObject, null, null, paramT); GMTrace.o(20015352905728L, 149126); return paramString; } } /* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\appbrand\n\f.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "robert0825@gmail.com" ]
robert0825@gmail.com
755e85d485c23c744446719c6c3af6235bb863d9
6416c83a026af7f9638df8b0e0ff517381f9da8b
/src/main/java/com/ts/service/pdss/pdss/ias/IAntiDrugExcessAuthorizationCheck.java
80924254b122867012bfa8bee50aee24f40cbcd9
[ "Apache-2.0" ]
permissive
ljcservice/autumnprogram
9e57b2052f6985c35ae8f55d9eee70a57bd6f2e1
37fecc185dafa71e2bf8afbae6e455fc9533a7c5
refs/heads/master
2022-12-22T22:03:49.586001
2019-10-28T16:11:39
2019-10-28T16:11:39
81,171,791
5
1
Apache-2.0
2022-12-16T07:40:31
2017-02-07T05:52:53
JavaScript
UTF-8
Java
false
false
406
java
package com.ts.service.pdss.pdss.ias; import com.hitzd.his.Beans.TPatOrderDrug; import com.hitzd.his.Beans.TPatientOrder; import com.ts.entity.pdss.pdss.RSBeans.ias.TAntiDrugRslt; /** * 超授权使用抗菌药物监测与提示 * @author Administrator * */ public interface IAntiDrugExcessAuthorizationCheck { public TAntiDrugRslt Checker(TPatientOrder po ,TPatOrderDrug poDrug); }
[ "autumn@HLJ-LIUJINGCONG.ebaonet.corp" ]
autumn@HLJ-LIUJINGCONG.ebaonet.corp
a330eeca2b9256d82470b06d7bd0f55efe67861a
8b5ba97387f56da7c3fcb65baff4bc3914ac7fbd
/src/scctp1/AnimalMorreuException.java
0fbc82a55df3464fe5692f12446998f3abf9e389
[]
no_license
migueldiogo/wild-simulator
51b68552351f5e061e05259a9b547e64c7d89702
668383d7c38a888ad4a9453be19fe174e034d76d
refs/heads/master
2021-06-01T05:45:17.736904
2015-03-01T12:32:26
2015-03-01T12:32:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
697
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package scctp1; /** * * @author MiguelDiogo */ public class AnimalMorreuException extends Exception { /** * Creates a new instance of <code>AnimalMorreuException</code> without * detail message. */ public AnimalMorreuException() { } /** * Constructs an instance of <code>AnimalMorreuException</code> with the * specified detail message. * * @param msg the detail message. */ public AnimalMorreuException(String msg) { super(msg); } }
[ "mdiogo@student.dei.uc.pt" ]
mdiogo@student.dei.uc.pt
4212c9b5a3f5b5643ecce17ee478a476b821ea29
3d55d44eba7405a10d8318c1e0a8862e94262162
/JavaCoreEpam/src/main/java/city/dto/CityDto.java
d64a61913b6ae6838626314f70368aabe3fbed58
[]
no_license
cantoress/JavaCoreEpam
d22a6411f1e19f5c57d6d7efbc5d803dcc5c48c1
d2d2cb2474c73128a8f1048703b65577fc1269d3
refs/heads/master
2020-05-09T20:49:07.974865
2019-04-15T06:00:50
2019-04-15T06:00:50
181,380,086
0
0
null
null
null
null
UTF-8
Java
false
false
1,447
java
package city.dto; import common.business.dto.BaseDto; public class CityDto extends BaseDto<Long> { protected Long countryId; protected String name; protected int population; protected boolean isCapital; public CityDto() { } public CityDto(Long countryId, String name, int population, boolean isCapital) { this.countryId = countryId; this.name = name; this.population = population; this.isCapital = isCapital; } public Long getCountryId() { return countryId; } public void setCountryId(Long countryId) { this.countryId = countryId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getPopulation() { return population; } public void setPopulation(int population) { this.population = population; } public boolean isCapital() { return isCapital; } public void setCapital(boolean capital) { isCapital = capital; } @Override public String toString() { return "City{" + "countryId=" + countryId + ", name='" + name + '\'' + ", population=" + population + ", isCapital=" + isCapital + ", id=" + id + '}'; } }
[ "noreply@github.com" ]
noreply@github.com
1909160621b323f107c47eb586307ab64831f4bf
9173e64a45a29d2fbb5459caafdf5694005fa4e8
/AndroidStudioProjects/Yixiaotong/app/src/main/java/com/zhexinit/yixiaotong/rxjavamanager/entity/resp/DownloadResponseBody.java
8cf04f271dfda540decf20ba023ce3c218383350
[]
no_license
waitzhou/zhou-dex
aaeb32bfe0d129ddb43480ca98001fee5e73091d
075b4212aa1ff9357d2e4407606fa483dfb25ec2
refs/heads/master
2021-01-24T12:02:27.037610
2020-04-22T08:04:15
2020-04-22T08:04:15
57,349,294
0
0
null
null
null
null
UTF-8
Java
false
false
1,944
java
package com.zhexinit.yixiaotong.rxjavamanager.entity.resp; import com.zhexinit.yixiaotong.rxjavamanager.interfaces.DownloadListener; import java.io.IOException; import okhttp3.MediaType; import okhttp3.ResponseBody; import okio.Buffer; import okio.BufferedSource; import okio.ForwardingSource; import okio.Okio; import okio.Source; /** * Author:@zhousx * date: 2018/2/24/14:27. * function :自定义下载体 暂时不支持断点续传 */ public class DownloadResponseBody extends ResponseBody { private ResponseBody responseBody; private DownloadListener progressListener; private BufferedSource bufferedSource; public DownloadResponseBody(ResponseBody responseBody, DownloadListener progressListener) { this.responseBody = responseBody; this.progressListener = progressListener; } @Override public MediaType contentType() { return responseBody.contentType(); } @Override public long contentLength() { return responseBody.contentLength(); } @Override public BufferedSource source() { if (bufferedSource == null) { bufferedSource = Okio.buffer(source(responseBody.source())); } return bufferedSource; } private Source source(Source source) { return new ForwardingSource(source) { long totalBytesRead = 0L; @Override public long read(Buffer sink, long byteCount) throws IOException { long bytesRead = super.read(sink, byteCount); // read() returns the number of bytes read, or -1 if this source is exhausted. totalBytesRead += bytesRead != -1 ? bytesRead : 0; if (null != progressListener) { progressListener.inProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); } return bytesRead; } }; } }
[ "1085714069@qq.com" ]
1085714069@qq.com
aaef3862309d464530305ed07393e54daa56db68
85ff70060ed4ac98610d9dca01449b457ccca29c
/app/src/main/java/com/example/android/Rifyandaru_1202150088_MODUL6/model/PhotoModel.java
f4310caf60448ae3fa269dd9894f4f0ef9b14e00
[]
no_license
RifyandaruWibisono/Rifyandaru_1202150088_MODUL6
0ee298f4defa512e85caa9555410c629e013bb42
7d0829a01023274f2fe6e94385f55d76c61de050
refs/heads/master
2020-03-07T18:43:31.455066
2018-04-01T16:33:57
2018-04-01T16:33:57
127,649,786
0
0
null
null
null
null
UTF-8
Java
false
false
1,709
java
package com.example.android.Rifyandaru_1202150088_MODUL6.model; import java.io.Serializable; //Class model untuk Menerima output dari json Photo di firebase //implements Serializable berfungsi supaya model dapat di passing menggunakan putExtra public class PhotoModel implements Serializable { //Deklarasi variable public String key; public String image_url; public String title; public String desc; public String name; public String email; //konstruktor kosong *diperlukan oleh firebase public PhotoModel() { } //konstruktor public PhotoModel(String key, String image_url, String title, String desc, String name, String email) { this.key = key; this.image_url = image_url; this.title = title; this.desc = desc; this.name = name; this.email = email; } //getter setter semua variable public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getImage_url() { return image_url; } public void setImage_url(String image_url) { this.image_url = image_url; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
[ "rifyandaru@gmail.com" ]
rifyandaru@gmail.com
e79cc0522eb44a3f9e5e29792a07ad1a46f5dfd5
2293c174797e34497342c968fc4273c1dc207076
/src/sneat/experiments/skrimish/Agent.java
068c0adb7f63d6d406e27a9b096f1231779e5cef
[]
no_license
dhonza/ne
260856a4b16c0568d1100f5b2096e51ad5b5c2eb
0c70eff4962b3c089f9264e226988665b6cd4ca6
refs/heads/master
2020-05-31T06:05:01.071727
2014-07-24T11:15:44
2014-07-24T11:15:44
5,673,351
0
1
null
null
null
null
UTF-8
Java
false
false
1,265
java
package sneat.experiments.skrimish; import sneat.neuralnetwork.INetwork; public abstract class Agent extends Drawable { public float heading; public float radius = 125; public int hitpoints = 1; public Agent() { super(); // color = System.Drawing.Brushes.Blue; heading = 0; } public Agent(float x, float y, float w, float h) { super(x, y, w, h); // color = System.Drawing.Brushes.Blue; heading = (float) (3 * Math.PI / 2.0); } public Agent(float x, float y, float w, float h, INetwork n) { super(x, y, w, h); // color = System.Drawing.Brushes.Black; heading = (float) (3 * Math.PI / 2.0); } public void turn(float radians) { heading += radians; //keep the heading between 0 and 2PI if (heading >= Utilities.twoPi) heading -= Utilities.twoPi; if (heading < 0) heading += Utilities.twoPi; } public void move(float speed) { x += speed * (float) Math.cos(heading); y += speed * (float) Math.sin(heading); } public boolean isActionable(Agent a) { return Utilities.Distance(a, this) < radius; } }
[ "drchaj1@drchal.(none)" ]
drchaj1@drchal.(none)
0617f90dbb726339ecb631f32d79b1650410e7b3
d36967d15a03945a1fe784bc512abe562ff89c6a
/src/trace/ot/OTListEditRemoteCountIncremented.java
be55838644a5b9ccb56d7a58089fa1dc68b52861
[]
no_license
pdewan/ColabTeaching
31f9739657b7a9764649f96e277432ca4e1e30e8
cb6e835cb2ce0e784de4d5abe9d7181862e36b45
refs/heads/master
2020-03-30T00:42:14.307357
2015-07-22T08:11:57
2015-07-22T08:11:57
23,260,341
0
1
null
null
null
null
UTF-8
Java
false
false
3,214
java
package trace.ot; import trace.echo.ListEditInfo; import trace.echo.modular.OperationName; public class OTListEditRemoteCountIncremented extends OTListEditInfo{ public OTListEditRemoteCountIncremented(String aMessage, String aLocatable, ListEditInfo aListEdit, UserOTTimeStampInfo anOTTimeStamp, Object aFinder) { super(aMessage, aLocatable, aListEdit, anOTTimeStamp, aFinder); } public OTListEditRemoteCountIncremented(String aMessage, OTListEditInfo aSuperClassInfo) { super(aMessage, aSuperClassInfo); } public static OTListEditRemoteCountIncremented toTraceable(String aMessage) { OTListEditInfo aSuperClassInfo = OTListEditInfo.toTraceable(aMessage); return new OTListEditRemoteCountIncremented(aMessage, aSuperClassInfo); } // public static String toString (String aLocatable, ListEditInfo aListEdit, UserOTTimeStampInfo anOTTimeStamp) { // return "@" + aLocatable + UserOTTimeStampedListEditInfo.toString(aListEdit, anOTTimeStamp); // } public static OTListEditRemoteCountIncremented newCase(String aLocatable, ListEditInfo aListEdit, UserOTTimeStampInfo anOTTimeStamp/*, String aSourceOrDestination*/, Object aFinder) { String aMessage = toString(aLocatable, aListEdit, anOTTimeStamp); OTListEditRemoteCountIncremented retVal = new OTListEditRemoteCountIncremented(aMessage, aLocatable, aListEdit, anOTTimeStamp, aFinder); retVal.announce(); return retVal; } public static OTListEditRemoteCountIncremented newCase(String aLocatable, ListEditInfo aListEdit, OTTimeStampInfo anOTTimeStamp/*, String aSourceOrDestination*/, String aUserName, /*boolean anInServer,*/ Object aFinder) { UserOTTimeStampInfo userOTTimeStampInfo = new UserOTTimeStampInfo(aLocatable, aUserName, anOTTimeStamp, null); return newCase(aLocatable, aListEdit, userOTTimeStampInfo, aFinder); } public static OTListEditRemoteCountIncremented newCase(String aLocatable, OperationName aName, int anIndex, Object anElement, int aLocalCount, int aRemoteCount, String aUserName, /*boolean anInServer,*/ Object aFinder) { ListEditInfo aListEditInfo = new ListEditInfo(aName, anIndex, null, anElement); OTTimeStampInfo anOTTimeStampInfo = new OTTimeStampInfo(aLocalCount, aRemoteCount); return newCase(aLocatable, aListEditInfo, anOTTimeStampInfo, aUserName, /*anInServer,*/ aFinder); } // public static UserOTTimeStampedListEditSent newCase(/*String aLocatable,*/ // ListEditInfo aListEdit, UserOTTimeStampInfo anOTTimeStamp, String aSourceOrDestination, // Object aFinder) { // String aMessage = toString(aListEdit, anOTTimeStamp); // UserOTTimeStampedListEditSent retVal = new UserOTTimeStampedListEditSent(aMessage/*, aLocatable*/, aListEdit, anOTTimeStamp, aFinder); // retVal.announce(); // return retVal; // } // public static UserOTTimeStampedListEditSent newCase(/*String aLocatable,*/ // UserOTTimeStampedListEditInfo otTimeStampedListEditInfo, String aSourceOrDestination, // Object aFinder) { // return newCase(/*aLocatable,*/ otTimeStampedListEditInfo.getListEdit(), otTimeStampedListEditInfo.getOTTimeStamp(), aSourceOrDestination, aFinder); // } }
[ "dewan@cs.unc.edu" ]
dewan@cs.unc.edu
c7d0f04e188d09ae61ec43762970d42ff21c6440
4900b7d1344188aae12c12ee26559139988843b1
/src/servlet/ApproveServlet.java
3f3ae6414a9d1acfb971bdefddd43a99ab113b85
[]
no_license
RoastEgg/HostelWorld
755f84c6344563e13c76d71ae5d711fd57ba950b
36b9dcf3e8bb6f4f218e60e024d91a3efe601d83
refs/heads/master
2021-01-21T20:43:18.019531
2017-12-10T14:26:55
2017-12-10T14:26:55
94,676,294
0
0
null
null
null
null
UTF-8
Java
false
false
2,194
java
package servlet; import java.io.IOException; import java.util.List; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import dao.AccommodationDao; import dao.HostelDao; import dao.ReserveDao; import dao.RoomDao; import daoImpl.AccommodationDaoImpl; import daoImpl.HostelDaoImpl; import daoImpl.ReserveDaoImpl; import daoImpl.RoomDaoImpl; import model.Accommodation; import model.Hostel; import model.Reserve; import model.Room; @WebServlet("/ApproveServlet") public class ApproveServlet extends HttpServlet{ /** * */ private static final long serialVersionUID = 1L; public ReserveDao reserve = new ReserveDaoImpl(); public AccommodationDao accommodation = new AccommodationDaoImpl(); public HostelDao hostel = new HostelDaoImpl(); public RoomDao room = new RoomDaoImpl(); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletContext context = request.getServletContext(); List<Reserve> reserveList = reserve.getForCEO(); List<Accommodation> accommodationList = accommodation.getForCEO(); List<Hostel> applyList = hostel.getForCEO(); List<Room> roomList = room.getForCEO(); request.getSession().setAttribute("CEOReserve", reserveList); request.getSession().setAttribute("CEOAccommodation", accommodationList); request.getSession().setAttribute("CEOHostelApply", applyList); request.getSession().setAttribute("CEORoomApply", roomList); context.getRequestDispatcher("/hostel/CEO.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String type = request.getParameter("type"); if (type.equals("hostelApply")){ hostel.approve(); } else{ room.approve(); } request.getServletContext().getRequestDispatcher("/hostel/approveSuccess.jsp").forward(request, response); } }
[ "hzluhailong@163.com" ]
hzluhailong@163.com
306ee918ea0b5cc4be50b7a80509f175ed3ab24e
0baf57260f156c53c2ca7d6a6d3e0b3d8a14e9f1
/src/main/java/com/scs/project/tool/job/service/JobLogServiceImpl.java
dd0a7f709feaf1cd1b947adbd240217274aa2c72
[]
no_license
HYKINGDOM/mock-system
a2d09bee5c81cd32313f2c38077fa32708972852
88462623c6abf3270c4b81780651c8a0ae601896
refs/heads/master
2022-09-17T23:48:06.756211
2020-02-20T03:20:23
2020-02-20T03:20:23
232,827,313
0
0
null
2022-09-01T23:18:47
2020-01-09T14:25:59
Java
UTF-8
Java
false
false
1,892
java
package com.scs.project.tool.job.service; import com.scs.common.core.text.Convert; import com.scs.project.tool.job.domain.JobLog; import com.scs.project.tool.job.mapper.JobLogMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 定时任务调度日志信息 服务层 * * @author yihur */ @Service public class JobLogServiceImpl implements IJobLogService { @Autowired private JobLogMapper jobLogMapper; /** * 获取quartz调度器日志的计划任务 * * @param jobLog 调度日志信息 * @return 调度任务日志集合 */ @Override public List<JobLog> selectJobLogList(JobLog jobLog) { return jobLogMapper.selectJobLogList(jobLog); } /** * 通过调度任务日志ID查询调度信息 * * @param jobLogId 调度任务日志ID * @return 调度任务日志对象信息 */ @Override public JobLog selectJobLogById(Long jobLogId) { return jobLogMapper.selectJobLogById(jobLogId); } /** * 新增任务日志 * * @param jobLog 调度日志信息 */ @Override public void addJobLog(JobLog jobLog) { jobLogMapper.insertJobLog(jobLog); } /** * 批量删除调度日志信息 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteJobLogByIds(String ids) { return jobLogMapper.deleteJobLogByIds(Convert.toStrArray(ids)); } /** * 删除任务日志 * * @param jobId 调度日志ID */ @Override public int deleteJobLogById(Long jobId) { return jobLogMapper.deleteJobLogById(jobId); } /** * 清空任务日志 */ @Override public void cleanJobLog() { jobLogMapper.cleanJobLog(); } }
[ "yihur@isoftstone.com" ]
yihur@isoftstone.com
c475d822c1b2da856317c3384bca3ef787ecf750
9766e024a5c04ee04fa9514cb8b0deba35882d78
/app/src/main/java/com/example/a12_17/moude/MainModelIImol.java
e593d574dfa53868306e5b5f3efe7f78cca86e8f
[]
no_license
960189026/12_17_2
32629c4c200035b65c6464e950c1662060e986fe
ca2d87205bb692ca607cfe22a9aafdb221bf7359
refs/heads/master
2023-02-02T01:23:44.251244
2020-12-17T16:51:44
2020-12-17T16:51:44
322,356,860
1
0
null
null
null
null
UTF-8
Java
false
false
598
java
package com.example.a12_17.moude; import com.example.a12_17.contract.MainContract; import com.example.a12_17.view.INetCallBack; import com.example.a12_17.view.RetrofitUtils; public class MainModelIImol implements MainContract.IMainModel { private MainContract.IMainPresenter presenter; public MainModelIImol(MainContract.IMainPresenter presenter) { this.presenter = presenter; } @Override public <T> void getLoginData(String url, INetCallBack<T> callBack) { presenter.loginResult("成功"); RetrofitUtils.getInstance().get(url,callBack); } }
[ "She@example.com" ]
She@example.com
0c9994f722f5c10f3f4352e932de74e98389b865
ebf0620542f2f9d659fd2827a40f76ce935b5db1
/src/lite/sfa/test/InfoClient.java
fb3867722d93baa9026a7e578f9fa1e1bf8eaf2d
[]
no_license
florin-b/LSFTST_
3d929dbe0ea1ad85efd741bedf9d2d714b9d7cee
5b070c65be5f8c67941a131bb0ad3186d1296832
refs/heads/master
2021-08-10T17:33:09.976715
2021-06-25T05:50:34
2021-06-25T05:50:34
168,500,262
0
0
null
null
null
null
UTF-8
Java
false
false
17,445
java
/** * @author florinb * */ package lite.sfa.test; import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import utils.UtilsUser; import beans.BeanAdresaLivrare; import beans.BeanClient; import listeners.AsyncTaskListener; import model.HandleJSONData; import model.UserInfo; import lite.sfa.test.R; import android.app.ActionBar; import android.app.ActionBar.LayoutParams; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.AdapterView; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; public class InfoClient extends Activity implements AsyncTaskListener { Button clientBtn; String filiala = "", nume = "", cod = ""; String clientResponse = ""; String codClient = ""; String numeClient = ""; String depart = ""; String codClientVar = ""; String numeClientVar = ""; ListView listViewClienti, listViewInfo_1; ArrayList<HashMap<String, String>> arrayInfo_1 = null; SimpleAdapter adapterUserInfo_1; private EditText txtNumeClient; private TextView textNumeClient, textCodClient; private NumberFormat nf2; int selectedInfoOption = 0; private static ArrayList<HashMap<String, String>> listClienti = null; public SimpleAdapter adapterClienti; private HashMap<String, String> artMap = null; private LinearLayout head_container, list_container; private Dialog optionsInfoDialog; String[] judete = { "ALBA", "ARAD", "ARGES", "BACAU", "BIHOR", "BISTRITA-NASAUD", "BOTOSANI", "BRAILA", "BRASOV", "BUCURESTI", "BUZAU", "CALARASI", "CARAS-SEVERIN", "CLUJ", "CONSTANTA", "COVASNA", "DAMBOVITA", "DOLJ", "GALATI", "GIURGIU", "GORJ", "HARGHITA", "HUNEDOARA", "IALOMITA", "IASI", "ILFOV", "MARAMURES", "MEHEDINTI", "MURES", "NEAMT", "OLT", "PRAHOVA", "SALAJ", "SATU-MARE", "SIBIU", "SUCEAVA", "TELEORMAN", "TIMIS", "TULCEA", "VALCEA", "VASLUI", "VRANCEA" }; String[] codJudete = { "01", "02", "03", "04", "05", "06", "07", "09", "08", "40", "10", "51", "11", "12", "13", "14", "15", "16", "17", "52", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "31", "30", "32", "33", "34", "35", "36", "38", "37", "39" }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this)); setTheme(R.style.LRTheme); setContentView(R.layout.infoclient_container); View vHeader = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_cautaclient, null, false); vHeader.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); head_container = (LinearLayout) findViewById(R.id.headerContainer); head_container.addView(vHeader); View vLista = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_listaclienti, null, false); vLista.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); list_container = (LinearLayout) findViewById(R.id.detailsContainer); list_container.addView(vLista); ActionBar actionBar = getActionBar(); actionBar.setTitle("Informatii client"); actionBar.setDisplayHomeAsUpEnabled(true); createObjCautaClient(); nf2 = NumberFormat.getInstance(); nf2.setMinimumFractionDigits(2); nf2.setMaximumFractionDigits(2); } private void createObjCautaClient() { this.clientBtn = (Button) findViewById(R.id.clientBtn); addListenerClient(); txtNumeClient = (EditText) findViewById(R.id.txtNumeClient); txtNumeClient.setHint("Introduceti nume client"); txtNumeClient.requestFocus(); InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(txtNumeClient, InputMethodManager.SHOW_IMPLICIT); listViewClienti = (ListView) findViewById(R.id.listVClienti); listClienti = new ArrayList<HashMap<String, String>>(); adapterClienti = new SimpleAdapter(this, listClienti, R.layout.customrownumeclient, new String[] { "numeClient", "codClient" }, new int[] { R.id.textNumeClient, R.id.textCodClient }); listViewClienti.setAdapter(adapterClienti); addListenerListClienti(); } private void createObjAfisClientInfo() { textNumeClient = (TextView) findViewById(R.id.textNumeClient); textCodClient = (TextView) findViewById(R.id.textCodClient); textNumeClient.setText(numeClient); textCodClient.setText(codClient); } private void CreateMenu(Menu menu) { MenuItem mnu1 = menu.add(0, 0, 0, "Client"); mnu1.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); MenuItem mnu2 = menu.add(0, 1, 1, "Info"); mnu2.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); CreateMenu(menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case 0: numeClient = ""; codClient = ""; head_container.removeAllViews(); list_container.removeAllViews(); View vHeader = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_cautaclient, null, false); vHeader.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); head_container.addView(vHeader); View vLista = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_listaclienti, null, false); vLista.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); list_container.addView(vLista); createObjCautaClient(); return true; case 1: if (numeClient.equals("")) { Toast.makeText(getApplicationContext(), "Selectati un client!", Toast.LENGTH_SHORT).show(); return true; } String[] options = { "Pondere art. B ultimele 30 zile", "Adrese, contacte", "Credit" }; optionsInfoDialog = new Dialog(InfoClient.this); optionsInfoDialog.setContentView(R.layout.infoclient_optionsdialog); optionsInfoDialog.setTitle("Selectati o optiune:"); Spinner spinnerSelInfo = (Spinner) optionsInfoDialog.findViewById(R.id.spinnerOptionsInfo); ArrayList<HashMap<String, String>> listInfo = new ArrayList<HashMap<String, String>>(); SimpleAdapter adapterOptions = new SimpleAdapter(this, listInfo, R.layout.customrowselinterval, new String[] { "optInterval" }, new int[] { R.id.textTipInterval }); HashMap<String, String> temp; for (int ii = 0; ii < options.length; ii++) { temp = new HashMap<String, String>(10, 0.75f); temp.put("optInterval", options[ii]); listInfo.add(temp); } spinnerSelInfo.setAdapter(adapterOptions); spinnerSelInfo.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { selectedInfoOption = pos; } public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }); Button btnOkInfo = (Button) optionsInfoDialog.findViewById(R.id.btnOkInfo); btnOkInfo.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { optionsInfoDialog.dismiss(); afisClientInfo(); } }); optionsInfoDialog.show(); return true; case android.R.id.home: UserInfo.getInstance().setParentScreen(""); Intent nextScreen = new Intent(getApplicationContext(), MainMenu.class); startActivity(nextScreen); finish(); return true; default: return super.onOptionsItemSelected(item); } } private void afisClientInfo() { try { HashMap<String, String> params = new HashMap<String, String>(); params.put("codClient", codClient); params.put("filiala", UserInfo.getInstance().getUnitLog()); params.put("depart", UserInfo.getInstance().getCodDepart()); params.put("tipInfo", String.valueOf(selectedInfoOption)); AsyncTaskWSCall call = new AsyncTaskWSCall(this, "getClientInfo", params); call.getCallResults(); } catch (Exception e) { Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show(); } } @SuppressWarnings("unchecked") private void fillClientInfo(String clientInfo) { if (!clientInfo.trim().equals("")) { View vLista = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_list1, null, false); vLista.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); if (list_container.getChildCount() == 0) { list_container.addView(vLista); listViewInfo_1 = (ListView) findViewById(R.id.listInfoClient_1); arrayInfo_1 = new ArrayList<HashMap<String, String>>(); adapterUserInfo_1 = new SimpleAdapter(this, arrayInfo_1, R.layout.infoclient_1_rowlayout, new String[] { "textLinie1", "textLinie2" }, new int[] { R.id.textLinie1, R.id.textLinie2 }); arrayInfo_1.clear(); } if (selectedInfoOption == 0) // pondere B 30 zile { // ***** elimiare existente int ii = 0; for (ii = 0; ii < arrayInfo_1.size(); ii++) { artMap = (HashMap<String, String>) adapterUserInfo_1.getItem(ii); if (artMap.get("textLinie1").contains("Pondere")) { arrayInfo_1.remove(ii); ii--; } listViewInfo_1.setAdapter(adapterUserInfo_1); adapterUserInfo_1.notifyDataSetChanged(); }// sf. for // ***** sf. eliminare HashMap<String, String> temp; temp = new HashMap<String, String>(1, 0.75f); temp.put("textLinie1", "Pondere art. B in ultimele 30 zile: "); temp.put("textLinie2", clientInfo + "% "); arrayInfo_1.add(temp); listViewInfo_1.setAdapter(adapterUserInfo_1); } if (selectedInfoOption == 1) // adrese de livrare { // ***** eliminare existente int ii = 0; for (ii = 0; ii < arrayInfo_1.size(); ii++) { artMap = (HashMap<String, String>) adapterUserInfo_1.getItem(ii); if (artMap.get("textLinie1").contains("Adresa")) { arrayInfo_1.remove(ii); ii--; } listViewInfo_1.setAdapter(adapterUserInfo_1); adapterUserInfo_1.notifyDataSetChanged(); }// sf. for // ***** sf. eliminare HandleJSONData objClientList = new HandleJSONData(this, clientInfo); ArrayList<BeanAdresaLivrare> adresaArray = objClientList.decodeJSONAdresaLivrare(); HashMap<String, String> temp; String strAdresa = ""; for (int i = 0; i < adresaArray.size(); i++) { temp = new HashMap<String, String>(10, 0.75f); strAdresa = getNumeJudet(adresaArray.get(i).getCodJudet()) + "; " + adresaArray.get(i).getOras() + "; " + adresaArray.get(i).getStrada() + "; " + adresaArray.get(i).getNrStrada() + ";"; temp.put("textLinie1", "Adresa " + String.valueOf(i + 1) + ":"); temp.put("textLinie2", strAdresa); arrayInfo_1.add(temp); } listViewInfo_1.setAdapter(adapterUserInfo_1); /* * // pers. contact if (tokenLinie.length - 1 == i) { oAdresa = * tokenLinie[i]; tokenAdresa = oAdresa.split("#"); * * if (!tokenAdresa[0].trim().equals("")) { strAdresa = * tokenAdresa[0]; * * if (!tokenAdresa[1].trim().equals("")) { strAdresa += * ", tel: " + tokenAdresa[1]; } * * temp = new HashMap<String, String>(1, 0.75f); * temp.put("textLinie1", "Pers. contact: "); * temp.put("textLinie2", strAdresa); arrayInfo_1.add(temp); * listViewInfo_1.setAdapter(adapterUserInfo_1); } } */ }// sf. adr. livrare if (selectedInfoOption == 2) // credit { // ***** eliminare existente int ii = 0; for (ii = 0; ii < arrayInfo_1.size(); ii++) { artMap = (HashMap<String, String>) adapterUserInfo_1.getItem(ii); if (artMap.get("textLinie1").contains("Limita")) { arrayInfo_1.remove(ii); ii--; } if (artMap.get("textLinie1").contains("Rest")) { arrayInfo_1.remove(ii); ii--; } listViewInfo_1.setAdapter(adapterUserInfo_1); adapterUserInfo_1.notifyDataSetChanged(); }// sf. for // ***** sf. eliminare HashMap<String, String> temp; String[] tokenCredit = clientInfo.split("#"); NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(2); nf.setMaximumFractionDigits(2); temp = new HashMap<String, String>(); temp.put("textLinie1", "Limita credit: "); temp.put("textLinie2", nf.format(Double.parseDouble(tokenCredit[0])) + " RON"); arrayInfo_1.add(temp); temp = new HashMap<String, String>(); temp.put("textLinie1", "Rest credit: "); temp.put("textLinie2", nf.format(Double.parseDouble(tokenCredit[1])) + " RON"); arrayInfo_1.add(temp); listViewInfo_1.setAdapter(adapterUserInfo_1); } } } private String getNumeJudet(String codJudet) { String numeJudet = "nedefinit"; int i = 0; for (i = 0; i < codJudete.length; i++) { if (codJudet.equals(codJudete[i])) { numeJudet = judete[i]; break; } } return numeJudet; } @SuppressWarnings("unchecked") public void addListenerListClienti() { listViewClienti.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { artMap = (HashMap<String, String>) adapterClienti.getItem(position); numeClient = artMap.get("numeClient"); codClient = artMap.get("codClient"); head_container.removeAllViews(); list_container.removeAllViews(); View vHeader = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.infoclient_selectedclient, null, false); vHeader.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); head_container.addView(vHeader); createObjAfisClientInfo(); } }); } public void populateListViewClient(String clientResponse) { HandleJSONData objClientList = new HandleJSONData(this, clientResponse); ArrayList<BeanClient> clientArray = objClientList.decodeJSONClientList(); if (clientArray.size() > 0) { HashMap<String, String> temp; for (int i = 0; i < clientArray.size(); i++) { temp = new HashMap<String, String>(); temp.put("numeClient", clientArray.get(i).getNumeClient()); temp.put("codClient", clientArray.get(i).getCodClient()); listClienti.add(temp); } } else { Toast.makeText(getApplicationContext(), "Nu exista inregistrari!", Toast.LENGTH_SHORT).show(); } } public void addListenerClient() { clientBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { if (txtNumeClient.length() > 0) { performListClients(); } else { Toast.makeText(getApplicationContext(), "Introduceti nume client!", Toast.LENGTH_SHORT).show(); } } catch (Exception ex) { Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_SHORT).show(); } } }); } private void performListClients() { try { HashMap<String, String> params = new HashMap<String, String>(); String numeClient = txtNumeClient.getText().toString().trim().replace('*', '%'); String depSel = ""; depSel = UserInfo.getInstance().getCodDepart(); if (CreareComanda.canalDistrib.equals("20")) depSel = "11"; String tipUserSap = UserInfo.getInstance().getTipUserSap(); if (UtilsUser.isDV() && UserInfo.getInstance().getInitDivizie().equals("11")) tipUserSap = "SDIP"; params.put("numeClient", numeClient); params.put("depart", depSel); params.put("departAg", UserInfo.getInstance().getCodDepart()); params.put("unitLog", UserInfo.getInstance().getUnitLog()); params.put("tipUserSap", tipUserSap); AsyncTaskWSCall call = new AsyncTaskWSCall(this, "cautaClientAndroid", params); call.getCallResults(); } catch (Exception e) { Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_SHORT).show(); } } private void listClients(String clientResponse) { if (clientResponse.length() > 0) { listClienti.clear(); adapterClienti.notifyDataSetChanged(); populateListViewClient(clientResponse); listViewClienti.setAdapter(adapterClienti); InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.hideSoftInputFromWindow(txtNumeClient.getWindowToken(), 0); txtNumeClient.setText(""); } } @Override public void onBackPressed() { UserInfo.getInstance().setParentScreen(""); Intent nextScreen = new Intent(getApplicationContext(), MainMenu.class); startActivity(nextScreen); finish(); return; } public void onTaskComplete(String methodName, Object result) { if (methodName.equals("getClientInfo")) { fillClientInfo((String) result); } if (methodName.equals("cautaClientAndroid")) { listClients((String) result); } } }
[ "gflorinb@yahoo.com" ]
gflorinb@yahoo.com
9330bdb128d21be5de33fd5c45663818bed995a1
487cb41b7643c6293a42719d5116d0239aa9271c
/src/week2HW3/Student.java
2547081377f5c314d8cb97a784f277d0094949a2
[]
no_license
Kenshinoyo/Mod3HW
d99f7228cbb603ba3952478eac5122cc4d8ff997
54cef4747dd7f710bded3ca20e0a2f162a5fe4c7
refs/heads/main
2023-08-14T07:31:59.792832
2021-10-14T01:45:04
2021-10-14T01:45:04
414,403,492
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package week2HW3; import java.util.Scanner; public class Student extends Person { int studID; String studentMajor; int studentCredits; // Tracker for total students static int totalStu; Student(int sID, String fName, String lName, int age, char gender, String major, int Credits) { super(fName, lName, age, gender); studID=sID; studentMajor=major; studentCredits=Credits; totalStu++; } Student(int sID, String fName, String lName, int age, char gender, String major) { super(fName, lName, age, gender); studID=sID; studentMajor=major; totalStu++; } public static void main(String[] args) { // TODO Auto-generated method stub } }
[ "garrad.d.belle@gmail.com" ]
garrad.d.belle@gmail.com
5c0be72030d3bd0787c04ec1b23d4243c1886ca0
766ec2cb22b46dd9ff19d2a2b0a9a580e1979cc5
/semant/SemanticChecker.java
51c5b7c7ca6c5ac6c10755501431883e56ed25b9
[]
no_license
lececo/compiler-spl
3abc11fbbcdaf1e0b15850b7ca99e0c99b8c5c42
3c988792e98ce66b3c74119d9277e83916ccdd99
refs/heads/master
2020-05-17T04:01:31.065438
2019-04-25T21:37:59
2019-04-25T21:37:59
183,497,174
0
0
null
null
null
null
UTF-8
Java
false
false
1,716
java
/* Semant.java -- semantic checks */ package semant; import absyn.*; import sym.Sym; import table.*; import types.*; import varalloc.*; import java.lang.Class; import javax.management.RuntimeErrorException; /** * A SemanticChecker object defines a method "check" for semantic * analysis and symbol table construction for SPL * <br> * SemanticChecker is a singleton class * <br> * author: Michael Jäger */ public class SemanticChecker { static final Type intType = new PrimitiveType("int", VarAllocator.INTBYTESIZE); static final Type boolType = new PrimitiveType("boolean", VarAllocator.BOOLBYTESIZE); public Table check(Absyn program, boolean showTables) { TableBuilder tablebuilder = new TableBuilder(program, showTables); Table table = tablebuilder.buildSymbolTables(); checkMainProcedure(table); ProcedureBodyChecker bodyChecker = new ProcedureBodyChecker(); bodyChecker.check(program, table); return table; } static void checkClass (Object object, Class<?> expectedClass, String errorMessage, int lineNo) { checkClass(object, expectedClass, errorMessage + " in line " + lineNo); } static void checkClass (Object object, Class<?> expectedClass, String errorMessage) { if (object.getClass()!=expectedClass) throw new RuntimeException(errorMessage); } private void checkMainProcedure(Table globalTable) { Entry entry = globalTable.lookup(Sym.newSym("main")); if(entry == null){ System.err.println("Error: procedure 'main' is missing"); System.exit(1); }else if(entry instanceof ProcEntry && ((ProcEntry) entry).paramTypes.size() > 0){ System.err.println("Error: procedure 'main' must not have any parameters"); System.exit(1); } } }
[ "leon.coert@mni.thm.de" ]
leon.coert@mni.thm.de
9967fea4e6940f1020bc5d52195d558691bacf8c
354ed8b713c775382b1e2c4d91706eeb1671398b
/spring-beans/src/main/java/org/springframework/beans/TypeConverterSupport.java
d96e7d939a9501582b170a06ba04b52f0407664e
[]
no_license
JessenPan/spring-framework
8c7cc66252c2c0e8517774d81a083664e1ad4369
c0c588454a71f8245ec1d6c12f209f95d3d807ea
refs/heads/master
2021-06-30T00:54:08.230154
2019-10-08T10:20:25
2019-10-08T10:20:25
91,221,166
2
0
null
2017-05-14T05:01:43
2017-05-14T05:01:42
null
UTF-8
Java
false
false
2,792
java
/* * Copyright 2002-2012 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.beans; import org.springframework.core.MethodParameter; import org.springframework.core.convert.ConversionException; import org.springframework.core.convert.ConverterNotFoundException; import java.lang.reflect.Field; /** * Base implementation of the {@link TypeConverter} interface, using a package-private delegate. * Mainly serves as base class for {@link BeanWrapperImpl}. * * @author Juergen Hoeller * @see SimpleTypeConverter * @since 3.2 */ public abstract class TypeConverterSupport extends PropertyEditorRegistrySupport implements TypeConverter { TypeConverterDelegate typeConverterDelegate; public <T> T convertIfNecessary(Object value, Class<T> requiredType) throws TypeMismatchException { return doConvert(value, requiredType, null, null); } public <T> T convertIfNecessary(Object value, Class<T> requiredType, MethodParameter methodParam) throws TypeMismatchException { return doConvert(value, requiredType, methodParam, null); } public <T> T convertIfNecessary(Object value, Class<T> requiredType, Field field) throws TypeMismatchException { return doConvert(value, requiredType, null, field); } private <T> T doConvert(Object value, Class<T> requiredType, MethodParameter methodParam, Field field) throws TypeMismatchException { try { if (field != null) { return this.typeConverterDelegate.convertIfNecessary(value, requiredType, field); } else { return this.typeConverterDelegate.convertIfNecessary(value, requiredType, methodParam); } } catch (ConverterNotFoundException ex) { throw new ConversionNotSupportedException(value, requiredType, ex); } catch (ConversionException ex) { throw new TypeMismatchException(value, requiredType, ex); } catch (IllegalStateException ex) { throw new ConversionNotSupportedException(value, requiredType, ex); } catch (IllegalArgumentException ex) { throw new TypeMismatchException(value, requiredType, ex); } } }
[ "jessenpan@qq.com" ]
jessenpan@qq.com
0d5b0ed29a29a7d28d2016886af91f7fa52c430f
962861ad5f1a519fdf9b803ecc134d383b49d4ca
/ruoyi-ecloud/src/main/java/com/ruoyi/ecloud/service/impl/CirculatePumpRealServiceImpl.java
540b0e9ad8b1e1b453fdc7534a1024f2ae3207cc
[ "MIT" ]
permissive
smileyf-wb/ecloud
d239d4d1539e2716669d7093215001581c2b0624
dbd120125c3d8899ce66135e160323791396c118
refs/heads/master
2022-12-02T21:22:07.743033
2020-08-20T03:19:28
2020-08-20T03:19:38
288,898,599
0
0
null
null
null
null
UTF-8
Java
false
false
2,817
java
package com.ruoyi.ecloud.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.ecloud.mapper.CirculatePumpRealMapper; import com.ruoyi.ecloud.domain.CirculatePumpReal; import com.ruoyi.ecloud.service.ICirculatePumpRealService; /** * 循环泵实时运行信息Service业务层处理 * * @author smile * @date 2020-08-17 */ @Service public class CirculatePumpRealServiceImpl implements ICirculatePumpRealService { @Autowired private CirculatePumpRealMapper circulatePumpRealMapper; /** * 查询循环泵实时运行信息 * * @param circulatePumpId 循环泵实时运行信息ID * @return 循环泵实时运行信息 */ @Override public CirculatePumpReal selectCirculatePumpRealById(String circulatePumpId) { return circulatePumpRealMapper.selectCirculatePumpRealById(circulatePumpId); } /** * 查询循环泵实时运行信息列表 * * @param circulatePumpReal 循环泵实时运行信息 * @return 循环泵实时运行信息 */ @Override public List<CirculatePumpReal> selectCirculatePumpRealList(CirculatePumpReal circulatePumpReal) { return circulatePumpRealMapper.selectCirculatePumpRealList(circulatePumpReal); } /** * 新增循环泵实时运行信息 * * @param circulatePumpReal 循环泵实时运行信息 * @return 结果 */ @Override public int insertCirculatePumpReal(CirculatePumpReal circulatePumpReal) { return circulatePumpRealMapper.insertCirculatePumpReal(circulatePumpReal); } /** * 修改循环泵实时运行信息 * * @param circulatePumpReal 循环泵实时运行信息 * @return 结果 */ @Override public int updateCirculatePumpReal(CirculatePumpReal circulatePumpReal) { circulatePumpReal.setUpdateTime(DateUtils.getNowDate()); return circulatePumpRealMapper.updateCirculatePumpReal(circulatePumpReal); } /** * 批量删除循环泵实时运行信息 * * @param circulatePumpIds 需要删除的循环泵实时运行信息ID * @return 结果 */ @Override public int deleteCirculatePumpRealByIds(String[] circulatePumpIds) { return circulatePumpRealMapper.deleteCirculatePumpRealByIds(circulatePumpIds); } /** * 删除循环泵实时运行信息信息 * * @param circulatePumpId 循环泵实时运行信息ID * @return 结果 */ @Override public int deleteCirculatePumpRealById(String circulatePumpId) { return circulatePumpRealMapper.deleteCirculatePumpRealById(circulatePumpId); } }
[ "1051235297@qq.com" ]
1051235297@qq.com
f1a128d1428e190c4199efc24f7ecca78c767a6b
18b731ab437622d5936e531ece88c3dd0b2bb2ea
/pbtd-user/src/main/java/com/pbtd/playuser/component/ConstantBeanConfig.java
922afd204007d34acf87a1193533000059405838
[]
no_license
harry0102/bai_project
b6c130e7235d220f2f0d4294a3f87b58f77cd265
674c6ddff7cf5dae514c69d2639d4b0245c0761f
refs/heads/master
2021-10-07T20:32:15.985439
2018-12-05T06:50:11
2018-12-05T06:50:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,266
java
package com.pbtd.playuser.component; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; @Configuration @PropertySource(value = { "classpath:config/vodConstant.properties" }) public class ConstantBeanConfig { @Value("${charset}") public String charset;// 接口编码 @Value("${param}") public String param;// 参数名称 @Value("${query_series_phone_url}") public String querySeriesPhoneUrl;// 通过专辑ID查询接口url-手机 @Value("${query_series_tv_url}") public String querySeriesTvUrl; // 通过专辑ID查询接口url-TV @Value("${max_probability}") public Integer maxProbability;// 转盘活动最大中奖概率 @Value("${total}") public Integer total;// 点播收藏和播放记录最大查看条数 @Value("${flux_number}") public Integer fluxNumber;// 点播收藏和播放记录最大查看条数 public static String LOCAL_URL;// 本项目URL public static Long PLAY_TIME;//播放时长 @Value("${localhost_url}") public void setLOCAL_URL(String picture_ip) { LOCAL_URL = picture_ip; } @Value("${play_time}") public void setPLAY_TIME(Long play_time) { PLAY_TIME = play_time; } }
[ "750460470@qq.com" ]
750460470@qq.com
4ab4174f415e23b20ded7a033c43697e3569d483
10104f175c50f669bda9bdf9a1e943cc85f9d626
/app/src/main/java/com/game/sound/thesis/soundgamev2/MainMenuActivity.java
9d071bb765615dc0f8fcdfa5190e274e74ff7623
[]
no_license
swingfox/one-sound-one-word
fb6b480ec210b1baa34dddb60c316b7fa4f927b1
d3e37349391e23fd773ab1a73d5e44c3ec94bded
refs/heads/master
2020-03-25T17:13:51.971196
2018-08-08T06:23:29
2018-08-08T06:23:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,316
java
package com.game.sound.thesis.soundgamev2; import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.Toast; import com.android.volley.AuthFailureError; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.game.sound.thesis.soundgamev2.model.Vocabulary; import com.game.sound.thesis.soundgamev2.sql.DatabaseHelper; import com.game.sound.thesis.soundgamev2.utils.Config; import com.game.sound.thesis.soundgamev2.utils.Session; import com.game.sound.thesis.soundgamev2.utils.Utils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class MainMenuActivity extends AppCompatActivity { @BindView(R.id.btnPlay) Button btnPlay; @BindView(R.id.btnVocabulary) Button btnVocabulary; @BindView(R.id.btnInstructions) Button btnInstructions; @BindView(R.id.btnQuit) Button btnQuit; @BindView(R.id.imgSettings) ImageView imgSettings; @BindView(R.id.mainLayout) RelativeLayout main; public void getAvailableWords(final DatabaseHelper db, final String word, final int stage){ StringRequest strReq = new StringRequest(Request.Method.POST, Config.URL, new Response.Listener<String>() { @Override public void onResponse(String response) { Log.d(TAG, "Register Response: " + response.toString()); try { if(response.equals(" []")){ } else { JSONArray jsonArray = new JSONArray(response); for(int i = 0; i < jsonArray.length(); i++){ JSONObject jsonObject = jsonArray.getJSONObject(i); String word = jsonObject.getString("word").trim(); int stage = Integer.parseInt(jsonObject.getString("stage")); int isUsed = Integer.parseInt(jsonObject.getString("isUsed")); String definition = jsonObject.getString("description").trim(); Vocabulary v = new Vocabulary(); v.setWord(word); v.setLength(word.length()); v.setStage(stage); v.setIsUsed(isUsed); v.setDefinition(definition); random.add(v); if(db != null){ db.addVocabulary(v); printRow(v.toString()); } } } } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Log.e(TAG, "Registration Error: " + error.getMessage()); Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_LONG).show(); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String,String> params = new HashMap<String, String>(); params.put("Content-Type","application/x-www-form-urlencoded"); return params; } @Override protected Map<String, String> getParams() { // Posting params to register url final Map<String, String> params = new HashMap<String, String>(); params.put("query", "select_word"); params.put("stage", stage+""); params.put("word", word); return params; } }; strReq.setShouldCache(false); AppController.getInstance().addToRequestQueue(strReq); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mainmenu); final ActionBar actionBar = getSupportActionBar(); assert actionBar != null; actionBar.hide(); ButterKnife.bind(this); initializeQuitButton(); Session session = Session.getInstance(MainMenuActivity.this); if(session.getCoins()==0){ session.setCoins(25); } DatabaseHelper db = new DatabaseHelper(MainMenuActivity.this); for(int i = 1; i <= 6 ;i++){ List<String> assets = Utils.listAssets(MainMenuActivity.this,"music/stage"+i); for(int j = 0; j < assets.size(); j++) { String word = assets.get(j).replace(".mp3",""); getAvailableWords(db,word,i); } } List<Vocabulary> vList = db.getAllWords(); Toast.makeText(getApplicationContext(),"LIST OF DB WORDS: " + vList.size(), Toast.LENGTH_LONG).show(); for(int i = 0; i < vList.size(); i++){ printRow(vList.get(i).getWord()); } } private List<Vocabulary> random = new ArrayList<>(); public void printRow(String word){ DatabaseHelper db = new DatabaseHelper(MainMenuActivity.this); Vocabulary v = db.getWord(word); Log.d("DB ROW",v.toString()); } private void initializeQuitButton(){ quit = new AlertDialog.Builder(MainMenuActivity.this) .setTitle("") .setMessage("Are you sure you want to exit the game?") .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { yesButton(); } }) .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { noButton(); } }); } @OnClick(R.id.btnPlay) public void play(){ Intent i = new Intent(MainMenuActivity.this,StagesActivity.class); startActivity(i); } @OnClick(R.id.btnInstructions) public void instructions(){ Intent j = new Intent(MainMenuActivity.this,InstructionsActivity.class); startActivity(j); } @OnClick(R.id.btnVocabulary) public void vocabulary(){ Intent j = new Intent(MainMenuActivity.this,VocabularyActivity.class); startActivity(j); } @OnClick(R.id.btnQuit) public void quit(){ onBackPressed(); } @OnClick(R.id.imgSettings) public void settings(){ SettingsDialog settingsDialog = new SettingsDialog(MainMenuActivity.this); Window window = settingsDialog.getWindow(); window.setLayout(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT); settingsDialog.show(); } private void noButton(){ } private void yesButton(){ finish(); } private AlertDialog.Builder quit; private void executeQuitButton(){ quit.show(); } @Override public void onBackPressed() { executeQuitButton(); } @OnClick(R.id.imgReset) public void reset(){ final AlertDialog.Builder clear = new AlertDialog.Builder(MainMenuActivity.this) .setTitle(getString(R.string.resetTitle)) .setMessage(getString(R.string.resetMessage)) .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Session session = Session.getInstance(getApplicationContext()); session.clear(); clearDB(); } }) .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { noButton(); } }); clear.show(); } public String TAG = "MAIN MENU ACTIVITY: "; public void clearDB(){ DatabaseHelper db = new DatabaseHelper(MainMenuActivity.this); db.clearVocabulary(); Toast.makeText(MainMenuActivity.this,"SUCCESSFULLY CLEARED!",Toast.LENGTH_LONG).show(); } }
[ "drthrax.ramirez@gmail.com" ]
drthrax.ramirez@gmail.com
805c14655c1366ade8a4820ce09f72a940440e39
14075476cc0fdb746d13c8fa1185d5d999004bf9
/src/main/java/thinkinjava/date6/HorrorShow.java
1b054278c8b1cb2a44bbf7642ba5fb20cce15671
[]
no_license
CodeLearner-ICU/ThinkInJava
e15cc78276b6c3327cdd22fe32f294b7d2e15b0a
4d2e25a911d95639cc8acbebe7b98b2ed330278e
refs/heads/master
2022-10-31T15:45:15.597709
2020-06-13T04:34:00
2020-06-13T04:34:00
271,946,652
0
0
null
2020-06-13T05:28:14
2020-06-13T05:28:13
null
UTF-8
Java
false
false
753
java
package thinkinjava.date6; /** * 怪兽 */ interface Monster{ //威胁 void menace(); } interface DangerousMonster extends Monster{ void destroy(); } //致命的 interface Lethal{ void kill(); } /** * 特斯拉 */ class DragonZilla implements DangerousMonster{ public void menace() { } public void destroy() { } } /** * 吸血鬼 */ interface Vampire extends DangerousMonster,Lethal{ void drinkBlood(); } /** * 惊悚 */ public class HorrorShow { static void u (Monster m){m.menace();} static void v(DangerousMonster d){ d.menace(); d.destroy(); } public static void main(String[] args) { DragonZilla d = new DragonZilla(); u(d); v(d); } }
[ "fff" ]
fff
10f1751a8c229cea536b4f0e920cdb5103b53e3c
18ff292c3bbb6f6ef2eda034d6c58cffae458f5e
/JessKit/src/main/java/com/jesson/android/internet/core/json/BeanDescription.java
d71393a48c623b41de698a8713ba4c896238880c
[ "Apache-2.0" ]
permissive
zhangdi0917/SexyBelle
91279992e33b6c72cccfb1dd6497c93255c624f8
b453b9828e422d09f5d8daa487b99b4b959eecd5
refs/heads/master
2021-01-22T01:05:04.006435
2015-04-21T14:45:56
2015-04-21T14:45:56
17,616,430
2
2
null
null
null
null
UTF-8
Java
false
false
4,908
java
/** * Copyright 2011-2012 Renren Inc. All rights reserved. * - Powered by Team Pegasus. - */ package com.jesson.android.internet.core.json; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; /** * * Bean Description * Describe bean's fields and constructor, etc. * * */ public class BeanDescription { /** * whether class has a JsonCreator */ boolean hasJsonCreator; /** * whether class is primitive */ boolean isPrimitive; /** * constructor used to instantiate the object, may be a JsonCreator */ Constructor<?> constructor; /** * field descriptions */ ArrayList<FieldDescription> fieldDescriptions; /** * constructor parameter descriptions */ ArrayList<ConstructorParamDescription> constructorParamDescriptions; /** * Add a field description * @param fieldDescription * field description to add */ public void addFieldDescription (FieldDescription fieldDescription) { if (fieldDescriptions == null) { fieldDescriptions = new ArrayList<FieldDescription>(); } if (fieldDescription != null) { fieldDescriptions.add(fieldDescription); } } /** * Add a field description * @param key * key in json * @param type * field type * @param value * field value * @param name * field name * @param genericType * field generic type, use in List */ public void addFieldDescription (String key, Class<?> type, Object value, String name, Type genericType) { FieldDescription fieldDescription = new FieldDescription(key, type, value, name, genericType); this.addFieldDescription(fieldDescription); } /** * Add a constructor parameter description * @param constructorParamDescription * constructor parameter description to add */ public void addConstructorParamDescription (ConstructorParamDescription constructorParamDescription) { if (constructorParamDescriptions == null) { constructorParamDescriptions = new ArrayList<BeanDescription.ConstructorParamDescription>(); } if (constructorParamDescription != null) { constructorParamDescriptions.add(constructorParamDescription); } } /** * Add a constructor parameter array * @param cpdArray * constructor parameter array to add */ public void addConstructorParamDescription (ConstructorParamDescription[] cpdArray) { if (cpdArray != null) { if (constructorParamDescriptions == null) { constructorParamDescriptions = new ArrayList<BeanDescription.ConstructorParamDescription>(); } constructorParamDescriptions.addAll(Arrays.asList(cpdArray)); } } public String toString () { StringBuffer sb = new StringBuffer(); sb.append("field desp: ").append("\n"); if (fieldDescriptions == null) { sb.append("\tnull").append("\n"); } else { for (FieldDescription fd : fieldDescriptions) { sb.append(fd.toString()).append("\n"); } } sb.append("con desp:").append("\n"); if (constructorParamDescriptions == null) { sb.append("\tnull").append("\n"); } else { for (ConstructorParamDescription cpd : constructorParamDescriptions) { sb.append(cpd.toString()).append("\n"); } } return sb.toString(); } /** * * Field Description * */ public static class FieldDescription { /** * key in json value */ public String key; /** * field type */ public Class<?> type; /** * field value */ public Object value; /** * field name */ public String name; /** * generic type */ public Type genericType; /** * field reference */ public Field field; public FieldDescription (String key, Class<?> type, Object value, String name, Type genericType) { this.key = key; this.type = type; this.value = value; this.name = name; this.genericType = genericType; } public String toString () { return "key :" + key + " type :" + type + " value:" + value; } } /** * * Constructor Parameter Description * */ public static class ConstructorParamDescription { /** * is this parameter annotated with JsonProperty */ public boolean isJsonProperty; /** * parameter type */ public Class<?> type; /** * parameter value */ public Object value; /** * link with field description */ public FieldDescription fieldDescription; public ConstructorParamDescription (boolean isJsonProperty, Class<?> type, Object value) { this.isJsonProperty = isJsonProperty; this.type = type; this.value = value; } public String toString () { return "isJsonProperty :" + isJsonProperty + " type :" + type + " value :" + value; } } }
[ "zhangdi0917@gmail.com" ]
zhangdi0917@gmail.com
40854ac3e7840e11d9c92b028accfb6f99d36fd5
818823ae0885f719b3289bbb6f2cf4c773e96d4f
/Java/src/laiCode/laiCode.java
9e5b78c7d4d4ed5ee1c6712f9a26db551f885568
[]
no_license
hankhengma/bilibili
28dd91ea8f880791b347020f195bacfb281a6bfd
a2b01a8f0d2ccf1a8849ca0c925b14fcd0d70d58
refs/heads/master
2020-04-11T20:40:19.089978
2018-09-28T06:09:42
2018-09-28T06:09:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
628
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package laiCode; import java.lang.*; import java.util.Arrays; import java.util.LinkedList; import LaiOffer.GoogleInterview.SortWith2Stacks.Solution; /** * * @author junhao.zhang.freddie */ public class laiCode { /** * @param args the command line arguments */ public static void main(String[] args) { Solution x = new Solution(); x.sort(new LinkedList<Integer>(Arrays.asList(4, 1, 2, 3))); } }
[ "junhao.zhang.freddie@gmail.com" ]
junhao.zhang.freddie@gmail.com
f3fe5f8bf5c216577db226a90b3d0d9351b032bd
28f748c9e3779aeb183cbf213f103056de6d032f
/iaikPkcs11Wrapper/src/java/src/iaik/pkcs/pkcs11/parameters/RSAPkcsPssParameters.java
35a32f46e8178a161a65dab869858171e5cf4a3f
[ "Apache-2.0" ]
permissive
livreprogramacao/cruzeiro.do.sul-assinatura-digital
90b70253535c1848a5c5ac110e63a04fdf0cd1a4
43695f9fa05fb25f2509af7c245c094ef2ee5e3a
refs/heads/master
2021-05-06T21:35:29.158996
2017-11-30T17:21:23
2017-11-30T17:21:23
112,617,077
1
0
null
null
null
null
UTF-8
Java
false
false
5,770
java
// Copyright (c) 2002 Graz University of Technology. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // 3. The end-user documentation included with the redistribution, if any, must // include the following acknowledgment: // // "This product includes software developed by IAIK of Graz University of // Technology." // // Alternately, this acknowledgment may appear in the software itself, if and // wherever such third-party acknowledgments normally appear. // // 4. The names "Graz University of Technology" and "IAIK of Graz University of // Technology" must not be used to endorse or promote products derived from this // software without prior written permission. // // 5. Products derived from this software may not be called "IAIK PKCS Wrapper", // nor may "IAIK" appear in their name, without prior written permission of // Graz University of Technology. // // THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. package iaik.pkcs.pkcs11.parameters; import iaik.pkcs.pkcs11.Mechanism; import iaik.pkcs.pkcs11.wrapper.CK_RSA_PKCS_PSS_PARAMS; import iaik.pkcs.pkcs11.wrapper.Constants; /** * This class encapsulates parameters for the Mechanism.RSA_PKCS_PSS. * * @author Karl Scheibelhofer * @version 1.0 * */ public class RSAPkcsPssParameters extends RSAPkcsParameters { /** * The length of the salt value in octets. */ protected long saltLength_; /** * Create a new RSAPkcsOaepParameters object with the given attributes. * * @param hashAlgorithm * The message digest algorithm used to calculate the digest of the encoding parameter. * @param maskGenerationFunction * The mask to apply to the encoded block. One of the constants defined in the * MessageGenerationFunctionType interface. * @param saltLength * The length of the salt value in octets. * @preconditions (hashAlgorithm <> null) and (maskGenerationFunction == * MessageGenerationFunctionType.Sha1) * */ public RSAPkcsPssParameters(Mechanism hashAlgorithm, long maskGenerationFunction, long saltLength) { super(hashAlgorithm, maskGenerationFunction); saltLength_ = saltLength; } /** * Get this parameters object as an object of the CK_RSA_PKCS_PSS_PARAMS class. * * @return This object as a CK_RSA_PKCS_PSS_PARAMS object. * * @postconditions (result <> null) */ public Object getPKCS11ParamsObject() { CK_RSA_PKCS_PSS_PARAMS params = new CK_RSA_PKCS_PSS_PARAMS(); params.hashAlg = hashAlgorithm_.getMechanismCode(); params.mgf = maskGenerationFunction_; params.sLen = saltLength_; return params; } /** * Get the length of the salt value in octets. * * @return The length of the salt value in octets. */ public long getSaltLength() { return saltLength_; } /** * Set the length of the salt value in octets. * * @param saltLength * The length of the salt value in octets. */ public void setSaltLength(long saltLength) { saltLength_ = saltLength; } /** * Returns the string representation of this object. Do not parse data from this string, it is for * debugging only. * * @return A string representation of this object. */ public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(super.toString()); buffer.append(Constants.NEWLINE); buffer.append(Constants.INDENT); buffer.append("Salt Length (octets, dec): "); buffer.append(saltLength_); // buffer.append(Constants.NEWLINE); return buffer.toString(); } /** * Compares all member variables of this object with the other object. Returns only true, if all * are equal in both objects. * * @param otherObject * The other object to compare to. * @return True, if other is an instance of this class and all member variables of both objects * are equal. False, otherwise. */ public boolean equals(java.lang.Object otherObject) { boolean equal = false; if (otherObject instanceof RSAPkcsPssParameters) { RSAPkcsPssParameters other = (RSAPkcsPssParameters) otherObject; equal = (this == other) || (super.equals(other) && (this.saltLength_ == other.saltLength_)); } return equal; } /** * The overriding of this method should ensure that the objects of this class work correctly in a * hashtable. * * @return The hash code of this object. */ public int hashCode() { return super.hashCode() ^ ((int) saltLength_); } }
[ "fabio.almeida@unicid.edu.br" ]
fabio.almeida@unicid.edu.br
2dbe9a40255bff8d11a440b6e3e73123e1c142e9
96c58e2c18690ed23769413ce2040c675a750d2d
/src/main/java/com/bridgelabz/addressbookservice/AddressBookService.java
70e4d29510a5585301df8834481c5321e6f09497
[]
no_license
adi2357/AddressBookSystem
ccfc39ce2848452fbd04d927a015f96ef7baf52d
dafd1143ed33df65450521ec767428aea5549100
refs/heads/master
2023-01-10T12:06:46.396237
2020-11-04T13:40:52
2020-11-04T13:40:52
298,373,392
0
0
null
null
null
null
UTF-8
Java
false
false
6,063
java
package com.bridgelabz.addressbookservice; import java.time.LocalDate; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; import com.bridgelabz.exception.DBException; import com.bridgelabz.ioservice.AddressBookDBIOService; import com.bridgelabz.model.Contacts; public class AddressBookService { public enum IOService { CONSOLE_IO, FILE_IO, DB_IO, REST_IO } public static final Scanner SC = new Scanner(System.in); private List<Contacts> contactDataList; private AddressBookDBIOService addressBookDBService; public AddressBookService() { this.contactDataList = new ArrayList<Contacts>(); addressBookDBService = AddressBookDBIOService.getInstatnce(); } public AddressBookService(List<Contacts> contactList) { this(); this.contactDataList = new ArrayList<>(contactList); } public int sizeOfContactList() { return this.contactDataList.size(); } public void readContactData(IOService ioType) { if (ioType.equals(IOService.DB_IO)) { try { this.contactDataList = addressBookDBService.readData(); } catch (DBException e) { e.printStackTrace(); } } } public Contacts getContactData(String firstName, String lastName) { return this.contactDataList.stream() .filter(contact -> contact.getFirstName().equals(firstName) && contact.getLastName().equals(lastName)) .findFirst() .orElse(null); } public void updateContactEmail(String firstName, String lastName, String email) throws DBException { int result = addressBookDBService.updateContactEmail(firstName, lastName, email); if(result == 0) throw new DBException("Cannot update the employee payroll data", DBException.ExceptionType.UPDATE_ERROR); Contacts contactData = this.getContactData(firstName, lastName); if(contactData != null) contactData.setEmail(email); else throw new DBException("Cannot find the contact data in the list", DBException.ExceptionType.INVALID_CONTACT_DATA); } public boolean checkContactDataInSyncWithDB(String firstName, String lastName) throws DBException { List<Contacts> contactDataListFromDB = addressBookDBService.getContactDataUsingName(firstName, lastName); Contacts contactDataFromList = getContactData(firstName, lastName); if(contactDataListFromDB.size() == 0 && contactDataFromList == null) return true; return contactDataListFromDB.get(0).equals(contactDataFromList); } public List<Contacts> readContactsForDateRange(IOService ioType, LocalDate startDate, LocalDate endDate) { if (ioType.equals(IOService.DB_IO)) { try { return addressBookDBService.readContactsForDateRange(startDate, endDate); } catch (DBException e) { e.printStackTrace(); } } return null; } public int getCountByCity(IOService ioType, String city) { if (ioType.equals(IOService.DB_IO)) { try { Map<String, Integer> cityToContactCountMap = addressBookDBService.getCountByCity(); return cityToContactCountMap.get(city); } catch (DBException e) { e.printStackTrace(); } } return 0; } public int getCountByState(IOService ioType, String state) { if (ioType.equals(IOService.DB_IO)) { try { Map<String, Integer> stateToContactCountMap = addressBookDBService.getCountByState(); return stateToContactCountMap.get(state); } catch (DBException e) { e.printStackTrace(); } } return 0; } public void addContactToAddressBook(String firstName, String lastName, String address, String city, String state, int zip, String email, String phone, String type, String addressBookName) { try { Contacts newContact = addressBookDBService.addContactToAddressBook(firstName, lastName, address, city, state, zip, email, phone, type, addressBookName); if(newContact != null) { Contacts exixtingContact = this.getContactData(firstName, lastName); boolean isContactExists = (exixtingContact != null); if(isContactExists) { this.contactDataList.remove(exixtingContact); } this.contactDataList.add(newContact); } }catch (DBException e) { e.printStackTrace(); } } public void addContactListToAddressBook(List<Contacts> contactList) { Map<Integer, Boolean> contactAdditionStatus = new HashMap<Integer, Boolean>(); contactList.stream().forEach(c -> { Runnable contactAddition = () -> { contactAdditionStatus.put(c.hashCode(), false); System.out.println("\nAdding Contact : " + Thread.currentThread().getName()); addContactToAddressBook(c.getFirstName(), c.getLastName(), c.getAddress(), c.getCity(), c.getState(), c.getZip(), c.getEmail(), c.getPhoneList().get(0), c.getAddressBookTypeList().get(0), c.getAddressBookNameList().get(0)); contactAdditionStatus.put(c.hashCode(), true); System.out.println("Added Contact : " + Thread.currentThread().getName() + "\n"); }; Thread thread = new Thread(contactAddition, c.getFullName()); thread.start(); }); while(contactAdditionStatus.containsValue(false)) { try { Thread.sleep(40); } catch (InterruptedException e1) { e1.printStackTrace(); } } } public void addContactToAddressBook(Contacts newContact) { this.addContactToAddressBook(newContact.getFirstName(), newContact.getLastName(), newContact.getAddress(), newContact.getCity(), newContact.getState(), newContact.getZip(), newContact.getEmail(), newContact.getPhoneList().get(0), newContact.getAddressBookTypeList().get(0), newContact.getAddressBookNameList().get(0)); } public void deleteContactData(String firstName, String lastName) throws DBException { int result = addressBookDBService.deleteContactData(firstName, lastName); if(result == 0) throw new DBException("Cannot update the employee payroll data", DBException.ExceptionType.UPDATE_ERROR); Contacts contactToDelete = this.getContactData(firstName, lastName); if(contactToDelete != null) this.contactDataList.remove(contactToDelete); else throw new DBException("Cannot find the contact data in the list", DBException.ExceptionType.INVALID_CONTACT_DATA); } }
[ "aaadarths2357@gmail.com" ]
aaadarths2357@gmail.com
b935fcb75772daaac5aaaf8d18c0b35ca45770de
6671904bf1a215ca88a42deffe4798c8523e0f28
/sii_commons/src/main/java/com/besixplus/sii/objects/Cgg_kdx_cierre.java
ea450ff416c09725fc09c3773b129fb83f983968
[]
no_license
antoniocanaveral/galapagos
904904e17dcd8e4a4d5f2300367d0d84bf878c91
be731daa086a4e1aaba46bf44ca322b073b173f5
refs/heads/master
2020-12-30T22:56:47.677245
2016-08-16T02:20:06
2016-08-16T02:20:06
80,631,711
0
0
null
null
null
null
UTF-8
Java
false
false
9,712
java
package com.besixplus.sii.objects; import java.io.Serializable; /** * CLASE Cgg_kdx_cierre * TABLA: CIERRE DE CAJA * DESCRIPCION:ALMACENA INFORMACION DE CIERRES DE CAJA DE LOS PUNTOS DE VENTA. * ABREVIATURA:CKCRR */ public class Cgg_kdx_cierre implements Serializable{ private static final long serialVersionUID = 184994039; /** * IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA */ private String myCkcrr_codigo; /** * IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA */ private String myCkpvt_codigo; /** * IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA */ private String myCkupv_codigo; /** * FECHA DE REALIZACION DEL CIERRE */ private java.util.Date myCkcrr_fecha_cierre; /** * NUMERO SECUENCIAL IDENTIFICATIVO */ private String myCkcrr_numero_cierre; /** * VALOR TOTAL REGISTRADO EN LA VENTA */ private java.math.BigDecimal myCkcrr_total_venta; /** * VALOR TOTAL CONTABILIZADO EN EL CIERRE */ private java.math.BigDecimal myCkcrr_total; /** * INFORMACION ADICIONAL */ private String myCkcrr_observacion; /** * VALOR DE DIFERENCIA */ private java.math.BigDecimal myCkcrr_diferencia; /** * ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA */ private int myCkcrr_estado_cierre; /** * ESTADO DEL REGISTRO */ private boolean myCkcrr_estado; /** * USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA */ private String myCkcrr_usuario_insert; /** * USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION */ private String myCkcrr_usuario_update; /** * CONSTRUCTOR DE LA CLASE Cgg_kdx_cierre */ public Cgg_kdx_cierre(){} /** * CONSTRUCTOR DE LA CLASE Cgg_kdx_cierre * @param inCkcrr_codigo IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA * @param inCkpvt_codigo IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA * @param inCkvnt_codigo IDENTIFICATIVO UNICO DE REGISTRO DE VENTA * @param inCkupv_codigo IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA * @param inCkcrr_fecha_cierre FECHA DE REALIZACION DEL CIERRE * @param inCkcrr_numero_cierre NUMERO SECUENCIAL IDENTIFICATIVO * @param inCkcrr_total_venta VALOR TOTAL REGISTRADO EN LA VENTA * @param inCkcrr_total VALOR TOTAL CONTABILIZADO EN EL CIERRE * @param inCkcrr_observacion INFORMACION ADICIONAL * @param inCkcrr_diferencia VALOR DE DIFERENCIA * @param inCkcrr_estado_cierre ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA * @param inCkcrr_estado ESTADO DEL REGISTRO * @param inCkcrr_usuario_insert USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA * @param inCkcrr_usuario_update USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION */ public Cgg_kdx_cierre( String inCkcrr_codigo, String inCkpvt_codigo, String inCkvnt_codigo, String inCkupv_codigo, java.util.Date inCkcrr_fecha_cierre, String inCkcrr_numero_cierre, java.math.BigDecimal inCkcrr_total_venta, java.math.BigDecimal inCkcrr_total, String inCkcrr_observacion, java.math.BigDecimal inCkcrr_diferencia, int inCkcrr_estado_cierre, boolean inCkcrr_estado, String inCkcrr_usuario_insert, String inCkcrr_usuario_update ){ this.setCKCRR_CODIGO(inCkcrr_codigo); this.setCKPVT_CODIGO(inCkpvt_codigo); this.setCKUPV_CODIGO(inCkupv_codigo); this.setCKCRR_FECHA_CIERRE(inCkcrr_fecha_cierre); this.setCKCRR_NUMERO_CIERRE(inCkcrr_numero_cierre); this.setCKCRR_TOTAL_VENTA(inCkcrr_total_venta); this.setCKCRR_TOTAL(inCkcrr_total); this.setCKCRR_OBSERVACION(inCkcrr_observacion); this.setCKCRR_DIFERENCIA(inCkcrr_diferencia); this.setCKCRR_ESTADO_CIERRE(inCkcrr_estado_cierre); this.setCKCRR_ESTADO(inCkcrr_estado); this.setCKCRR_USUARIO_INSERT(inCkcrr_usuario_insert); this.setCKCRR_USUARIO_UPDATE(inCkcrr_usuario_update); } /** * ESTABLECE IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA * @param inCkcrr_codigo IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA */ public void setCKCRR_CODIGO(String inCkcrr_codigo){ this.myCkcrr_codigo = inCkcrr_codigo; } /** * OBTIENE IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA * @return String IDENTIFICATIVO UNICO DE REGISTRO DE CIERRE DE CAJA */ public String getCKCRR_CODIGO(){ return this.myCkcrr_codigo; } /** * ESTABLECE IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA * @param inCkpvt_codigo IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA */ public void setCKPVT_CODIGO(String inCkpvt_codigo){ this.myCkpvt_codigo = inCkpvt_codigo; } /** * OBTIENE IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA * @return String IDENTIFICATIVO UNICO DE REGISTRO DE PUNTO DE VENTA */ public String getCKPVT_CODIGO(){ return this.myCkpvt_codigo; } /** * ESTABLECE IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA * @param inCkupv_codigo IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA */ public void setCKUPV_CODIGO(String inCkupv_codigo){ this.myCkupv_codigo = inCkupv_codigo; } /** * OBTIENE IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA * @return String IDENTIFICATIVO UNICO DE REGISTRO DE USUARIO PUNTO DE VENTA */ public String getCKUPV_CODIGO(){ return this.myCkupv_codigo; } /** * ESTABLECE FECHA DE REALIZACION DEL CIERRE * @param inCkcrr_fecha_cierre FECHA DE REALIZACION DEL CIERRE */ public void setCKCRR_FECHA_CIERRE(java.util.Date inCkcrr_fecha_cierre){ this.myCkcrr_fecha_cierre = inCkcrr_fecha_cierre; } /** * OBTIENE FECHA DE REALIZACION DEL CIERRE * @return java.util.Date FECHA DE REALIZACION DEL CIERRE */ public java.util.Date getCKCRR_FECHA_CIERRE(){ return this.myCkcrr_fecha_cierre; } /** * ESTABLECE NUMERO SECUENCIAL IDENTIFICATIVO * @param inCkcrr_numero_cierre NUMERO SECUENCIAL IDENTIFICATIVO */ public void setCKCRR_NUMERO_CIERRE(String inCkcrr_numero_cierre){ this.myCkcrr_numero_cierre = inCkcrr_numero_cierre; } /** * OBTIENE NUMERO SECUENCIAL IDENTIFICATIVO * @return String NUMERO SECUENCIAL IDENTIFICATIVO */ public String getCKCRR_NUMERO_CIERRE(){ return this.myCkcrr_numero_cierre; } /** * ESTABLECE VALOR TOTAL REGISTRADO EN LA VENTA * @param inCkcrr_total_venta VALOR TOTAL REGISTRADO EN LA VENTA */ public void setCKCRR_TOTAL_VENTA(java.math.BigDecimal inCkcrr_total_venta){ this.myCkcrr_total_venta = inCkcrr_total_venta; } /** * OBTIENE VALOR TOTAL REGISTRADO EN LA VENTA * @return java.math.BigDecimal VALOR TOTAL REGISTRADO EN LA VENTA */ public java.math.BigDecimal getCKCRR_TOTAL_VENTA(){ return this.myCkcrr_total_venta; } /** * ESTABLECE VALOR TOTAL CONTABILIZADO EN EL CIERRE * @param inCkcrr_total VALOR TOTAL CONTABILIZADO EN EL CIERRE */ public void setCKCRR_TOTAL(java.math.BigDecimal inCkcrr_total){ this.myCkcrr_total = inCkcrr_total; } /** * OBTIENE VALOR TOTAL CONTABILIZADO EN EL CIERRE * @return java.math.BigDecimal VALOR TOTAL CONTABILIZADO EN EL CIERRE */ public java.math.BigDecimal getCKCRR_TOTAL(){ return this.myCkcrr_total; } /** * ESTABLECE INFORMACION ADICIONAL * @param inCkcrr_observacion INFORMACION ADICIONAL */ public void setCKCRR_OBSERVACION(String inCkcrr_observacion){ this.myCkcrr_observacion = inCkcrr_observacion; } /** * OBTIENE INFORMACION ADICIONAL * @return String INFORMACION ADICIONAL */ public String getCKCRR_OBSERVACION(){ return this.myCkcrr_observacion; } /** * ESTABLECE VALOR DE DIFERENCIA * @param inCkcrr_diferencia VALOR DE DIFERENCIA */ public void setCKCRR_DIFERENCIA(java.math.BigDecimal inCkcrr_diferencia){ this.myCkcrr_diferencia = inCkcrr_diferencia; } /** * OBTIENE VALOR DE DIFERENCIA * @return java.math.BigDecimal VALOR DE DIFERENCIA */ public java.math.BigDecimal getCKCRR_DIFERENCIA(){ return this.myCkcrr_diferencia; } /** * ESTABLECE ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA * @param inCkcrr_estado_cierre ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA */ public void setCKCRR_ESTADO_CIERRE(int inCkcrr_estado_cierre){ this.myCkcrr_estado_cierre = inCkcrr_estado_cierre; } /** * OBTIENE ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA * @return int ESTADO DEL REGISTRO DE CIERRE PARA CONTROL DE INFORMACION 0.- REGISTRADA 1.- CONFIRMADA */ public int getCKCRR_ESTADO_CIERRE(){ return this.myCkcrr_estado_cierre; } /** * ESTABLECE ESTADO DEL REGISTRO * @param inCkcrr_estado ESTADO DEL REGISTRO */ public void setCKCRR_ESTADO(boolean inCkcrr_estado){ this.myCkcrr_estado = inCkcrr_estado; } /** * OBTIENE ESTADO DEL REGISTRO * @return boolean ESTADO DEL REGISTRO */ public boolean getCKCRR_ESTADO(){ return this.myCkcrr_estado; } /** * ESTABLECE USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA * @param inCkcrr_usuario_insert USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA */ public void setCKCRR_USUARIO_INSERT(String inCkcrr_usuario_insert){ this.myCkcrr_usuario_insert = inCkcrr_usuario_insert; } /** * OBTIENE USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA * @return String USUARIO QUE INGRESO LA INFORMACION EN EL SISTEMA */ public String getCKCRR_USUARIO_INSERT(){ return this.myCkcrr_usuario_insert; } /** * ESTABLECE USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION * @param inCkcrr_usuario_update USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION */ public void setCKCRR_USUARIO_UPDATE(String inCkcrr_usuario_update){ this.myCkcrr_usuario_update = inCkcrr_usuario_update; } /** * OBTIENE USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION * @return String USUARIO QUE REALIZO LA ACTUALIZACION DE LA INFORMACION */ public String getCKCRR_USUARIO_UPDATE(){ return this.myCkcrr_usuario_update; } }
[ "acanaveral@general.local" ]
acanaveral@general.local
1933aaf607df94506341368d997c00ef90fb9401
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_4a1febf4cc7bbb5cfdbb7498661c1e995af7619f/WeechatPreferencesActivity/2_4a1febf4cc7bbb5cfdbb7498661c1e995af7619f_WeechatPreferencesActivity_s.java
f4f796c06bf12831f08d6b34d94d05dab17fd93e
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,699
java
/******************************************************************************* * Copyright 2012 Keith Johnson * * 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 com.ubergeek42.WeechatAndroid; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.os.Bundle; import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.PreferenceActivity; public class WeechatPreferencesActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener { private SharedPreferences sharedPreferences; private EditTextPreference hostPref; private EditTextPreference portPref; private EditTextPreference textSizePref; private EditTextPreference timestampformatPref; private EditTextPreference passPref; private EditTextPreference stunnelCert; private EditTextPreference stunnelPass; private EditTextPreference sshHostPref; private EditTextPreference sshPortPref; private EditTextPreference sshPassPref; private EditTextPreference sshUserPref; private ListPreference prefixPref; private ListPreference connectionTypePref; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); sharedPreferences = getPreferenceScreen().getSharedPreferences(); hostPref = (EditTextPreference) getPreferenceScreen().findPreference("host"); portPref = (EditTextPreference) getPreferenceScreen().findPreference("port"); passPref = (EditTextPreference) getPreferenceScreen().findPreference("password"); textSizePref = (EditTextPreference) getPreferenceScreen().findPreference("text_size"); timestampformatPref = (EditTextPreference) getPreferenceScreen().findPreference( "timestamp_format"); stunnelCert = (EditTextPreference) getPreferenceScreen().findPreference("stunnel_cert"); stunnelPass = (EditTextPreference) getPreferenceScreen().findPreference("stunnel_pass"); sshHostPref = (EditTextPreference) getPreferenceScreen().findPreference("ssh_host"); sshUserPref = (EditTextPreference) getPreferenceScreen().findPreference("ssh_user"); sshPortPref = (EditTextPreference) getPreferenceScreen().findPreference("ssh_port"); sshPassPref = (EditTextPreference) getPreferenceScreen().findPreference("ssh_pass"); prefixPref = (ListPreference) getPreferenceScreen().findPreference("prefix_align"); connectionTypePref = (ListPreference) getPreferenceScreen().findPreference( "connection_type"); setTitle(R.string.preferences); } @Override protected void onPause() { super.onPause(); sharedPreferences.unregisterOnSharedPreferenceChangeListener(this); } @Override protected void onResume() { super.onResume(); sharedPreferences.registerOnSharedPreferenceChangeListener(this); hostPref.setSummary(sharedPreferences.getString("host", "")); portPref.setSummary(sharedPreferences.getString("port", "8001")); textSizePref.setSummary(sharedPreferences.getString("text_size", "10")); timestampformatPref.setSummary(sharedPreferences.getString("timestamp_format", "HH:mm:ss")); stunnelCert.setSummary(sharedPreferences.getString("stunnel_cert", "Not Set")); sshHostPref.setSummary(sharedPreferences.getString("ssh_host", "")); sshUserPref.setSummary(sharedPreferences.getString("ssh_user", "")); sshPortPref.setSummary(sharedPreferences.getString("ssh_port", "22")); prefixPref.setSummary(prefixPref.getEntry()); connectionTypePref.setSummary(connectionTypePref.getEntry()); String tmp; tmp = sharedPreferences.getString("password", null); if (tmp == null || tmp.equals("")) { passPref.setSummary("None Set"); } else { passPref.setSummary("******"); } tmp = sharedPreferences.getString("stunnel_pass", null); if (tmp == null || tmp.equals("")) { stunnelPass.setSummary("None Set"); } else { stunnelPass.setSummary("******"); } tmp = sharedPreferences.getString("ssh_pass", null); if (tmp == null || tmp.equals("")) { sshPassPref.setSummary("None Set"); } else { sshPassPref.setSummary("******"); } } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (key.equals("host")) { hostPref.setSummary(sharedPreferences.getString(key, "")); } else if (key.equals("port")) { portPref.setSummary(sharedPreferences.getString("port", "8001")); } else if (key.equals("password")) { String tmp = sharedPreferences.getString("password", null); if (tmp == null || tmp.equals("")) { passPref.setSummary("None Set"); } else { passPref.setSummary("******"); } } else if (key.equals("text_size")) { textSizePref.setSummary(sharedPreferences.getString("text_size", "10")); } else if (key.equals("timestamp_format")) { timestampformatPref.setSummary(sharedPreferences.getString("timestamp_format", "HH:mm:ss")); } else if (key.equals("stunnel_cert")) { stunnelCert.setSummary(sharedPreferences.getString("stunnel_cert", "/sdcard/weechat/client.p12")); } else if (key.equals("stunnel_pass")) { String tmp = sharedPreferences.getString("stunnel_pass", null); if (tmp == null || tmp.equals("")) { stunnelPass.setSummary("None Set"); } else { stunnelPass.setSummary("******"); } } else if (key.equals("ssh_host")) { sshHostPref.setSummary(sharedPreferences.getString(key, "")); } else if (key.equals("ssh_user")) { sshUserPref.setSummary(sharedPreferences.getString(key, "")); } else if (key.equals("port")) { sshPortPref.setSummary(sharedPreferences.getString(key, "22")); } else if (key.equals("ssh_pass")) { String tmp = sharedPreferences.getString("ssh_pass", null); if (tmp == null || tmp.equals("")) { sshPassPref.setSummary("None Set"); } else { sshPassPref.setSummary("******"); } } else if (key.equals("prefix_align")) { prefixPref.setSummary(prefixPref.getEntry()); } else if (key.equals("connection_type")) { connectionTypePref.setSummary(connectionTypePref.getEntry()); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3c60f737b4c290d12c7bf99f990dbd116763c987
fd6ee410fa4671c570baaf07858856d39a49e1b3
/src/com/fgl/cwp/model/Store.java
e63e93b782a4c0245dbb071fd5cb4aa8561bfe16
[]
no_license
fgldevteam/CWP
0b1903ad48bbca30be11ede484c09c2d828c797b
34ba3e1947585cd21a55f409446a8c59178866d9
refs/heads/master
2021-08-18T19:40:00.503283
2017-11-23T17:29:37
2017-11-23T17:29:37
111,835,561
0
0
null
null
null
null
UTF-8
Java
false
false
8,137
java
package com.fgl.cwp.model; import org.apache.commons.lang.StringUtils; /** * @author Jessica Wong * * @hibernate.class * table = "store" * mutable = "false" * * @hibernate.query * name = "getStoreByID" * query = "SELECT store * FROM Store store * WHERE store.number = :number" * @hibernate.query * name = "getAllStores" * query = "from Store" */ public class Store implements Comparable { private static String BANNER_SPORT_CHECK = "SC"; private static String BANNER_COAST_MOUNTAIN_SPORTS = "CMS"; private int number; private String name; private String shortName; private String description; private String areaCode; private String phoneNumber; private String faxAreaCode; private String faxNumber; private String city; private String banner; private String region; private String address; private String province; private String postalCode; private Integer relatedStoreNumber; private Integer capId; /** * Compare value. * @param o * @return */ public int compareTo(Object o) { Store s = (Store)o; if (this.number < s.getNumber()) { return -1; } if (this.number == s.getNumber()) { return 0; } return 1; } /** * Return the email address for this store. This is not a persisted value. * It is generated based on a mask value: * For Sport Check: * sc####@forzani.net * * For Coast Mountain Sports: * cm####&forzani.net * * @return */ public String getEmailAddress() { if (banner != null) { if (banner.toUpperCase().equals(BANNER_SPORT_CHECK.toUpperCase())) { return "sc" + StringUtils.leftPad(String.valueOf(this.number),4,'0') + "@forzani.net"; } if (banner.toUpperCase().equals(BANNER_COAST_MOUNTAIN_SPORTS.toUpperCase())) { return "cm" + StringUtils.leftPad(String.valueOf(this.number),4,'0') + "@forzani.net"; } } return null; } /** * Return the store number and name in one string. * @return */ public String getFullName() { StringBuffer buf = new StringBuffer(); buf.append(number); if (buf.length()>0) { buf.append(" - "); } buf.append(name); return buf.toString(); } /** * @return * * @hibernate.id * column = "number" * generator-class = "assigned" */ public int getNumber() { return number; } /** * @param number */ public void setNumber(int number) { this.number = number; } /** * @return * * @hibernate.property * column = "full_name" */ public String getName() { return name; } /** * @param name */ public void setName(String name) { this.name = name; } /** * @return * * @hibernate.property * column = "short_name" */ public String getShortName() { return shortName; } /** * @param shortName */ public void setShortName(String shortName) { this.shortName = shortName; } /** * @return * * @hibernate.property * column = "description" */ public String getDescription() { return description; } /** * @param description */ public void setDescription(String description) { this.description = description; } /** * @return * * @hibernate.property * column = "area_code" */ public String getAreaCode() { return areaCode; } /** * @param areaCode */ public void setAreaCode(String areaCode) { this.areaCode = areaCode; } /** * @return * * @hibernate.property * column = "phone_number" */ public String getPhoneNumber() { return phoneNumber; } /** * @param phoneNumber */ public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } /** * @return * * @hibernate.property * column = "city" */ public String getCity() { return city; } /** * @param city */ public void setCity(String city) { this.city = city; } /** * @return * @hibernate.property * column = "chain" */ public String getBanner() { return banner; } /** * @param banner */ public void setBanner(String banner) { this.banner = banner; } /** * @return * * @hibernate.property * column = "region" */ public String getRegion() { return region; } /** * @param region */ public void setRegion(String region) { this.region = region; } /** * @return * * @hibernate.property * column = "fax_area_code" */ public String getFaxAreaCode() { return faxAreaCode; } /** * @param faxAreaCode */ public void setFaxAreaCode(String faxAreaCode) { this.faxAreaCode = faxAreaCode; } /** * @return * * @hibernate.property * column = "fax_number" */ public String getFaxNumber() { return faxNumber; } /** * @param faxNumber */ public void setFaxNumber(String faxNumber) { this.faxNumber = faxNumber; } /** * @return * * @hibernate.property * column = "address" */ public String getAddress() { return address; } /** * @param address */ public void setAddress(String address) { this.address = address; } /** * @return * * @hibernate.property * column = "province" */ public String getProvince() { return province; } /** * @param province */ public void setProvince(String province) { this.province = province; } /** * @return Returns the postalCode. * @hibernate.property * column = "postal_code" */ public String getPostalCode() { return postalCode; } /** * @param postalCode The postalCode to set. */ public void setPostalCode(String postalCode) { this.postalCode = postalCode; } /** * @return Returns the relatedStoreNumber. * @hibernate.property * column = "related_store_number" * not-null = "false" */ public Integer getRelatedStoreNumber() { return relatedStoreNumber; } /** * @param relatedStoreNumber The relatedStoreNumber to set. */ public void setRelatedStoreNumber(Integer relatedStoreNumber) { this.relatedStoreNumber = relatedStoreNumber; } /** * @hibernate.property * column = "cap_id" * @return */ public Integer getCapId() { return capId; } public void setCapId(Integer capId) { this.capId = capId; } }
[ "bgarner@gmail.com" ]
bgarner@gmail.com
e8b57957b380f691ee13adbfb884f3316a5f016a
5bac396a6e56769df634c32c94ebb502e0d426ac
/src/com/example/selvet/getAllOpinions.java
b8e98b0af96a668bcb4ab9d9e54d2a2c690a3d74
[]
no_license
ZYY0911/mobileA
c658639f2e185b63a6cd8cab3aa35fd62652c74f
6a35f23d65455ec7ee3757e0b498ba87cf0f6db9
refs/heads/master
2022-12-26T14:31:31.691626
2020-10-10T08:33:18
2020-10-10T08:33:18
300,592,954
0
1
null
null
null
null
UTF-8
Java
false
false
2,980
java
package com.example.selvet; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.example.db.DB; import com.example.db.MyUtil; import net.sf.json.JSONObject; /** * Servlet implementation class getAllOpinions */ @WebServlet("/getAllOpinions") public class getAllOpinions extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public getAllOpinions() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse * response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.setContentType("application/json"); response.setCharacterEncoding("UTF-8"); request.setCharacterEncoding("UTF-8"); BufferedReader reader = request.getReader(); String json = reader.readLine(); JSONObject jsonobject = JSONObject.fromObject(json); String urlString = request.getRequestURL().toString(); urlString = urlString.substring(0, urlString.lastIndexOf("/")); System.out.println(urlString); System.out.println(request.getRemoteHost()); System.err.println(new MyUtil().simpDate("yyyy-MM-dd HH:mm:ss", new java.util.Date())); reader.close(); DB db = new DB(); JSONObject jsonObject2 = new JSONObject(); db.getRs("select * from opinions"); ResultSet set = db.getRs(); try { if (set != null) { jsonObject2.put("RESULT", "S"); List<JSONObject> jsonObjects = new ArrayList<JSONObject>(); while (set.next()) { JSONObject jsonObject3 = new JSONObject(); jsonObject3.put("id", set.getInt(1)); jsonObject3.put("content", set.getString(2)); jsonObject3.put("username", set.getString(3)); jsonObject3.put("time", set.getString(4).replace(".0", "")); jsonObjects.add(jsonObject3); } jsonObject2.put("ROWS_DETAIL", jsonObjects.toString()); } else { jsonObject2.put("RESULT", "F"); } } catch (SQLException e) { // TODO Auto-generated catch block jsonObject2.clear(); jsonObject2.put("RESULT", "F"); e.printStackTrace(); } finally { db.closed(); PrintWriter owtPrintWriter = response.getWriter(); owtPrintWriter.write(jsonObject2.toString()); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "605061405@qq.com" ]
605061405@qq.com
0e855de49ae4f2d052bfa4414e2b5b34d7390bb0
98d15fb202a803dada6f7917c61e714c55a713a9
/bd_java_code/src/bd_java_code/Pessoa.java
963b57d665e59919761f6a0b3b34b9e440e4aab5
[]
no_license
joanetes14/sd_bd
8951c831125617dbe21880939e0bc7f6c063ad7c
4a8395f1770469c5dcd15514331724e28ed9c4b5
refs/heads/master
2021-08-23T20:41:24.257716
2017-12-06T12:55:13
2017-12-06T12:55:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,369
java
package bd_java_code; public class Pessoa { private String nome; private int ncc; private String cargo; private String senha; private int telefone; private String morada; private Faculdade fac; private Departamento dep; public Pessoa(int ncc,String nome,String cargo,String senha,int telefone,String morada,Departamento dep,Faculdade fac){ this.nome = nome; this.ncc = ncc; this.cargo = cargo; this.senha = senha; this.telefone = telefone; this.morada = morada; this.fac = fac; this.dep = dep; } public String getCargo() { return cargo; }public String getMorada() { return morada; }public int getNcc() { return ncc; }public String getNome() { return nome; }public String getSenha() { return senha; }public int getTelefone() { return telefone; }public Faculdade getFac() { return fac; }public Departamento getDep() { return dep; }public void setCargo(String cargo) { this.cargo = cargo; }public void setMorada(String morada) { this.morada = morada; }public void setNcc(int ncc) { this.ncc = ncc; }public void setNome(String nome) { this.nome = nome; }public void setSenha(String senha) { this.senha = senha; }public void setTelefone(int telefone) { this.telefone = telefone; }public void setFac(Faculdade fac) { this.fac = fac; }public void setDep(Departamento dep) { this.dep = dep; } }
[ "htbc@dei.student.uc.pt" ]
htbc@dei.student.uc.pt
9a3a79ba533c89f150cd98a20dcfe8ff6ad8091b
06b5151777ee4864fa526da52cdcb0075e36b135
/JARVISTesting/src/main/java/com/mphasis/jarvis/entities/FlightClass.java
ad4c7c130e93132356dd898d1a190d16ddb79d49
[]
no_license
171RLLProjects/Jarvis
fe2a4000b99ac53019928867526d82656644af54
940c2132463e2a8bda0c4f64a5b26a3e9c116a05
refs/heads/master
2022-12-20T21:12:02.498680
2019-10-26T07:38:16
2019-10-26T07:38:16
215,941,416
0
0
null
2022-12-16T08:03:16
2019-10-18T04:30:03
Java
UTF-8
Java
false
false
1,114
java
package com.mphasis.jarvis.entities; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @Entity public class FlightClass { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int flightClassId; private String flightClass; private int numberOfSeats; public Flight getFlight() { return flight; } public void setFlight(Flight flight) { this.flight = flight; } @ManyToOne @JoinColumn(name="flightId") private Flight flight; public int getFlightClassId() { return flightClassId; } public int getNumberOfSeats() { return numberOfSeats; } public void setNumberOfSeats(int numberOfSeats) { this.numberOfSeats = numberOfSeats; } public void setFlightClassId(int flightClassId) { this.flightClassId = flightClassId; } public String getFlightClass() { return flightClass; } public void setFlightClass(String flightClass) { this.flightClass = flightClass; } }
[ "d.sankar@WKSBAN24ARY0023.corp.mphasis.com" ]
d.sankar@WKSBAN24ARY0023.corp.mphasis.com
360ec70815aeb980f3a1c3de9789e97e2ff16f16
528bd5aa11808d7f7b1777c19430183257132eb4
/netty-demos/netty-rpc/src/main/java/com/holmes/rpc/App.java
a4c23205816356cfff8eaa0f108a13a8ecabfdc1
[]
no_license
chenyexin2012/netty-learning
19ad918f96575863abf9b830addfc6cb75f5e753
af4e449be94815e924aafb7a6b7b69fb939c2e64
refs/heads/master
2021-07-23T22:13:00.970798
2020-06-15T11:33:14
2020-06-15T11:33:14
186,567,246
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package com.holmes.rpc; public class App { public static void main(String[] args) { System.out.println(App.class.getTypeName()); System.out.println(App.class.getName()); System.out.println(App.class.getCanonicalName()); System.out.println(App.class.getSimpleName()); } }
[ "chenyexin2012@126.com" ]
chenyexin2012@126.com
af5338cb7fb4a6c4451f892818eb41fc37c02e0f
d60d72dc8afce46eb5125027d536bab8d43367e3
/module/CMSJava-core/src/shu/cms/gma/gbp/CIECAM02Vendor.java
8995c9d5f4b6d4b2c48fd69f552c25b252ee3db5
[]
no_license
enessssimsek/cmsjava
556cd61f4cab3d1a31f722138d7a6a488c055eeb
59988c118159ba49496167b41cd0cfa9ea2e3c74
refs/heads/master
2023-03-18T12:35:16.160707
2018-10-29T08:22:16
2018-10-29T08:22:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,434
java
package shu.cms.gma.gbp; import shu.cms.colorspace.independ.*; import shu.cms.hvs.cam.ciecam02.*; import shu.cms.hvs.cam.ciecam02.ViewingConditions; import shu.cms.profile.*; /** * <p>Title: Colour Management System</p> * * <p>Description: a Colour Management System by Java</p> * * <p>Copyright: Copyright (c) 2009</p> * * <p>Company: skygroup</p> * * @author not attributable * @version 1.0 */ public class CIECAM02Vendor extends LChVendor { public CIECAM02Vendor(ProfileColorSpace pcs, ViewingConditions vc) { this(pcs, new CIECAM02(vc)); } public CIECAM02Vendor(ProfileColorSpace pcs, CIECAM02 cam02) { super(pcs); this.cam02 = cam02; // cam02.getViewingConditions().get this.white = (CIEXYZ) cam02.getViewingConditions().white.clone(); this.white.normalizeY(); } private CIEXYZ white; private CIECAM02 cam02; public double[] getLChValues(double[] rgbValues) { //先從pcs撈出d50 (or d65?) 的data //轉進cam, 得到JCh //XYZ的data應該對齊cam的白點吧! double[] XYZValues = pcs.toCIEXYZValues(rgbValues); CIEXYZ XYZ = new CIEXYZ(XYZValues, white); XYZ.normalizeWhite(); CIECAM02Color JCh = cam02.forward(XYZ); double[] JChValues = JCh.getJChValues(); return JChValues; } public double[] getLChValues(double[] rgbValues, CIEXYZ referenceWhite) { return getLChValues(rgbValues); } }
[ "skyforce@gmail.com" ]
skyforce@gmail.com
2ab8ce64fc40e4d1fdc76a49deb0287eee873762
78eccb568a50bd840c6d0643b7d659bfc4fc1e7d
/back_end/visit/src/main/java/com/kang/visit/config/redis/prefix/base/BasePrefix.java
757bd1d1fc9f2d67a48d14ba27c546b1d1025564
[]
no_license
zhaokangye/visitDataCollect
18183e184e7f2a91aad916b22b88a9fceb5106a0
7b3950b6bddbe9a05b2d7682991fb8f05dfe9d81
refs/heads/master
2022-10-25T14:38:06.424979
2019-12-05T04:14:30
2019-12-05T04:14:30
207,834,878
2
0
null
2022-10-12T20:34:39
2019-09-11T14:39:06
JavaScript
UTF-8
Java
false
false
615
java
package com.kang.visit.config.redis.prefix.base; public abstract class BasePrefix implements KeyPrefix{ private int expireSeconds; private String prefix; public BasePrefix(String prefix) {//0代表永不过期 this(0, prefix); } public BasePrefix(int expireSeconds, String prefix) { this.expireSeconds = expireSeconds; this.prefix = prefix; } public int expireSeconds() {//默认0代表永不过期 return expireSeconds; } public String getPrefix() { //String className = getClass().getSimpleName(); return prefix; } }
[ "1260502253@qq.com" ]
1260502253@qq.com
9b13d6fc16632ef9cf4f14559a4ac4602c32c767
b5a3264c6bd853a8416b2efb586b28b58e0106b4
/MyLauncherTest/app/src/main/java/com/jchun/mylauncher/widget/ControllerImp.java
2949bba694fdc33175657f27e130fb12a63d94a0
[]
no_license
cc-shifo/copyoflauncher
3ad86eb8a582bd171b40371710f59b20ef16c0fb
5a308d161e042d3cf3b0d587b3f1f7dec1727ad7
refs/heads/master
2021-05-15T18:48:02.387657
2017-10-20T09:25:08
2017-10-20T09:25:08
107,651,866
0
0
null
null
null
null
UTF-8
Java
false
false
6,724
java
package com.jchun.mylauncher.widget; import android.content.Intent; import android.os.AsyncTask; import android.widget.Toast; import com.jchun.mylauncher.activity.MainActivity; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /** * Created by Administrator on 17-9-30. */ public class ControllerImp implements Controller{ @Override public void initData(final List<ApplicationInfo> list) { AsyncTask<String, String, String> tast = new AsyncTask<String, String, String>() { @Override protected String doInBackground(String... params) { // List<ApplicationInfo> child = new ArrayList<ApplicationInfo>(); for (int i = 0; i < 8; i++) { ApplicationInfo info = new ApplicationInfo(); info.setId(i + ""); info.setTitle("应用" + i); info.setOrder(i); if (i == 0) { info.setImgUrl("http://img3.imgtn.bdimg.com/it/u=568867752,3099839373&fm=21&gp=0.jpg"); } else if (i == 1) { info.setImgUrl("http://a2.att.hudong.com/04/58/300001054794129041580438110_950.jpg"); } else if (i == 2) { info.setImgUrl("http://img.sc115.com/uploads/sc/jpgs/11/pic1916_sc115.com.jpg"); } else if (i == 3) { info.setImgUrl("http://pic12.nipic.com/20110222/6660820_111945190101_2.jpg"); } else if (i == 4) { info.setImgUrl("http://pica.nipic.com/2007-12-26/2007122602930235_2.jpg"); } else if (i == 5) { info.setImgUrl("http://pic9.nipic.com/20100902/5615113_084913055054_2.jpg"); } else if (i == 6) { info.setImgUrl("http://pica.nipic.com/2008-01-03/200813165855102_2.jpg"); } else if (i == 7) { info.setImgUrl("http://pica.nipic.com/2008-03-20/2008320152335853_2.jpg"); } else { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logo)); info.setImgUrl("http://pic2.ooopic.com/01/26/61/83bOOOPIC72.jpg"); } // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logo)); list.add(info); } // for (int i = 0; i < 13; i++) { // ApplicationInfo info = new ApplicationInfo(); // info.setId(i + "aa"); // info.setTitle("应用" + i); // info.setId(i + ""); // info.setOrder(i); // if (i == 0) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a1)); // } else if (i == 1) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a2)); // } else if (i == 2) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a3)); // } else if (i == 3) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a4)); // } else if (i == 4) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a5)); // } else if (i == 5) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a6)); // } else if (i == 6) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a7)); // } else if (i == 7) { // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.a8)); // } else { // // info.setIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logo)); // info.setImgUrl("http://img3.imgtn.bdimg.com/it/u=568867752,3099839373&fm=21&gp=0.jpg"); // } // child.add(info); // } // FolderInfo folder = new FolderInfo(); // folder.setId(25 + ""); // folder.setIcons(child); // folder.setOrder(25); // folder.setTitle("文件夹"); // list.add(folder); Collections.sort(list, new Comparator<ApplicationInfo>() { public int compare(ApplicationInfo arg0, ApplicationInfo arg1) { return arg0.getOrder() - arg1.getOrder(); } }); return null; } protected void onPostExecute(String result) { // loaded(); } }; tast.execute(""); } @Override public void onSynchronize() { // Toast.makeText(MainActivity.this, "正在同步数据", Toast.LENGTH_SHORT).show(); } @Override public void onAppClick(ApplicationInfo app) { // Toast.makeText(MainActivity.this, "点击了" + app.getTitle(), Toast.LENGTH_SHORT).show(); } @Override public void onAppRemove(ApplicationInfo app) { // Toast.makeText(MainActivity.this, "删除" + app.getTitle(), Toast.LENGTH_SHORT).show(); // Intent intent = new Intent(RECEIVER_ADD_APP); // sendBroadcast(intent); } }
[ "502091250@qq.com" ]
502091250@qq.com
b3af81a918f99d6e2b996d07a8fde05853f59d6a
2b648240c95a936671f96997d67b53a6e12e4a35
/src/com/esri/gpt/control/livedata/ArcGISRenderer.java
67443205e499d1ae986310fdf202b162f6724913
[ "Apache-2.0" ]
permissive
GeoinformationSystems/GeoprocessingAppstore
f8b0cb6e10534a48568c73af94656fce21b8289d
cfccc6a67c34cdb680e61be0eacf365d8f9c1791
refs/heads/master
2021-01-10T21:43:57.556757
2015-07-06T11:26:04
2015-07-06T11:26:04
27,544,813
6
5
null
null
null
null
UTF-8
Java
false
false
1,376
java
/* See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Esri Inc. licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.esri.gpt.control.livedata; /** * ARCGIS Renderer. */ /*packge*/ abstract class ArcGISRenderer extends MapBasedRenderer { protected abstract String getUrl(); protected abstract boolean isImageService(); @Override protected String newLayerDeclaration() { if (isImageService()) { return "new esri.layers.ArcGISImageServiceLayer(\"" +getUrl()+ "\")"; } else { return "new esri.layers.ArcGISDynamicMapServiceLayer(\"" +getUrl()+ "\")"; } } @Override protected boolean generateBaseMap() { return false; } @Override public String toString() { return ArcGISRenderer.class.getSimpleName() + "("+getUrl()+")"; } }
[ "christin.henzen@tu-dresden.de" ]
christin.henzen@tu-dresden.de
9c059706a7f3a7c547a09a2d3093e366ee2d24bb
78107eb3ec6bd4b3338ba27126f29c1716a0d64e
/app/src/main/java/com/example/application/ui/home/sign/Sign.java
84e7e5261fdc3ac44f651ab41203b12567c187b4
[]
no_license
wangxuanx/Application
23eeb70cfd93fcfa364b2bfafbb5b3113f06603f
56484971f1d4053b62f911c801bffce814a4f4f7
refs/heads/master
2023-06-12T23:09:41.747736
2020-06-10T05:57:38
2020-06-10T05:57:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
687
java
package com.example.application.ui.home.sign; public class Sign { private int type; private String title; private String user; private String time; public int getType() { return type; } public void setType(int type) { this.type = type; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } }
[ "1484642072@qq.com" ]
1484642072@qq.com
cfa69ac3ff6b4eee38cdd799e001ae25564abce4
a7717cb09e0a7c89a3409d01a58f62c2c41997e8
/src/main/java/zebra/example/common/schedule/ZebraBoardArticleCreationJob.java
030156ea8fabbf2813131b4d36cb110ace38b285
[]
no_license
sawhsong/alpaca
999989c2a06f8923cceb5f6c0432863b725a3e3d
783057130c19163b6b5eb2e901161155aefe10ba
refs/heads/master
2023-08-07T02:38:24.106460
2023-07-30T22:53:27
2023-07-30T22:53:27
143,237,867
0
0
null
null
null
null
UTF-8
Java
false
false
4,730
java
package zebra.example.common.schedule; import java.util.Iterator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.quartz.QuartzJobBean; import zebra.example.common.module.commoncode.ZebraCommonCodeManager; import zebra.example.common.module.key.ZebraKeyManager; import zebra.example.conf.resource.ormapper.dao.ZebraBoard.ZebraBoardDao; import zebra.example.conf.resource.ormapper.dto.oracle.ZebraBoard; import zebra.util.CommonUtil; import zebra.util.ConfigUtil; public class ZebraBoardArticleCreationJob extends QuartzJobBean { private Logger logger = LogManager.getLogger(getClass()); private ZebraBoardDao zebraBoardDao; public void setZebraBoardDao(ZebraBoardDao zebraBoardDao) { this.zebraBoardDao = zebraBoardDao; } @Override protected void executeInternal(JobExecutionContext context) throws JobExecutionException { addBoard(context); } @SuppressWarnings("rawtypes") private void addBoard(JobExecutionContext context) { String uid = CommonUtil.uid(); String contents = ""; try { ZebraBoard zebraBoard = new ZebraBoard(); logger.debug("ZebraBoardArticleCreationJob Begin : "+CommonUtil.getSysdate("yyyy-MM-dd HH:mm:ss")); zebraBoard.setArticleId(ZebraKeyManager.getId("ZEBRA_BOARD_S")); if (CommonUtil.toInt(CommonUtil.substring(uid, 0, 3)) % 2 == 0) { zebraBoard.setBoardType(ZebraCommonCodeManager.getCodeByConstants("BOARD_TYPE_NOTICE")); contents += "ZebraBoardArticleCreationJob System generated article - "+CommonUtil.getSysdate("yyyy-MM-dd HH:mm:ss")+" - "+uid+"\n\n"; contents += "context.getFireInstanceId() : "+context.getFireInstanceId()+"\n"; contents += "context.getJobRunTime() : "+CommonUtil.toString(context.getJobRunTime()/1000, "#,##0.00")+"\n"; contents += "context.getRefireCount() : "+context.getRefireCount()+"\n"; contents += "context.getFireTime() : "+CommonUtil.toString(context.getFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"\n"; contents += "context.getPreviousFireTime() : "+CommonUtil.toString(context.getPreviousFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"\n"; contents += "context.getNextFireTime() : "+CommonUtil.toString(context.getNextFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"\n\n"; contents += "System Generated UID : "+uid+"\n"; } else { JobDetail jobDetail = context.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); zebraBoard.setBoardType(ZebraCommonCodeManager.getCodeByConstants("BOARD_TYPE_FREE")); contents += "ZebraBoardArticleCreationJob System generated article - "+CommonUtil.getSysdate("yyyy-MM-dd HH:mm:ss")+" - "+uid+"</br></br>"; contents += "context.getFireInstanceId() : "+context.getFireInstanceId()+"</br>"; contents += "context.getJobRunTime() : "+CommonUtil.toString(context.getJobRunTime()/1000, "#,##0.00")+"</br>"; contents += "context.getRefireCount() : "+context.getRefireCount()+"</br>"; contents += "context.getFireTime() : "+CommonUtil.toString(context.getFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"</br>"; contents += "context.getPreviousFireTime() : "+CommonUtil.toString(context.getPreviousFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"</br>"; contents += "context.getNextFireTime() : "+CommonUtil.toString(context.getNextFireTime(), ConfigUtil.getProperty("format.dateTime.java"))+"</br></br>"; contents += "jobDetail.getDescription() : "+jobDetail.getDescription()+"</br></br>"; contents += "System Generated UID : "+uid+"</br></br>"; for (Iterator keys = jobDataMap.keySet().iterator(); keys.hasNext();) { String key = (String)keys.next(); contents += "jobDataMap("+key+") : "+jobDataMap.get(key)+"</br>"; } } zebraBoard.setWriterId("0"); zebraBoard.setWriterName("ZebraBoardArticleCreationJob"); zebraBoard.setWriterEmail(ConfigUtil.getProperty("mail.default.from")); zebraBoard.setWriterIpAddress("127.0.0.1"); zebraBoard.setArticleSubject("ZebraBoardArticleCreationJob System generated article - "+CommonUtil.getSysdate("yyyy-MM-dd HH:mm:ss")+" - "+uid); zebraBoard.setArticleContents(contents); zebraBoard.setInsertUserId("0"); zebraBoard.setInsertDate(CommonUtil.toDate(CommonUtil.getSysdate())); zebraBoard.setRefArticleId("-1"); zebraBoardDao.insert(zebraBoard); logger.debug("ZebraBoardArticleCreationJob End : "+CommonUtil.getSysdate("yyyy-MM-dd HH:mm:ss")); } catch (Exception ex) { ex.printStackTrace(); logger.error(ex); } } }
[ "sawhsong@gmail.com" ]
sawhsong@gmail.com
91c7b904f81b6c807c1c3822bb6910ae49cbcf32
af7f3ce774055981aa3832e036266702a3c37964
/standalone-core/src/main/java/io/github/underscore11code/ccord/core/CarbonCoreBootstrap.java
092ec045dd9e84e68a7b1da85e25ec21cd3991cb
[]
no_license
Hexaoxide/CarbonCord
d1218af01130e6be5271e42c2bbedfb7fc623987
7b021deb15ec8cc8c79e2661a1965ad51ae671c5
refs/heads/master
2023-03-23T12:47:01.257829
2021-03-24T00:02:39
2021-03-24T00:02:39
322,993,748
3
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package io.github.underscore11code.ccord.core; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; // Sorry, the one time when I can't use a static block or constructor. @SuppressWarnings("initialization.static.fields.uninitialized") public final class CarbonCoreBootstrap { private static final Logger logger = LoggerFactory.getLogger(CarbonCoreBootstrap.class); private static CarbonCore carbonCore; private CarbonCoreBootstrap() { } @SuppressWarnings({"dereference.of.nullable", "argument.type.incompatible"}) public static void main(final String[] args) { logger.info("Bootstrapping CarbonCord Core"); // https://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file try { carbonCore = new CarbonCore(new File(CarbonCoreBootstrap.class.getProtectionDomain().getCodeSource().getLocation() .toURI()).getParentFile()); } catch (final Exception e) { logger.error("FATAL: Error while starting up - {}: {}", e.getClass().getSimpleName(), e.getMessage()); logger.error("", e); try { carbonCore.shutdown(); } catch (final Exception shutdownException) { logger.error("Second error while shutting down, killing process...", shutdownException); System.exit(1); } } Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { carbonCore.shutdown(); } catch (final Exception e) { logger.error("Error while shutting down - {}: {}", e.getClass().getSimpleName(), e.getMessage()); logger.error("", e); } })); } }
[ "minecrafter11mrt@gmail.com" ]
minecrafter11mrt@gmail.com
9104de47c015e4c97c9a47a49e1dace1dcde503f
3ad9838f0e2a664e2af2551613972dbc448b8512
/src/main/java/com/example/mongoserver/config/SecurityConfig.java
7009c3bd7e1efdcb8e3a641fb1f654b3fdc1f9f3
[]
no_license
JessZHENG/mongo-server
c2fa5642339a074db9588c31df8a2ac539425063
907e45b15c8755620edcc576cd52a472d9c0e4b5
refs/heads/master
2021-05-20T03:28:53.513722
2020-04-01T12:18:00
2020-04-01T12:18:00
252,166,228
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.example.mongoserver.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; /** * Spring Security 配置类. * * @since 1.0.0 2017年3月8日 * @author <a href="https://waylau.com">Way Lau</a> */ @Configuration @EnableWebMvc public class SecurityConfig extends WebMvcConfigurerAdapter { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**").allowedOrigins("*") ; // 允许跨域请求 } }
[ "43813897+JessZHENG@users.noreply.github.com" ]
43813897+JessZHENG@users.noreply.github.com
80d5624ea3e3971ae9d0450131a87e39111aee7a
0a6f1dde4d0461ebaf530f69339e2c238a74f224
/pharmadex/generic2/src/main/java/org/msh/pharmadex/service/validator/PastDateValid.java
9b59403613ece0d4a412985f3f51fff117bd2708
[]
no_license
alexkurasoff/Pharmadex-Generic-2-nd
d776149523fbba5c1f790def7ea7c6345cdac5db
26e2b5b90f36c62b307ed8809fdf9ef33bd55cfe
refs/heads/main
2023-05-29T13:11:37.849764
2021-06-07T14:27:25
2021-06-07T14:27:25
364,581,463
0
0
null
null
null
null
UTF-8
Java
false
false
1,741
java
package org.msh.pharmadex.service.validator; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.ResourceBundle; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; /** * Author: dudchenko * проверка введенной даты * введенная дата позже текущей - ошибка */ @FacesValidator("pastDateValid") public class PastDateValid implements Validator { private final static Map<String, String> mapResource = new HashMap<String, String>(); static{ mapResource.put("apprDate", "error_apprdate_past"); mapResource.put("regExpiryDate", "error_regexp_past"); } @Override public void validate(FacesContext facesContext, UIComponent uiComponent, Object o) throws ValidatorException { ResourceBundle resourceBundle = facesContext.getApplication().getResourceBundle(facesContext, "msgs"); if(o == null){ FacesMessage msg = new FacesMessage(resourceBundle.getString("valid_value_req")); msg.setSeverity(FacesMessage.SEVERITY_ERROR); throw new ValidatorException(msg); } String key = uiComponent.getId(); String messKey = mapResource.get(key); Date curDate = new Date(); Date componentDate = (Date) o; if(componentDate.before(curDate)){ FacesMessage msg = new FacesMessage(componentDate + " " + resourceBundle.getString(messKey)); msg.setSeverity(FacesMessage.SEVERITY_ERROR); throw new ValidatorException(msg); } } }
[ "alex.kurasoff@gmail.com" ]
alex.kurasoff@gmail.com
b218c90267c43a4e9c7eecc6ff0f907422047913
608bfa6cad5c48c62329aa51b945cae45b762e7e
/app/src/main/java/chips/in/mvvmexample/model/User.java
b1cbdc5f2b02aff450bddbd51215e9e2be0c5cbf
[]
no_license
KamalNishad/MvvmExample
23c0065445cdeecb15048b497d6416df2a1380ec
c557b2cb30ee811630d7c49c039882e452feea42
refs/heads/master
2023-05-22T07:40:00.864461
2021-06-14T06:51:00
2021-06-14T06:51:00
376,725,421
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package chips.in.mvvmexample.model; public class User { private String email; private String passwod; public String emailhint; public String passwordhint; public User(String emailhint, String passwordhint) { this.emailhint = emailhint; this.passwordhint = passwordhint; } }
[ "44111565+KamalNishad@users.noreply.github.com" ]
44111565+KamalNishad@users.noreply.github.com
cd3782be8240e266c2429243d15c0b57b5f61f6b
17e3684165cf1c2596b7103fa7820180254e9236
/lambda-behave/src/test/java/com/insightfullogic/lambdabehave/example/ExpectationSpec.java
3f5b790b510e1dd05eebecb886c51750c4229d98
[ "MIT" ]
permissive
neomatrix369/lambda-behave
aa2e7b2ac7d96ca866bc02e72c0322c4d4a9cbf8
cc8b44e99021a14aab21cf28156f4515fc0c4f55
refs/heads/master
2021-11-28T12:53:37.442195
2018-06-17T12:39:22
2018-06-17T12:39:22
21,961,094
0
0
MIT
2020-10-13T23:41:45
2014-07-17T23:26:27
Java
UTF-8
Java
false
false
3,264
java
package com.insightfullogic.lambdabehave.example; import com.insightfullogic.lambdabehave.JunitSuiteRunner; import org.junit.runner.RunWith; import java.util.Arrays; import java.util.List; import static com.insightfullogic.lambdabehave.Suite.describe; /** * This example specification is designed more as a way of testing out the API and * showing that it is readable and usable than actually testing out the matcher API. */ @RunWith(JunitSuiteRunner.class) public class ExpectationSpec {{ describe("the different forms of expectation", it -> { it.should("support basic expectations over values", expect -> { House greenGables = new House("Green Gables", "Anne", true); List<House> houses = Arrays.asList(greenGables); Object nothing = null; expect.that(greenGables) .instanceOf(House.class) .is(greenGables) .isEqualTo(greenGables) .isIn(houses) .isIn(greenGables) .isNotNull() .sameInstance(greenGables) .and(nothing).toBeNull(); }); it.should("allow you write expectations about different collection values", expect -> { House greenGables = new House("Green Gables", "Anne", true); House kensingtonPalace = new House("Kensington Palace", "The Royal Family", false); House nothing = null; List<House> houses = Arrays.asList(greenGables, kensingtonPalace, nothing); expect.that(houses) .hasItem(greenGables) .contains(greenGables, kensingtonPalace, nothing) .containsInAnyOrder(nothing, kensingtonPalace, greenGables) .hasItems(kensingtonPalace, greenGables) .hasSize(3) .isNotNull() .sameInstance(houses) .never() .toBeNull(); }); it.should("support expectations about different string values", expect -> { String str = "The quick brown fox jumps over the lazy dog"; expect.that(str) .containsString("quick brown") .equalToIgnoringCase("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG") .endsWith("lazy dog") .startsWith("The quick") .is(str); }); it.should("support expectations about different array values", expect -> { final String[] strs = { "The quick brown", "fox jumps over", "the lazy dog" }; expect.that(strs) .isArrayWithSize(3) .isArrayWithItem("the lazy dog") .is(strs); }); }); }} class House { private final String name; private final String owner; private final boolean isFictional; House(String name, String owner, boolean isFictional) { this.name = name; this.owner = owner; this.isFictional = isFictional; } public String getName() { return name; } public String getOwner() { return owner; } public boolean isFictional() { return isFictional; } }
[ "richard.warburton@gmail.com" ]
richard.warburton@gmail.com
016527c4566ffc5a878a9d0fcdd63f5277ddbca0
ff63cc2fa7e7574718e3480a39b4cface8afef9c
/src/java/br/gov/sp/cps/antena/util/ByteImg.java
ffd213dbcd56459c81c38f0b554b3ed991e1f75b
[]
no_license
danielrares1/inova-antena-java
d1071a962ff27fbce5f0fa022dd4d3dee31d6f95
5f25f91d885a326a4eb60c0bb62f311144f9d394
refs/heads/master
2020-07-08T08:57:39.792585
2019-12-13T17:11:15
2019-12-13T17:11:15
203,625,240
0
0
null
2019-09-13T16:47:03
2019-08-21T16:39:44
Java
UTF-8
Java
false
false
408
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package br.gov.sp.cps.antena.util; /** * * @author daniel.rares */ public class ByteImg { public void upload (String teste, String nome) { } }
[ "matheusmqar@gmail.com" ]
matheusmqar@gmail.com
15a09cb328c22d1e119fc72ba72c026bc9d6f431
07ebb58a1d18769ce4764c540f1adf0f752f8a0c
/src/com/company/Balls.java
82d133f1fdbb9e1272d82fec9bd6846f9a35d238
[]
no_license
aidinrakanov/M2.HM2.2
38c3e29e89aedccb54baea117af31b85e32bd2f3
800375224fccd9143135e5f7286c4fd551ee260a
refs/heads/master
2020-12-29T22:32:25.393201
2020-02-08T14:36:41
2020-02-08T14:36:41
238,756,989
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.company; public class Balls extends Toys { private int size; private String type; public Balls(int price, int size, String type) { super(price); this.size = size; this.type = type; } public int getSize() { return size; } public String getType() { return type; } @Override public void print() { System.out.println("Мячик " + "| размер: "+getSize() + "| тип: " + getType() + "| цена: " + getPrice() ); } }
[ "altynaikanatbekova@gmail.com" ]
altynaikanatbekova@gmail.com
9fa0e2f62f61b8d21eb52d44731cccdf4bf2fa36
3f5c18e8384da80b72e712e2129f3442a10c3257
/Defining Classes Exercise/SpeedRacing/Main.java
2b317a5019c88dd8c4b0572d743f4d9a03aa58ae
[]
no_license
altnum/Java-Advanced
b356928c88229f9b0aa12544a94e6d7b80bd06ec
3741bda782048f1b9d1633e10342a7f42cb36ffe
refs/heads/master
2023-02-04T03:38:15.746179
2020-12-14T18:28:44
2020-12-14T18:28:44
295,775,251
0
0
null
2020-10-06T18:30:44
2020-09-15T15:45:42
Java
UTF-8
Java
false
false
1,441
java
package SpeedRacing; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(reader.readLine()); List<Car> carsToTrack = new LinkedList<>(); for (int i = 0; i < n; i++) { String[] info = reader.readLine().split("\\s+"); carsToTrack.add(new Car(info[0], Double.parseDouble(info[1]), Double.parseDouble(info[2]))); } String command = reader.readLine(); while (!"End".equals(command)) { String[] tokens = command.split("\\s+"); int distance = Integer.parseInt(tokens[2]); for (Car c : carsToTrack) { if (tokens[1].equals(c.getModel())) { if (c.CanTravel(distance)) { c.setFuelAmount(distance); c.setDistance(distance); } } } command = reader.readLine(); } reader.close(); carsToTrack .forEach(e -> { System.out.printf("%s %.2f %d%n", e.getModel(), e.getFuelAmount(), e.getDistance()); }); } }
[ "altnum16@gmail.com" ]
altnum16@gmail.com
9467964915c04cb6d0f2c48dfe2efb7e1068e1d5
f64db1f2414a8327ba411e6223d9495dae4a2d46
/Filehandling.java
a69cdf58d297c68169b57e9f45f20cb4f6b6fb47
[]
no_license
amitk95/filehandling
0734e05ead301c025dc061edd0410fa81542c4d1
d76f1367eb4efdcdf4f1f50add5836d99e21fbb2
refs/heads/master
2023-07-31T12:45:47.120465
2021-09-21T17:20:40
2021-09-21T17:20:40
408,908,158
0
0
null
null
null
null
UTF-8
Java
false
false
148
java
package filehandling; public class Filehandling { public static void main(String[] args) { // TODO Auto-generated method stub } }
[ "noreply@github.com" ]
noreply@github.com
ebadf0c99872c52ac2991e9108b5aadb9d63b4cd
c46e8e2f7f110a72e1df36d5d08b7d7d6fd48705
/spring-boot-student-data-redis-distributed-lock/src/test/java/com/xiaolyuh/service/TestRedisLockService.java
30b2338c03bd738745641d5dc5604d6ff480bae9
[]
no_license
learn-spring-project/spring-boot-student
72d090080cfc2cda05e1ce13ce106900dde30774
750f64d6ee618bae7c702d493f092704178d8ada
refs/heads/master
2021-08-12T07:37:17.940192
2017-11-14T14:42:38
2017-11-14T14:42:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,357
java
package com.xiaolyuh.service; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class TestRedisLockService { public static final Logger logger = LoggerFactory.getLogger(PersonService.class); static int i = 0; @Autowired PersonService personService; @Test public void redisLock() { while (i++ < 1000) { new Thread(new Runnable() { @Override public void run() { personService.redisLock(i); } }).start(); } sleep(); } @Test public void redisLock2() { while (i++ < 1000) { new Thread(new Runnable() { @Override public void run() { personService.redisLock2(i); } }).start(); } sleep(); } private void sleep() { try { Thread.sleep(999999999999999999L); } catch (InterruptedException e) { logger.info(e.getMessage(), e); } } }
[ "xiaolyuh@163.com" ]
xiaolyuh@163.com
59aa87cf2482675b6b65025bb8bddfaf4c20eb19
5b8834558ff8b775cd3f4cc5253596630345d939
/src/main/java/com/cpp/shareremind/dao/ShareValueDao.java
3fe0e14128ed147f8827fc65ae451becc94f43f6
[]
no_license
cpp597455873/shareremind
874f8f3ca4d6adfd6b0e9df250671b6edd150e57
3be9b98ce06e96c8cce3da1cbd183c9688d93992
refs/heads/master
2020-03-22T15:13:16.932239
2018-07-10T10:18:59
2018-07-10T10:18:59
140,236,339
0
0
null
null
null
null
UTF-8
Java
false
false
1,407
java
package com.cpp.shareremind.dao; import com.cpp.shareremind.model.ShareHoldNow; import com.cpp.shareremind.model.ShareValue; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface ShareValueDao { @Select("select * from share") List<ShareValue> getShareValue(); @Select("insert into share (share_code, value, share_time) values (#{shareCode},#{value},#{shareTime})") List<ShareValue> insert(ShareValue shareValue); @Select("select min(value) min_max_value from (select value from share where share_code=#{share_code} and share_time>#{today} order by value desc limit 10) a") Double getMinMax(@Param("share_code") String share_code, @Param("today") String today); @Select("select max(value) from share where share_code=#{share_code} and share_time>#{today}") Double getTodayMax(@Param("share_code") String share_code, @Param("today") String today); @Select("select a.*,b.value*a.share now_total,a.cost*a.share cost_total,b.share_time,(b.value-a.cost)*a.share profit_total,b.value from share_hold a left join (select share_code,value,share_time from share where id in (select max(id) from share group by share_code having share_code in (select code from share_hold))) b on a.code=b.share_code") List<ShareHoldNow> getLatestPrice(); }
[ "chenpiaopiao@lightinthebox" ]
chenpiaopiao@lightinthebox
1faf0df914539b5cadd0b5d534d1841cd4a295da
084275c4e66fe1bbc611393e920f7a18480c3120
/app/src/main/java/r12/retrofitrssxmljson/GitHub/GitHubUser.java
8fd942c9e2697ba3f376cdde2cf2430e877cdbf9
[]
no_license
R12rus/Retrofit-RssXml-Json
b97fccb29671d7a7b473b89309d08e26a2389d6c
2f9d424ca60edef8571d22e4ef1a41647600f362
refs/heads/master
2021-06-11T14:15:05.420647
2016-12-14T13:52:31
2016-12-14T13:52:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
12,001
java
package r12.retrofitrssxmljson.GitHub; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class GitHubUser { @SerializedName("login") @Expose private String login; @SerializedName("id") @Expose private Integer id; @SerializedName("avatar_url") @Expose private String avatarUrl; @SerializedName("gravatar_id") @Expose private String gravatarId; @SerializedName("url") @Expose private String url; @SerializedName("html_url") @Expose private String htmlUrl; @SerializedName("followers_url") @Expose private String followersUrl; @SerializedName("following_url") @Expose private String followingUrl; @SerializedName("gists_url") @Expose private String gistsUrl; @SerializedName("starred_url") @Expose private String starredUrl; @SerializedName("subscriptions_url") @Expose private String subscriptionsUrl; @SerializedName("organizations_url") @Expose private String organizationsUrl; @SerializedName("repos_url") @Expose private String reposUrl; @SerializedName("events_url") @Expose private String eventsUrl; @SerializedName("received_events_url") @Expose private String receivedEventsUrl; @SerializedName("type") @Expose private String type; @SerializedName("site_admin") @Expose private Boolean siteAdmin; @SerializedName("name") @Expose private Object name; @SerializedName("company") @Expose private Object company; @SerializedName("blog") @Expose private Object blog; @SerializedName("location") @Expose private Object location; @SerializedName("email") @Expose private Object email; @SerializedName("hireable") @Expose private Object hireable; @SerializedName("bio") @Expose private Object bio; @SerializedName("public_repos") @Expose private Integer publicRepos; @SerializedName("public_gists") @Expose private Integer publicGists; @SerializedName("followers") @Expose private Integer followers; @SerializedName("following") @Expose private Integer following; @SerializedName("created_at") @Expose private String createdAt; @SerializedName("updated_at") @Expose private String updatedAt; public String getAllInfo(){ String allInfo = login + "\n" + id + "\n" + avatarUrl + "\n" + gravatarId + "\n" + url + "\n" + htmlUrl + "\n" + followersUrl + "\n" + followingUrl + "\n" + gistsUrl + "\n" + starredUrl + "\n" + subscriptionsUrl + "\n" + organizationsUrl + "\n" + reposUrl + "\n" + eventsUrl + "\n" + receivedEventsUrl + "\n" + type + "\n" + siteAdmin + "\n" + name + "\n" + company + "\n" + blog + "\n" + location + "\n" + email + "\n" + hireable + "\n" + bio + "\n" + publicRepos + "\n" + publicGists + "\n" + followers + "\n" + following + "\n" + createdAt + "\n" + updatedAt; return allInfo; } /** * * @return * The login */ public String getLogin() { return login; } /** * * @param login * The login */ public void setLogin(String login) { this.login = login; } /** * * @return * The id */ public Integer getId() { return id; } /** * * @param id * The id */ public void setId(Integer id) { this.id = id; } /** * * @return * The avatarUrl */ public String getAvatarUrl() { return avatarUrl; } /** * * @param avatarUrl * The avatar_url */ public void setAvatarUrl(String avatarUrl) { this.avatarUrl = avatarUrl; } /** * * @return * The gravatarId */ public String getGravatarId() { return gravatarId; } /** * * @param gravatarId * The gravatar_id */ public void setGravatarId(String gravatarId) { this.gravatarId = gravatarId; } /** * * @return * The url */ public String getUrl() { return url; } /** * * @param url * The url */ public void setUrl(String url) { this.url = url; } /** * * @return * The htmlUrl */ public String getHtmlUrl() { return htmlUrl; } /** * * @param htmlUrl * The html_url */ public void setHtmlUrl(String htmlUrl) { this.htmlUrl = htmlUrl; } /** * * @return * The followersUrl */ public String getFollowersUrl() { return followersUrl; } /** * * @param followersUrl * The followers_url */ public void setFollowersUrl(String followersUrl) { this.followersUrl = followersUrl; } /** * * @return * The followingUrl */ public String getFollowingUrl() { return followingUrl; } /** * * @param followingUrl * The following_url */ public void setFollowingUrl(String followingUrl) { this.followingUrl = followingUrl; } /** * * @return * The gistsUrl */ public String getGistsUrl() { return gistsUrl; } /** * * @param gistsUrl * The gists_url */ public void setGistsUrl(String gistsUrl) { this.gistsUrl = gistsUrl; } /** * * @return * The starredUrl */ public String getStarredUrl() { return starredUrl; } /** * * @param starredUrl * The starred_url */ public void setStarredUrl(String starredUrl) { this.starredUrl = starredUrl; } /** * * @return * The subscriptionsUrl */ public String getSubscriptionsUrl() { return subscriptionsUrl; } /** * * @param subscriptionsUrl * The subscriptions_url */ public void setSubscriptionsUrl(String subscriptionsUrl) { this.subscriptionsUrl = subscriptionsUrl; } /** * * @return * The organizationsUrl */ public String getOrganizationsUrl() { return organizationsUrl; } /** * * @param organizationsUrl * The organizations_url */ public void setOrganizationsUrl(String organizationsUrl) { this.organizationsUrl = organizationsUrl; } /** * * @return * The reposUrl */ public String getReposUrl() { return reposUrl; } /** * * @param reposUrl * The repos_url */ public void setReposUrl(String reposUrl) { this.reposUrl = reposUrl; } /** * * @return * The eventsUrl */ public String getEventsUrl() { return eventsUrl; } /** * * @param eventsUrl * The events_url */ public void setEventsUrl(String eventsUrl) { this.eventsUrl = eventsUrl; } /** * * @return * The receivedEventsUrl */ public String getReceivedEventsUrl() { return receivedEventsUrl; } /** * * @param receivedEventsUrl * The received_events_url */ public void setReceivedEventsUrl(String receivedEventsUrl) { this.receivedEventsUrl = receivedEventsUrl; } /** * * @return * The type */ public String getType() { return type; } /** * * @param type * The type */ public void setType(String type) { this.type = type; } /** * * @return * The siteAdmin */ public Boolean getSiteAdmin() { return siteAdmin; } /** * * @param siteAdmin * The site_admin */ public void setSiteAdmin(Boolean siteAdmin) { this.siteAdmin = siteAdmin; } /** * * @return * The name */ public Object getName() { return name; } /** * * @param name * The name */ public void setName(Object name) { this.name = name; } /** * * @return * The company */ public Object getCompany() { return company; } /** * * @param company * The company */ public void setCompany(Object company) { this.company = company; } /** * * @return * The blog */ public Object getBlog() { return blog; } /** * * @param blog * The blog */ public void setBlog(Object blog) { this.blog = blog; } /** * * @return * The location */ public Object getLocation() { return location; } /** * * @param location * The location */ public void setLocation(Object location) { this.location = location; } /** * * @return * The email */ public Object getEmail() { return email; } /** * * @param email * The email */ public void setEmail(Object email) { this.email = email; } /** * * @return * The hireable */ public Object getHireable() { return hireable; } /** * * @param hireable * The hireable */ public void setHireable(Object hireable) { this.hireable = hireable; } /** * * @return * The bio */ public Object getBio() { return bio; } /** * * @param bio * The bio */ public void setBio(Object bio) { this.bio = bio; } /** * * @return * The publicRepos */ public Integer getPublicRepos() { return publicRepos; } /** * * @param publicRepos * The public_repos */ public void setPublicRepos(Integer publicRepos) { this.publicRepos = publicRepos; } /** * * @return * The publicGists */ public Integer getPublicGists() { return publicGists; } /** * * @param publicGists * The public_gists */ public void setPublicGists(Integer publicGists) { this.publicGists = publicGists; } /** * * @return * The followers */ public Integer getFollowers() { return followers; } /** * * @param followers * The followers */ public void setFollowers(Integer followers) { this.followers = followers; } /** * * @return * The following */ public Integer getFollowing() { return following; } /** * * @param following * The following */ public void setFollowing(Integer following) { this.following = following; } /** * * @return * The createdAt */ public String getCreatedAt() { return createdAt; } /** * * @param createdAt * The created_at */ public void setCreatedAt(String createdAt) { this.createdAt = createdAt; } /** * * @return * The updatedAt */ public String getUpdatedAt() { return updatedAt; } /** * * @param updatedAt * The updated_at */ public void setUpdatedAt(String updatedAt) { this.updatedAt = updatedAt; } }
[ "Respect12rus_no_spam@mail.ru" ]
Respect12rus_no_spam@mail.ru
781901d7fff37fadd1d3387c42f112e713ac802a
8d55350b6ad5781de2d0a83a52fb76aa83e4b2fd
/broheim-websocket-core/src/main/java/com/broheim/websocket/core/message/SimpleMessage.java
143da15fd90c2a8759d20d631fdf68e07c0a9c71
[]
no_license
boyalearn/broheim
af2b77cc27b3c4f2a5c2af1417f036998c811677
ad32a19ae535a6c9545584f81038e85c09cb7e3d
refs/heads/master
2023-05-02T20:58:35.089288
2021-04-23T03:02:51
2021-04-23T03:02:51
357,521,319
3
0
null
null
null
null
UTF-8
Java
false
false
238
java
package com.broheim.websocket.core.message; import lombok.Getter; import lombok.Setter; @Setter @Getter public class SimpleMessage implements Message { private Integer serialNo; private String cmd; private String body; }
[ "2114517411@qq.com" ]
2114517411@qq.com
0b9518f96b3c3c820d1cc72104a2dcaef12debfb
a54c0e617c068ea695ca8cb7a0e9ed9f545b7da2
/src/Epsilon/Shape.java
67905d50778188ccc1dd690ceed8fa1b97af1e7e
[]
no_license
FuturaeVisionis/Generics
fbc7a76169e62de8dc65f25ae7db7b1f079f3e99
3f5518b28ceea203213646c721345a611272298a
refs/heads/master
2021-01-21T19:13:16.909033
2017-05-23T04:26:13
2017-05-23T04:26:13
92,128,965
0
0
null
null
null
null
UTF-8
Java
false
false
1,446
java
package Epsilon; import java.util.ArrayList; import java.util.List; /** * Created by ronald on 15/11/16. */ public abstract class Shape { abstract void draw(); abstract void colour(); } class Rectangle extends Shape { @Override void draw() { System.out.println("drawing rectangle"); } @Override void colour() { System.out.println("Colouring Rectangle."); } } class Circle extends Shape { @Override void draw() { System.out.println("drawing circle"); } @Override void colour() { System.out.println("Colouring Circle"); } } class Square extends Circle{ void draw() { System.out.println("I like square shaped figures."); } void colour(){ System.out.println("Colouring square."); } } class GenericTest { // creating a method that accepts only a child class of shape public static void drawShapes(List<? extends Shape> lists) { for (Shape s : lists) { s.draw(); s.colour(); } } public static void main(String[] args) { List<Rectangle> list1 = new ArrayList<>(); list1.add(new Rectangle()); drawShapes(list1); List<Circle> list2 = new ArrayList<>(); list2.add(new Circle()); drawShapes(list2); List<Square> list3 = new ArrayList<>(); list3.add(new Square()); drawShapes(list3); } }
[ "ronald@Ronalds-MacBook-Pro.local" ]
ronald@Ronalds-MacBook-Pro.local
c5c19b6e9b56ff84ceeb41c47320938f78ced6e5
cbac2ab9c8ff686dcd17ea58052afaabcdee55f5
/src/InheritanceAdvanced/Entity.java
7fa477cab29c37caaa749e365d365eb16f6547dd
[]
no_license
shaffy1211/Advanced-Java
e94e932362af00b0a7d0bffd316ac474c3189a03
3a54ea51efbd1f08370ef8ae1a60aa9e58414579
refs/heads/master
2022-09-16T06:04:32.919601
2020-06-02T02:04:41
2020-06-02T02:04:41
268,160,622
0
0
null
null
null
null
UTF-8
Java
false
false
251
java
package InheritanceAdvanced; public abstract class Entity implements Action { //this class is never instantiated. it is the blue print of any class protected int strenght; protected int speed; protected int health; public String name; }
[ "joga90zim@gmail.com" ]
joga90zim@gmail.com
906e352191f9729fc4f1a2943c634ea252bf705e
3818b06d9be9c542c74fcf2af4a20338301dcba6
/eqmanager/src/main/java/top/tosim/eqmanager/config/RootConfig.java
3d0fbfebacfb20272a7d1424c332ad85a4f92003
[]
no_license
tosim/web
f1f2daa0e6e647d1a772235de88f9880a16093f1
5ae1f22b11861dcea8cee3f10afd4f352d919552
refs/heads/master
2021-08-22T23:14:47.880924
2017-12-01T16:01:26
2017-12-01T16:01:26
108,406,893
0
0
null
null
null
null
UTF-8
Java
false
false
944
java
package top.tosim.eqmanager.config; import org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator; import org.springframework.context.annotation.*; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @Configuration @ComponentScan(basePackages = {"top.tosim.eqmanager"},excludeFilters = {@Filter(type = FilterType.ANNOTATION,value = EnableWebMvc.class)})//包扫描,排除mvc组件 @Import(DataSourceConfig.class)//加载数据源配置 public class RootConfig { //配置aop自动代理 /* @Bean public BeanNameAutoProxyCreator proxycreate(){ BeanNameAutoProxyCreator proxycreate = new BeanNameAutoProxyCreator(); proxycreate.setProxyTargetClass(true); proxycreate.setBeanNames("*ServiceImpl"); proxycreate.setInterceptorNames("transactionInterceptor"); return proxycreate; }*/ }
[ "82415327@qq.com" ]
82415327@qq.com
6be989e6e84dc6ec249f187fc5fb606593ecf3a4
23ff493b8800c3c43bb37303c7c7886bef34ba82
/src/hpu/zyf/service/ProductService.java
1d86bc82a9c29193f9ca027d9133f6e02ac0d182
[]
no_license
hpulzl/snackShop
223c381fd368ba207c4e7ea7f9cf56e2476974ff
74566253173b4abba569bfb44c5492a9254a473f
refs/heads/master
2021-01-01T05:29:03.445658
2017-04-13T06:53:34
2017-04-13T06:53:34
59,088,502
1
0
null
null
null
null
GB18030
Java
false
false
835
java
package hpu.zyf.service; import hpu.zyf.entity.ProductType; import hpu.zyf.entity.Productdetail; import java.util.List; /** * 商品信息的接口 * 商品的添加、删除、修改、查询()等 * @author admin * */ public interface ProductService { public boolean inserProduct(Productdetail pd)throws Exception; public boolean updateProduct(Productdetail pd)throws Exception; public boolean deleteProduct(String pdid)throws Exception; public Productdetail selectByPdid(String pdid)throws Exception; //通过条件进行分页查询,只需要传入页码,每页显示的数据时固定的。 public List<Productdetail> selectByPdExample(String example,int pageNo)throws Exception; //总共的页数 public int pageTotal(String example)throws Exception; public List<ProductType> selectAllType()throws Exception; }
[ "824337531@qq.com" ]
824337531@qq.com
1c3ccab16fa655a5b4355fec9f1a37d5c9ff8be0
4c01db9b8deeb40988d88f9a74b01ee99d41b176
/easymallTest/ht/src/main/java/cn/gao/ht/pojo/Module.java
194cc966148cf6d5e5ac4367e9d8908c12b5c81a
[]
no_license
GGPay/-
76743bf63d059cbf34c058b55edfdb6a58a41f71
20b584467142c6033ff92549fd77297da8ae6bfc
refs/heads/master
2020-04-29T10:24:29.949835
2018-04-07T04:34:19
2018-04-07T04:34:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,882
java
package cn.gao.ht.pojo; /** * Created by tarena on 2016/10/17. */ public class Module extends BaseEntity { private Module parent;//父级模块 private Integer ctype;//类型 1 主菜单 2 操作页面 3 按钮 private Integer state;// 状态 private Integer orderNo; //排序号 private String remark;//备注 private String name;//模块名称 private String moduleId;//模块id private String pId;//ztree 的父级节点 private boolean checked;//角色是否拥有该权限 有为true 没有为false public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } public String getId(){ return moduleId; } public String getpId() { return pId; } public void setpId(String pId) { this.pId = pId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getCtype() { return ctype; } public void setCtype(Integer ctype) { this.ctype = ctype; } public Module getParent() { return parent; } public void setParent(Module parent) { this.parent = parent; } public String getModuleId() { return moduleId; } public void setModuleId(String moduleId) { this.moduleId = moduleId; } public Integer getOrderNo() { return orderNo; } public void setOrderNo(Integer orderNo) { this.orderNo = orderNo; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Integer getState() { return state; } public void setState(Integer state) { this.state = state; } }
[ "pinggaimuir@sina.com" ]
pinggaimuir@sina.com
d0e2816cdf871f90c95863b6a05b3a61092729ab
e4a311c44eaf3e53bdc1c06f92505530709ebefc
/app/src/main/java/com/example/covid_19trackerapp/OnboardingActivity.java
30a722a163e0324f1757d30df7276923c69c6732
[]
no_license
sandeepkumaaar/COVID-19_TRACKER_Android_APP
5a9170bbf3637d5379096ae0666838ab0a1bbb8e
b106662f38923750d7da2168d8ae167611358688
refs/heads/master
2022-12-20T02:42:55.794750
2020-09-24T05:55:16
2020-09-24T05:55:16
291,047,648
0
0
null
null
null
null
UTF-8
Java
false
false
1,516
java
package com.example.covid_19trackerapp; import androidx.appcompat.app.AppCompatActivity; import androidx.viewpager2.widget.ViewPager2; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import com.example.covid_19trackerapp.adapters.OnboardingAdapter; import com.example.covid_19trackerapp.fragments.SlideOneFragment; import com.example.covid_19trackerapp.fragments.SlideThreeFragment; import com.example.covid_19trackerapp.fragments.SlideTwoFragment; public class OnboardingActivity extends AppCompatActivity { ViewPager2 viewpager2Slider; OnboardingAdapter onboardingAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_onboarding); viewpager2Slider = findViewById(R.id.viewpager2_slider); setupViewpager(viewpager2Slider); } private void setupViewpager(ViewPager2 viewpager2Slider) { onboardingAdapter = new OnboardingAdapter(getSupportFragmentManager(),getLifecycle()); onboardingAdapter.addFragment(new SlideOneFragment()); onboardingAdapter.addFragment(new SlideTwoFragment()); onboardingAdapter.addFragment(new SlideThreeFragment()); viewpager2Slider.setAdapter(onboardingAdapter); } }
[ "sandeepkumar8679@gmail.com" ]
sandeepkumar8679@gmail.com
1f6044d6e8df9ce45ba985c2ddd48516103d1058
6f7fc41f6a719a7aebaa7bfef51dcb121d83ba00
/src/main/java/com/waylau/spring/boot/blog/repository/VoteRepository.java
be0895b361fe36be1082702192666a8956cdf5e1
[]
no_license
baiyukun001/blog
7b3ca0be8c5eeb3ca5accefe92b9406f89523676
5f3c08900a9ccb9a9d4242115690cdd1aee494ce
refs/heads/master
2020-04-23T21:44:38.012769
2020-01-29T04:26:15
2020-01-29T04:26:15
171,479,327
1
0
null
null
null
null
UTF-8
Java
false
false
265
java
package com.waylau.spring.boot.blog.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.waylau.spring.boot.blog.domain.Vote; /** * Vote Repository接口. */ public interface VoteRepository extends JpaRepository<Vote, Long> { }
[ "412627624@qq.com" ]
412627624@qq.com
3cddb23277e4437377bbfafb53ad6165cbc59658
e3bc0cc08e2e99abeea39d5585c8edbcb7b6cf5b
/backend/tripplanner/src/main/java/com/szymonosicinski/tripplanner/Util/UserPrincipal.java
42033716f0d5edef5d00b39a9b2406f3bff23f22
[]
no_license
szymosi/TripPlanner
513343d9dfa885328f8fc2df86fcf2cd7cc06d07
30430b4124916029409da09593a388e8381e8de1
refs/heads/master
2022-04-11T22:15:41.999109
2020-02-12T18:27:20
2020-02-12T18:27:20
220,992,347
0
0
null
null
null
null
UTF-8
Java
false
false
3,080
java
package com.szymonosicinski.tripplanner.Util; import com.fasterxml.jackson.annotation.JsonIgnore; import com.szymonosicinski.tripplanner.Entity.User; import io.swagger.annotations.ApiModelProperty; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.*; public class UserPrincipal implements UserDetails { @ApiModelProperty(hidden = true) private UUID id; @ApiModelProperty(hidden = true) private String name; @ApiModelProperty(hidden = true) private String surname; @ApiModelProperty(hidden = true) @JsonIgnore private String password; @ApiModelProperty(hidden = true) @JsonIgnore private String username; @ApiModelProperty(hidden = true) private final Collection<? extends GrantedAuthority> authorities; public UserPrincipal(final UUID id, String name, String surname, String password, String username, final Collection<? extends GrantedAuthority> authorities){ this.id=id; this.name=name; this.surname=surname; this.password=password; this.username=username; this.authorities=authorities; } public static UserPrincipal create(final User user){ final List<GrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority("User")); return new UserPrincipal( user.getId(), user.getName(), user.getSurname(), user.getPassword(), user.getUsername(), authorities); } public UUID getId(){return id;} public String getName() {return name;} public String getSurname() {return surname;} @Override public String getUsername() { return username; } @Override public String getPassword() { return password; } @ApiModelProperty(hidden = true) @Override public boolean isAccountNonLocked() { return true; } @ApiModelProperty(hidden = true) @JsonIgnore @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities; } @ApiModelProperty(hidden = true) @Override public boolean isAccountNonExpired() { return true; } @ApiModelProperty(hidden = true) @Override public boolean isCredentialsNonExpired() { return true; } @ApiModelProperty(hidden = true) @Override public boolean isEnabled() { return true; } @Override public boolean equals(final Object object) { if (this == object) { return true; } if (object == null || getClass() != object.getClass()) { return false; } final UserPrincipal that = (UserPrincipal) object; return Objects.equals(id, that.id); } @Override public int hashCode() { return Objects.hash(id); } }
[ "szymon.osicinski@gmail.com" ]
szymon.osicinski@gmail.com
db5b2fedc2d756dd96ed87bd7c5df03bf36692ed
5bc431820d2562b9e065af91e14ef3f2aebcad88
/app/src/main/java/com/example/mark/book/Adapter.java
ac65086ab5a784df60a6b45679ca790e9e1e2184
[]
no_license
android2112/Books
e4407a820f0d225b3148f5e85c4b6087475a3bd4
58c55c530c8a9f789bf8d37ea98684acd9e12427
refs/heads/master
2020-03-21T00:04:00.987435
2018-06-22T11:20:30
2018-06-22T11:20:30
137,875,867
0
0
null
null
null
null
UTF-8
Java
false
false
3,311
java
package com.example.mark.book; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import org.w3c.dom.Text; import java.net.URLEncoder; import java.util.ArrayList; public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder> { private ArrayList<Book> mdataset; private Context context; public Adapter(ArrayList<Book> mdataset) { this.mdataset = mdataset; } @NonNull @Override public Adapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_titolo, parent, false); ViewHolder vh = new ViewHolder(v); return vh; } @Override public void onBindViewHolder(@NonNull Adapter.ViewHolder holder, int position) { holder.nometitolo.setText(mdataset.get(position).getTitolo()); /* holder.autore.setText(mdataset.get(position));*/ int listAuthors = mdataset.get(position).getauthors().size(); String authorlist = ""; for (int i = 0; i < listAuthors; i++) { authorlist += mdataset.get(position).getauthors().get(i); if (i < listAuthors - 1) authorlist += ", "; } holder.autore.setText(authorlist); Glide.with(holder.nometitolo.getContext()) .load(mdataset.get(position).getImageView()) .into(holder.imageView); } @Override public int getItemCount() { return mdataset.size(); } public class ViewHolder extends RecyclerView.ViewHolder { public CardView cardView; public TextView nometitolo; public TextView autore; public ImageView imageView; //ArrayList<String> idlibro; public ViewHolder(final View itemView) { super(itemView); cardView = itemView.findViewById(R.id.cv); nometitolo = itemView.findViewById(R.id.nometitolo); imageView = itemView.findViewById(R.id.image); autore = itemView.findViewById(R.id.autore); itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* String title = mdataset.get(getAdapterPosition()).getTitolo(); ArrayList<String> autori=mdataset.get(getAdapterPosition()).getauthors(); */ String id = mdataset.get(getAdapterPosition()).getId(); Intent nuovolibro = new Intent(v.getContext(), Detail_Activity.class); nuovolibro.putExtra("id", id); ((MainActivity) v.getContext()).startActivity(nuovolibro); } }); } } public void setBooksList(ArrayList<Book> books) { mdataset.clear(); mdataset.addAll(books); notifyDataSetChanged(); } }
[ "mabu32@hotmail.com" ]
mabu32@hotmail.com
b9c541a13451abf28b55c0bd47bda35cddc35156
7a1491f372becd08d954b13e562b55df58df976f
/HospitalTask/src/main/java/Com/Qa/HospitalTask/People.java
7f7a57a18aa1bfb6fbb81b4a624a3b283c63f535
[]
no_license
JHignett1995/HospitalTask
dc3ed8580555e237f9ebd108479c706841211bcb
b84fd405e7cbf2e33ac974089e888e38a31bafbb
refs/heads/master
2020-04-20T00:01:29.166280
2019-01-31T17:19:48
2019-01-31T17:19:48
168,511,727
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
package Com.Qa.HospitalTask; public abstract class People { private String foreName; private String surName; private int age; private String homeAddress; public People(String foreName, String surName, int age, String homeAddress) { super(); this.foreName = foreName; this.surName = surName; this.age = age; homeAddress = homeAddress; } public String getForeName() { return foreName; } public void setForeName(String foreName) { this.foreName = foreName; } public String getSurName() { return surName; } public void setSurName(String surName) { this.surName = surName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getAddress() { return homeAddress; } public void setAddress(String address) { homeAddress = address; } }
[ "jordan.hignett1@googlemail.com" ]
jordan.hignett1@googlemail.com
73a2d04fa2fa509c0891e36646a5eb2ca346d3d1
d58b335762b591fbb33e3f0175ebd7e64d5c6a67
/Client/src/client/Client.java
a55a9e9b7dd8abb71a24a5d9d9e365467ff56527
[]
no_license
GonzaloSS/RandomWordsPhrasesSockets
3212073133c318e8b561755d6f1fb8f8110c68cd
dc01fca9a17bde74f553773dfc42338db996427f
refs/heads/main
2023-02-26T17:26:40.986051
2021-01-21T22:59:08
2021-01-21T22:59:08
331,759,607
0
0
null
null
null
null
UTF-8
Java
false
false
2,101
java
package client; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.Socket; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; public class Client { /** * @param args the command line arguments */ public static void main(String[] args) { final int PORT = 40080; final String HOST = "192.168.0.33"; try { Socket socket = new Socket(HOST, PORT); comunicateWithServer(socket); } catch (IOException ex) { Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex); } } private static void comunicateWithServer(Socket socket) { try { OutputStream os = socket.getOutputStream(); OutputStreamWriter osw = new OutputStreamWriter(os); BufferedWriter bw = new BufferedWriter(osw); InputStream is = socket.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); Scanner sc = new Scanner(System.in); String line, lineFromServer, name; System.out.println("What's your name?: "); name = sc.nextLine(); do{ System.out.println("Press enter to start. "); line = sc.nextLine(); bw.write(name + " said: " + line); bw.newLine(); bw.flush(); lineFromServer = br.readLine(); System.out.println("Make a phrase with " + lineFromServer+ "."); }while (line != "FIN"); } catch (IOException ex) { Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex); } } }
[ "gonzalosantanasantana3@gmail.com" ]
gonzalosantanasantana3@gmail.com
f4b95c5f2f6e036b494535f346c38c6c6b8136f0
8f854fa78f5ddaceeabb7ffcd4da6a83e3eb808c
/Downwork-collective project/back-end/profile-micro/src/main/java/ro/ubb/downWork/profilemicro/dto/JobDto.java
613d15e8090609e964d6ac21be47923490c87059
[]
no_license
ancafai/faculty-projects
c3ac890a0abb724767517c72d2ab64fbfaf3fc2a
015492f50a20479513817fabed72910436a7effa
refs/heads/master
2020-04-01T14:01:17.473456
2018-10-16T12:15:56
2018-10-16T12:15:56
153,277,052
0
0
null
null
null
null
UTF-8
Java
false
false
1,490
java
package ro.ubb.downWork.profilemicro.dto; import ro.ubb.downWork.profilemicro.model.CostType; import ro.ubb.downWork.profilemicro.model.JobOccurrence; import ro.ubb.downWork.profilemicro.model.JobStatus; import java.sql.Date; import java.sql.Time; public class JobDto extends NewJobDto { private Long id; private JobStatus status; private Time startTime; private Time endTime; private JobDto() { } public JobDto(Long id, String title, String description, JobStatus status, String location, JobOccurrence occurrence, Date startDate, Date endDate, Time startTime, Time endTime, Double cost, CostType costType, String owner, String jobtype, Boolean isOffer) { super(title, description, location, occurrence, startDate, endDate, cost, costType, owner, jobtype, isOffer); this.id = id; this.status = status; this.startTime = startTime; this.endTime = endTime; } public Long getId() { return id; } public JobStatus getStatus() { return status; } public Time getStartTime() { return startTime; } public Time getEndTime() { return endTime; } @Override public String toString() { return "JobDto{" + "id=" + id + ", status=" + status + ", startTime=" + startTime + ", endTime=" + endTime + '}'; } }
[ "anca.okey@yahoo.com" ]
anca.okey@yahoo.com
d95df3423f48b37c3a85c836a4dbbf6c44970719
2af399844d08f7ed5a78ddecc550259b035cf3af
/src/HelloWorld.java
c958a04b81b427ae27778a1290b8c00e4020069a
[]
no_license
pkloves/javahelloworld
c5d64ad96ac55af25b37df157613ac61cc9eb0d7
ffb959433d883ffb0e3409d860bc1748b47f7b03
refs/heads/master
2020-06-12T19:55:30.634631
2016-12-06T18:35:45
2016-12-06T18:35:45
75,758,103
0
0
null
null
null
null
UTF-8
Java
false
false
115
java
public class HelloWorld { public static void main (String [] args) { System.out.println("Hello My World"); } }
[ "student@ip-10-13-14-189.us-west-2.compute.internal" ]
student@ip-10-13-14-189.us-west-2.compute.internal
50fc989e910446673cfa66f05bf125b627224161
2bd967f6deae50eb3e5b696b14a7e52762c9ee37
/src/main/java/hu/bp/lightrobot/LightRobotTD.java
1869ae0e65f9aa55c9153cc5f05de62b3602d5f0
[]
no_license
peterborkuti/java-lightrobot
f48cdd94d1438ec60dac2936c1842c79dd7ac92f
b55a674bc0e4a4e32d18cc86ed47cabe7e6b2943
refs/heads/master
2020-03-19T07:28:09.920321
2018-07-08T08:39:48
2018-07-08T08:39:48
136,116,402
0
0
null
null
null
null
UTF-8
Java
false
false
595
java
package hu.bp.lightrobot; import hu.bp.ai.agents.TemporalDifferenceAgent; import hu.bp.ai.interfaces.Environment; import hu.bp.ai.util.ActionUtil; import hu.bp.ai.util.MLUtil; import java.util.stream.IntStream; public class LightRobotTD extends TemporalDifferenceAgent { LightRobotTD(Environment world) { super(world, 0.1,0.1); } @Override public int getNumberOfActions() { return 2; } @Override public Integer[] getGreedyPolicy() { return IntStream.range(0, world.getNumberOfStates()).map( state-> MLUtil.argMax(policy[state]) ).boxed().toArray(Integer[]::new); } }
[ "peter@aspire" ]
peter@aspire
29b168f68f4e2b9d9aaa4b67f2691e8910e965a4
c659510cc660a02b17cb2de6312209c01066379e
/app/src/main/java/com/angle/hshb/servicedemo/DownloadActivity.java
363a4fb9d4cf84bba475ace56e867dafaa6056b3
[]
no_license
Angle-yc/ServiceDemo
b5c1dbe8c94043b73c106cd73bd8e806f9a2cd5a
78702075f6ba06e05d223050af7ba75830977f76
refs/heads/master
2021-05-06T21:51:55.143209
2017-12-01T03:06:01
2017-12-01T03:06:01
112,686,323
0
0
null
null
null
null
UTF-8
Java
false
false
2,710
java
package com.angle.hshb.servicedemo; import android.Manifest; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageManager; import android.os.IBinder; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Toast; import com.angle.hshb.servicedemo.service.DownloadService; public class DownloadActivity extends AppCompatActivity { private DownloadService.DownloadBinder downloadBinder; private ServiceConnection connection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { downloadBinder = (DownloadService.DownloadBinder) iBinder; } @Override public void onServiceDisconnected(ComponentName componentName) { } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_download); Intent intent = new Intent(this,DownloadService.class); startService(intent);//启动服务 bindService(intent,connection,BIND_AUTO_CREATE);//绑定服务 if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},1); } } public void startDownload(View view) { String url = "http://sw.bos.baidu.com/sw-search-sp/software/cc62bf36e918a/eclipse_win32_v4.7.0.exe"; downloadBinder.startDownLoad(url); } public void pauseDownload(View view) { downloadBinder.pauseDownload(); } public void cancelDownload(View view) { downloadBinder.cancelDownload(); } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { switch (requestCode){ case 1: if (grantResults.length > 0 && grantResults[0] != PackageManager.PERMISSION_GRANTED){ Toast.makeText(this, "拒绝权限将无法使用程序", Toast.LENGTH_SHORT).show(); finish(); } break; } } @Override protected void onDestroy() { super.onDestroy(); unbindService(connection); } }
[ "916374683@qq.com" ]
916374683@qq.com
550a34e08d3d5245777be965a62e63f0ca336f41
c8cd781b0ccf27363e17fe30d1ed6933258030f2
/simpleplayer/src/main/java/com/example/simpleplayer/player/icMediaPlayer.java
2baf626449d08724a6109544a75b32a3b8991eda
[]
no_license
krctech9999/AmlogicPlayer
d47efaf6062c5b01cf568ccb835f704d68a1dcd8
d4205ecffcbb8d6d42c5606e2517a73fa9a5b52e
refs/heads/master
2020-09-20T20:07:11.124488
2019-11-29T03:38:22
2019-11-29T03:38:22
224,579,445
0
0
null
null
null
null
UTF-8
Java
false
false
5,398
java
/* * Copyright (C) 2013-2014 Zhang Rui <bbcallen@gmail.com> * * 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 com.example.amlogicplayer.player; import java.io.IOException; import java.util.Map; import android.annotation.TargetApi; import android.content.Context; import android.net.Uri; import android.os.Build; import android.view.Surface; import android.view.SurfaceHolder; public interface icMediaPlayer { /* * Do not change these values without updating their counterparts in native */ public static final int MEDIA_INFO_UNKNOWN = 1; public static final int MEDIA_INFO_STARTED_AS_NEXT = 2; public static final int MEDIA_INFO_VIDEO_RENDERING_START = 3; public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700; public static final int MEDIA_INFO_BUFFERING_START = 701; public static final int MEDIA_INFO_BUFFERING_END = 702; public static final int MEDIA_INFO_BAD_INTERLEAVING = 800; public static final int MEDIA_INFO_NOT_SEEKABLE = 801; public static final int MEDIA_INFO_METADATA_UPDATE = 802; public static final int MEDIA_INFO_TIMED_TEXT_ERROR = 900; public static final int MEDIA_ERROR_UNKNOWN = 1; public static final int MEDIA_ERROR_SERVER_DIED = 100; public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200; public static final int MEDIA_ERROR_IO = -1004; public static final int MEDIA_ERROR_MALFORMED = -1007; public static final int MEDIA_ERROR_UNSUPPORTED = -1010; public static final int MEDIA_ERROR_TIMED_OUT = -110; public abstract void setDisplay(SurfaceHolder sh); public abstract void setDataSource(Context context, Uri uri) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException; public abstract void setDataSource(Context context, Uri uri, Map<String, String> header) throws IOException, IllegalArgumentException, SecurityException, IllegalStateException; public abstract void prepareAsync() throws IllegalStateException; public abstract void start() throws IllegalStateException; public abstract void stop() throws IllegalStateException; public abstract void pause() throws IllegalStateException; public abstract void setScreenOnWhilePlaying(boolean screenOn); public abstract int getVideoWidth(); public abstract int getVideoHeight(); public abstract boolean isPlaying(); public abstract void seekTo(long msec) throws IllegalStateException; public abstract long getCurrentPosition(); public abstract long getDuration(); public abstract void release(); public abstract void reset(); public abstract void setVolume(float leftVolume, float rightVolume); public abstract void setLogEnabled(boolean enable); public abstract boolean isPlayable(); public abstract void setOnPreparedListener(OnPreparedListener listener); public abstract void setOnCompletionListener(OnCompletionListener listener); public abstract void setOnBufferingUpdateListener( OnBufferingUpdateListener listener); public abstract void setOnSeekCompleteListener( OnSeekCompleteListener listener); public abstract void setOnVideoSizeChangedListener( OnVideoSizeChangedListener listener); public abstract void setOnErrorListener(OnErrorListener listener); public abstract void setOnInfoListener(OnInfoListener listener); /*-------------------- * Listeners */ public static interface OnPreparedListener { public void onPrepared(icMediaPlayer mp); } public static interface OnCompletionListener { public void onCompletion(icMediaPlayer mp); } public static interface OnBufferingUpdateListener { public void onBufferingUpdate(icMediaPlayer mp, int percent); } public static interface OnSeekCompleteListener { public void onSeekComplete(icMediaPlayer mp); } public static interface OnVideoSizeChangedListener { public void onVideoSizeChanged(icMediaPlayer mp, int width, int height, int sar_num, int sar_den); } public static interface OnErrorListener { public boolean onError(icMediaPlayer mp, int what, int extra); } public static interface OnInfoListener { public boolean onInfo(icMediaPlayer mp, int what, int extra); } /*-------------------- * Optional */ public abstract void setAudioStreamType(int streamtype); public abstract void setKeepInBackground(boolean keepInBackground); public abstract int getVideoSarNum(); public abstract int getVideoSarDen(); @Deprecated public abstract void setWakeMode(Context context, int mode); @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) public abstract void setSurface(Surface surface); }
[ "chevylin0802@gmail.com" ]
chevylin0802@gmail.com
b3ab61d0fc15de8a48048999813d75ff50ae2274
095b0f77ffdad9d735710c883d5dafd9b30f8379
/src/com/google/android/gms/games/multiplayer/realtime/RoomEntity.java
fafd97001003454ff189bc7f0870b4cac676a450
[]
no_license
wubainian/smali_to_java
d49f9b1b9b5ae3b41e350cc17c84045bdc843cde
47cfc88bbe435a5289fb71a26d7b730db8366373
refs/heads/master
2021-01-10T01:52:44.648391
2016-03-10T12:10:09
2016-03-10T12:10:09
53,547,707
1
0
null
null
null
null
UTF-8
Java
false
false
1,963
java
package com.google.android.gms.games.multiplayer.realtime import android.os.Parcelable$Creator; import android.os.Bundle; import java.util.ArrayList; import android.os.Parcel; public final class RoomEntity extends com.google.android.gms.internal.av implements com.google.android.gms.games.multiplayer.realtime.Room{ //instance field private final int a; private final String b; private final String c; private final long d; private final int e; private final String f; private final int g; private final Bundle h; private final ArrayList i; private final int j; //static field public static final Parcelable$Creator CREATOR; //clinit method static{ } //init method RoomEntity(int aint0, String aString0, String aString0, long along0, int aint0, String aString0, int aint0, Bundle aBundle0, ArrayList aArrayList0, int aint0){ } public RoomEntity(com.google.android.gms.games.multiplayer.realtime.Room aRoom0){ } //ordinary method static int a(com.google.android.gms.games.multiplayer.realtime.Room aRoom0){ } static boolean a(com.google.android.gms.games.multiplayer.realtime.Room aRoom0, Object aObject0){ } static synthetic boolean a(Integer aInteger0){ } static synthetic boolean a(String aString0){ } static String b(com.google.android.gms.games.multiplayer.realtime.Room aRoom0){ } static synthetic Integer m(){ } public synthetic Object a(){ } public String b(){ } public String c(){ } public long d(){ } public int describeContents(){ } public int e(){ } public boolean equals(Object aObject0){ } public String f(){ } public int g(){ } public Bundle h(){ } public int hashCode(){ } public ArrayList i(){ } public int j(){ } public int k(){ } public com.google.android.gms.games.multiplayer.realtime.Room l(){ } public String toString(){ } public void writeToParcel(Parcel aParcel0, int aint0){ } }
[ "guoliang@tigerjoys.com" ]
guoliang@tigerjoys.com
a43331b4789bd46a912c6e49cd23569bb4ada81c
9203a3b272e5d4376372c809dcb036c835b80728
/JwtAuth-master/Swagger Contract poc/spring-server-DIS/src/main/java/io/swagger/model/SubDivision.java
2b4faf88ca84fd3bbd9ef558a46820456a9aae29
[]
no_license
shree-vinayak/PraticeProjects
a6e701fd6beac3fbe6a45d02d05ecd6822289bb1
dc5d0f4bb2f9147db02e25277dc208b056bde483
refs/heads/master
2023-01-21T18:55:10.928472
2020-02-07T15:10:21
2020-02-07T15:10:21
228,643,752
0
0
null
2023-01-12T04:51:19
2019-12-17T15:16:48
Java
UTF-8
Java
false
false
3,593
java
package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Address; import io.swagger.model.Division; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.*; /** * SubDivision */ @Validated @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-05-27T11:55:04.724Z[GMT]") public class SubDivision { @JsonProperty("idDivision") private Integer idDivision = null; @JsonProperty("name") private String name = null; @JsonProperty("address") private Address address = null; @JsonProperty("division") private Division division = null; public SubDivision idDivision(Integer idDivision) { this.idDivision = idDivision; return this; } /** * Get idDivision * @return idDivision **/ @ApiModelProperty(example = "2005", value = "") public Integer getIdDivision() { return idDivision; } public void setIdDivision(Integer idDivision) { this.idDivision = idDivision; } public SubDivision name(String name) { this.name = name; return this; } /** * Get name * @return name **/ @ApiModelProperty(example = "Indore Sub Division", value = "") public String getName() { return name; } public void setName(String name) { this.name = name; } public SubDivision address(Address address) { this.address = address; return this; } /** * Get address * @return address **/ @ApiModelProperty(value = "") @Valid public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } public SubDivision division(Division division) { this.division = division; return this; } /** * Get division * @return division **/ @ApiModelProperty(value = "") @Valid public Division getDivision() { return division; } public void setDivision(Division division) { this.division = division; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SubDivision subDivision = (SubDivision) o; return Objects.equals(this.idDivision, subDivision.idDivision) && Objects.equals(this.name, subDivision.name) && Objects.equals(this.address, subDivision.address) && Objects.equals(this.division, subDivision.division); } @Override public int hashCode() { return Objects.hash(idDivision, name, address, division); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SubDivision {\n"); sb.append(" idDivision: ").append(toIndentedString(idDivision)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); sb.append(" division: ").append(toIndentedString(division)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "ankit.rajpoot@aartek.in" ]
ankit.rajpoot@aartek.in
2f6b9320f245259717757d6c520127b97834d00c
369270a14e669687b5b506b35895ef385dad11ab
/jdk.internal.vm.compiler/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
f91c94abbbf0b2d61d3a62fb50442c1b945e6426
[]
no_license
zcc888/Java9Source
39254262bd6751203c2002d9fc020da533f78731
7776908d8053678b0b987101a50d68995c65b431
refs/heads/master
2021-09-10T05:49:56.469417
2018-03-20T06:26:03
2018-03-20T06:26:03
125,970,208
3
3
null
null
null
null
UTF-8
Java
false
false
3,588
java
/* * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * */ package org.graalvm.compiler.phases.graph; import org.graalvm.compiler.core.common.type.ObjectStamp; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.ValuePhiNode; public class InferStamps { /** * Infer the stamps for all Object nodes in the graph, to make the stamps as precise as * possible. For example, this propagates the word-type through phi functions. To handle phi * functions at loop headers, the stamp inference is called until a fix point is reached. * <p> * This method can be used when it is needed that stamps are inferred before the first run of * the canonicalizer. For example, word type rewriting must run before the first run of the * canonicalizer because many nodes are not prepared to see the word type during * canonicalization. */ public static void inferStamps(StructuredGraph graph) { /* * We want to make the stamps more precise. For cyclic phi functions, this means we have to * ignore the initial stamp because the imprecise stamp would always propagate around the * cycle. We therefore set the stamp to an illegal stamp, which is automatically ignored * when the phi function performs the "meet" operator on its input stamps. */ for (Node n : graph.getNodes()) { if (n instanceof ValuePhiNode) { ValueNode node = (ValueNode) n; if (node.stamp() instanceof ObjectStamp) { assert node.stamp().hasValues() : "We assume all Phi and Proxy stamps are legal before the analysis"; node.setStamp(node.stamp().empty()); } } } boolean stampChanged; // The algorithm is not guaranteed to reach a stable state. int z = 0; do { stampChanged = false; /* * We could use GraphOrder.forwardGraph() to process the nodes in a defined order and * propagate long def-use chains in fewer iterations. However, measurements showed that * we have few iterations anyway, and the overhead of computing the order is much higher * than the benefit. */ for (Node n : graph.getNodes()) { if (n instanceof ValueNode) { ValueNode node = (ValueNode) n; if (node.stamp() instanceof ObjectStamp) { stampChanged |= node.inferStamp(); } } } ++z; } while (stampChanged && z < 10000); /* * Check that all the illegal stamps we introduced above are correctly replaced with real * stamps again. */ assert checkNoEmptyStamp(graph); } private static boolean checkNoEmptyStamp(StructuredGraph graph) { for (Node n : graph.getNodes()) { if (n instanceof ValuePhiNode) { ValueNode node = (ValueNode) n; assert node.stamp().hasValues() : "Stamp is empty after analysis. This is not necessarily an error, but a condition that we want to investigate (and then maybe relax or remove the assertion)."; } } return true; } }
[ "841617433@qq.com" ]
841617433@qq.com
8e5e4ac99252e57da31738eef7b6be65dd0d1f38
5d10b0b0b995823362d0cb40b16615d8a8c7a456
/src/main/java/com/ldbc/driver/dshini/db/neo4j/emdedded/handlers/index/IndexQueryNodeOnOfferIndexOperationHandler.java
348835a53d4844463f989c1ff562bc1d395f8829
[]
no_license
alexaverbuch/ldbc_bench-log_gen
c17eed3658e605fce3c2ac829496a76067a021de
7cc62f088cfeed334e7d564da7be83662f86af78
refs/heads/master
2021-01-02T22:51:25.194211
2013-08-22T17:45:41
2013-08-22T17:45:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.ldbc.driver.dshini.db.neo4j.emdedded.handlers.index; import java.util.Iterator; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import org.neo4j.helpers.collection.IteratorUtil; import com.ldbc.driver.OperationHandler; import com.ldbc.driver.OperationResult; import com.ldbc.driver.dshini.db.neo4j.emdedded.Neo4jConnectionStateEmbedded; import com.ldbc.driver.dshini.operations.index.IndexQueryNodeOnOfferIndexOperationFactory.IndexQueryNodeOnOfferIndexOperation; public class IndexQueryNodeOnOfferIndexOperationHandler extends OperationHandler<IndexQueryNodeOnOfferIndexOperation> { @Override protected OperationResult executeOperation( IndexQueryNodeOnOfferIndexOperation operation ) { int resultCode; int result; Neo4jConnectionStateEmbedded connection = (Neo4jConnectionStateEmbedded) getDbConnectionState(); Transaction tx = connection.getDb().beginTx(); try { Iterator<Node> nodes = connection.getDb().index().forNodes( operation.getIndexName() ).query( operation.getIndexQuery() ); resultCode = 0; result = IteratorUtil.count( nodes ); } catch ( Exception e ) { resultCode = -1; result = 0; } finally { tx.finish(); } return operation.buildResult( resultCode, result ); } }
[ "alex.averbuch@gmail.com" ]
alex.averbuch@gmail.com
035b155ee1a56e78aef11f80abe90b2e30bf7722
2bb86b458ae6a3bae3c93a355b8e07989fdae156
/app/src/main/java/com/oneside/ui/story/JokeDetailPageParam.java
327142233a34b4ccc9276ac11e215162303e81e5
[]
no_license
pingfuf/one_side_android
9877d46594e890f32101929454d86f48cb2ddd20
d0afa5411fd19d0c886f52fe4c0a743430c74807
refs/heads/master
2020-05-23T03:00:11.491026
2017-08-24T03:04:35
2017-08-24T03:04:35
48,836,831
0
0
null
null
null
null
UTF-8
Java
false
false
233
java
package com.oneside.ui.story; import com.oneside.base.model.BasePageParam; /** * Created by fupingfu on 2017/1/18. */ public class JokeDetailPageParam extends BasePageParam { public String title; public String content; }
[ "fupingfu@51talk.com" ]
fupingfu@51talk.com
bff0e94fa9f37ce82d972d61c02ae6c907c0e24c
8d614248c6bd6d1f0e527451e1e6261c0fdbecec
/gateway/src/test/java/com/org/myapp/sales/config/WebConfigurerTest.java
1b5755728169b40ca21a99175625fae20005c629
[]
no_license
gmarziou/so-59577185
609e0a420e48f2b22da3f007d2b19b5e3cd0994c
26a1fe0945976da2f4f145bbc3c397324d9c2e40
refs/heads/master
2022-07-20T13:32:27.523248
2020-01-03T16:55:44
2020-01-03T16:55:44
231,628,895
0
0
null
2022-07-07T15:26:54
2020-01-03T16:54:19
TypeScript
UTF-8
Java
false
false
7,183
java
package com.org.myapp.sales.config; import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.web.filter.CachingHttpHeadersFilter; import org.h2.server.web.WebServlet; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.springframework.http.HttpHeaders; import org.springframework.mock.env.MockEnvironment; import org.springframework.mock.web.MockServletContext; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import javax.servlet.*; import java.io.File; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Unit tests for the {@link WebConfigurer} class. */ public class WebConfigurerTest { private WebConfigurer webConfigurer; private MockServletContext servletContext; private MockEnvironment env; private JHipsterProperties props; @BeforeEach public void setup() { servletContext = spy(new MockServletContext()); doReturn(mock(FilterRegistration.Dynamic.class)) .when(servletContext).addFilter(anyString(), any(Filter.class)); doReturn(mock(ServletRegistration.Dynamic.class)) .when(servletContext).addServlet(anyString(), any(Servlet.class)); env = new MockEnvironment(); props = new JHipsterProperties(); webConfigurer = new WebConfigurer(env, props); } @Test public void testStartUpProdServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); webConfigurer.onStartup(servletContext); verify(servletContext).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class)); } @Test public void testStartUpDevServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); webConfigurer.onStartup(servletContext); verify(servletContext, never()).addFilter(eq("cachingHttpHeadersFilter"), any(CachingHttpHeadersFilter.class)); verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class)); } @Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowServletWebServerFactory container = new UndertowServletWebServerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg"); assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8"); assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8"); if (container.getDocumentRoot() != null) { assertThat(container.getDocumentRoot()).isEqualTo(new File("build/resources/main/static/")); } } @Test public void testCorsFilterOnApiPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( options("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST")) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) .andExpect(header().string(HttpHeaders.VARY, "Origin")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); } @Test public void testCorsFilterOnOtherPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/test/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test public void testCorsFilterDeactivated() throws Exception { props.getCors().setAllowedOrigins(null); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test public void testCorsFilterDeactivated2() throws Exception { props.getCors().setAllowedOrigins(new ArrayList<>()); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } }
[ "gael.marziou@gmail.com" ]
gael.marziou@gmail.com
c086c45ee8ba77912389db10a9cefbc9a3187ed5
3368c00b7bc6f06b65925429c26f0b971c727456
/src/main/java/validator/DataConverter.java
5b6586c26e4ccdd8dc3bcfc42bed21a66218f328
[]
no_license
dremlin2215/by.study.triangle
43a712c5d83c30d97d1d439d92e88c5509818604
6cd30cc8811c9b2fa2791e4d41713276863ff976
refs/heads/master
2021-12-29T22:39:42.286474
2019-07-01T20:25:20
2019-07-01T20:25:20
194,737,958
0
0
null
null
null
null
UTF-8
Java
false
false
2,057
java
package validator; import entity.Dot; import entity.Triangle; import exception.WrongParamsException; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public class DataConverter { private static final String RIGHT_COORDINATE_EXPRESSION = "^-?\\d+.?\\d*$"; private static final String RIGHT_DOT_DIV = " "; private static final String RIGHT_COORDINATE_DIV = ","; private static DataConverter ourInstance = new DataConverter(); private DataConverter() { } public static DataConverter getInstance() { return ourInstance; } public List<Triangle> convertLinesToTriangles(List<String> lines) throws WrongParamsException { List<Triangle> triangles = new ArrayList<>(); for (String line : lines) { String[] subStrings = line.split(RIGHT_DOT_DIV); if (subStrings.length != 3) { throw new WrongParamsException("Triangle should have 3 dots"); } Dot a = convertDot(subStrings[0]); Dot b = convertDot(subStrings[1]); Dot c = convertDot(subStrings[2]); Triangle triangle = new Triangle(a, b, c, ""); triangles.add(triangle); } return triangles; } public Dot convertDot(String line) throws WrongParamsException { String[] coordinates = line.split(RIGHT_COORDINATE_DIV); if ((coordinates.length != 2) || !isValidDataString(coordinates[0]) || !isValidDataString(coordinates[1])) { throw new WrongParamsException("Dot should have 2 coordinates"); } double coordinate0 = Double.parseDouble(coordinates[0]); double coordinate1 = Double.parseDouble(coordinates[1]); return new Dot(coordinate0, coordinate1); } private boolean isValidDataString(String string) { Pattern p = Pattern.compile(RIGHT_COORDINATE_EXPRESSION); Matcher m = p.matcher(string); return m.matches(); } }
[ "as.bliznets@gmail.com" ]
as.bliznets@gmail.com
d4ae9f17f34aaa3bdf1094823819f52d797f7053
1818a376a14cfad3eb7c6b692e573ab4576ba056
/dddlib-domain/src/main/java/org/dayatang/domain/EntityRepository.java
4fdfa6451eccd41ac780565f4ed269c1bc60b770
[ "Apache-2.0" ]
permissive
XinxiJiang/dddlib
476cd655bc8d19671f027f2a37bca8654d6d5af4
b244de70326aaecfbbbaebc5de2a9c0e8c89f565
refs/heads/master
2023-08-28T12:16:04.675805
2021-11-16T04:07:35
2021-11-16T04:07:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,808
java
package org.dayatang.domain; import java.io.Serializable; import java.util.List; /** * 仓储访问接口。用于存取和查询数据库中的各种类型的实体。 * * @author yyang (<a href="mailto:gdyangyu@gmail.com">gdyangyu@gmail.com</a>) * */ public interface EntityRepository { /** * 将实体(无论是新的还是修改了的)保存到仓储中。 * * @param <T> 实体的类型 * @param entity 要存储的实体实例。 * @return 持久化后的当前实体 */ <T extends Entity> T save(T entity); /** * 将实体从仓储中删除。如果仓储中不存在此实例将抛出EntityNotExistedException异常。 * * @param entity 要删除的实体实例。 */ void remove(Entity entity); /** * 判断仓储中是否存在指定ID的实体实例。 * * @param <T> 实体类型 * @param clazz 实体的类 * @param id 实体标识 * @return 如果实体实例存在,返回true,否则返回false */ <T extends Entity> boolean exists(Class<T> clazz, Serializable id); /** * 从仓储中获取指定类型、指定ID的实体 * * @param <T> 实体类型 * @param clazz 实体的类 * @param id 实体标识 * @return 一个实体实例。 */ <T extends Entity> T get(Class<T> clazz, Serializable id); /** * 从仓储中装载指定类型、指定ID的实体 * * @param <T> 实体类型 * @param clazz 实体的类 * @param id 实体标识 * @return 一个实体实例。 */ <T extends Entity> T load(Class<T> clazz, Serializable id); /** * 从仓储中获取entity参数所代表的未修改的实体 * * @param <T> 实体类型 * @param clazz 实体的类 * @param entity 要查询的实体 * @return 参数entity在仓储中的未修改版本 */ <T extends Entity> T getUnmodified(Class<T> clazz, T entity); /** * 根据业务主键从仓储中获取指定类型的实体 * * @param <T> 实体类型 * @param clazz 实体的类 * @param keyValues 代表业务主键值的命名参数。key为主键属性名,value为主键属性值 * @return 一个实体实例。 */ <T extends Entity> T getByBusinessKeys(Class<T> clazz, NamedParameters keyValues); /** * 查找指定类型的所有实体 * * @param <T> 实体类型 * @param clazz 实体的类 * @return 符合条件的实体集合 */ <T extends Entity> List<T> findAll(Class<T> clazz); /** * 创建条件查询 * * @param entityClass 要查询的实体类 * @param <T> 实体的类型 * @return 一个条件查询 */ <T extends Entity> CriteriaQuery createCriteriaQuery(Class<T> entityClass); /** * 执行条件查询,返回符合条件的实体列表 * * @param criteriaQuery 要执行的条件查询 * @param <T> 返回结果元素类型 * @return 符合查询条件的实体列表 */ <T> List<T> find(CriteriaQuery criteriaQuery); /** * 执行条件查询,返回符合条件的单个实体 * * @param criteriaQuery 要执行的条件查询 * @param <T> 返回结果类型 * @return 符合查询条件的单个结果 */ <T> T getSingleResult(CriteriaQuery criteriaQuery); /** * 根据指定的条件执行条件查询,返回符合条件的实体列表 * * @param entityClass 查询的目标实体类 * @param criterion 查询条件 * @param <T> 返回结果元素类型 * @return 符合查询条件的实体列表 */ <T extends Entity> List<T> find(Class<T> entityClass, QueryCriterion criterion); /** * 根据指定的条件执行条件查询,返回符合条件的单个实体 * * @param entityClass 查询的目标实体类 * @param criterion 查询条件 * @param <T> 返回结果类型 * @return 符合查询条件的单个结果 */ <T extends Entity> T getSingleResult(Class<T> entityClass, QueryCriterion criterion); /** * 创建JPQL查询 * * @param jpql JPQL语句 * @return 一个JPQL查询 */ JpqlQuery createJpqlQuery(String jpql); /** * 执行JPQL查询,返回符合条件的实体列表 * * @param jpqlQuery 要执行的JPQL查询 * @param <T> 返回结果元素类型 * @return 符合查询条件的结果列表 */ <T> List<T> find(JpqlQuery jpqlQuery); /** * 执行JPQL查询,返回符合条件的单个实体 * * @param jpqlQuery 要执行的JPQL查询 * @param <T> 返回结果类型 * @return 符合查询条件的单个结果 */ <T> T getSingleResult(JpqlQuery jpqlQuery); /** * 执行更新仓储的操作。 * * @param jpqlQuery 要执行的JPQL查询。 * @return 被更新或删除的实体的数量 */ int executeUpdate(JpqlQuery jpqlQuery); /** * 创建命名查询 * * @param queryName 命名查询的名字 * @return 一个命名查询 */ NamedQuery createNamedQuery(String queryName); /** * 执行命名查询,返回符合条件的实体列表 * * @param namedQuery 要执行的命名查询 * @param <T> 返回结果元素类型 * @return 符合查询条件的结果列表 */ <T> List<T> find(NamedQuery namedQuery); /** * 执行命名查询,返回符合条件的单个实体 * * @param namedQuery 要执行的命名查询 * @param <T> 返回结果类型 * @return 符合查询条件的单个结果 */ <T> T getSingleResult(NamedQuery namedQuery); /** * 使用命名查询执行更新仓储的操作。 * * @param namedQuery 要执行的命名查询。 * @return 被更新或删除的实体的数量 */ int executeUpdate(NamedQuery namedQuery); /** * 创建原生SQL查询 * * @param sql SQL语句 * @return 一个原生SQL查询 */ SqlQuery createSqlQuery(String sql); /** * 执行SQL查询,返回符合条件的实体列表 * * @param sqlQuery 要执行的SQL查询。 * @param <T> 返回结果元素类型 * @return 符合查询条件的结果列表 */ <T> List<T> find(SqlQuery sqlQuery); /** * 执行SQL查询,返回符合条件的单个实体 * * @param sqlQuery 要执行的SQL查询。 * @param <T> 返回结果类型 * @return 符合查询条件的单个结果 */ <T> T getSingleResult(SqlQuery sqlQuery); /** * 使用SQL查询执行更新仓储的操作。 * * @param sqlQuery 要执行的SQL查询。 * @return 被更新或删除的实体的数量 */ int executeUpdate(SqlQuery sqlQuery); /** * 按例查询。 * * @param <T> 查询的目标实体类型 * @param <E> 查询样例的类型 * @param example 查询样例 * @param settings 查询设置 * @return 与example相似的T类型的范例 */ <T extends Entity, E extends T> List<T> findByExample(E example, ExampleSettings<T> settings); /** * 根据单一属性的值查找实体 * * @param <T> 要查询的实体的类型 * @param clazz 要查询的实体的类 * @param propertyName 要查询的属性 * @param propertyValue 匹配的属性值 * @return 类型为clazz的、属性propertyName的值等于propertyValue的实体的集合 */ <T extends Entity> List<T> findByProperty(Class<T> clazz, String propertyName, Object propertyValue); /** * 根据多个属性的值查找实体 * * @param <T> 要查询的实体的类型 * @param clazz 要查询的实体的类 * @param properties 命名参数,其中key为属性名,value为要匹配的属性值。 * @return 类型为clazz、多个属性分别等于指定的属性值的实体的集合。 */ <T extends Entity> List<T> findByProperties(Class<T> clazz, NamedParameters properties); /** * 获取命名查询的查询字符串 * @param queryName 命名查询的名字 * @return 命名查询对应的JPQL字符串 */ String getQueryStringOfNamedQuery(String queryName); /** * 将内存中的持久化对象状态即时写入数据库 */ void flush(); /** * 使用数据库中的最新数据更新实体的当前状态。实体中的任何已改变但未持久化的属性值将被数据库中的最新值覆盖。 * * @param entity 要刷新的实体 */ void refresh(Entity entity); /** * 清空持久化缓存 */ void clear(); }
[ "gdyangyu@gmail.com" ]
gdyangyu@gmail.com
bfda8aecd68bd36c51ca127e37974cb134131e81
a543f30171ce6977b421f935541de60f071fd33d
/src/test/java/MyFirstTest.java
4acca2cb1eaa7f6cf01f3ce20ee3a21b0df81634
[ "Apache-2.0" ]
permissive
OlgaLa/selenium_les2_2
cb93e05726a6d3e6331f239c9947d21f506aa9e8
7aa0fdd9edb6407069ad7fd9ac977be978cbf495
refs/heads/master
2021-01-21T23:17:02.246704
2017-06-23T20:09:14
2017-06-23T20:09:14
95,223,322
0
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
import org.junit.Before; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import static org.openqa.selenium.support.ui.ExpectedConditions.titleContains; /** * Created by olapanovich on 23.6.17. */ public class MyFirstTest { private WebDriver driver; private WebDriverWait wait; private static final String URL = "https://www.google.com"; @BeforeMethod public void setUp() { //System.setProperty("webdriver.chrome.driver", "../chromedriver"); driver = new ChromeDriver(); wait = new WebDriverWait(driver, 10); } @Test public void myFirstTest() { driver.get(URL); driver.findElement(By.cssSelector(".gsfi")).sendKeys("webdriver"); driver.findElement(By.cssSelector(".jsb>center>input")).click(); wait.until(titleContains("webdriver")); } @AfterMethod public void tearDown() { driver.close(); } }
[ "olapanovich@klika-tech.com" ]
olapanovich@klika-tech.com
f9e4264ae3b3fe453a858366f2a3c655c3e1992b
1e0875970c39ae238c0dc782cd1136602dd484a5
/src/main/java/ru/master/service/CodeLabService.java
1894fde72146da70135b89f0787d049b0635f9f6
[]
no_license
stellarnexus2018/parse-json
40fac0ab752db632b66bfc890262e31b6a7cf3bc
a390e8022ef593bf22fdd2443a6c385b7087c998
refs/heads/master
2023-06-02T02:15:24.085961
2021-06-16T22:35:11
2021-06-16T22:35:11
377,643,911
0
0
null
null
null
null
UTF-8
Java
false
false
3,080
java
package ru.master.service; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import ru.master.dto.MarketIndexRateDto; import ru.master.dto.SampleDto; import java.io.IOException; import java.io.InputStream; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; public class CodeLabService { public static void RunOne(String sampleFilePath) throws JsonProcessingException { SampleDto sampleDto = new SampleDto(); sampleDto.setId(1); sampleDto.setFirstName("Igor"); sampleDto.setLastName("Grigoryev"); sampleDto.setVdat(LocalDateTime.now()); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new JavaTimeModule()); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); //objectMapper.enable(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); String s = objectMapper.writeValueAsString(sampleDto); System.out.println(s); } public static void RunTwo(String sampleFilePath) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new JavaTimeModule()); // objectMapper.enable(SerializationFeature.INDENT_OUTPUT); // objectMapper.enable(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS); //objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); InputStream insSample = DataService.getDataStream(sampleFilePath); SampleDto sampleDto = objectMapper.readValue(insSample, SampleDto.class); System.out.println(sampleDto); } public static void RunThree() throws IOException { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new JavaTimeModule()); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); Map<Long, String> mp = new HashMap<>(); mp.put(1L, "Первый элемент"); mp.put(2L, "Второй элемент"); mp.put(3L, "Третий элемент"); mp.put(4L, "Четвёртый элемент"); mp.put(5L, "Пятый элемент"); String sample = objectMapper.writeValueAsString(mp); System.out.println(sample); } } /* { "id" : 1, "firstName" : "Igor", "lastName" : "Grigoryev", "vdat" : 1623792815338 } */ /* { "sample_id" : 1, "first_name" : "Igor", "last_name" : "Grigoryev", "sample_vdat" : [ 2021, 6, 16, 1, 5, 50, 328467000 ] } */ /*"sample_vdat" : { "year": 2025, "month": "MAY", "chronology": { "calendarType": "iso8601", "id": "ISO" }, "leapYear": false, "dayOfWeek": "MONDAY", "dayOfYear": 125, "era": "CE", "monthValue": 5, "dayOfMonth": 5 }*/
[ "stellarnexus@gmail.com" ]
stellarnexus@gmail.com
42b7acbb5d4fad87be91d4f0a812ed043851b0e4
168c04d7aa47dae24bc8aa0d8fefa3ffca19c0a2
/app/src/main/java/com/rose/android/contract/PostWithdrawalContract.java
276cf81bcc51681763cd693cd4bea6de0fdcccf2
[]
no_license
A-W-C-J/RoseAndroid
6f0ade8db30eef9f4315da12a3754342c073959f
bdfa83ad13b3c0d81cf1dee28c4817aee56aef8a
refs/heads/master
2022-03-08T11:25:08.715307
2019-08-29T04:02:09
2019-08-29T04:02:09
205,077,331
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package com.rose.android.contract; /** * Created by xiaohuabu on 17/10/12. */ public interface PostWithdrawalContract { interface View extends BaseContract.View { void postWithdrawal(long amount, String pwd); } interface Presenter extends BaseContract.Presenter { void postWithdrawal(long amount, String pwd); } }
[ "wenmengjian@penquanyun.com" ]
wenmengjian@penquanyun.com
d3fca0fc2844a5eb7e01b50c6c1c009206afa9a4
ca44bc9f8896e6507c0963b13b3e1e3a187803dd
/src/main/java/com/wewe/redis/JedisClusterPipeline.java
9f2d342a92396bee6ae703e9f60e89e43a2d3029
[]
no_license
BenXiangYangGuang/note-demo
040c39d5b47584c7099a4e754afd972efeaf8103
a34c62a5601b9859bb2243fb1bcea540a9872efd
refs/heads/master
2022-12-25T01:44:28.706299
2019-09-09T10:22:35
2019-09-09T10:22:35
133,653,800
0
0
null
null
null
null
UTF-8
Java
false
false
8,377
java
package com.wewe.redis; /** * Author: fei2 * Date: 2018/12/20 20:54 * Description: * Refer To:https://zhuanlan.zhihu.com/p/30879714 */ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import redis.clients.jedis.*; import redis.clients.jedis.exceptions.JedisMovedDataException; import redis.clients.jedis.exceptions.JedisRedirectionException; import redis.clients.util.JedisClusterCRC16; import redis.clients.util.SafeEncoder; import java.io.Closeable; import java.lang.reflect.Field; import java.util.*; /** * 在集群模式下提供批量操作的功能。 <br/> * 由于集群模式存在节点的动态添加删除,且client不能实时感知(只有在执行命令时才可能知道集群发生变更), * 因此,该实现不保证一定成功,建议在批量操作之前调用 refreshCluster() 方法重新获取集群信息。<br /> * 应用需要保证不论成功还是失败都会调用close() 方法,否则可能会造成泄露。<br/> * 如果失败需要应用自己去重试,因此每个批次执行的命令数量需要控制。防止失败后重试的数量过多。<br /> * 基于以上说明,建议在集群环境较稳定(增减节点不会过于频繁)的情况下使用,且允许失败或有对应的重试策略。<br /> * * @author youaremoon * @since Ver 1.1 */ public class JedisClusterPipeline extends PipelineBase implements Closeable { private static final Logger LOGGER = LoggerFactory.getLogger(JedisClusterPipeline.class); private static final String SPLIT_WORD = ":"; // 部分字段没有对应的获取方法,只能采用反射来做 // 你也可以去继承JedisCluster和JedisSlotBasedConnectionHandler来提供访问接口 private static final Field FIELD_CONNECTION_HANDLER; private static final Field FIELD_CACHE; static { FIELD_CONNECTION_HANDLER = getField(BinaryJedisCluster.class, "connectionHandler"); FIELD_CACHE = getField(JedisClusterConnectionHandler.class, "cache"); } private JedisSlotBasedConnectionHandler connectionHandler; private JedisClusterInfoCache clusterInfoCache; private Queue<Client> clients = new LinkedList<Client>(); // 根据顺序存储每个命令对应的Client private Map<JedisPool, Map<Long, Jedis>> jedisMap = new HashMap<JedisPool, Map<Long, Jedis>>(); // 用于缓存连接 private boolean hasDataInBuf = false; // 是否有数据在缓存区 public JedisClusterPipeline(JedisCluster jedisCluster) { setJedisCluster(jedisCluster); } /** * 刷新集群信息,当集群信息发生变更时调用 * * @param * @return */ public void refreshCluster() { connectionHandler.renewSlotCache(); } /** * 同步读取所有数据. 与syncAndReturnAll()相比,sync()只是没有对数据做反序列化 */ public void sync() { innerSync(null); } @Override public void close() { clean(); clients.clear(); for (Map.Entry<JedisPool, Map<Long, Jedis>> poolEntry : jedisMap.entrySet()) { for (Map.Entry<Long, Jedis> jedisEntry : poolEntry.getValue().entrySet()) { if (hasDataInBuf) { flushCachedData(jedisEntry.getValue()); } jedisEntry.getValue().close(); } } jedisMap.clear(); hasDataInBuf = false; } /** * 同步读取所有数据 并按命令顺序返回一个列表 * * @return 按照命令的顺序返回所有的数据 */ public List<Object> syncAndReturnAll() { List<Object> responseList = new ArrayList<Object>(); innerSync(responseList); return responseList; } private void setJedisCluster(JedisCluster jedis) { connectionHandler = getValue(jedis, FIELD_CONNECTION_HANDLER); clusterInfoCache = getValue(connectionHandler, FIELD_CACHE); } private void innerSync(List<Object> formatted) { HashSet<Client> clientSet = new HashSet<Client>(); try { for (Client client : clients) { // 在sync()调用时其实是不需要解析结果数据的,但是如果不调用get方法,发生了JedisMovedDataException这样的错误应用是不知道的,因此需要调用get()来触发错误。 // 其实如果Response的data属性可以直接获取,可以省掉解析数据的时间,然而它并没有提供对应方法,要获取data属性就得用反射,不想再反射了,所以就这样了 Object data = generateResponse(client.getOne()).get(); if (null != formatted) { formatted.add(data); } // size相同说明所有的client都已经添加,就不用再调用add方法了 if (clientSet.size() != jedisMap.size()) { clientSet.add(client); } } } catch (JedisRedirectionException jre) { if (jre instanceof JedisMovedDataException) { // if MOVED redirection occurred, rebuilds cluster's slot cache, // recommended by Redis cluster specification refreshCluster(); } throw jre; } finally { if (clientSet.size() != jedisMap.size()) { // 所有还没有执行过的client要保证执行(flush),防止放回连接池后后面的命令被污染 for (Map.Entry<JedisPool, Map<Long, Jedis>> poolEntry : jedisMap.entrySet()) { for (Map.Entry<Long, Jedis> jedisEntry : poolEntry.getValue().entrySet()) { if (clientSet.contains(jedisEntry.getValue().getClient())) { continue; } flushCachedData(jedisEntry.getValue()); } } } hasDataInBuf = false; close(); } } private void flushCachedData(Jedis jedis) { try { jedis.getClient().getAll(); } catch (RuntimeException ex) { } } @Override protected Client getClient(String key) { byte[] bKey = SafeEncoder.encode(key); return getClient(bKey); } @Override protected Client getClient(byte[] key) { Jedis jedis = getJedis(JedisClusterCRC16.getSlot(key)); Client client = jedis.getClient(); clients.add(client); return client; } private Jedis getJedis(int slot) { // 根据线程id从缓存中获取Jedis Jedis jedis = null; Map<Long, Jedis> tmpMap = null; //获取线程id long id = Thread.currentThread().getId(); //获取jedispool JedisPool pool = clusterInfoCache.getSlotPool(slot); if (jedisMap.containsKey(pool)) { tmpMap = jedisMap.get(pool); if (tmpMap.containsKey(id)) { jedis = tmpMap.get(id); } else { jedis = pool.getResource(); tmpMap.put(id, jedis); } } else { tmpMap = new HashMap<Long, Jedis>(); jedis = pool.getResource(); tmpMap.put(id, jedis); jedisMap.put(pool,tmpMap); } hasDataInBuf = true; return jedis; } private static Field getField(Class<?> cls, String fieldName) { try { Field field = cls.getDeclaredField(fieldName); field.setAccessible(true); return field; } catch (NoSuchFieldException | SecurityException e) { throw new RuntimeException("cannot find or access field '" + fieldName + "' from " + cls.getName(), e); } } @SuppressWarnings({"unchecked"}) private static <T> T getValue(Object obj, Field field) { try { return (T) field.get(obj); } catch (IllegalArgumentException | IllegalAccessException e) { LOGGER.error("get value fail", e); throw new RuntimeException(e); } } }
[ "987050838@qq.com" ]
987050838@qq.com
727ab01876f724c3cf2478c720132619209d2f50
fa33039e15bc570af9d4e2ad8a403db93000c48f
/Chapter21_Input-Output/src/be/intecbrussel/exercise07_object_serialization/drawing/DrawingApp.java
4aad8e120766e129e76269dc40e20f411bdef7ce
[]
no_license
Mert1980/JAVA-11-Fundamentals
0098f54e839cbed6f7db80056daacacb94f82169
1785da2dcb34ae93723a62af90a508d07cad4cd4
refs/heads/master
2023-03-03T20:59:18.902535
2021-02-13T04:28:26
2021-02-13T04:28:26
300,883,080
1
1
null
null
null
null
UTF-8
Java
false
false
815
java
package be.intecbrussel.exercise07_object_serialization.drawing; import java.util.Iterator; public class DrawingApp { public static void main(String[] args) { Drawing myDrawing = new Drawing(); myDrawing.add(new Circle(5, 5, 5)); myDrawing.add(new Rectangle(10, 20, 1, 1)); myDrawing.add(new Triangle(10, 20, 20)); myDrawing.add(new Square(7, 1, 1)); Iterator iterator = myDrawing.new DrawableIterator(); // more simply while(iterator.hasNext()){ try{ System.out.println(iterator.next()); } catch (Exception e){ System.out.println(e.getMessage()); } } /*for (Object drawable:myDrawing ) { System.out.println(drawable); }*/ } }
[ "mertdemirok80@gmail.com" ]
mertdemirok80@gmail.com
cb183ce9454b0ef8e12352baf04aa463e0affc81
237063c7bc8f824e8cbcaf19d7f3f9f45bc7f801
/src/wattaina/bulletin_board/controller/EditServlet.java
0d35632acf9c8d7cbefef4cc8e7768316787ab12
[]
no_license
nozomi-musha/bulletinborad
c986d6c3cef8713848cb1377128abdabe90e9ba2
548db5809374064554dd50c680a45de248d72f44
refs/heads/master
2020-12-03T01:47:38.390269
2017-07-25T09:15:05
2017-07-25T09:15:05
95,867,177
0
0
null
null
null
null
UTF-8
Java
false
false
5,797
java
package wattaina.bulletin_board.controller; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import wattaina.bulletin_board.beans.Branch; import wattaina.bulletin_board.beans.Position; import wattaina.bulletin_board.beans.User; import wattaina.bulletin_board.service.BranchService; import wattaina.bulletin_board.service.PositionService; import wattaina.bulletin_board.service.UserService; @WebServlet(urlPatterns = { "/edit" }) public class EditServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String strUser = (request.getParameter("userId")); List<String> messages = new ArrayList<String>(); HttpSession session = request.getSession(); //URLで不正なページに飛ばさない if (strUser == null) { messages.add("不正なアクセスです"); session.setAttribute("errorMessages", messages); response.sendRedirect("userlist"); return; } if (!(strUser.matches("\\d{1,}"))){ messages.add("不正なアクセスです"); session.setAttribute("errorMessages", messages); response.sendRedirect("userlist"); return; } int userId = (Integer.parseInt(request.getParameter("userId"))); User user = new UserService().getUser(userId); if (user == null) { messages.add("不正なアクセスです"); session.setAttribute("errorMessages", messages); response.sendRedirect("userlist"); return; } request.setAttribute("user", user); List<Branch> branches = new BranchService().getBranches(); request.setAttribute("branches", branches); List<Position> positions = new PositionService().getPositions(); request.setAttribute("positions", positions); request.getRequestDispatcher("edit.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { List<String> messages = new ArrayList<String>(); HttpSession session = request.getSession(); User user = new User(); user.setId(Integer.parseInt(request.getParameter("userId"))); user.setLoginId(request.getParameter("loginId")); user.setName(request.getParameter("name")); System.out.println(user.getName()); if (!(StringUtils.isEmpty("password"))) { user.setPassword(request.getParameter("password")); System.out.println(user.getPassword()); } user.setBranchId(Integer.parseInt(request.getParameter("branchId"))); user.setPositionId(Integer.parseInt(request.getParameter("positionId"))); if (isValid(request, messages) == true) { // System.out.println(request.getParameter("userId")); new UserService().update(user); response.sendRedirect("userlist"); } else { System.out.println("test"); // String s = request.getParameter("name"); session.setAttribute("errorMessages", messages); request.setAttribute("user", user); List<Branch> branches = new BranchService().getBranches(); request.setAttribute("branches", branches); List<Position> positions = new PositionService().getPositions(); request.setAttribute("positions", positions); request.getRequestDispatcher("edit.jsp").forward(request, response); } } private boolean isValid(HttpServletRequest request, List<String> messages) { String loginId = request.getParameter("loginId"); String name = request.getParameter("name"); String password = request.getParameter("password"); String confirmation = request.getParameter("confirmation"); String branchId = request.getParameter("branchId"); String positionId = request.getParameter("positionId"); if (StringUtils.isEmpty(loginId) == true) { messages.add("ログインIDを入力してください"); } else if (!(loginId.matches("[a-zA-Z0-9]{6,20}"))) { messages.add("ログインIDは半角英数6文字以上20文字以下で入力してください"); } if ((StringUtils.isEmpty(password) != true) && (!(password.matches("^[a-zA-Z0-9]{6,20}$")))) { messages.add("パスワードは半角英数字6~20字以下で入力してください"); } if ((!(password.equals(confirmation)))) { messages.add("確認パスワードが一致しません"); } if (StringUtils.isEmpty(name) == true) { messages.add("名前を入力してください"); } else if (!(name.length() <= 10)) { messages.add("名前は10文字以内で入力してください"); } if (StringUtils.isEmpty(branchId) == true) { messages.add("支店名を選択してください"); } if (StringUtils.isEmpty(positionId) == true) { messages.add("役職を選択してください"); } else if ((!branchId.equals("1") && (positionId.equals("1") || positionId.equals("2")))) { messages.add("支店と役職の組み合わせが正しくありません"); } if (branchId.equals("1") && (!(positionId.equals("1") || positionId.equals("2")))) { messages.add("支店と役職の組み合わせが正しくありません"); } //既存のIDと被っていたら登録できない UserService userService = new UserService(); User user = userService.getUser(loginId); int editId = (Integer.parseInt(request.getParameter("userId"))); if (user != null && editId !=user.getId()) { messages.add("既に登録されているIDです"); } if (messages.size() == 0) { return true; } else { return false; } } }
[ "musha.nozomi@am.lhinc.jp" ]
musha.nozomi@am.lhinc.jp
9c35e23afd1b05bd9ee86a19d5a4ff91ab6285ed
0cfadbe44a1f3272d5b4901be7ded8db22ec63a6
/trade-app/stock/src/main/java/com/akmans/trade/stock/dto/JapanStockLogQueryDto.java
d9ff5799ec461f15393277a4f61209ec6a8b5a4b
[]
no_license
akmans/stock_db
4391ddae8a03aa3348f104b711d9fb7555b09749
986cb4a7645a1543d36f97e262fbee07389d30ea
refs/heads/master
2021-01-12T06:13:35.688347
2016-11-03T06:51:37
2016-11-03T06:51:37
77,327,205
0
0
null
null
null
null
UTF-8
Java
false
false
1,023
java
package com.akmans.trade.stock.dto; import java.io.Serializable; import java.util.Date; import com.akmans.trade.core.dto.AbstractQueryDto; public class JapanStockLogQueryDto extends AbstractQueryDto implements Serializable { private static final long serialVersionUID = 1L; /** job id. */ private String jobId; /** process date. */ private Date processDate; /** * jobId getter.<BR> * * @return jobId */ public String getJobId() { return this.jobId; } /** * jobId setter.<BR> * * @param jobId */ public void setJobId(String jobId) { this.jobId = jobId; } /** * processDate getter.<BR> * * @return processDate */ public Date getProcessDate() { return this.processDate; } /** * processDate setter.<BR> * * @param processDate */ public void setProcessDate(Date processDate) { this.processDate = processDate; } @Override public String toString() { return "[jobId=" + jobId + ", processDate=" + processDate + ", pageable=" + super.toString() + "]"; } }
[ "mr.wgang@gmail.com" ]
mr.wgang@gmail.com
f5fa7a502a8a72c39ecbb5bd03ff84aab81bbf83
4b6c47fede949e6a19c44561707a17ac4872d447
/app/src/main/java/com/mine/shortvideo/customview/FractionTranslateLayout.java
54e1623fdb77dd6e0951a6bc7ea95679ee77778f
[]
no_license
tingqiuyuerushui/game-share-platform
dfa61e400d62a733568d0db172dd5647549f3535
04134df62dc6a60914a5110778bdf41360529bf3
refs/heads/master
2021-07-13T22:42:09.136790
2018-12-24T09:10:54
2018-12-24T09:10:54
143,990,987
0
0
null
null
null
null
UTF-8
Java
false
false
2,257
java
package com.mine.shortvideo.customview; import android.content.Context; import android.util.AttributeSet; import android.widget.RelativeLayout; /** * 作者:created by lun.zhang on 12/21/2018 13:38 * 邮箱:zhanglun_study@163.com */ public class FractionTranslateLayout extends RelativeLayout { private int screenWidth; private float fractionX; private OnLayoutTranslateListener onLayoutTranslateListener; public FractionTranslateLayout(Context context) { super(context); } public FractionTranslateLayout(Context context, AttributeSet attrs) { super(context, attrs); } public FractionTranslateLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } protected void onSizeChanged(int w, int h, int oldW, int oldH){ // Assign the actual screen width to our class variable. screenWidth = w; super.onSizeChanged(w, h, oldW, oldH); } public float getFractionX(){ return fractionX; } public void setFractionX(float xFraction){ this.fractionX = xFraction; // When we modify the xFraction, we want to adjust the x translation // accordingly. Here, the scale is that if xFraction is -1, then // the layout is off screen to the left, if xFraction is 0, then the // layout is exactly on the screen, and if xFraction is 1, then the // layout is completely offscreen to the right. setX((screenWidth > 0) ? (xFraction * screenWidth) : 0); if (xFraction == 1 || xFraction == -1) { setAlpha(0); } else if (xFraction < 1 /* enter */|| xFraction > -1 /* exit */) { if (getAlpha() != 1) { setAlpha(1); } } if (onLayoutTranslateListener != null) { onLayoutTranslateListener.onLayoutTranslate(this, xFraction); } } public void setOnLayoutTranslateListener(OnLayoutTranslateListener onLayoutTranslateListener) { this.onLayoutTranslateListener = onLayoutTranslateListener; } public static interface OnLayoutTranslateListener { void onLayoutTranslate(FractionTranslateLayout view, float xFraction); } }
[ "ext.lun.zhang@uaes.com" ]
ext.lun.zhang@uaes.com
897df0a009fb63152243e404200b0468e4ac068d
4d2bf4558bffb9e8219e920f91c71f1fb98a0b83
/src/com/inti/dao/impl/DepartementDAO.java
27e7888850332fe54c7d37a98b142e29d10b9be9
[]
no_license
AlexisAndreu/gestion_ferme
b8781bd369ea272dd97bfb25278a5adb4cbda8a8
5f71e04b756c481bc06badd4cc63c52a7d6f9a47
refs/heads/master
2023-02-19T07:57:41.680972
2021-01-19T13:15:02
2021-01-19T13:15:02
330,942,484
0
0
null
null
null
null
UTF-8
Java
false
false
640
java
package com.inti.dao.impl; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import com.inti.dao.interfaces.IDepartementDAO; import com.inti.entities.Departement; import com.inti.utils.HibernateUtility; public class DepartementDAO extends ManagerDAO<Departement> implements IDepartementDAO { @Override public Departement rechercherDepartementParNom(String nom) { Session s = HibernateUtility.getSessionFactory().openSession(); Criteria crit = s.createCriteria(Departement.class); crit.add(Restrictions.eq("nom", nom)); return (Departement) crit.uniqueResult(); } }
[ "you@example.com" ]
you@example.com
3b8553f4fc8f5659f337be32c6357dfbfb5b6865
ee2cbfea37d59dd453206b4490e99b4083871d6c
/src/main/java/com/ak/demo/DemoorderApplication.java
4dd0a596cb4e3a1f35557ee7e27b4593c1d30319
[]
no_license
jslearner07/demoorder
60c20564cf7fc8c6371c04f3f56e5d218c9533df
37b5e46ba5861fe35f0e4beb7a0d817958b6d01a
refs/heads/main
2023-09-04T03:21:59.982340
2021-10-21T06:20:11
2021-10-21T06:20:11
414,211,481
0
0
null
null
null
null
UTF-8
Java
false
false
4,493
java
package com.ak.demo; import java.sql.SQLException; import java.util.Arrays; import javax.annotation.PostConstruct; import org.h2.tools.Server; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @SpringBootApplication public class DemoorderApplication { public static void main(String[] args) { SpringApplication.run(DemoorderApplication.class, args); } @Autowired private JdbcTemplate jdbcTemplate; @Autowired private BCryptPasswordEncoder passwordEncoder; /** * Comment for Oracle DB */ @PostConstruct private void initDb() { System.out.println(String.format("****** Creating table: %s, and Inserting test data ******", "Order")); String encryptedPwd = passwordEncoder.encode("test123"); String sqlStatements[] = { "drop table purchaseorder if exists;", "drop table purchase_orderline if exists;", "drop table USER_MST if exists;", "create table purchaseorder(ORDER_ID serial,VERSION SMALLINT,TOTAL_ORDER SMALLINT,NAME varchar(300),ADDRESS varchar(300)," + "CREATION_DATE timestamp(6));", "create table purchase_orderline(ORDERLINE_ID serial,VERSION SMALLINT,QUANTITY SMALLINT,BOOK_ID INT,ORDER_ID INT," + "CREATION_DATE timestamp(6),foreign key (ORDER_ID) references purchaseorder(ORDER_ID));", "create table user_mst(USER_ID serial,USER_NAME varchar(35),PASSWORD varchar(100),ACTIVE varchar(1),ROLES varchar(500)," + "CREATION_DATE timestamp(6));", "drop sequence SEQ_TKSK_SURVEY_ID if exists;", "create sequence SEQ_TKSK_SURVEY_ID start with 6 increment by 1;", "insert into purchaseorder(ORDER_ID, VERSION, TOTAL_ORDER,NAME,ADDRESS,CREATION_DATE) values('1','10','20','QA Tower1 Books','QA Tower1, Doha',CURRENT_TIMESTAMP);", "insert into purchaseorder(ORDER_ID, VERSION, TOTAL_ORDER,NAME,ADDRESS,CREATION_DATE) values('2','11','21','QA Tower2 Books','QA Tower2, Al hilal',CURRENT_TIMESTAMP);", "insert into purchaseorder(ORDER_ID, VERSION, TOTAL_ORDER,NAME,ADDRESS,CREATION_DATE) values('3','12','22','QA Tower3 Books','QA Tower3, AL wakra',CURRENT_TIMESTAMP);", "insert into purchaseorder(ORDER_ID, VERSION, TOTAL_ORDER,NAME,ADDRESS,CREATION_DATE) values('4','13','23','QA Tower4 Books','QA Tower4, Salwa road',CURRENT_TIMESTAMP);", "insert into purchaseorder(ORDER_ID, VERSION, TOTAL_ORDER,NAME,ADDRESS,CREATION_DATE) values('5','14','24','QA Tower5 Books','QA Tower5, Al wukhair',CURRENT_TIMESTAMP);", "insert into purchase_orderline(ORDERLINE_ID, VERSION, QUANTITY,BOOK_ID,ORDER_ID,CREATION_DATE) values('1','1','20','1','1',CURRENT_TIMESTAMP);", "insert into purchase_orderline(ORDERLINE_ID, VERSION, QUANTITY,BOOK_ID,ORDER_ID,CREATION_DATE) values('2','2','11','2','2',CURRENT_TIMESTAMP);", "insert into purchase_orderline(ORDERLINE_ID, VERSION, QUANTITY,BOOK_ID,ORDER_ID,CREATION_DATE) values('3','3','22','3','3',CURRENT_TIMESTAMP);", "insert into purchase_orderline(ORDERLINE_ID, VERSION, QUANTITY,BOOK_ID,ORDER_ID,CREATION_DATE) values('4','4','33','4','4',CURRENT_TIMESTAMP);", "insert into purchase_orderline(ORDERLINE_ID, VERSION, QUANTITY,BOOK_ID,ORDER_ID,CREATION_DATE) values('5','5','14','5','5',CURRENT_TIMESTAMP);", "insert into user_mst(USER_ID, USER_NAME, PASSWORD,ACTIVE,ROLES,CREATION_DATE) values('1','AHMED','test123','Y','ROLE_ADMIN',CURRENT_TIMESTAMP);", "insert into user_mst(USER_ID, USER_NAME, PASSWORD,ACTIVE,ROLES,CREATION_DATE) values('2','MARK','test123','Y','ROLE_ADMIN,ROLE_MODERATOR',CURRENT_TIMESTAMP);", "insert into user_mst(USER_ID, USER_NAME, PASSWORD,ACTIVE,ROLES,CREATION_DATE) values('3','MICHAEL','test123','Y','ROLE_USER',CURRENT_TIMESTAMP);"}; Arrays.asList(sqlStatements).stream().forEach(sql -> { if(sql.contains("test123")) { sql = sql.replace("test123", encryptedPwd); System.out.println("encryptedPwd-------------->"+encryptedPwd); } System.out.println(sql); jdbcTemplate.execute(sql); }); } /** * Comment for Oracle DB */ @Bean(initMethod = "start", destroyMethod = "stop") public Server inMemoryH2DatabaseServer() throws SQLException { return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092"); } }
[ "noreply@github.com" ]
noreply@github.com
446db7f2937232e0808bbba038761e89cb82e566
1166251998613732474df4be59992621bac08c08
/QunYingZhuan/app/src/main/java/com/example/hp/qunyingzhuan/MainActivity.java
558e4d5bfa3a51abaa5f7334ec47eb0887621f0e
[]
no_license
zhaozuyuan/AndroidStudy
01ed59003836e74187d034ba560125953a92bbe8
395a74d37eb904c31937253dfc7812a7f423adb4
refs/heads/master
2020-07-05T03:46:18.157784
2019-12-01T06:27:10
2019-12-01T06:27:10
202,511,855
0
0
null
null
null
null
UTF-8
Java
false
false
8,188
java
package com.example.hp.qunyingzhuan; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.ActivityOptions; import android.app.Notification; import android.app.NotificationManager; import android.content.Intent; import android.graphics.BitmapFactory; import android.os.Build; import android.support.constraint.ConstraintLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.animation.BounceInterpolator; import android.webkit.WebView; import android.widget.Button; import android.widget.RemoteViews; import android.widget.TextView; import android.widget.Toast; import cn.bmob.v3.Bmob; public class MainActivity extends AppCompatActivity { private Button btnOut, btnHide, btnOpen, btnGone; private boolean isFlag = false; private int mHiddenViewMeasuredHeight; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); addNotification(); findViewById(R.id.btn_to_scroll_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,ScrollActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_listview_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,ListActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_slide_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,SlideActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_dragview_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,DragViewActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_image_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,ImageActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_surface_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,SurfaceActivity.class); startActivity(intent); } }); findViewById(R.id.btn_to_bmob_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,BmobActivity.class); startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(MainActivity.this) .toBundle()); } }); findViewById(R.id.btn_to_transition_a_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,TransitionAActivity.class); startActivity(intent); } }); btnOut = (Button)findViewById(R.id.btn_main_out); btnHide = (Button)findViewById(R.id.btn_main_hide); btnOpen = (Button)findViewById(R.id.btn_open_btn); btnGone = (Button)findViewById(R.id.btn_gone); btnOut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(isFlag){ endAnim(); }else { startAnim(); } } }); //像素密度 float mDensity = getResources().getDisplayMetrics().density; //获取布局的高度 mHiddenViewMeasuredHeight = (int)(mDensity *40 + 0.5); btnOpen.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { btnClickToOpen(); } }); } /** * 属性动画 */ private void startAnim(){ ObjectAnimator animator = ObjectAnimator.ofFloat(btnOut,"alpha", 1f, 0.5f); ObjectAnimator animator1 = ObjectAnimator.ofFloat(btnHide, "translationX", 200F); AnimatorSet set = new AnimatorSet(); set.setDuration(500); //下面是设置回弹 set.setInterpolator(new BounceInterpolator()); set.playTogether(animator, animator1); set.start(); isFlag = true; } private void endAnim(){ ObjectAnimator animator = ObjectAnimator.ofFloat(btnOut,"alpha", 0.5f, 1f); ObjectAnimator animator1 = ObjectAnimator.ofFloat(btnHide, "translationX", 0); AnimatorSet set = new AnimatorSet(); set.setDuration(500); set.playTogether(animator, animator1); set.start(); isFlag = false; } /** * 值变化动画 * * @param tvTime */ private void tvTimer(final TextView tvTime){ ValueAnimator valueAnimator = ValueAnimator.ofInt(0, 6); valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { tvTime.setText("$"+(int)animation.getAnimatedValue()); } }); valueAnimator.setDuration(10000); valueAnimator.start(); } public void btnClickToOpen(){ if(btnGone.getVisibility() == View.GONE){ animateOpen(); }else { animateClose(); } } private void animateOpen(){ btnGone.setVisibility(View.VISIBLE); ValueAnimator animator = createAnimator(btnGone, 0, mHiddenViewMeasuredHeight); animator.start(); } private void animateClose(){ int height = btnGone.getHeight(); ValueAnimator animator = createAnimator(btnGone, height, 0); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { btnGone.setVisibility(View.GONE); } }); animator.start(); } private ValueAnimator createAnimator(final View view, int start, int end){ ValueAnimator animator = ValueAnimator.ofInt(start, end); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { int value = (Integer) animation.getAnimatedValue(); ViewGroup.LayoutParams params = view.getLayoutParams(); params.height = value; //view.requestLayout(); view.setLayoutParams(params); } }); animator.setDuration(1000); return animator; } @TargetApi(Build.VERSION_CODES.N) private void addNotification(){ // RemoteViews views = new RemoteViews(getPackageName(), R.layout.layout_notification); // Notification.Builder builder = new Notification.Builder(this); // builder.setContentText("吃呀二"); // NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); // assert notificationManager != null; // notificationManager.notify(0, builder.build()); } }
[ "191868314@qq.com" ]
191868314@qq.com
a12ab7f12cbb9419c8d4bb4db9e2a7482187dbad
0708f0c5944f9459d29b0fa6fe3f120e4de0ece0
/GUI/YClient_GUI/src/sample/NodeFile.java
7f974e688ca350b2c1ae65b11eb50cd248f3b397
[]
no_license
ThomasVerschoor/Distributed_Systems_404
fcb663006834e745a02b368615da4d8d1eb68ede
504d3cabab3aad434719c8fd57f678908df6aeb9
refs/heads/master
2021-02-12T08:43:23.606724
2020-05-31T23:46:42
2020-05-31T23:46:42
244,578,845
0
0
null
2020-03-30T14:45:57
2020-03-03T08:16:12
Java
UTF-8
Java
false
false
674
java
package sample; import static java.lang.StrictMath.abs; public class NodeFile { private String filename; private int hash; public NodeFile(String filename){ this.filename = filename; this.hash = hashCode(); } public void setFilename(String filename) { this.filename = filename; } public String getFilename() { return filename; } public int getHash() { return hash; } @Override public int hashCode(){ long max = 2147483647; long min = -2147483647; double result = (filename.hashCode()+max)*(327680d/(max+abs(min))); return (int) result; } }
[ "thomas.verschoor2@student.uantwerpen.be" ]
thomas.verschoor2@student.uantwerpen.be