blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
352
14b682d7635975dc2c4554720b00879e091336b2
ffab893471e0e3e5c3d51263f6a6fe0aa3c9b5ef
/src/main/java/com/readyhuihui/designpatterndemo/hander1/TianQiHandler.java
8dda828ec4f061243cf5be1c7e0daa90c793ebd2
[]
no_license
readyhuihui/designpatterndemo
05d81912a66b5117d079904691d23ff12c0a2cfc
37411a91c67c02fd017da520e7b062c583b7806b
refs/heads/master
2023-06-03T09:47:34.131641
2021-06-17T04:37:32
2021-06-17T04:37:32
267,893,489
0
0
null
null
null
null
UTF-8
Java
false
false
413
java
package com.readyhuihui.designpatterndemo.hander1; import org.springframework.stereotype.Component; @Component public class TianQiHandler implements Handler { @Override public void AAA(String name) { // 业务逻辑A System.out.println("田七完成任务"); } @Override public void afterPropertiesSet() throws Exception { Factory.register("田七", this); } }
dd7e8dc6163718a2992a6e21da8e0fe8e42e40d5
61e735527a7c491587bc948cc0e1b5d9bc8674c1
/fr.pigeo.rimap.rimaprcp.core.ui/src/fr/pigeo/rimap/rimaprcp/core/ui/swt/LayerDetails.java
84ef4bd0a23dad0999f1be51d347f24080fb68ff
[]
no_license
zhj149/RiMaP-RCP
98165e8b15692d8e0ada93fdee01008758011fb7
8b5b3d8500a6879af1ebcaffaeb49d597c1e8a1d
refs/heads/master
2020-06-05T16:28:45.350611
2018-06-08T15:12:56
2018-06-08T15:12:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,760
java
package fr.pigeo.rimap.rimaprcp.core.ui.swt; import javax.annotation.PostConstruct; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.UpdateValueStrategy; import org.eclipse.core.databinding.beans.PojoProperties; import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.jface.databinding.swt.WidgetProperties; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Scale; import org.eclipse.swt.widgets.Text; import org.eclipse.wb.swt.ResourceManager; import org.eclipse.wb.swt.SWTResourceManager; import fr.pigeo.rimap.rimaprcp.core.ui.swt.bindings.OpacityToScaleConverter; import fr.pigeo.rimap.rimaprcp.core.ui.swt.bindings.ScaleToOpacityConverter; import gov.nasa.worldwind.WWObject; public class LayerDetails { protected DataBindingContext m_bindingContext; protected WWObject layer; protected Label lblLayerName, lblOpacity, lblDescription; protected Scale scaleOpacity; protected Group grpDetails; protected Button btnShowMetadata, btnShowLegend; protected Text txtLayerDescription; protected Button btnZoomToExtent; protected Composite timeChooserComposite; protected Label lblDate; protected Combo comboDate; protected ComboViewer comboDateViewer; protected Button btnReloadLayer; protected Button btnAnimate; @PostConstruct public void postConstruct(Composite parent) { parent.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); parent.setLayout(new GridLayout(1, false)); grpDetails = new Group(parent, SWT.NONE); grpDetails.setFont(SWTResourceManager.getFont("Sans", 12, SWT.BOLD)); grpDetails.setBackground(SWTResourceManager.getColor(SWT.COLOR_TRANSPARENT)); grpDetails.setText("Layer details"); grpDetails.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); grpDetails.setLayout(new GridLayout(2, false)); lblLayerName = new Label(grpDetails, SWT.WRAP); lblLayerName.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); lblLayerName.setFont(SWTResourceManager.getFont("Sans", 10, SWT.BOLD)); lblLayerName.setText("Layer name"); btnZoomToExtent = new Button(grpDetails, SWT.NONE); btnZoomToExtent.setToolTipText("Zoom to layer's extent"); btnZoomToExtent.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); btnZoomToExtent.setImage( ResourceManager.getPluginImage("fr.pigeo.rimap.rimaprcp.core.ui", "icons/icon_zoomlayer.png")); timeChooserComposite = new Composite(grpDetails, SWT.BORDER); timeChooserComposite.setLayout(new FormLayout()); GridData gd_timeChooserComposite = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1); gd_timeChooserComposite.heightHint = 25; timeChooserComposite.setLayoutData(gd_timeChooserComposite); lblDate = new Label(timeChooserComposite, SWT.NONE); FormData fd_lblDate = new FormData(); fd_lblDate.top = new FormAttachment(0, 5); fd_lblDate.bottom = new FormAttachment(100); fd_lblDate.left = new FormAttachment(0, 10); lblDate.setLayoutData(fd_lblDate); lblDate.setText("Date/Time"); btnAnimate = new Button(timeChooserComposite, SWT.NONE); btnAnimate.setToolTipText("Play as an animation"); btnAnimate.setImage(ResourceManager.getPluginImage("fr.pigeo.rimap.rimaprcp.core.ui", "icons/clock_play.png")); FormData fd_btnAnimate = new FormData(); fd_btnAnimate.right = new FormAttachment(100, -2); btnAnimate.setLayoutData(fd_btnAnimate); comboDateViewer = new ComboViewer(timeChooserComposite, SWT.READ_ONLY); comboDate = comboDateViewer.getCombo(); FormData fd_comboDate = new FormData(); fd_comboDate.top = new FormAttachment(lblDate, -2, SWT.TOP); fd_comboDate.left = new FormAttachment(lblDate, 30); comboDate.setLayoutData(fd_comboDate); btnReloadLayer = new Button(timeChooserComposite, SWT.NONE); btnReloadLayer.setToolTipText("Update from server"); fd_comboDate.right = new FormAttachment(btnReloadLayer, -5); btnReloadLayer.setImage(ResourceManager.getPluginImage("fr.pigeo.rimap.rimaprcp.core.ui", "icons/arrow_refresh.png")); FormData fd_btnReloadLayer = new FormData(); fd_btnReloadLayer.right = new FormAttachment(btnAnimate, -5); btnReloadLayer.setLayoutData(fd_btnReloadLayer); lblOpacity = new Label(grpDetails, SWT.NONE); lblOpacity.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1)); lblOpacity.setText("Opacity:"); new Label(grpDetails, SWT.NONE); scaleOpacity = new Scale(grpDetails, SWT.NONE); scaleOpacity.setSelection(100); scaleOpacity.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1)); scaleOpacity.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { scaleOpacity.setToolTipText(String.valueOf(scaleOpacity.getSelection()) + "%"); } @Override public void widgetDefaultSelected(SelectionEvent e) { // TODO Auto-generated method stub } }); lblDescription = new Label(grpDetails, SWT.NONE); lblDescription.setText("Description:"); new Label(grpDetails, SWT.NONE); txtLayerDescription = new Text(grpDetails, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI); txtLayerDescription.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); txtLayerDescription.setText( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus quis fringilla massa, at ullamcorper neque. Integer scelerisque malesuada leo, eget tincidunt ante interdum sed. Morbi non purus vitae sapien fringilla semper in eget velit. Nulla volutpat arcu sed pulvinar aliquet. Praesent lectus nisi, iaculis at commodo sed, auctor eget ipsum. Nulla imperdiet lacus eget libero fermentum, quis placerat metus hendrerit. Nam laoreet lectus eget massa tempor, nec convallis massa sagittis. Curabitur egestas condimentum condimentum. Maecenas porta purus et fermentum gravida. Sed sed velit metus. Sed pretium efficitur arcu ut cursus. Curabitur ornare dolor nec felis fermentum, in eleifend orci maximus. Fusce libero libero, consectetur id finibus et, tristique eu lectus. Quisque justo sapien, rutrum faucibus turpis a, gravida lobortis elit. Vestibulum at metus non turpis aliquam iaculis. "); txtLayerDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); btnShowMetadata = new Button(grpDetails, SWT.NONE); btnShowMetadata.setImage( ResourceManager.getPluginImage("fr.pigeo.rimap.rimaprcp.core.ui", "icons/icon_metadata_16px.png")); btnShowMetadata.setToolTipText( "Show the associated metadata (information sheet about the data)\nOpens a window in your favorite browser."); btnShowMetadata.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1)); btnShowMetadata.setText(" - Show more"); btnShowLegend = new Button(grpDetails, SWT.NONE); GridData gd_btnShowLegend = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1); gd_btnShowLegend.heightHint = 34; btnShowLegend.setLayoutData(gd_btnShowLegend); btnShowLegend.setToolTipText("Show the associated metadata (information sheet about the data)"); btnShowLegend.setText("Show legend"); btnShowLegend.setImage(null); m_bindingContext = initDataBindings(); } protected DataBindingContext initDataBindings() { DataBindingContext bindingContext = new DataBindingContext(); // IObservableValue observeTextLblNewLabel_1ObserveWidget = WidgetProperties.text().observe(lblLayerName); IObservableValue nameLayerObserveValue = PojoProperties.value("name").observe(layer); bindingContext.bindValue(observeTextLblNewLabel_1ObserveWidget, nameLayerObserveValue, null, null); // IObservableValue observeSelectionScaleObserveWidget = WidgetProperties.selection().observe(scaleOpacity); IObservableValue opacityLayerObserveValue = PojoProperties.value("opacity").observe(layer); UpdateValueStrategy strategy = new UpdateValueStrategy(); strategy.setConverter(new ScaleToOpacityConverter()); UpdateValueStrategy strategy_1 = new UpdateValueStrategy(); strategy_1.setConverter(new OpacityToScaleConverter()); bindingContext.bindValue(observeSelectionScaleObserveWidget, opacityLayerObserveValue, strategy, strategy_1); // return bindingContext; } }
b7bb18b89a9f050d996ab4e0ddacdedd0e08aefd
954f5f72b52089148d4af48219d8b35bf6c68edd
/app/src/main/java/com/axehome/www/guojinapp/ui/activitys/MyJianDingActivity.java
fd5d0ac822540e8819bfbdbe9ce64a79279971af
[]
no_license
fxgwl/GuojinApp
d97226f4b50c91983f02ccfbff79c3a3e78e3c02
b15a34fd3efd6a85dfa5a6887cd1bb9625ebe969
refs/heads/master
2023-05-09T00:29:22.149980
2021-06-04T11:12:47
2021-06-04T11:12:47
373,815,590
0
0
null
null
null
null
UTF-8
Java
false
false
7,594
java
package com.axehome.www.guojinapp.ui.activitys; import android.os.Bundle; import android.text.format.DateUtils; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.axehome.www.guojinapp.R; import com.axehome.www.guojinapp.beans.JianDingBean; import com.axehome.www.guojinapp.ui.adapters.MyJianDingAdapter; import com.axehome.www.guojinapp.utils.MyUtils; import com.axehome.www.guojinapp.utils.NetConfig; import com.axehome.www.guojinapp.views.MyListView; import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshScrollView; import com.zhy.http.okhttp.OkHttpUtils; import com.zhy.http.okhttp.callback.StringCallback; 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; import okhttp3.Call; public class MyJianDingActivity extends BaseActivity { @BindView(R.id.back_top) ImageView backTop; @BindView(R.id.title) TextView title; @BindView(R.id.tv_right) TextView tvRight; @BindView(R.id.iv_jiubao) ImageView ivJiubao; @BindView(R.id.mlv_list) MyListView mlvList; @BindView(R.id.scroll_view) PullToRefreshScrollView scrollView; @BindView(R.id.rb_class01) RadioButton rbClass01; @BindView(R.id.rb_class02) RadioButton rbClass02; @BindView(R.id.rg_menu) RadioGroup rgMenu; private List<JianDingBean> jianDingBeanList = new ArrayList<>(); private MyJianDingAdapter jianDingAdapter; private int curPage = 1; private String type = "0";//0:待鉴定;1:已鉴定;2:待支付 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_jian_ding); ButterKnife.bind(this); title.setText("我的鉴定"); initView(); PullLisition(); getMyCouponList(); } private void initView() { jianDingAdapter = new MyJianDingAdapter(getApplicationContext(), jianDingBeanList); mlvList.setAdapter(jianDingAdapter); rgMenu.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup radioGroup, int i) { switch (i){ case R.id.rb_class01: curPage=1; type="0"; getMyCouponList(); break; case R.id.rb_class02: curPage=1; type="1"; getMyCouponList(); break; } } }); } @OnClick({R.id.back_top}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.back_top: finish(); break; } } public void PullLisition() { // 1.设置刷新模式 scrollView.setMode(PullToRefreshBase.Mode.BOTH); // 上拉加载更多,分页加载 scrollView.getLoadingLayoutProxy(false, true).setPullLabel("加载更多"); scrollView.getLoadingLayoutProxy(false, true).setRefreshingLabel("加载中..."); scrollView.getLoadingLayoutProxy(false, true).setReleaseLabel("松开加载"); // 下拉刷新 scrollView.getLoadingLayoutProxy(true, false).setPullLabel("下拉刷新"); scrollView.getLoadingLayoutProxy(true, false).setRefreshingLabel("更新中..."); scrollView.getLoadingLayoutProxy(true, false).setReleaseLabel("松开更新"); scrollView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ScrollView>() { @Override public void onPullDownToRefresh(PullToRefreshBase<ScrollView> refreshView) { String label = DateUtils.formatDateTime( getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL); refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label); curPage = 1; getMyCouponList(); // mPresenter.getDetails(String.valueOf(pageNo)); } @Override public void onPullUpToRefresh(PullToRefreshBase<ScrollView> refreshView) { // 自定义上拉header内容 scrollView.getLoadingLayoutProxy(false, true) .setPullLabel("上拉加载..."); scrollView.getLoadingLayoutProxy(false, true) .setRefreshingLabel("正在为你加载更多内容..."); scrollView.getLoadingLayoutProxy(false, true) .setReleaseLabel("松开自动加载..."); curPage++; getMyCouponList(); // mPresenter.getDetails(String.valueOf(pageNo)); } }); } private void getMyCouponList() { Map<String, String> map = new HashMap<>(); map.put("page", String.valueOf(curPage)); map.put("status", type);//0:待鉴定;1:已鉴定;2:待支付 map.put("user_id", String.valueOf(MyUtils.getUser().getUser_id())); OkHttpUtils.post() .url(NetConfig.getJianDingUrl) .params(map) .build() .execute(new StringCallback() { @Override public void onError(Call call, Exception e, int id) { Log.e("aaa", "(getMyCouponList.java:420)" + e.getMessage()); scrollView.onRefreshComplete(); } @Override public void onResponse(String response, int id) { Log.e("aaa", "(getMyCouponList.java:71)" + response); if (response == null) { //Toast.makeText(getApplicationContext(),"系统故障",Toast.LENGTH_SHORT).show(); scrollView.onRefreshComplete(); return; } JSONObject jsonObject = JSONObject.parseObject(response); if (jsonObject.getInteger("code") == 0) { if (curPage == 1) { jianDingBeanList.clear(); } List<JianDingBean> jianDingBeans = new ArrayList<>(); jianDingBeans.addAll(JSON.parseArray(jsonObject.getJSONObject("data").getString("list"), JianDingBean.class)); jianDingBeanList.addAll(jianDingBeans); } else { Toast.makeText(getApplicationContext(), jsonObject.getString("msg"), Toast.LENGTH_SHORT).show(); } jianDingAdapter.notifyDataSetChanged(); scrollView.onRefreshComplete(); } }); } }
91165b3e2e523520fc770b6222a68a3027a00725
acdf66a3356912e90b5f905e3e152ec491696e60
/src/main/java/edu/daemondev/psquare/repositories/UserDetailsRepo.java
c9ec7187be470d80d267c8f30b4905942b52449c
[]
no_license
kishore0102/psquare-springboot-service
d11342c7f1a59cc1fe99f26e37e1b14169c3bc55
7382fe6381aed2a7cdd4d9c01cfc1763eb1bf3d7
refs/heads/master
2023-08-20T00:01:57.755392
2021-10-13T12:52:40
2021-10-13T12:52:40
319,975,739
1
0
null
null
null
null
UTF-8
Java
false
false
1,937
java
package edu.daemondev.psquare.repositories; import java.sql.Timestamp; import java.util.List; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import edu.daemondev.psquare.models.UserDetails; @Repository @Transactional public interface UserDetailsRepo extends CrudRepository<UserDetails, Long> { List<UserDetails> findAll(); @Query("select u from UserDetails u where u.email = :email") UserDetails getUserDetailsByEmail(String email); @Query("select count(u) from UserDetails u where u.email = :email") int getCountByEmail(String email); @Modifying @Query(value = "insert into user_details (email, firstname, lastname, status, passhash) VALUES (?1, ?2, ?3, ?4, ?5)", nativeQuery = true) int addUserDetails(String email, String firstname, String lastname, char status, String passhash); @Modifying @Query(value = "update user_details set otp = ?2, otpts = ?3, otpvalidator = 0 where email = ?1", nativeQuery = true) int updateOTPByEmail(String email, String otp, Timestamp otpts); @Modifying @Query(value = "update user_details set otp = null, otpts = null, otpvalidator = 0 where email = ?1", nativeQuery = true) int resetOTPByEmail(String email); @Modifying @Query(value = "update user_details set lockcount = lockcount + 1 where email = ?1", nativeQuery = true) int incrementUserLock(String email); @Modifying @Query(value = "update user_details set lockcount = 0 where email = ?1", nativeQuery = true) int resetUserLock(String email); @Modifying @Query(value = "update user_details set status = ?2 where email = ?1", nativeQuery = true) int updateStatusByEmail(String email, char status); }
22d4abd16549c2ec431d2bc979d0dc132a1df804
04653acfca56d9bab08beca174eb15eaee97e1ce
/eaccount-web-manage/src/main/java/com/ucsmy/eaccount/manage/dao/ManageIpScheduleTaskDao.java
7f50b62ba85d4f9219034cd1c08ee04a2623af6d
[]
no_license
msm3673763/eaccount
9fee55b68292326cebfe06486dd8a655fafad3a6
e38de479a1f602493bc82cf2a575f250fa37851a
refs/heads/master
2021-07-04T14:34:51.516682
2017-09-26T04:32:19
2017-09-26T04:32:19
104,832,964
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package com.ucsmy.eaccount.manage.dao; import com.ucsmy.core.dao.BasicDao; import com.ucsmy.eaccount.manage.entity.ManageIpScheduleTask; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; /** * 定时任务Dao * * @author chenqilin * @since 2017/9/7 */ @Repository public interface ManageIpScheduleTaskDao extends BasicDao<ManageIpScheduleTask> { /** * 任务码是否存在 * * @param taskCode 任务码 * @param id 排除的id * @return */ int isTaskCodeExist(@Param("taskCode") String taskCode, @Param("id") String id); int updateStatus(@Param("id") String id); }
9995d0ef7a0baf6df4614eefa42d776080c73330
be518806fd9880910b333bc51a56ccfbaad3c8e3
/src/main/java/info/jerrinot/nettyloc/StringUtil.java
85198237ad1639c373282e3b4d49b44cca2726e0
[]
no_license
alisheikh/hugecast
111e4ea59543bcd0ac54fe7b6806f940f852b7bf
bc3b201498ec46344d85336124bd29bccac547ab
refs/heads/master
2020-12-25T09:08:08.703169
2013-12-01T19:15:51
2013-12-01T19:15:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
/* * Copyright 2012 The Netty Project * * The Netty Project 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 info.jerrinot.nettyloc; import java.util.ArrayList; import java.util.Formatter; import java.util.List; /** * String utility class. */ public final class StringUtil { private StringUtil() { // Unused. } public static final String NEWLINE; static { String newLine; try { newLine = new Formatter().format("%n").toString(); } catch (Exception e) { newLine = "\n"; } NEWLINE = newLine; } }
3ed0c1fd3f65ba93b2e076cbe84965bfc053d51b
55a1da6e002f6a83e13ec45a0ac4f8a27cf1c0e7
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/testControlHub.java
5c104a161f08f3e00fdca38c4b6cb1b13d90f364
[ "MIT" ]
permissive
GiuliCon/ftc-dashboard-master-master
727cbdf3720e3bf0cf184b260c91ba32020b7eb7
640db73c69a825cead458f64697203de6576f01d
refs/heads/master
2023-05-07T12:58:53.858932
2021-06-01T11:20:52
2021-06-01T11:20:52
372,453,014
0
0
null
null
null
null
UTF-8
Java
false
false
824
java
package org.firstinspires.ftc.teamcode; import com.acmerobotics.roadrunner.geometry.Pose2d; import com.acmerobotics.roadrunner.trajectory.Trajectory; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive; @Autonomous(group = "advanced",preselectTeleOp = "TeleOpAlignWithPoint") public class testControlHub extends LinearOpMode { SampleMecanumDrive driveTrain = new SampleMecanumDrive(hardwareMap); @Override public void runOpMode() throws InterruptedException { Trajectory test1 = driveTrain.trajectoryBuilder(new Pose2d(-60, -50, 0)) .forward(100) .build(); waitForStart(); driveTrain.followTrajectory(test1); } }
[ "Zdsp5shtSqEPw6A" ]
Zdsp5shtSqEPw6A
07f21e4df111bd0e06222f19cb9c5f490aa6bf5c
c1b5808a24f521f0f30f842150e9f348092d2978
/src/main/java/com/yoshio3/json/Ip.java
41ec36b29ba44ed8f3c79786aed7b842c1ab048d
[ "MIT" ]
permissive
yoshioterada/Azure-Media-Service-Redact-Face-from-Images
bafa9f20790d002b3980f7042322e705fd553f57
1f7dc8adf85025e2732f4883da7a9ebf5baa551a
refs/heads/master
2023-03-10T01:08:41.774530
2021-02-17T07:44:51
2021-02-17T07:44:51
113,637,023
1
3
MIT
2021-02-17T07:44:52
2017-12-09T03:00:58
Java
UTF-8
Java
false
false
1,606
java
/** * * @author Yoshio Terada * * Copyright (c) 2017 Yoshio Terada * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.yoshio3.json; import java.util.List; import javax.json.bind.annotation.JsonbProperty; public class Ip { @JsonbProperty("Allow") private List<Allow> allow; public List<Allow> getAllow() { return allow; } public void setAllow(List<Allow> value) { this.allow = value; } }
52cd20e653c67f6c3640e3804acdb7dd803e08c8
c337a483aa08b47497e90582eff217a1043e4b1d
/app/src/main/java/com/watabou/pixeldungeon/effects/MagicMissile.java
12c1c3732ea7a5e1360a6ff2560109ba73d4d735
[]
no_license
painlessgames/ezd
d2e4c2c3a28fc46a1051fe4c64c2be2c7fb2876c
f70bf0c0c77be72f924e2484e2d1d1995588255b
refs/heads/master
2016-09-06T03:26:51.962276
2014-10-27T06:31:15
2014-10-27T06:31:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,138
java
/* * Easy Dungeon * Copyright (C) 2012-2014 Oleg Dolya * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/> */ package com.watabou.pixeldungeon.effects; import com.watabou.noosa.Game; import com.watabou.noosa.Group; import com.watabou.noosa.particles.Emitter; import com.watabou.noosa.particles.PixelParticle; import com.watabou.pixeldungeon.DungeonTilemap; import com.watabou.pixeldungeon.effects.particles.FlameParticle; import com.watabou.pixeldungeon.effects.particles.LeafParticle; import com.watabou.pixeldungeon.effects.particles.PoisonParticle; import com.watabou.pixeldungeon.effects.particles.PurpleParticle; import com.watabou.pixeldungeon.effects.particles.ShadowParticle; import com.watabou.pixeldungeon.effects.particles.WoolParticle; import com.watabou.utils.Callback; import com.watabou.utils.ColorMath; import com.watabou.utils.PointF; import com.watabou.utils.Random; public class MagicMissile extends Emitter { private static final float SPEED = 200f; private Callback callback; private float sx; private float sy; private float time; public void reset( int from, int to, Callback callback ) { this.callback = callback; revive(); PointF pf = DungeonTilemap.tileCenterToWorld( from ); PointF pt = DungeonTilemap.tileCenterToWorld( to ); x = pf.x; y = pf.y; width = 0; height = 0; PointF d = PointF.diff( pt, pf ); PointF speed = new PointF( d ).normalize().scale( SPEED ); sx = speed.x; sy = speed.y; time = d.length() / SPEED; } public void size( float size ) { x -= size / 2; y -= size / 2; width = height = size; } public static void blueLight( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.pour( MagicParticle.FACTORY, 0.01f ); } public static void fire( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( FlameParticle.FACTORY, 0.01f ); } public static void earth( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 2 ); missile.pour( EarthParticle.FACTORY, 0.01f ); } public static void purpleLight( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 2 ); missile.pour( PurpleParticle.MISSILE, 0.01f ); } public static void whiteLight( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( WhiteParticle.FACTORY, 0.01f ); } public static void wool( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 3 ); missile.pour( WoolParticle.FACTORY, 0.01f ); } public static void poison( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 3 ); missile.pour( PoisonParticle.MISSILE, 0.01f ); } public static void foliage( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( LeafParticle.GENERAL, 0.01f ); } public static void slowness( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.pour( SlowParticle.FACTORY, 0.01f ); } public static void force( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( ForceParticle.FACTORY, 0.01f ); } public static void coldLight( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( ColdParticle.FACTORY, 0.01f ); } public static void shadow( Group group, int from, int to, Callback callback ) { MagicMissile missile = ((MagicMissile)group.recycle( MagicMissile.class )); missile.reset( from, to, callback ); missile.size( 4 ); missile.pour( ShadowParticle.MISSILE, 0.01f ); } @Override public void update() { super.update(); if (on) { float d = Game.elapsed; x += sx * d; y += sy * d; if ((time -= d) <= 0) { on = false; callback.call(); } } } public static class MagicParticle extends PixelParticle { public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((MagicParticle)emitter.recycle( MagicParticle.class )).reset( x, y ); } @Override public boolean lightMode() { return true; }; }; public MagicParticle() { super(); color( 0x88CCFF ); lifespan = 0.5f; speed.set( Random.Float( -10, +10 ), Random.Float( -10, +10 ) ); } public void reset( float x, float y ) { revive(); this.x = x; this.y = y; left = lifespan; } @Override public void update() { super.update(); // alpha: 1 -> 0; size: 1 -> 4 size( 4 - (am = left / lifespan) * 3 ); } } public static class EarthParticle extends PixelParticle.Shrinking { public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((EarthParticle)emitter.recycle( EarthParticle.class )).reset( x, y ); } }; public EarthParticle() { super(); lifespan = 0.5f; color( ColorMath.random( 0x555555, 0x777766 ) ); acc.set( 0, +40 ); } public void reset( float x, float y ) { revive(); this.x = x; this.y = y; left = lifespan; size = 4; speed.set( Random.Float( -10, +10 ), Random.Float( -10, +10 ) ); } } public static class WhiteParticle extends PixelParticle { public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((WhiteParticle)emitter.recycle( WhiteParticle.class )).reset( x, y ); } @Override public boolean lightMode() { return true; }; }; public WhiteParticle() { super(); lifespan = 0.4f; am = 0.5f; } public void reset( float x, float y ) { revive(); this.x = x; this.y = y; left = lifespan; } @Override public void update() { super.update(); // size: 3 -> 0 size( (left / lifespan) * 3 ); } } public static class SlowParticle extends PixelParticle { private Emitter emitter; public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((SlowParticle)emitter.recycle( SlowParticle.class )).reset( x, y, emitter ); } @Override public boolean lightMode() { return true; }; }; public SlowParticle() { super(); lifespan = 0.6f; color( 0x664422 ); size( 2 ); } public void reset( float x, float y, Emitter emitter ) { revive(); this.x = x; this.y = y; this.emitter = emitter; left = lifespan; acc.set( 0 ); speed.set( Random.Float( -20, +20 ), Random.Float( -20, +20 ) ); } @Override public void update() { super.update(); am = left / lifespan; acc.set( (emitter.x - x) * 10, (emitter.y - y) * 10 ); } } public static class ForceParticle extends PixelParticle { public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((ForceParticle)emitter.recycle( ForceParticle.class )).reset( x, y ); } }; public ForceParticle() { super(); lifespan = 0.6f; size( 4 ); } public void reset( float x, float y ) { revive(); this.x = x; this.y = y; left = lifespan; acc.set( 0 ); speed.set( Random.Float( -40, +40 ), Random.Float( -40, +40 ) ); } @Override public void update() { super.update(); am = (left / lifespan) / 2; acc.set( -speed.x * 10, -speed.y * 10 ); } } public static class ColdParticle extends PixelParticle.Shrinking { public static final Emitter.Factory FACTORY = new Factory() { @Override public void emit( Emitter emitter, int index, float x, float y ) { ((ColdParticle)emitter.recycle( ColdParticle.class )).reset( x, y ); } @Override public boolean lightMode() { return true; }; }; public ColdParticle() { super(); lifespan = 0.6f; color( 0x2244FF ); } public void reset( float x, float y ) { revive(); this.x = x; this.y = y; left = lifespan; size = 8; } @Override public void update() { super.update(); am = 1 - left / lifespan; } } }
6afd617ba40babf273cc029e6ea81eb37b2840d9
3aa0430c6ce1f0487faf477568fcc817c0c4f586
/src/main/java/com/hui/usual/service/NoticeService.java
9b79a188b895defb9e707c85c7b1775d6295618b
[]
no_license
NGAsomeone/pms
c53328af0717c16e8351dd2638f3fc1881368ee5
40e02988ae78651ff4c034322fbc888da513b2fa
refs/heads/master
2023-02-18T09:34:00.492318
2019-11-06T11:09:58
2019-11-06T11:09:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.hui.usual.service; import com.github.pagehelper.PageInfo; import com.hui.usual.bean.Notice; import java.util.List; import java.util.Map; public interface NoticeService { void saveInfo(Notice notice); PageInfo<Notice> getNoticeList(Integer pageNum, Map<String, Object> paramrterMap); List<Notice> latestNotice(); Notice showInfo(Integer nid); }
16db653cce240fbbb28beeaf322625b08625112a
9c8c3ea425a7f7a824bbb86bac82b564e3d1ad8c
/src/test/java/com/consistencyhash/AppTest.java
8f7d94a7446baf6e59fa5a18713220ea67aef7d2
[]
no_license
mahe0924/consistency-hash
d3030fb91f4859ad42759b9545c84f24cd43198a
614748e43c073b2e9b9f7fc3488019c8ced09c1b
refs/heads/master
2020-03-09T16:16:54.666459
2018-04-10T05:50:17
2018-04-10T05:50:17
128,880,349
0
0
null
null
null
null
UTF-8
Java
false
false
291
java
package com.consistencyhash; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * Unit test for simple App. */ public class AppTest { /** * Rigorous Test :-) */ @Test public void shouldAnswerWithTrue() { assertTrue( true ); } }
[ "mahe0924" ]
mahe0924
58e3b14e869eb02050450ce5e4b89dd807ccfcb6
ef9010f39a84d69ca0bc1f54051efbb2c3300edb
/AdaptavantRecruitmentProcess/src/com/acti/recruitment/controller/UpdateUser.java
7d4204098472b086206d7717cbe3c0b3ecc3452e
[]
no_license
lambodar/Recruitment-app
df2cb8a06531cea1a5adc6130bef8968f07950ca
04199c1b3f7ba2ebdc9b77b9688c652b12161173
refs/heads/master
2021-01-02T08:57:39.406602
2012-12-18T15:13:13
2012-12-18T15:13:13
6,839,817
1
0
null
null
null
null
UTF-8
Java
false
false
1,912
java
package com.acti.recruitment.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.acti.recruitment.dao.ConnectionProviderFactory; import com.acti.recruitment.dto.UserDetails; import com.acti.recruitment.serviceloader.DaoServiceLoader; @Controller @RequestMapping(value="/update") public class UpdateUser { @RequestMapping(value="/updateJobTitle", method=RequestMethod.POST) public String updateJobTitle(HttpServletRequest request){ HttpSession session=request.getSession(); if(session!=null){ String fbid=request.getParameter("fid"); System.out.println("inside update::"+fbid); String jobTitle=request.getParameter("designation"); System.out.println("inside update::"+jobTitle); String yearOfExperience=request.getParameter("experience"); System.out.println("inside update::"+yearOfExperience); DaoServiceLoader serviceLoader=ConnectionProviderFactory.getConnectionProvider(); System.out.println("test-1"); List<UserDetails> userDetails=(List<UserDetails>)serviceLoader.getPojo(fbid); System.out.println("userDetails::"+userDetails); System.out.println("test-2"); for (UserDetails updateUserDetails : userDetails) { System.out.println("test-3"); updateUserDetails.setJodTitle(jobTitle); System.out.println("test-4"); updateUserDetails.setYearOfExperience(yearOfExperience); System.out.println("test-5"); serviceLoader.savePojo(updateUserDetails); System.out.println("job title updated successfullt"); } return "views/afterGettingData"; } return "views/serverError"; } }
e77397cc5e2fad240aeedf96ae4509a6cbac9033
e37016f9bea6aac6954954ba33bde705a1245047
/custom-plugins/stanford_stemmer/src/main/java/edu/stanford/nlp/tagger/maxent/Distsim.java
20704f0682debb248012ad9341170f6daa6f353a
[]
no_license
zouxiang1993/es_lucene
11d558d98a9847b9df1d9d575bc9b362ac548f9b
c463345975db890105124c429965ed96ebd8bf92
refs/heads/master
2023-07-19T21:03:26.092718
2019-08-27T16:24:46
2019-08-27T16:24:46
148,873,770
3
3
null
2023-07-18T02:50:13
2018-09-15T05:47:30
Java
UTF-8
Java
false
false
3,214
java
package edu.stanford.nlp.tagger.maxent; //import edu.stanford.nlp.objectbank.ObjectBank; import edu.stanford.nlp.objectbank.ObjectBank; import edu.stanford.nlp.util.Generics; import java.io.File; import java.io.Serializable; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Keeps track of a distributional similarity mapping, i.e., a map from * word to class. Returns strings to save time, since that is how the * results are used in the tagger. */ public class Distsim implements Serializable { // Avoid loading the same lexicon twice but allow different lexicons // TODO: when loading a distsim, should we populate this map? private static final Map<String,Distsim> lexiconMap = Generics.newHashMap(); private final Map<String,String> lexicon; private final String unk; private boolean mapdigits; // = false private boolean casedDistSim; // = false; private static final Pattern digits = Pattern.compile("[0-9]"); /** * The Extractor argument extraction keeps ; together, so we use * that to delimit options. Actually, the only option supported is * mapdigits, which tells the Distsim to try mapping [0-9] to 0 and * requery for an unknown word with digits. */ public Distsim(String path) { String[] pieces = path.split(";"); String filename = pieces[0]; for (int arg = 1; arg < pieces.length; ++arg) { if (pieces[arg].equalsIgnoreCase("mapdigits")) { mapdigits = true; } else if (pieces[arg].equalsIgnoreCase("casedDistSim")) { casedDistSim = true; } else { throw new IllegalArgumentException("Unknown argument " + pieces[arg]); } } lexicon = Generics.newHashMap(); // todo [cdm 2016]: Note that this loads file with default file encoding rather than specifying it for (String word : ObjectBank.getLineIterator(new File(filename))) { String[] bits = word.split("\\s+"); String w = bits[0]; if ( ! casedDistSim) { w = w.toLowerCase(); } lexicon.put(w, bits[1]); } if (lexicon.containsKey("<unk>")) { unk = lexicon.get("<unk>"); } else { unk = "null"; } } public static Distsim initLexicon(String path) { synchronized (lexiconMap) { Distsim lex = lexiconMap.get(path); if (lex == null) { lex = new Distsim(path); lexiconMap.put(path, lex); } return lex; } } /** * Returns the cluster for the given word as a string. If the word * is not found, but the Distsim contains default numbers and the * word contains the digits 0-9, the default number is returned if * found. If the word is still unknown, the unknown word is * returned ("null" if no other unknown word was specified). */ public String getMapping(String word) { String distSim = lexicon.get(word.toLowerCase()); if (distSim == null && mapdigits) { Matcher matcher = digits.matcher(word); if (matcher.find()) { distSim = lexicon.get(matcher.replaceAll("0")); } } if (distSim == null) { distSim = unk; } return distSim; } private static final long serialVersionUID = 2L; }
24b2caab6c186b2ed7d800421ef5a80dc4a91d14
be693f39cb944cf6276efc75d720d5f67f684d64
/ec-member-service/src/main/java/com/lj/business/member/dto/FindPersonMember.java
6208d85e0b78f65f51b67fb82549872c694d8d3d
[]
no_license
wo510751575/service
8846da26529810fcf1e34b3a7d495518456831f7
2d8b2cb469c00271ce8c7ceb32b197e07fc96760
refs/heads/master
2022-12-28T22:29:57.315251
2019-08-27T08:08:52
2019-08-27T08:11:27
203,946,023
1
1
null
2022-12-16T11:35:13
2019-08-23T07:20:48
Java
UTF-8
Java
false
false
3,369
java
package com.lj.business.member.dto; import java.io.Serializable; // TODO: Auto-generated Javadoc /** * The Class FindPersonMember. */ public class FindPersonMember implements Serializable { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 9076091602064733682L; /** The code. */ private String code; /** 客户号. */ private String memberNo; /** 导购号. */ private String memberNoGm; /** 商户号. */ private String merchantNo; /** 区域CODE. */ private String areaCode; /** 区域名称. */ private String areaName; /**门店编号*/ private String shopNo; /**客户类型*/ private String pmTypeType; /**创建时间*/ private String createDate; /**省code*/ private String provinceCode; public String getProvinceCode() { return provinceCode; } public void setProvinceCode(String provinceCode) { this.provinceCode = provinceCode; } public String getShopNo() { return shopNo; } public void setShopNo(String shopNo) { this.shopNo = shopNo; } /** * Gets the area code. * * @return the area code */ public String getAreaCode() { return areaCode; } /** * Sets the area code. * * @param areaCode the area code */ public void setAreaCode(String areaCode) { this.areaCode = areaCode; } /** * Gets the area name. * * @return the area name */ public String getAreaName() { return areaName; } /** * Sets the area name. * * @param areaName the area name */ public void setAreaName(String areaName) { this.areaName = areaName; } /** * Gets the code. * * @return the code */ public String getCode() { return code; } /** * Sets the code. * * @param code the code to set */ public void setCode(String code) { this.code = code; } /** * Gets the 客户号. * * @return the 客户号 */ public String getMemberNo() { return memberNo; } /** * Sets the 客户号. * * @param memberNo the new 客户号 */ public void setMemberNo(String memberNo) { this.memberNo = memberNo; } /** * Gets the 导购号. * * @return the 导购号 */ public String getMemberNoGm() { return memberNoGm; } /** * Sets the 导购号. * * @param memberNoGm the new 导购号 */ public void setMemberNoGm(String memberNoGm) { this.memberNoGm = memberNoGm; } /** * Gets the merchant no. * * @return the merchant no */ public String getMerchantNo() { return merchantNo; } /** * Sets the merchant no. * * @param merchantNo the merchant no */ public void setMerchantNo(String merchantNo) { this.merchantNo = merchantNo; } public String getPmTypeType() { return pmTypeType; } public void setPmTypeType(String pmTypeType) { this.pmTypeType = pmTypeType; } public String getCreateDate() { return createDate; } public void setCreateDate(String createDate) { this.createDate = createDate; } @Override public String toString() { return "FindPersonMember [code=" + code + ", memberNo=" + memberNo + ", memberNoGm=" + memberNoGm + ", merchantNo=" + merchantNo + ", areaCode=" + areaCode + ", areaName=" + areaName + ", shopNo=" + shopNo + ", pmTypeType=" + pmTypeType + ", createDate=" + createDate + ", provinceCode=" + provinceCode + "]"; } }
b80c0f112f742968a6c1173ce6cbac624774efd2
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/shopee/app/ui/follow/search/n.java
1ca59a7007d0b38bc1575749ae38894fb8db4003
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,097
java
package com.shopee.app.ui.follow.search; import android.content.Context; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.shopee.id.R; import org.a.a.b.a; import org.a.a.b.b; import org.a.a.b.c; public final class n extends m implements a, b { private boolean q = false; private final c r = new c(); public n(Context context, String str, boolean z, int i, boolean z2, String str2) { super(context, str, z, i, z2, str2); k(); } public static m a(Context context, String str, boolean z, int i, boolean z2, String str2) { n nVar = new n(context, str, z, i, z2, str2); nVar.onFinishInflate(); return nVar; } public void onFinishInflate() { if (!this.q) { this.q = true; inflate(getContext(), R.layout.search_user_layout, this); this.r.a((a) this); } super.onFinishInflate(); } private void k() { c a2 = c.a(this.r); c.a((b) this); c.a(a2); } public <T extends View> T internalFindViewById(int i) { return findViewById(i); } public void onViewChanged(a aVar) { this.f21818a = (ListView) aVar.internalFindViewById(R.id.search_user_list); this.f21819b = (ListView) aVar.internalFindViewById(R.id.history_and_hotKey_list); this.h = aVar.internalFindViewById(R.id.emptyView); if (this.f21819b != null) { this.f21819b.setOnItemClickListener(new AdapterView.OnItemClickListener() { /* JADX WARNING: type inference failed for: r1v0, types: [android.widget.AdapterView<?>, android.widget.AdapterView] */ /* JADX WARNING: Unknown variable types count: 1 */ /* Code decompiled incorrectly, please refer to instructions dump. */ public void onItemClick(android.widget.AdapterView<?> r1, android.view.View r2, int r3, long r4) { /* r0 = this; com.shopee.app.ui.follow.search.n r2 = com.shopee.app.ui.follow.search.n.this android.widget.Adapter r1 = r1.getAdapter() java.lang.Object r1 = r1.getItem(r3) com.shopee.app.data.viewmodel.SearchProductItem r1 = (com.shopee.app.data.viewmodel.SearchProductItem) r1 r2.a((com.shopee.app.data.viewmodel.SearchProductItem) r1) return */ throw new UnsupportedOperationException("Method not decompiled: com.shopee.app.ui.follow.search.n.AnonymousClass1.onItemClick(android.widget.AdapterView, android.view.View, int, long):void"); } }); } if (this.f21818a != null) { this.f21818a.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) { n.this.a(i); } }); } a(); } }
c6ea7d85c81cc1c116030a20b341022c8de3859d
225011bbc304c541f0170ef5b7ba09b967885e95
/com/mopub/nativeads/MoPubNativeAdPositioning.java
61bedc27952368f242eb4e163049b1ab6c592623
[]
no_license
sebaudracco/bubble
66536da5367f945ca3318fecc4a5f2e68c1df7ee
e282cda009dfc9422594b05c63e15f443ef093dc
refs/heads/master
2023-08-25T09:32:04.599322
2018-08-14T15:27:23
2018-08-14T15:27:23
140,444,001
1
1
null
null
null
null
UTF-8
Java
false
false
2,347
java
package com.mopub.nativeads; import android.support.annotation.NonNull; import com.mopub.common.Preconditions; import com.mopub.common.Preconditions.NoThrow; import java.util.ArrayList; import java.util.Collections; import java.util.List; public final class MoPubNativeAdPositioning { public static class MoPubClientPositioning { public static final int NO_REPEAT = Integer.MAX_VALUE; @NonNull private final ArrayList<Integer> mFixedPositions = new ArrayList(); private int mRepeatInterval = Integer.MAX_VALUE; @NonNull public MoPubClientPositioning addFixedPosition(int position) { if (NoThrow.checkArgument(position >= 0)) { int index = Collections.binarySearch(this.mFixedPositions, Integer.valueOf(position)); if (index < 0) { this.mFixedPositions.add(index ^ -1, Integer.valueOf(position)); } } return this; } @NonNull List<Integer> getFixedPositions() { return this.mFixedPositions; } @NonNull public MoPubClientPositioning enableRepeatingPositions(int interval) { boolean z = true; if (interval <= 1) { z = false; } if (NoThrow.checkArgument(z, "Repeating interval must be greater than 1")) { this.mRepeatInterval = interval; } else { this.mRepeatInterval = Integer.MAX_VALUE; } return this; } int getRepeatingInterval() { return this.mRepeatInterval; } } public static class MoPubServerPositioning { } @NonNull static MoPubClientPositioning clone(@NonNull MoPubClientPositioning positioning) { Preconditions.checkNotNull(positioning); MoPubClientPositioning clone = new MoPubClientPositioning(); clone.mFixedPositions.addAll(positioning.mFixedPositions); clone.mRepeatInterval = positioning.mRepeatInterval; return clone; } @NonNull public static MoPubClientPositioning clientPositioning() { return new MoPubClientPositioning(); } @NonNull public static MoPubServerPositioning serverPositioning() { return new MoPubServerPositioning(); } }
fe673bb3fa41bbfd1edaa57905166ac04c61fd1c
954c21022efa1b1c368165ffd5429593764e0f21
/codeFiles/srcDoc/adaptors/instagram/InstagramFetchers.java
1e5dc354ba086333c248e912c1f2ef53d130b4e1
[ "Apache-2.0" ]
permissive
dkmsntua/SociosApi
75fe3ba52e05b76342a1c906441e8ff13e8d0f5d
2dfabb9e13c241e8687b50d5f82900a30d638e52
refs/heads/master
2021-01-13T09:42:59.092152
2015-10-22T11:18:18
2015-10-22T11:18:18
24,592,638
3
3
null
null
null
null
UTF-8
Java
false
false
5,561
java
package adaptors.instagram; import helper.misc.SociosConstants; import helper.utilities.ExceptionsUtilities; import objects.containers.CommentsContainer; import objects.containers.MediaItemsContainer; import objects.containers.PersonsContainer; import objects.enums.SocialNetwork; import objects.enums.SociosObject; import objects.main.Comment; import objects.main.MediaItem; import objects.main.Person; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class InstagramFetchers { private static SocialNetwork sn = SocialNetwork.DAILYMOTION; public static PersonsContainer fetchPerson(String response, String id) { PersonsContainer result = new PersonsContainer(); try { JSONObject json = new JSONObject(response); JSONObject jsperson = json.optJSONObject("data"); Person person = InstagramParsers.parsePerson(jsperson); result.getPersons().add(person); } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.PERSON, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } public static PersonsContainer fetchPersons(String response, String id) { PersonsContainer result = new PersonsContainer(); try { JSONObject json = new JSONObject(response); JSONArray personArray = json.optJSONArray("data"); for (int index = 0; index < personArray.length(); index++) { JSONObject jsperson = personArray.optJSONObject(index); Person person = InstagramParsers.parsePerson(jsperson); result.getPersons().add(person); } } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.PERSON, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } public static PersonsContainer fetchRelevantPersons(String response, String id) { PersonsContainer result = new PersonsContainer(); try { JSONObject json = new JSONObject(response); JSONObject jsmediaItem = json.optJSONObject("data"); JSONObject jsuser = jsmediaItem.optJSONObject("user"); Person user = InstagramParsers.parsePerson(jsuser); result.getPersons().add(user); JSONObject jslikers = jsmediaItem.optJSONObject("likes"); JSONArray likersArray = jslikers.optJSONArray("data"); for (int index = 0; index < likersArray.length(); index++) { JSONObject jsliker = likersArray.optJSONObject(index); Person liker = InstagramParsers.parsePerson(jsliker); result.getPersons().add(liker); } JSONArray taggedArray = jsmediaItem.optJSONArray("users_in_photo"); for (int index = 0; index < taggedArray.length(); index++) { JSONObject jstagged = taggedArray.optJSONObject(index); JSONObject jstaggedUser = jstagged.optJSONObject("user"); Person taggedUser = InstagramParsers.parsePerson(jstaggedUser); result.getPersons().add(taggedUser); } JSONObject jscomments = jsmediaItem.optJSONObject("comments"); JSONArray commentsArray = jscomments.optJSONArray("data"); for (int index = 0; index < commentsArray.length(); index++) { JSONObject jscomment = commentsArray.optJSONObject(index); JSONObject jscommenter = jscomment.optJSONObject("from"); Person commenter = InstagramParsers.parsePerson(jscommenter); result.getPersons().add(commenter); } } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.PERSON, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } public static MediaItemsContainer fetchMediaItem(String response, String id) { MediaItemsContainer result = new MediaItemsContainer(); try { JSONObject json = new JSONObject(response); JSONObject jsmediaItem = json.optJSONObject("data"); MediaItem mediaItem = InstagramParsers.parseMediaItem(jsmediaItem); result.getMediaItems().add(mediaItem); } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.MEDIAITEM, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } public static MediaItemsContainer fetchMediaItems(String response, String id) { MediaItemsContainer result = new MediaItemsContainer(); try { JSONObject json = new JSONObject(response); JSONArray array = json.optJSONArray("data"); for (int index = 0; index < array.length(); index++) { JSONObject jsmediaItem = array.optJSONObject(index); MediaItem mediaItem = InstagramParsers.parseMediaItem(jsmediaItem); result.getMediaItems().add(mediaItem); } } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.MEDIAITEM, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } public static CommentsContainer fetchComments(String response, String id) { CommentsContainer result = new CommentsContainer(); try { JSONObject json = new JSONObject(response); JSONArray commentArray = json.optJSONArray("data"); for (int index = 0; index < commentArray.length(); index++) { JSONObject jscomment = commentArray.optJSONObject(index); Comment comment = InstagramParsers.parseComments(jscomment); result.getComments().add(comment); } } catch (JSONException exc) { return ExceptionsUtilities.getException(SociosObject.COMMENT, sn, exc.getMessage() + " ==> " + response, id, SociosConstants.ERROR_500); } return result; } }
09b22b367e9539ed061a5215e60da972695bb0cf
8b27b960a2f633a812aeac4aa5ff391755cf1170
/app/src/main/java/wza/slx/com/xlxapplication/model/Contact.java
79269ae02d7e38e13945e2476fb92762cd18b532
[]
no_license
wangzhengchao/XLXApplication
ed56c1c0afc3372d6ac0bff59dcdad0b5c25d120
aac4b745a351dce19b50d82f644337be9c731869
refs/heads/master
2021-01-21T17:24:23.460334
2017-04-28T02:13:58
2017-04-28T02:13:58
85,382,261
0
1
null
null
null
null
UTF-8
Java
false
false
235
java
package wza.slx.com.xlxapplication.model; import java.io.Serializable; /** */ public class Contact implements Serializable{ /** * callName : * phone : */ public String callName; public String phone; }
5064c160174b5753fd8c5a2b6ece8b25865a0dc3
11f5760c4f702957659fe05b072378a3b5044479
/src/main/java/com/bsuir/second/service/SpecializationService.java
2547c0b6f5cdde83ec5a998640b864c7d3a4ee12
[]
no_license
mvladmoss/SpringBootThymeleafHttpServer
55e2b308c6b7646838379f6c1f9c01b6ebf14757
1916fc5628ccee57ce01b5ecc835e6db0c646fd0
refs/heads/master
2022-10-02T13:45:59.034941
2020-02-06T19:03:19
2020-02-06T19:03:19
238,760,025
0
0
null
2022-09-08T01:06:14
2020-02-06T18:49:13
Java
UTF-8
Java
false
false
447
java
package com.bsuir.second.service; import java.util.List; import com.bsuir.second.model.dto.SpecializationDto; public interface SpecializationService { List<SpecializationDto> findAll(); SpecializationDto findById(Long id); SpecializationDto findByName(String name); SpecializationDto save(SpecializationDto specializationDto); SpecializationDto update(SpecializationDto specializationDto); void remove(Long id); }
47c334f782b6f0f1954a1d55781ba79c2a210c56
5d6c374a2518d469d674a1327d21d8e0cf2b54f7
/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/sdo/CoordinateAccessFactory.java
68419d39be54cd049e0672e6142dd3976b5f5857
[]
no_license
HGitMaster/geotools-osgi
648ebd9343db99a1e2688d9aefad857f6521898d
09f6e327fb797c7e0451e3629794a3db2c55c32b
refs/heads/osgi
2021-01-19T08:33:56.014532
2014-03-19T18:04:03
2014-03-19T18:04:03
4,750,321
3
0
null
2014-03-19T13:50:54
2012-06-22T11:21:01
Java
UTF-8
Java
false
false
2,152
java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2003-2008, Open Source Geospatial Foundation (OSGeo) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * Refractions Research Inc. Can be found on the web at: * http://www.refractions.net/ * * Created on Oct 29, 2003 */ package org.geotools.data.oracle.sdo; import com.vividsolutions.jts.geom.CoordinateSequenceFactory; /** * Extends CoordianteSequenceFactory with meta data information. * <p> * This allows us to determine the dimensions of a Geometry. * </p> * @author jgarnett * * @source $URL: http://svn.osgeo.org/geotools/tags/8.0-M1/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/sdo/CoordinateAccessFactory.java $ */ public interface CoordinateAccessFactory extends CoordinateSequenceFactory { /** * Create method that allows additional content. * <p> * Example: (x,y,z,t) getDimension()==2, getNumAttributes()==2 * </p> * <pre><code> * <b>xyz</b>:[ [ x1, x2,...,xN], [ y1, y2,...,yN] ] * <b>attributes</b>:[ [ z1, z2,...,zN], [ t1, t2,..., tN] ] * </code></pre> * @param xyz an array of doubles in column major order where xyz.length == getDimension() * @param attributes an array of Objects which can be null. Column major measure arrays where attributes.length == getNumAttributes() */ public CoordinateAccess create(double[] xyz[], Object[] attributes ); /** Number of spatial ordinates() */ public int getDimension(); /** Number of non spatial ordinates() */ public int getNumAttributes(); }
[ "devnull@localhost" ]
devnull@localhost
cd08f1e416a56f1922a15279e06c62f254fb1c53
b389b7a2306eb92e02e5bfdcee460051b9ae7cc6
/app/src/main/java/com/example/admin/github/data/DataManager.java
febe634fee6973a220b8cebcb919024284ab9c03
[]
no_license
agamirzaev/GitHub
0675c2ceac2783b07bdf75988a8f511d8e9d1548
7baeb3aae22834e4c23c59686fd4747da6716f29
refs/heads/master
2020-03-23T10:12:45.125047
2018-07-18T16:40:46
2018-07-18T16:40:46
141,418,560
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
package com.example.admin.github.data; import com.example.admin.github.data.model.User; import com.example.admin.github.data.remote.GitHubApi; import com.example.admin.github.data.remote.ServicesGenerator; import java.util.List; import retrofit2.Call; public class DataManager { public Call<List<User>> getUsers(){ return ServicesGenerator.createService(GitHubApi.class).getUsers(); } public Call<User> getUserDetails(String login){ return ServicesGenerator.createService(GitHubApi.class).getUserDetails(login); } }
89d634eb5431e0f7a039ec3ec670a6db7bca7125
a270ceb590c5b05dfa56accf41be8cfde9b076c8
/src/main/java/com/example/demoshop/dao/UserInfoDOMapper.java
14843245e4ccd2bd88d5ba486547570ea4797cfe
[]
no_license
GH-jia/demoshop
d81a144c1587ad269f5b05671f2f607a344ec3be
3452ba224a3037e410b38bb1d8732fbd50ccbc4a
refs/heads/master
2022-07-07T15:01:05.338431
2020-04-06T15:03:20
2020-04-06T15:03:20
228,302,586
0
0
null
2022-06-21T02:27:21
2019-12-16T04:29:57
Java
UTF-8
Java
false
false
3,090
java
package com.example.demoshop.dao; import com.example.demoshop.daoObject.UserInfoDO; import com.example.demoshop.daoObject.UserInfoDOExample; import java.util.List; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @Repository public interface UserInfoDOMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ long countByExample(UserInfoDOExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int deleteByExample(UserInfoDOExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int insert(UserInfoDO record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int insertSelective(UserInfoDO record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ List<UserInfoDO> selectByExample(UserInfoDOExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ UserInfoDO selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int updateByExampleSelective(@Param("record") UserInfoDO record, @Param("example") UserInfoDOExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int updateByExample(@Param("record") UserInfoDO record, @Param("example") UserInfoDOExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int updateByPrimaryKeySelective(UserInfoDO record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table user_info * * @mbg.generated Fri Nov 29 16:06:44 CST 2019 */ int updateByPrimaryKey(UserInfoDO record); }
e3ca7c7195f5b9c77220918c1b0c81d87c22c53b
be0ad3abc68acebb5d68d806aa97e88ae2c95fd3
/src/main/java/shift_manager_pro/controllers/shifts/ShiftAllocateController.java
2e912392e8a5527a957b244365d1a7f9a27957b2
[]
no_license
quangminhduong/A2Fixed1
f83e07a988dacdcb3e46d7f793b407d89e1d6c7d
505a257dfec4bb4998d95da907ec761d13aaacfc
refs/heads/main
2023-05-13T05:20:57.865946
2021-05-30T12:16:35
2021-05-30T12:16:35
371,933,334
1
0
null
null
null
null
UTF-8
Java
false
false
798
java
package shift_manager_pro.controllers.shifts; import io.javalin.http.Context; import io.javalin.http.Handler; import org.jetbrains.annotations.NotNull; import shift_manager_pro.dao.*; import shift_manager_pro.models.*; import shift_manager_pro.utils.EmailSender; public class ShiftAllocateController implements Handler { @Override public void handle(@NotNull Context ctx) throws Exception { User user = UserDao.INSTANCE.get( ctx.pathParam("user_id", Long.class).get() ); Shift shift = ShiftDao.INSTANCE.getById( ctx.pathParam("shift_id", Long.class).get() ); shift.setUser_id(user.getId()); shift.setStatus("PENDING"); EmailSender.newShiftEmailSender(user, shift); ShiftDao.INSTANCE.updateShift(shift); ctx.redirect("/view_all_shifts"); } }
24645a082c2a8e21f1f093e01a7d540573b0b654
260b40bfdab44257c0615fe5fbf30cabfd15c144
/app/src/main/java/me/jessyan/mvpart/demo/demo4/FourthActivity.java
b784344c3274bd4cfc2cc3d9c954074232973099
[ "Apache-2.0" ]
permissive
JerryMissTom/MVPArt
91d9ab3edd92d1ade15076eda7acc2ba02a18635
4fa9fb556efba09d94448e4446e750646888e0c9
refs/heads/master
2021-01-21T06:38:42.562553
2017-02-26T15:16:22
2017-02-26T15:16:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,175
java
package me.jessyan.mvpart.demo.demo4; import android.content.Intent; import android.view.View; import android.widget.RelativeLayout; import android.widget.Toast; import butterknife.BindView; import butterknife.OnClick; import me.jessyan.art.base.BaseActivity; import me.jessyan.art.mvp.BaseView; import me.jessyan.art.mvp.Message; import me.jessyan.mvpart.demo.MainPresenter; import me.jessyan.mvpart.demo.R; /** * Created by jess on 25/02/2017 20:22 * Contact with [email protected] * 这里为了展示一个页面可以持有多个Presenter对象,做不同的逻辑处理,相比于传统MVP,可以随便重用Presenter * 而不用担心,实现多余的view接口,也可以减少大量Presenter类 */ public class FourthActivity extends BaseActivity<MainPresenter> implements BaseView { private SecondPresenter mSecondPresenter; @BindView(R.id.activity_main) RelativeLayout mRoot; @Override protected int initView() { return R.layout.activity_fourth; } @Override protected void initData() { } @Override protected MainPresenter getPresenter() { mSecondPresenter = new SecondPresenter(); return new MainPresenter(); } @Override protected void onDestroy() { super.onDestroy(); if (mSecondPresenter != null) mSecondPresenter.onDestroy(); mSecondPresenter = null; } @Override public void showLoading() { } @Override public void hideLoading() { } @Override public void showMessage(String message) { Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show(); } @Override public void launchActivity(Intent intent) { } @Override public void handleMessage(Message message) { switch (message.what) { // 两个presenter都使用了"2"这个what字段,所以使用presenter字段来区分 // 但记得每次调用presenter方法前将此presenter的类名赋值给message的presenter字段 case 2: if (message.presenter.equals(MainPresenter.class.getSimpleName())) { mRoot.setBackgroundResource(R.color.colorAccent); // 在一个请求链中重用多个不同presenter的方法来完成所有请求,灵活重用presenter使MVP更强大 mSecondPresenter.request3(Message.obtain(this, SecondPresenter.class)); } else if (message.presenter.equals(SecondPresenter.class.getSimpleName())) { showMessage("MVPArt"); } break; } } @OnClick({R.id.btn_request}) public void onClick(View v) { switch (v.getId()) { case R.id.btn_request: // 使用多个presenter时,可能都使用过同一个what值,存在冲突的情况 // 所以message提供一个presenter字段,避免这个冲突的情况 // 这个方法也就是将presenter的类名赋值给message.presenter mPresenter.request2(Message.obtain(this, MainPresenter.class)); break; } } }
432662769642fd5271adfe47c172c0a55b182f5a
5a78c0ddd9eb6945d1556f07b02e4a85a22c6348
/ssm-salt-cloud/ssm-service-gateway/src/main/java/cn/edu/cqvie/controller/FallbackController.java
6c9718a505a2de5181f39d18ed630af934de7fc2
[]
no_license
zhengsh/ssm-salt
a5c1323abdb3d0230b55edad7bffa2a748570a8d
3ce8d4866843b294df2262b332295ce9c0dc65d3
refs/heads/master
2023-03-18T21:52:00.025665
2021-03-10T02:55:49
2021-03-10T02:55:49
307,019,368
1
1
null
null
null
null
UTF-8
Java
false
false
584
java
package cn.edu.cqvie.controller; import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * 服务降级重定向返回 * * @author zhengsh * @date 2021-01-31 */ @RestController public class FallbackController { @GetMapping("/fallback") public Object login(ServerHttpResponse response) { response.setStatusCode(HttpStatus.GATEWAY_TIMEOUT); return "服务降级"; } }
91a60a0690b8cdc1804d61dc492121c4a5a49865
4f6b326e1d9d9eba3d5e4c0839a0b6d364068b9e
/app/src/main/java/com/dylan/quizzgame/ViewHolder/ScoreDetailViewHolder.java
b1b69bf3671b342658ac4ed33d8994ca3a4a7557
[]
no_license
DDylanBD/QuizGame
94105d577c961b9f84a715d8635e3eed1ba32fc8
a6cd26098b009a4cb205ff044db4bf9fe6f52a22
refs/heads/master
2020-03-22T00:10:47.284570
2018-06-30T08:27:59
2018-06-30T08:27:59
139,228,715
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package com.dylan.quizzgame.ViewHolder; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.TextView; import com.dylan.quizzgame.R; /** * Created by Dylan on 12/04/2018. */ public class ScoreDetailViewHolder extends RecyclerView.ViewHolder { public TextView txt_name,txt_score; public ScoreDetailViewHolder(View itemView) { super(itemView); txt_name = (TextView)itemView.findViewById(R.id.txt_name); txt_score = (TextView)itemView.findViewById(R.id.txt_score); } }
[ "8089076304" ]
8089076304
43f571f419a7332f31d229631e1f6feab446ffec
f6d1013296ecc58c5ef10c880cb404ac877c46fe
/src/test/java/guice/guice_tutorial/project/SomeDelegateTest.java
8ce7c26262f20c42bdc78d6cc2a59c941e24aac4
[]
no_license
jojo8775/guice-tutorial
4e0d8feec482684ab3e3e34d26ed29b1f0a2b82a
b7956b965ebf896bd9cb8a37fc942cf873b49b76
refs/heads/master
2021-06-21T15:53:23.631741
2017-04-25T17:24:54
2017-04-25T17:24:54
56,207,634
0
1
null
null
null
null
UTF-8
Java
false
false
2,294
java
package guice.guice_tutorial.project; import java.util.List; import org.junit.Test; import com.google.inject.Binder; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; import com.google.inject.assistedinject.FactoryModuleBuilder; public class SomeDelegateTest { @Test public void testProcessSomething() { Injector injector = Guice.createInjector(new Module() { public void configure(Binder binder) { binder.bind(SomeHelper.class).to(MockSomeHelper.class); binder.install(new FactoryModuleBuilder().implement(SomeHelper2.class, MockSomeHelper2.class) .implement(SomeHelper3.class, MockSampleHelper3.class) .implement(SomeHelper4.class, MockSomeHelper4.class).build(SomeFactory.class)); } }); SomeDelegate someDelegate = injector.getInstance(SomeDelegate.class); someDelegate.processSomething(injector); } private static class MockSomeHelper extends SomeHelper { @Override public void print() { System.out.println("this is the test implementation."); } } private static class MockSomeHelper2 extends SomeHelper2 { @AssistedInject public MockSomeHelper2(@Assisted("msg1") String msg1, @Assisted("msg2") String msg2) { super(msg1, msg2); } @Override public void print() { System.out.println("This is constructor injection"); } } private static class MockSampleHelper3 extends SomeHelper3 { private List<String> msgList; @AssistedInject public MockSampleHelper3(@Assisted List<String> msgList) { super(msgList); this.msgList = msgList; } @Override public void print() { System.out.println("This is mock list"); for(String s : msgList){ System.out.print(s + ", "); } System.out.println("end of mock"); } } private static class MockSomeHelper4 extends SomeHelper4 { private SomeModel criteria; @AssistedInject public MockSomeHelper4(@Assisted SomeModel criteria) { super(criteria); this.criteria = criteria; } public void print(){ System.out.println("Helper 4 mock beg: "); System.out.println(criteria.getName()); System.out.println("Helper 4 mock end:"); } } }
79f507afb79b0051fe17b07842cd4bb4c48bed35
dff3a7afc38b3ce8d8323e7e351e9d0ad80af8eb
/t1/src/volatiletest/Producer.java
389667449efde34e904bbe02fafd185a88e71c21
[]
no_license
hyeagle/concurrency-learning
947dd33786dbb711e0016acf0c76eb4a3ab02ce5
9f87bdf4c797087d79b206b21452f66f3249e285
refs/heads/master
2023-03-30T11:11:31.471557
2021-04-09T09:11:51
2021-04-09T09:11:51
329,788,887
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
package volatiletest; import java.util.concurrent.BlockingQueue; public class Producer implements Runnable { public volatile boolean canceled = false; BlockingQueue storage; public Producer(BlockingQueue storage) { this.storage = storage; } @Override public void run() { int num = 0; try { while (num <= 100000 && !canceled) { if (num % 50 == 0) { storage.put(num); System.out.println(num + "是50的倍数,被放到仓库中了。"); } num++; } } catch (InterruptedException e) { e.printStackTrace(); } finally { System.out.println("生产者结束运行"); } } }
555777f3c7eb83818fd24036be50a2d695e00c6a
3c1e2d028f7f11d89ee857ab75e342afac500cdb
/app/src/main/java/com/test/mymrceapp/User.java
acb6ad034b5ea1ffb112bc950231438e94474c7f
[]
no_license
sanjaydevlop/MY_MRCE_APP
1c25b4c266642238c9fb54d2951b765ea9fbc759
85dfde918c1488b9e53ee55a6ff39fa09e66e39b
refs/heads/master
2023-02-10T04:30:05.452780
2020-12-29T06:37:25
2020-12-29T06:37:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package com.test.mymrceapp; public class User { public String name, email, rollnumber; public User() { } public User(String name, String email, String rollnumber) { this.name = name; this.email = email; this.rollnumber = rollnumber; } }
9b401fafcf140e938b9c1b8d29fd1a136abaf93d
9e4f379555b116497b5450a94616edcc9183e03c
/src/JavaSessions/LoopsConcept.java
cbf643b4d0da152c58ccd7804b7e8d5680788d49
[]
no_license
naveenanimation20/Jan2021JavaSessions
d6398bd43fe236d73d341ef7929acfa3aa5553a7
d392c8e53683013e0650a0ce4aa2d116ae5a7f39
refs/heads/master
2023-04-06T22:54:20.320163
2021-04-20T02:20:16
2021-04-20T02:20:16
359,654,561
6
6
null
null
null
null
UTF-8
Java
false
false
1,504
java
package JavaSessions; public class LoopsConcept { public static void main(String[] args) { //1 to 10 //1. while loop: int i = 1; while(i<=10) { System.out.println(i);//1 2 3 4 5 6...10 i++; //++i; //i=i+1; } int n = 1; while(n<=50) { System.out.println(n);//1 if(n % 5 == 0) { System.out.println("Hi...."); } n++; } System.out.println("---------------"); //break with while: int num = 0; while(num<=100) { System.out.println(num); if(num == 50) { System.out.println("half century"); } if(num == 100) { System.out.println("century"); } if(num==0) { System.out.println("duck...out"); break; } num++; } System.out.println("----------------"); //2. for loops: //1 to 10: for(int k=1; k<=10; ) { System.out.println(k);//1....10 k++; } System.out.println("----------------"); for(double d = 1.0; d<=10.0; d++) { System.out.println(d); } System.out.println("----------------"); for(char c='a'; c<='z'; c++) { System.out.println(c);//a b c d } // // for(;;) { // System.out.println("welcome to TAJ Hotel...."); // } //for with break: for(int w=1; w<=20; w++) { System.out.println(w); if(w==15) { System.out.println("value is 15..."); break; } } System.out.println("------"); //3. do-while: int p = 1; do { System.out.println(p);//1 p++; } while (p<=10); } }
f1517d6517241cbd33d3584ff6935e23aef1edfc
882a1a28c4ec993c1752c5d3c36642fdda3d8fad
/proxies/com/microsoft/bingads/v12/campaignmanagement/GetMediaMetaDataByAccountIdRequest.java
f971170b4419b88017aff7a4226385a18a5898a8
[ "MIT" ]
permissive
BazaRoi/BingAds-Java-SDK
640545e3595ed4e80f5a1cd69bf23520754c4697
e30e5b73c01113d1c523304860180f24b37405c7
refs/heads/master
2020-07-26T08:11:14.446350
2019-09-10T03:25:30
2019-09-10T03:25:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,638
java
package com.microsoft.bingads.v12.campaignmanagement; import java.util.Collection; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="MediaEnabledEntities" type="{https://bingads.microsoft.com/CampaignManagement/v12}MediaEnabledEntityFilter" minOccurs="0"/> * &lt;element name="PageInfo" type="{https://bingads.microsoft.com/CampaignManagement/v12}Paging" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "mediaEnabledEntities", "pageInfo" }) @XmlRootElement(name = "GetMediaMetaDataByAccountIdRequest") public class GetMediaMetaDataByAccountIdRequest { @XmlElement(name = "MediaEnabledEntities", type = String.class) @XmlJavaTypeAdapter(Adapter9 .class) protected Collection<MediaEnabledEntityFilter> mediaEnabledEntities; @XmlElement(name = "PageInfo", nillable = true) protected Paging pageInfo; /** * Gets the value of the mediaEnabledEntities property. * * @return * possible object is * {@link String } * */ public Collection<MediaEnabledEntityFilter> getMediaEnabledEntities() { return mediaEnabledEntities; } /** * Sets the value of the mediaEnabledEntities property. * * @param value * allowed object is * {@link String } * */ public void setMediaEnabledEntities(Collection<MediaEnabledEntityFilter> value) { this.mediaEnabledEntities = value; } /** * Gets the value of the pageInfo property. * * @return * possible object is * {@link Paging } * */ public Paging getPageInfo() { return pageInfo; } /** * Sets the value of the pageInfo property. * * @param value * allowed object is * {@link Paging } * */ public void setPageInfo(Paging value) { this.pageInfo = value; } }
150d9ab1e69d16012ab0dcbcd6bd461acdaf1244
1cb0587f4b6edff26a226bab1716605b1c3f24a7
/medsales/medsales-api/src/main/java/org/sales/medsales/api/web/action/ResultData.java
539e3e9c3f90bc2c69f91a9901224400a3b49267
[]
no_license
augustobreno/medsales
d378367bc1bc2f541aca1bac07cd9d3cf3adfff8
a42af603897ff8c49ee9f31dc0e1ad8e9531b5b1
refs/heads/master
2021-01-14T08:03:21.493832
2017-03-23T21:26:28
2017-03-23T21:26:28
28,267,894
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package org.sales.medsales.api.web.action; import java.util.List; import org.sales.medsales.api.dominio.Entity; /** * Wraper para encapsular o resultado de uma consulta, contendo a lista e o número total * de registros. * @author augusto */ public class ResultData<ENTITY extends Entity<?>> { private List<ENTITY> resultList; private Integer countAll; public ResultData(List<ENTITY> resultList, Integer countAll) { super(); this.resultList = resultList; this.countAll = countAll; } public List<ENTITY> getResultList() { return resultList; } public void setResultList(List<ENTITY> resultList) { this.resultList = resultList; } public Integer getCountAll() { return countAll; } public void setCountAll(Integer countAll) { this.countAll = countAll; } }
29cf46c3279899a100ac4f06d5c5308d2faca28c
0c29dc96c14381bd750360ec1e0bb176baffbe60
/sample-springboot-mybatis/src/main/java/com/smallcode/sample/springboot/mybatis/controller/AutoController.java
9a169defc8cb110446490cda6f9107e75fc4bf8f
[]
no_license
applenele/sample
ddb074de9e561d656734557d78d4084aa5fa3482
3ed67c80e283298c82993972d032f67acad688b8
refs/heads/master
2021-07-18T14:27:18.931978
2019-01-03T03:34:40
2019-01-03T03:34:40
139,969,037
0
0
null
null
null
null
UTF-8
Java
false
false
547
java
package com.smallcode.sample.springboot.mybatis.controller; import com.smallcode.sample.DataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * @Auther: lenny * @Date: 2018/12/2 18:02 * @Description: */ @RestController public class AutoController { @Autowired private DataService dataService; @GetMapping("/auto/show") public String show() { dataService.show(); return "show"; } }
e1b823cd5f5002e6bc46e460421a47665189bc63
8529c050b8a81577a30f96d4cad8d37c3da48e75
/src/weixinapp/model/ConvStatus.java
e2edc684ba52208fce75fd0bc413ee328fa95b78
[ "Apache-2.0" ]
permissive
czqmike/WeixinAppServer
03ccef098a30c294bc228e05d728c4f91a2901dd
f6a0dc639fecb106548e202bff8aacf4f133d2e8
refs/heads/master
2020-04-10T08:50:17.566707
2019-03-16T06:20:46
2019-03-16T06:20:46
160,916,785
3
0
null
null
null
null
UTF-8
Java
false
false
789
java
package weixinapp.model; public class ConvStatus { private int user_lower; private int user_upper; private boolean chating; public ConvStatus() { this.user_lower = -1; this.user_lower = -1; this.chating = false; } public ConvStatus(int user_lower, int user_upper, boolean chating) { this.user_lower = user_lower; this.user_upper = user_upper; this.chating = chating; } public int getUser_lower() { return user_lower; } public void setUser_lower(int user_lower) { this.user_lower = user_lower; } public int getUser_upper() { return user_upper; } public void setUser_upper(int user_upper) { this.user_upper = user_upper; } public boolean isChating() { return chating; } public void setChating(boolean chating) { this.chating = chating; } }
2e9d33ebde4d11084ebd4447b4b4114de3c09fe1
51271989ee2b1b6eb0ad30104b2be4480ca21584
/src/main/java/study/querydsl/repository/support/Querydsl4RepositorySupport.java
80b8e61cd88f2f262124a1bab2bb039c41696e78
[]
no_license
almond-bongbong/basic-querydsl
4a3e61e4af699defa74a17c9f34e89feade923ee
cfeb878910fef7f46db5b21f89cb184f1d83834d
refs/heads/master
2020-12-14T17:04:32.058132
2020-02-02T00:56:02
2020-02-02T00:56:02
234,818,168
0
0
null
null
null
null
UTF-8
Java
false
false
3,432
java
package study.querydsl.repository.support; import com.querydsl.core.types.EntityPath; import com.querydsl.core.types.Expression; import com.querydsl.core.types.dsl.PathBuilder; import com.querydsl.jpa.impl.JPAQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.support.JpaEntityInformation; import org.springframework.data.jpa.repository.support.JpaEntityInformationSupport; import org.springframework.data.jpa.repository.support.Querydsl; import org.springframework.data.querydsl.SimpleEntityPathResolver; import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; import org.springframework.util.Assert; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import java.util.List; import java.util.function.Function; @Repository public class Querydsl4RepositorySupport { private final Class domainClass; private Querydsl querydsl; private EntityManager entityManager; private JPAQueryFactory queryFactory; public Querydsl4RepositorySupport(Class<?> domainClass) { Assert.notNull(domainClass, "Domain class must not be null!"); this.domainClass = domainClass; } @Autowired public void setEntityManager(EntityManager entityManager) { Assert.notNull(entityManager, "EntityManager must not be null!"); JpaEntityInformation entityInformation = JpaEntityInformationSupport.getEntityInformation(domainClass, entityManager); SimpleEntityPathResolver resolver = SimpleEntityPathResolver.INSTANCE; EntityPath path = resolver.createPath(entityInformation.getJavaType()); this.entityManager = entityManager; this.querydsl = new Querydsl(entityManager, new PathBuilder<>(path.getType(), path.getMetadata())); this.queryFactory = new JPAQueryFactory(entityManager); } @PostConstruct public void validate() { Assert.notNull(entityManager, "EntityManager must not be null!"); Assert.notNull(querydsl, "Querydsl must not be null!"); Assert.notNull(queryFactory, "QueryFactory must not be null!"); } protected JPAQueryFactory getQueryFactory() { return queryFactory; } protected Querydsl getQuerydsl() { return querydsl; } protected EntityManager getEntityManager() { return entityManager; } protected <T> JPAQuery<T> select(Expression<T> expr) { return getQueryFactory().select(expr); } protected <T> JPAQuery<T> selectFrom(EntityPath<T> from) { return getQueryFactory().selectFrom(from); } protected <T> Page<T> applyPagination(Pageable pageable, Function<JPAQueryFactory, JPAQuery> contentQuery) { JPAQuery jpaQuery = contentQuery.apply(getQueryFactory()); List<T> content = getQuerydsl().applyPagination(pageable, jpaQuery).fetch(); return PageableExecutionUtils.getPage(content, pageable, jpaQuery::fetchCount); } protected <T> Page<T> applyPagination(Pageable pageable, Function<JPAQueryFactory, JPAQuery> contentQuery, Function<JPAQueryFactory, JPAQuery> countQuery) { JPAQuery jpaContentQuery = contentQuery.apply(getQueryFactory()); List<T> content = getQuerydsl().applyPagination(pageable, jpaContentQuery).fetch(); JPAQuery countResult = countQuery.apply(getQueryFactory()); return PageableExecutionUtils.getPage(content, pageable, countResult::fetchCount); } }
217c312126bb3086ac8dadf132d8e6dc8f53fce8
076464f9b017a94fb2dce9a6e6ca09bb14614204
/app/src/main/java/com/example/vivek/gprstracking/MapsActivity.java
eb6f21e022735d3a652ee555c3a3b52c56f39757
[]
no_license
vivekdevil143/GprsTracking
3cfd21ba56bad960287638545946cce01431a5a3
c3b24cb783920ae66bcb76347fdfc53ff1325514
refs/heads/master
2020-06-06T00:34:45.034295
2019-06-18T17:58:52
2019-06-18T17:58:52
192,588,863
0
0
null
null
null
null
UTF-8
Java
false
false
9,636
java
package com.example.vivek.gprstracking; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import android.support.v4.content.ContextCompat; import android.widget.Toast; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import static com.google.android.gms.common.ConnectionResult.SUCCESS; public class MapsActivity extends FragmentActivity implements OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener { private GoogleMap mMap; SupportMapFragment mapFrag; LocationRequest mLocationRequest; GoogleApiClient mGoogleApiClient; Location mLastLocation; Marker mCurrLocationMarker; LocationManager locationManager; Location location; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_maps); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); locationManager= (LocationManager) getSystemService(LOCATION_SERVICE); } /** * Manipulates the map once available. * This callback is triggered when the map is ready to be used. * This is where we can add markers or lines, add listeners or move the camera. In this case, * we just add a marker near Sydney, Australia. * If Google Play services is not installed on the device, the user will be prompted to install * it inside the SupportMapFragment. This method will only be triggered once the user has * installed Google Play services and returned to the app. */ @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap=googleMap; mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { //Location Permission already granted buildGoogleApiClient(); mMap.setMyLocationEnabled(true); } else { //Request Location Permission checkLocationPermission(); } } else { buildGoogleApiClient(); mMap.setMyLocationEnabled(true); } } @Override public void onLocationChanged(Location location) { mLastLocation = location; if (mCurrLocationMarker != null) { mCurrLocationMarker.remove(); } //Place current location marker LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); MarkerOptions markerOptions = new MarkerOptions(); markerOptions.position(latLng); markerOptions.title("Current Position"); markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA)); mCurrLocationMarker = mMap.addMarker(markerOptions); //move map camera mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng,11)); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void onConnectionSuspended(int i) { } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { } @Override protected void onPause() { super.onPause(); if (mGoogleApiClient != null) { LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, (com.google.android.gms.location.LocationListener) this); } } protected synchronized void buildGoogleApiClient() { mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); mGoogleApiClient.connect(); } @Override public void onConnected(Bundle bundle) { mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(1000); mLocationRequest.setFastestInterval(1000); mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY); if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { LocationServices.getFusedLocationProviderClient(this); //LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); } } public static final int MY_PERMISSIONS_REQUEST_LOCATION = 99; private void checkLocationPermission() { if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.ACCESS_FINE_LOCATION)) { // Show an explanation to the user *asynchronously* -- don't block // this thread waiting for the user's response! After the user // sees the explanation, try again to request the permission. new AlertDialog.Builder(this) .setTitle("Location Permission Needed") .setMessage("This app needs the Location permission, please accept to use location functionality") .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { //Prompt the user once explanation has been shown ActivityCompat.requestPermissions(MapsActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQUEST_LOCATION ); } }) .create() .show(); } else { // No explanation needed, we can request the permission. ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, MY_PERMISSIONS_REQUEST_LOCATION ); } } } @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case MY_PERMISSIONS_REQUEST_LOCATION: { // If request is cancelled, the result arrays are empty. if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { // permission was granted, yay! Do the // location-related task you need to do. if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { if (mGoogleApiClient == null) { buildGoogleApiClient(); } mMap.setMyLocationEnabled(true); } } else { // permission denied, boo! Disable the // functionality that depends on this permission. Toast.makeText(this, "permission denied", Toast.LENGTH_LONG).show(); } return; } // other 'case' lines to check for other // permissions this app might request } } }
c404de60d24eabfb5c88d24b9538f2fa62ea0ad5
d4692be261739742257f24bd4df17defd70ce4de
/src/servlet/storeServlet/LoginOutServlet.java
eedbe34554e14faf995f76ed4e1fcf38dc66fece
[]
no_license
dd1227514920/SCM
053253e29a95b2b8587df10a8724f02188f694d0
bde80081d1927828cd0d329d7e70c40f3cb11ed1
refs/heads/master
2020-03-16T14:55:08.175562
2017-09-10T09:10:34
2017-09-10T09:10:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
838
java
package servlet.storeServlet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by leo on 2017/7/20. */ @WebServlet(name = "LoginOutServlet",urlPatterns = {"/LoginOutServlet"}) public class LoginOutServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().removeAttribute("username"); response.sendRedirect("../index.jsp"); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request,response); } }
f3aee3cc43e70ed2bda345684f969e29e39074d1
09d0ddd512472a10bab82c912b66cbb13113fcbf
/TestApplications/privacy-friendly-netmonitor-2.0/DecompiledCode/Fernflower/src/main/java/org/greenrobot/greendao/internal/DaoConfig.java
d7fce7d12c6570f1f6aea52d1bb56167721625f1
[]
no_license
sgros/activity_flow_plugin
bde2de3745d95e8097c053795c9e990c829a88f4
9e59f8b3adacf078946990db9c58f4965a5ccb48
refs/heads/master
2020-06-19T02:39:13.865609
2019-07-08T20:17:28
2019-07-08T20:17:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,245
java
package org.greenrobot.greendao.internal; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Iterator; import org.greenrobot.greendao.DaoException; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.identityscope.IdentityScope; import org.greenrobot.greendao.identityscope.IdentityScopeLong; import org.greenrobot.greendao.identityscope.IdentityScopeObject; import org.greenrobot.greendao.identityscope.IdentityScopeType; public final class DaoConfig implements Cloneable { public final String[] allColumns; public final Database db; private IdentityScope identityScope; public final boolean keyIsNumeric; public final String[] nonPkColumns; public final String[] pkColumns; public final Property pkProperty; public final Property[] properties; public final TableStatements statements; public final String tablename; public DaoConfig(Database var1, Class var2) { this.db = var1; Exception var10000; label159: { Field var3; boolean var10001; try { var3 = var2.getField("TABLENAME"); } catch (Exception var28) { var10000 = var28; var10001 = false; break label159; } Property var4 = null; Property[] var5; ArrayList var6; ArrayList var7; try { this.tablename = (String)var3.get((Object)null); var5 = reflectProperties(var2); this.properties = var5; this.allColumns = new String[var5.length]; var6 = new ArrayList(); var7 = new ArrayList(); } catch (Exception var27) { var10000 = var27; var10001 = false; break label159; } Property var31 = null; int var8 = 0; while(true) { try { if (var8 >= var5.length) { break; } } catch (Exception var25) { var10000 = var25; var10001 = false; break label159; } Property var33 = var5[var8]; label143: { String var9; label142: { try { var9 = var33.columnName; this.allColumns[var8] = var9; if (!var33.primaryKey) { break label142; } var6.add(var9); } catch (Exception var26) { var10000 = var26; var10001 = false; break label159; } var31 = var33; break label143; } try { var7.add(var9); } catch (Exception var24) { var10000 = var24; var10001 = false; break label159; } } ++var8; } try { this.nonPkColumns = (String[])var7.toArray(new String[var7.size()]); this.pkColumns = (String[])var6.toArray(new String[var6.size()]); var8 = this.pkColumns.length; } catch (Exception var23) { var10000 = var23; var10001 = false; break label159; } boolean var10 = true; if (var8 == 1) { var4 = var31; } label125: { label161: { Class var29; try { this.pkProperty = var4; TableStatements var32 = new TableStatements(var1, this.tablename, this.allColumns, this.pkColumns); this.statements = var32; if (this.pkProperty == null) { break label161; } var29 = this.pkProperty.type; } catch (Exception var22) { var10000 = var22; var10001 = false; break label159; } boolean var11 = var10; label162: { try { if (var29.equals(Long.TYPE)) { break label162; } } catch (Exception var20) { var10000 = var20; var10001 = false; break label159; } var11 = var10; try { if (var29.equals(Long.class)) { break label162; } } catch (Exception var19) { var10000 = var19; var10001 = false; break label159; } var11 = var10; try { if (var29.equals(Integer.TYPE)) { break label162; } } catch (Exception var18) { var10000 = var18; var10001 = false; break label159; } var11 = var10; try { if (var29.equals(Integer.class)) { break label162; } } catch (Exception var17) { var10000 = var17; var10001 = false; break label159; } var11 = var10; try { if (var29.equals(Short.TYPE)) { break label162; } } catch (Exception var16) { var10000 = var16; var10001 = false; break label159; } var11 = var10; try { if (var29.equals(Short.class)) { break label162; } } catch (Exception var15) { var10000 = var15; var10001 = false; break label159; } var11 = var10; label114: { try { if (var29.equals(Byte.TYPE)) { break label162; } if (var29.equals(Byte.class)) { break label114; } } catch (Exception var21) { var10000 = var21; var10001 = false; break label159; } var11 = false; break label162; } var11 = var10; } try { this.keyIsNumeric = var11; break label125; } catch (Exception var14) { var10000 = var14; var10001 = false; break label159; } } try { this.keyIsNumeric = false; } catch (Exception var13) { var10000 = var13; var10001 = false; break label159; } } try { return; } catch (Exception var12) { var10000 = var12; var10001 = false; } } Exception var30 = var10000; throw new DaoException("Could not init DAOConfig", var30); } public DaoConfig(DaoConfig var1) { this.db = var1.db; this.tablename = var1.tablename; this.properties = var1.properties; this.allColumns = var1.allColumns; this.pkColumns = var1.pkColumns; this.nonPkColumns = var1.nonPkColumns; this.pkProperty = var1.pkProperty; this.statements = var1.statements; this.keyIsNumeric = var1.keyIsNumeric; } private static Property[] reflectProperties(Class var0) throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException { StringBuilder var1 = new StringBuilder(); var1.append(var0.getName()); var1.append("$Properties"); Field[] var7 = Class.forName(var1.toString()).getDeclaredFields(); ArrayList var5 = new ArrayList(); int var2 = 0; for(int var3 = var7.length; var2 < var3; ++var2) { Field var4 = var7[var2]; if ((var4.getModifiers() & 9) == 9) { Object var9 = var4.get((Object)null); if (var9 instanceof Property) { var5.add((Property)var9); } } } Property[] var8 = new Property[var5.size()]; Property var10; for(Iterator var6 = var5.iterator(); var6.hasNext(); var8[var10.ordinal] = var10) { var10 = (Property)var6.next(); if (var8[var10.ordinal] != null) { throw new DaoException("Duplicate property ordinals"); } } return var8; } public void clearIdentityScope() { IdentityScope var1 = this.identityScope; if (var1 != null) { var1.clear(); } } public DaoConfig clone() { return new DaoConfig(this); } public IdentityScope getIdentityScope() { return this.identityScope; } public void initIdentityScope(IdentityScopeType var1) { if (var1 == IdentityScopeType.None) { this.identityScope = null; } else { if (var1 != IdentityScopeType.Session) { StringBuilder var2 = new StringBuilder(); var2.append("Unsupported type: "); var2.append(var1); throw new IllegalArgumentException(var2.toString()); } if (this.keyIsNumeric) { this.identityScope = new IdentityScopeLong(); } else { this.identityScope = new IdentityScopeObject(); } } } public void setIdentityScope(IdentityScope var1) { this.identityScope = var1; } }
10152b1f88761bc09495f6ad1368f0a3fb00b159
2fa924f8cb5c2159002101a8b58d3ac17277b517
/MyMoney/src/se/jagvetintedu/mymoney/client/GreetingServiceAsync.java
8934ad018bea2038359f74530a9284fd30c1e9b8
[]
no_license
pekelund/mymoney
d0073630361cd5daf7ba7efc33a35edc9c080ba0
70d57e751262940b3716087a854360f9d380545b
refs/heads/master
2020-04-30T06:26:15.271756
2012-08-17T19:03:10
2012-08-17T19:03:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package se.jagvetintedu.mymoney.client; import com.google.gwt.user.client.rpc.AsyncCallback; /** * The async counterpart of <code>GreetingService</code>. */ public interface GreetingServiceAsync { void greetServer(String input, AsyncCallback<String> callback) throws IllegalArgumentException; }
84984053b0a04c95ea408195071317164b9ad6c9
bb1603e54442728d527ee1ba6e17f9f20bca2c90
/src/main/java/com/petclinic/model/Animal.java
1e50d9dafbb6654349b4d45190a386a7883f28fc
[]
no_license
shalauniou/pet-clinic
d25860d827068e72d640805a90813901942e549a
950a96710eb17a3c94d981a102098c40bf072859
refs/heads/master
2021-01-19T21:05:15.289887
2017-04-19T07:11:55
2017-04-19T07:11:55
88,600,819
0
0
null
null
null
null
UTF-8
Java
false
false
1,059
java
package com.petclinic.model; import groovy.transform.EqualsAndHashCode; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.io.Serializable; import java.util.UUID; /** * Animal entity. * <p/> * Date: 4/12/2017 * * @author Stanislau Halauniou */ @Entity @Table(name="animal") @EqualsAndHashCode public class Animal implements Serializable { @Id private String id; private String name; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return new ToStringBuilder(this) .append("id", id) .append("name", name) .toString(); } }
d847ec29c2a1a8908b912632786e14bd97da2df9
478415330f20554d99802dcaab59dd502f5d8576
/src/test/java/com/stackroute/movieservice/service/MovieServiceTest.java
49e099058f3539ba536c6dc426681ceb529bdfc8
[]
no_license
amul1210/Movie-Service
606e41131a15e8c6fa94aab4fd4256e1908cffbf
92e8f5b97cf75b7da3f3ba2d5417ea7dba9f2c3c
refs/heads/master
2020-04-02T16:19:58.674422
2018-10-25T04:01:17
2018-10-25T04:01:17
154,607,852
0
0
null
null
null
null
UTF-8
Java
false
false
4,410
java
package com.stackroute.movieservice.service; import com.stackroute.movieservice.domain.Movies; import com.stackroute.movieservice.exceptions.EmptyDBException; import com.stackroute.movieservice.exceptions.MovieAlreadyExistsException; import com.stackroute.movieservice.exceptions.MovieNotFoundException; import com.stackroute.movieservice.repository.MovieRepository; import com.stackroute.movieservice.services.MovieServicesImpl; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import java.util.ArrayList; import java.util.List; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; public class MovieServiceTest { Movies movies; //Create a mock for MoviesRepository @Mock//test double MovieRepository movieRepository; //Inject the mocks as dependencies into MoviesServiceImpl @InjectMocks MovieServicesImpl movieServices; List<Movies> list= null; @Before public void setUp(){ //Initialising the mock object MockitoAnnotations.initMocks(this); movies = new Movies(); movies.setComments("Very Good"); movies.setImdbId("31"); movies.setYearOfRelease("2014"); movies.setMovieTitle("Venom"); movies.setRating(4.4); movies.setPosterURL("#######"); list = new ArrayList<>(); list.add(movies); } @Test public void saveMoviesTestSuccess() throws MovieAlreadyExistsException { when(movieRepository.save((Movies)any())).thenReturn(movies); Movies savedMovie = movieServices.saveMovie(movies); Assert.assertEquals(movies,savedMovie); //verify here verifies that movieRepository save method is only called once verify(movieRepository,times(1)).save(movies); } @Test(expected = MovieAlreadyExistsException.class) public void saveMoviesTestFailure() throws MovieAlreadyExistsException { when(movieRepository.save((Movies) any())).thenReturn(null); Movies savedMovie = movieServices.saveMovie(movies); System.out.println("savedMovies" + savedMovie); Assert.assertEquals(movies,savedMovie); //add verify doThrow(new MovieAlreadyExistsException()).when(movieRepository).findById(eq("31")); movieServices.saveMovie(movies); } @Test public void getAllMovies() throws EmptyDBException { movieRepository.save(movies); //stubbing the mock to return specific data when(movieRepository.findAll()).thenReturn(list); List<Movies> moviesList = movieServices.getAllMovies(); Assert.assertEquals(list,moviesList); //add verify } @Test(expected = MovieNotFoundException.class) public void testDeleteMovie() throws MovieNotFoundException { when(movieRepository.findById((String)any())).thenReturn(java.util.Optional.of((Movies) movies)); Movies deletedMovie = movieServices.deleteMovie(movies); Assert.assertEquals(movies,deletedMovie); } @Test public void testUpdateMovie() throws MovieNotFoundException { when(movieRepository.save(movies)).thenReturn(movies); when(movieRepository.existsById(movies.getImdbId())).thenReturn(true); when(movieRepository.findByimdbId(movies.getImdbId())).thenReturn(movies); Movies updatedMovie = movieServices.updateMovie(movies,movies.getImdbId()); updatedMovie.setComments("Is Funny"); Assert.assertEquals("Is Funny",updatedMovie.getComments()); } @Test(expected = MovieNotFoundException.class) public void testGetMovieByID() throws MovieNotFoundException { when(movieRepository.save(movies)).thenReturn(movies); when(movieRepository.existsById(movies.getImdbId())).thenReturn(true); when(movieRepository.findByimdbId(movies.getImdbId())).thenReturn(movies); Movies movieByID = movieServices.getByIMDBId("31"); Assert.assertEquals(movies.getImdbId(),movieByID.getImdbId()); } @Test public void testGetMovieByTitle() throws MovieNotFoundException { when(movieRepository.findByMovieTitle(any())).thenReturn(list); List<Movies> movieList = movieServices.getMovieByTitle(movies.getMovieTitle()); Assert.assertEquals(1,movieList.size()); } }
e41ff6b6d43854d7645d36cacf74010334cccb4e
13829f6236e258aac7138c8978431275054175d2
/src/main/java/com/duuuhs/miaosha_system/controller/OrderController.java
b7e320cf8cbc5a2bf2c4cc7d98c4efae653f8cb1
[]
no_license
Duuuhs/miaosha_system
fc943f18cd9902fc44513135321d3fa711955873
0242c10e654609d575847944057b84b0d5ccaea1
refs/heads/master
2022-06-24T11:35:35.026083
2019-05-25T15:29:17
2019-05-25T15:29:17
188,586,832
2
0
null
2022-06-21T01:10:20
2019-05-25T16:08:51
Java
UTF-8
Java
false
false
2,586
java
package com.duuuhs.miaosha_system.controller; import com.duuuhs.miaosha_system.model.OrderInfo; import com.duuuhs.miaosha_system.model.User; import com.duuuhs.miaosha_system.redis.RedisService; import com.duuuhs.miaosha_system.redis.UserKey; import com.duuuhs.miaosha_system.result.CodeMsg; import com.duuuhs.miaosha_system.service.GoodsService; import com.duuuhs.miaosha_system.service.OrderService; import com.duuuhs.miaosha_system.service.UserService; import com.duuuhs.miaosha_system.vo.GoodsVo; import com.duuuhs.miaosha_system.vo.OrderDetailVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.duuuhs.miaosha_system.result.Reslut; import javax.servlet.http.HttpServletResponse; import static com.duuuhs.miaosha_system.util.Assert.isNull; @Controller @RequestMapping("/order") public class OrderController { @Autowired UserService userService; @Autowired RedisService redisService; @Autowired OrderService orderService; @Autowired GoodsService goodsService; /* * 获取订单信息 * @parm: response * @parm: cookieToken * @parm: paramToken * @parm: orderId * @return: Reslut<OrderDetailVo> */ @RequestMapping("/detail") @ResponseBody public Reslut<OrderDetailVo> info(HttpServletResponse response, @CookieValue(value = UserKey.COOKIE_NAME_TOKEN, required = false) String cookieToken, @RequestParam(value = UserKey.COOKIE_NAME_TOKEN, required = false) String paramToken, @RequestParam("orderId") long orderId) { if (isNull(paramToken) && isNull(cookieToken)){ return Reslut.error(CodeMsg.SESSION_ERROR); } //根据token获取用户信息 String token = isNull(paramToken) ? cookieToken : paramToken; User user = userService.getByToken(response, token); if(user == null) { return Reslut.error(CodeMsg.SESSION_ERROR); } OrderInfo order = orderService.getOrderById(orderId); if(order == null) { return Reslut.error(CodeMsg.ORDER_NOT_EXIST); } long goodsId = order.getGoodsId(); GoodsVo goods = goodsService.getMiaoShaById(goodsId); OrderDetailVo vo = new OrderDetailVo(); vo.setOrder(order); vo.setGoods(goods); return Reslut.success(CodeMsg.SUCCESS, vo); } }
3491b7065c23422fb79c87bb47643cc1e5cfa5c4
24445cc96c831f643825749736bd5579fcad6cc8
/src/main/java/com/aruerue/shop/config/DataAccessConfig.java
920ed3bdcc2ea01819d19639e92d8cb36c488f6e
[]
no_license
tjdtnsla0911/git-samang
7ed2bfef2f7f2117b4292c80f10380a728ffe212
cd35537c49c7fe042c2e70f030e666e820c29707
refs/heads/master
2022-12-10T18:46:00.505942
2020-09-03T11:44:26
2020-09-03T11:44:26
292,553,197
0
0
null
null
null
null
UTF-8
Java
false
false
1,201
java
package com.aruerue.shop.config; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; @Configuration @MapperScan(basePackages = "com.aruerue.shop.repository") public class DataAccessConfig { @Bean public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception{ System.out.println("DataAccessConfig : 여기왔니"); SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); sessionFactory.setMapperLocations( new PathMatchingResourcePatternResolver().getResources("classpath:mapper/**/**/*.xml")); return sessionFactory.getObject(); } @Bean public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) { System.out.println("DataAccessConfig : 여긴왔니?"); return new SqlSessionTemplate(sqlSessionFactory); } }
7f6923fec3262f73a1287edb8ecd34c0c10f4bfd
db08b66b0e39e25a59dd830deceda8cf1296bbdb
/jtester.testng/src/test/java/org/jtester/tools/reflector/ReflectorTest_NewInstance.java
18ca50e877185d13e76c0a310289c275b90bbab0
[]
no_license
pengsong31/jtester
a3c577e26699d44c9a815cafa4f3ad5201358552
51bb78a7212d1cab4ce0a6e4a778476e77b5c28b
refs/heads/master
2020-05-02T19:19:22.618616
2013-08-23T08:24:17
2013-08-23T08:24:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
package org.jtester.tools.reflector; import org.jtester.testng.JTester; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @Test(groups = "jtester") @SuppressWarnings({ "rawtypes", "unchecked" }) public class ReflectorTest_NewInstance extends JTester { @Test(dataProvider = "instance_data") public void testNewInstance(Class claz) { Object instance = reflector.newInstance(claz); want.object(instance).notNull(); String result = ((ISayHello) instance).getName(); want.string(result).isNull(); } @DataProvider public Object[][] instance_data() { return new Object[][] { { NoDefaultConstructor.class },// <br> { ISayHello.class } // <br> }; } @Test public void testPrivateConstruction() { Object instance = reflector.newInstance(PrivateConstructor.class); want.object(instance).notNull(); String result = ((ISayHello) instance).getName(); want.string(result).isEqualTo("construction"); } public void testNewInstance_AbstractClazz() { try { reflector.newInstance(AbstractClazz.class); want.fail(); } catch (Exception e) { String message = e.getMessage(); want.string(message).contains("unsupport").contains("abstract class"); } } } class NoDefaultConstructor implements ISayHello { private String name = "defualt"; public NoDefaultConstructor(String name) { this.name = name; } public String getName() { return name; } } class PrivateConstructor implements ISayHello { private String name = "defualt"; private PrivateConstructor() { this.name = "construction"; } public String getName() { return name; } } abstract class AbstractClazz implements ISayHello { private String name = "defualt"; private AbstractClazz(String name) { this.name = name; } public String getName() { return name; } } interface ISayHello { public String getName(); }
46ba05eb236e99c6d03d379c1a51c63a38cffa3e
1ae4d5338a07f6c847a2543d93dbac9e2b524fa5
/SerializationDemo/src/ReadObjects.java
46e7e40fc6fc5a15ca25a8804d4db27770f1c53c
[]
no_license
harry520/My-Android-Apps
b1dc0c04fbcb5f2c3671eebca1bbf121f047eb6b
ff3342289d3c81c59ba7da56d26322cba20510d8
refs/heads/master
2021-01-19T07:09:40.964190
2018-01-03T08:49:44
2018-01-03T08:49:44
63,644,696
1
0
null
null
null
null
UTF-8
Java
false
false
723
java
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; public class ReadObjects { public static void main(String[] args) { System.out.println("Reading objects..."); try (FileInputStream fi = new FileInputStream("people.bin")) { ObjectInputStream os = new ObjectInputStream(fi); Person person1 = (Person) os.readObject(); Person person2 = (Person) os.readObject(); os.close(); System.out.println(person1); System.out.println(person2); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }
a02fd3aedf67dd99efa1d3caf3feb5be01cd2470
f158efdfeaa757fb56e513e50031c5034c6aa4a7
/java_source_learn/src/com/zhd/source/com/sun/corba/se/spi/activation/POANameHelper.java
bdadc196ef7daf349e82a581d3f052a855c52dce
[]
no_license
zhanghda/data_structure
40c6ff01cf576ec03788f226238b43e372ecdad2
5975e0ec59e409f673278c5ddb62af2d65d42cee
refs/heads/master
2021-01-07T05:50:05.044092
2020-05-17T07:46:25
2020-05-17T07:46:25
241,597,360
1
0
null
null
null
null
UTF-8
Java
false
false
1,860
java
package com.sun.corba.se.spi.activation; /** * com/sun/corba/se/spi/activation/POANameHelper.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u171/10807/corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl * Wednesday, March 28, 2018 4:07:48 PM PDT */ abstract public class POANameHelper { private static String _id = "IDL:activation/POAName:1.0"; public static void insert (org.omg.CORBA.Any a, String[] that) { org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static String[] extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0); __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.spi.activation.POANameHelper.id (), "POAName", __typeCode); } return __typeCode; } public static String id () { return _id; } public static String[] read (org.omg.CORBA.portable.InputStream istream) { String value[] = null; int _len0 = istream.read_long (); value = new String[_len0]; for (int _o1 = 0;_o1 < value.length; ++_o1) value[_o1] = istream.read_string (); return value; } public static void write (org.omg.CORBA.portable.OutputStream ostream, String[] value) { ostream.write_long (value.length); for (int _i0 = 0;_i0 < value.length; ++_i0) ostream.write_string (value[_i0]); } }
eb39dc0a3736db0237d1ef031ed86494109b47d3
93ec1a2137c0b3f1d378cdafa3b11c2a1be7de20
/app/src/main/java/com/wang/wheelview/widget/wheel/WheelAdapter.java
cc42ced29e5e69b17ca096b593a5a5dc4249024c
[]
no_license
twfx5/WheelView
452fbb778b0c60f697441bb97d970b26c462e886
affb86cf21ea8559c9d1dfde8f5355b7b0b58538
refs/heads/master
2023-03-05T03:32:28.560979
2021-02-16T13:18:43
2021-02-16T13:18:43
339,404,129
0
0
null
null
null
null
UTF-8
Java
false
false
1,237
java
/* * Copyright 2010 Yuri Kanivets * * 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.wang.wheelview.widget.wheel; /** * Wheel adapter interface * * @deprecated Use WheelViewAdapter */ public interface WheelAdapter { /** * Gets items count * @return the count of wheel items */ public int getItemsCount(); /** * Gets a wheel item by index. * * @param index the item index * @return the wheel item text or null */ public String getItem(int index); /** * Gets maximum item length. It is used to determine the wheel width. * If -1 is returned there will be used the default wheel width. * * @return the maximum item length or -1 */ public int getMaximumLength(); }
58f063013c49b2ccba88803a866c400de4c2eabd
72f6e8812bbb3d721ade555b13219304a0333fa3
/xcapture/src/main/java/com/famsa/xmlmarshall/Tabla.java
54b1d6debef4cae4a7f7c69932fc0328140a2d86
[]
no_license
fernandoaguilarfloresfamsa/eclipse
d28e3a7f05ac6cb53473237785c63548d35f75e5
18194dab2522d1ec7d9d1b7405e039bd48620abb
refs/heads/master
2020-04-22T12:29:03.323093
2019-03-20T00:54:03
2019-03-20T00:54:03
170,373,066
0
0
null
null
null
null
UTF-8
Java
false
false
1,472
java
package com.famsa.xmlmarshall; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @XmlRootElement(name="tabla") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "tabla", propOrder = { "nombreTabla", "tipo", "folderOut" }) public class Tabla { @XmlElement(required = true) private String nombreTabla; @XmlElement(required = true) private String tipo; @XmlElement(name = "folderOut") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String folderOut; public String getNombreTabla() { return nombreTabla; } public void setNombreTabla(String nombreTabla) { this.nombreTabla = nombreTabla; } public String getTipo() { return tipo; } public void setTipo(String tipo) { this.tipo = tipo; } public String getFolderOut() { return folderOut; } public void setFolderOut(String folderOut) { this.folderOut = folderOut; } @Override public String toString() { return "Tabla [nombreTabla=" + nombreTabla + ", tipo=" + tipo + ", folderOut=" + folderOut + "]"; } }
[ "RDEFAGUILA@RDEFAGUILA" ]
RDEFAGUILA@RDEFAGUILA
3b18427ddba9a63c8c7327162e404fc8f5a8e28f
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_278/Productionnull_27750.java
1676e103f91d17b9743203859feaebffc1eb1363
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_278; public class Productionnull_27750 { private final String property; public Productionnull_27750(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
22b02b5e909f7c28739d1fcd6cf19b1dcf109068
07074962be026c67519a0ccfb3d48bd95ede38ed
/Delivery/app/src/main/java/com/e/delivery/Activities/MainActivity.java
95764481dcecd85713f2df7d43db72aef7f15672
[]
no_license
End1-1/Cafe5
2fa65c62f395c186e2204f3fb941a2f93fd3a653
ba2b695c627cf59260a3ac1134927198c004fe53
refs/heads/master
2023-08-17T02:39:29.224396
2023-08-14T06:37:55
2023-08-14T06:37:55
151,380,276
2
1
null
null
null
null
UTF-8
Java
false
false
9,315
java
package com.e.delivery.Activities; import android.Manifest; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.view.View; import android.view.inputmethod.InputMethodManager; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.core.app.ActivityCompat; import com.e.delivery.Data.DataMessage; import com.e.delivery.Data.GoodsProvider; import com.e.delivery.Data.PartnerProvider; import com.e.delivery.R; import com.e.delivery.Services.LocalMessanger; import com.e.delivery.Services.TempService; import com.e.delivery.Utils.Config; import com.e.delivery.Utils.DataSenderCommands; import com.e.delivery.Utils.EnumView; import com.e.delivery.Utils.Json; import com.e.delivery.Utils.ViewAnimator; public class MainActivity extends ParentActivity { final int REQUEST_ACCESS_FINE_LOCATION = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EnumView.setButtonsClickListener(findViewById(R.id.idParent), this); Intent intent = new Intent(this, TempService.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { startForegroundService(intent); } else { startService(intent); } ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION }, REQUEST_ACCESS_FINE_LOCATION); if (!Config.getString("session_id").isEmpty()) { PartnerProvider.initPartners(); GoodsProvider.init(); ViewAnimator.animateHeight(findViewById(R.id.clConfig), -1, 0, hideLogin); } } @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case REQUEST_ACCESS_FINE_LOCATION: if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { } else { AlertDialog.Builder ab = new AlertDialog.Builder(this); ab.setMessage(R.string.YouMustAllowToAccessLocationService); ab.setCancelable(false); ab.setNegativeButton(R.string.Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }); AlertDialog dlg = ab.create(); dlg.show(); } break; } } @Override protected void messageHandler(DataMessage m) { super.messageHandler(m); switch (m.mCommand) { case DataSenderCommands.lServiceStarted: if (findViewById(R.id.clConfig).getVisibility() == View.VISIBLE) { if (Config.getString("username").length() > 0) { setEditText(R.id.edUsername, Config.getString("username")); setEditText(R.id.edPassword, Config.getString("password")); findViewById(R.id.progressBar).setVisibility(View.VISIBLE); findViewById(R.id.tvLoginStatus).setVisibility(View.VISIBLE); findViewById(R.id.btnEnter).setEnabled(false); setTextViewText(R.id.tvLoginStatus, getString(R.string.LoginStatus)); Json j = new Json(); j.putString("username", editText(R.id.edUsername)); j.putString("password", editText(R.id.edPassword)); j.putString("session", Config.getString("session_id")); j.putInt("listofgoods", 1); m = new DataMessage(DataSenderCommands.qLogin, j.toString(), "A", "S"); LocalMessanger.sendMessage(m); } } break; case DataSenderCommands.qLogin: Json data = new Json(m.mBuffer); if (m.mResponse == DataSenderCommands.rOk) { Config.setString("username", editText(R.id.edUsername)); Config.setString("password", editText(R.id.edPassword)); Config.setString("session_id", data.getString("session")); Config.setString("fullname", data.getString("lastname") + " " + data.getString("firstname")); setTextViewText(R.id.tvFullname, Config.getString("fullname")); setTextViewText(R.id.tvLoginStatus, getString(R.string.LoginStatusGoodsGroups)); Json gg = data.getJsonObject("listofgoodsgroups"); Json goodsGroups = gg.getJsonArray("groups"); GoodsProvider.initGoodsGroups(goodsGroups.getArray("groups")); setTextViewText(R.id.tvLoginStatus, getString(R.string.LoginStatusGoods)); Json goods = gg.getJsonArray("goods"); GoodsProvider.initGoods(goods.getArray("goods")); Json partners = gg.getJsonArray("partners"); PartnerProvider.initPartners(partners.getArray("partners")); ViewAnimator.animateHeight(findViewById(R.id.clConfig), -1, 0, hideLogin); } else { Config.setString("session_id", ""); findViewById(R.id.progressBar).setVisibility(View.GONE); findViewById(R.id.btnEnter).setEnabled(true); String msg = String.format("%s\n%s", getString(R.string.LoginStatusFailed), data.getString("msg")); setTextViewText(R.id.tvLoginStatus, msg); } break; } } @Override public void onClick(View view) { Intent i; Json j; DataMessage m; super.onClick(view); switch (view.getId()) { case R.id.btnEnter: findViewById(R.id.progressBar).setVisibility(View.VISIBLE); findViewById(R.id.tvLoginStatus).setVisibility(View.VISIBLE); findViewById(R.id.btnEnter).setEnabled(false); setTextViewText(R.id.tvLoginStatus, getString(R.string.LoginStatus)); j = new Json(); j.putString("username", editText(R.id.edUsername)); j.putString("password", editText(R.id.edPassword)); j.putString("session", Config.getString("session_id")); j.putInt("listofgoods", 1); m = new DataMessage(DataSenderCommands.qLogin, j.toString(), "A", "S"); LocalMessanger.sendMessage(m); break; case R.id.btnSettings: i = new Intent(this, ConfigActivity.class); startActivity(i); break; case R.id.btnOrder: i = new Intent(this, OrderActivity.class); startActivity(i); break; case R.id.btnSales: i = new Intent(this, SalesTodayActivity.class); startActivity(i); break; case R.id.btnLogout: ViewAnimator.animateHeight(findViewById(R.id.llWorking), -1, 0, showLogin); j = new Json(); j.putInt("logout", 1); j.putString("session", Config.getString("session_id")); m = new DataMessage(DataSenderCommands.qLogin, j.toString(), "A", "S"); LocalMessanger.sendMessage(m); break; } } ViewAnimator.ViewAnimatorEnd hideLogin = new ViewAnimator.ViewAnimatorEnd() { @Override public void end() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); ViewAnimator.animateHeight(findViewById(R.id.llWorking), 0, findViewById(R.id.idParent).getMeasuredHeight(), null); } }; ViewAnimator.ViewAnimatorEnd showLogin = new ViewAnimator.ViewAnimatorEnd() { @Override public void end() { Config.setString("username", ""); Config.setString("password", ""); Config.setString("session_id", ""); setEditText(R.id.edUsername, Config.getString("username")); setEditText(R.id.edPassword, Config.getString("password")); findViewById(R.id.progressBar).setVisibility(View.GONE); findViewById(R.id.tvLoginStatus).setVisibility(View.GONE); findViewById(R.id.btnEnter).setEnabled(true); findViewById(R.id.edUsername).requestFocus(); ViewAnimator.animateHeight(findViewById(R.id.clConfig), 0, findViewById(R.id.idParent).getMeasuredHeight(), null); } }; }
99a876b4f0d39707861c2861f117cbe76ad83999
404b7a75ed8feee3ce2fcbded735ffba4fea9fc6
/app/src/main/java/com/example/rolling/items/LevelSettings.java
5c44691d547bc840f87045c2dbc6f98885057323
[]
no_license
adiAmana/Rolling-android-app
42afee47cb169c8214ad0e3b2c832ed6f9542952
2c78937e68fc02316c536cda8ffb4fc8667e7348
refs/heads/master
2022-12-28T02:55:01.272424
2020-10-01T17:57:53
2020-10-01T18:15:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,025
java
package com.example.rolling.items; import android.os.Parcel; import android.os.Parcelable; public class LevelSettings implements Parcelable { private int gameTime; // seconds private int startSpeed; private int maxSpeed; private int resIdFirstBackground; private int resIdSecondBackground; private int[] resIdObstacles; private int[] widthToDivideArray; private int[] heightToDivideArray; public LevelSettings(int gameTime, int startSpeed, int maxSpeed, int resIdFirstBackground, int resIdSecondBackground, int[] resIdObstacles, int[] widthToDivideArray, int[] heightToDivideArray) { this.gameTime = gameTime; this.startSpeed = startSpeed; this.maxSpeed = maxSpeed; this.resIdFirstBackground = resIdFirstBackground; this.resIdSecondBackground = resIdSecondBackground; this.resIdObstacles = resIdObstacles; this.widthToDivideArray = widthToDivideArray; this.heightToDivideArray = heightToDivideArray; } private LevelSettings(Parcel in) { gameTime = in.readInt(); startSpeed = in.readInt(); maxSpeed = in.readInt(); resIdFirstBackground = in.readInt(); resIdSecondBackground = in.readInt(); resIdObstacles = in.createIntArray(); widthToDivideArray = in.createIntArray(); heightToDivideArray = in.createIntArray(); } public static final Creator<LevelSettings> CREATOR = new Creator<LevelSettings>() { @Override public LevelSettings createFromParcel(Parcel in) { return new LevelSettings(in); } @Override public LevelSettings[] newArray(int size) { return new LevelSettings[size]; } }; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(gameTime); dest.writeInt(startSpeed); dest.writeInt(maxSpeed); dest.writeInt(resIdFirstBackground); dest.writeInt(resIdSecondBackground); dest.writeIntArray(resIdObstacles); dest.writeIntArray(widthToDivideArray); dest.writeIntArray(heightToDivideArray); } public int getGameTime() { return gameTime; } public int getStartSpeed() { return startSpeed; } public int getMaxSpeed() { return maxSpeed; } public int getResIdFirstBackground() { return resIdFirstBackground; } public int getResIdSecondBackground() { return resIdSecondBackground; } public int[] getResIdObstacles() { return resIdObstacles; } public int[] getWidthToDivideArray() { return widthToDivideArray; } public int[] getHeightToDivideArray() { return heightToDivideArray; } }
7e347b849c7abb2e6ab783675b6b8bdc3f45f36e
f4a9fc60a414dedc59d4a51ecfcd04605232b265
/Alg/Alg/src/com/gfg/io/FreeDiskSpace.java
8238df97b45bc7cbb886cf6e4158788f47b7a535
[]
no_license
NareshNalla/AlgorithmsPractise
3ca6e0a73b9d94481c98c7c117339ac8378bf622
830e07e7acef8f28bacf2910cd53a48a645bcdea
refs/heads/master
2023-04-30T12:38:28.238791
2021-05-21T19:27:58
2021-05-21T19:27:58
119,640,449
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.gfg.io; import java.io.File; /*Find free disk space using Java */ public class FreeDiskSpace { public static void main(String[] args) { File file = new File("C:\\"); double size = file.getFreeSpace() / (1024.0 * 1024 * 1024); System.out.printf( "%.3f GB\n", size); double size1 = new File("C:\\").getFreeSpace() / (1024.0 * 1024 * 1024); System.out.printf( "%.3f GB\n", size1); double size2 = new File("C:\\").getUsableSpace() / (1024.0 * 1024 * 1024); System.out.printf( "%.3f GB\n", size2); double size3 = new File("C:\\").getTotalSpace() / (1024.0 * 1024 * 1024); System.out.printf( "%.3f GB\n", size3); } }
d9041fa24344c7353f65deb444e450de78169d25
50b5ddfa7a31b14307e2acc17744eda74e620bcc
/bportal-parser/src/main/java/dk/bringlarsen/dbtu/rating/common/exception/DBTURatinglisterPageParseException.java
6761a451d38805a8b4bdc2f775be5549c3669618
[]
no_license
jessbringlarsen/bportal
934f1c31c1fb5f260f38ef064c7bc22e5e17856d
027863121593e36d44e17010e0976514750dbe38
refs/heads/master
2020-06-10T09:41:31.380615
2016-12-08T20:56:33
2016-12-08T20:56:33
75,973,470
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
package dk.bringlarsen.dbtu.rating.common.exception; public class DBTURatinglisterPageParseException extends RuntimeException { public DBTURatinglisterPageParseException(String message) { super(message); } }
a260df3a233c1df0e199d3f5c2e2a07bc34d5492
518d6b8dd258dfd0acd6286478f6341c876ea14d
/model/src/main/java/com/basaki/example/menagerie/model/animal/Elephant.java
240a6d374383111334909bcdabd649e185a448b7
[]
no_license
junlapong/swagger-deepdive
326e3d64ea2216b503232277e20b3e96d0229c62
fa6d13d3275a38bfa4ede10357db6c7f3a67c348
refs/heads/master
2021-06-17T11:54:44.738814
2017-05-26T22:02:36
2017-05-26T22:02:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package com.basaki.example.menagerie.model.animal; import com.basaki.example.menagerie.model.MenagerieModel; /** * {@code Elephant} represents a large mammal of the family Elephantidae and the * order Proboscidea. * <p> * * @author Indra Basak * @since 4/29/17 */ public class Elephant extends MenagerieModel { }
3b177450564bf6cc7230bd6b76a41f82bda422b0
8fcc7121441ff95eb3015d0f0a7dfe83feb8a505
/INHERITANCE/doubt15.java
6f2e0f521bb04b1194ccb053224f898e472bda88
[]
no_license
Pavan-Em/JavaExamples
57a172cd5d95ebdad58122b78be2d59221d900c6
9def1ac570becbf800ea707773f442dcbd4a1f06
refs/heads/master
2022-12-30T02:37:17.128802
2020-10-21T02:59:42
2020-10-21T02:59:42
305,890,364
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
class A { void test() { System.out.println(this.i);//in super class we cannot use the members of sub class } } class B extends A { int i=33; void exam() { System.out.println(this.i); } } class doubt15 { public static void main(String[]args) { B obj=new B(); obj.test(); } } //OUTPUT //CTE bcoz i is not declared inside class A so i'll give compile time error //very impt note it
8d331029ffda91a33418e4b8fc396f71b218cd60
f96fe513bfdf2d1dbd582305e1cbfda14a665bec
/net.sf.smbt.jazzmutant/src-model/net/sf/smbt/jzmui/Script.java
f4f31839ec67599a8291f615effdfbdf28c6ac0e
[]
no_license
lucascraft/ubq_wip
04fdb727e7b2dc384ba1d2195ad47e895068e1e4
eff577040f21be71ea2c76c187d574f1617703ce
refs/heads/master
2021-01-22T02:28:20.687330
2015-06-10T12:38:47
2015-06-10T12:38:47
37,206,324
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
/** * <copyright> * </copyright> * * $Id$ */ package net.sf.smbt.jzmui; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Script</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link net.sf.smbt.jzmui.Script#getExpr <em>Expr</em>}</li> * </ul> * </p> * * @see net.sf.smbt.jzmui.JzmuiPackage#getScript() * @model * @generated */ public interface Script extends EObject { /** * Returns the value of the '<em><b>Expr</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Expr</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Expr</em>' attribute. * @see #setExpr(String) * @see net.sf.smbt.jzmui.JzmuiPackage#getScript_Expr() * @model * @generated */ String getExpr(); /** * Sets the value of the '{@link net.sf.smbt.jzmui.Script#getExpr <em>Expr</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Expr</em>' attribute. * @see #getExpr() * @generated */ void setExpr(String value); } // Script
ca4b748c0ad09cd99ffc568b829efbb01bbcc172
d57b607551cebefa3f2b572d508c22cdac9bc773
/eureka-feign/src/test/java/com/open/springcloud/eurekafeign/EurekaFeignApplicationTests.java
0eaaab0079ef655ee2878c1b508233d3be7e6ebb
[]
no_license
OpenZhang/springcloud
50a2ac90a3b644410c4503c9af5bd84973575fc4
05b255efdd6e8a80455afff08ddc514fd70894c4
refs/heads/master
2020-03-16T15:36:19.046075
2018-05-11T06:04:52
2018-05-11T06:04:52
132,750,954
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package com.open.springcloud.eurekafeign; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class EurekaFeignApplicationTests { @Test public void contextLoads() { } }
74ca9d088985512fd0117b67b48d7d2ceaf45e9e
dc5c571c50cafb894aef8da6698ab5a9d724012b
/RxExampleDemo/app/src/main/java/example/rx/com/rxexampledemo/zoomeye/ZoomEyeSearch.java
9aa236456888f6cfe4abd791a11de88ff68997e4
[]
no_license
wangjian-k/AndroidRxExample
746f6951be1d7c35e6f2ccd1d8559dff939d32b0
73413d52a6c73493a51b02cef82347e6fbdd6636
refs/heads/master
2016-09-12T21:38:58.375090
2016-06-05T16:03:03
2016-06-05T16:03:03
59,768,041
0
0
null
null
null
null
UTF-8
Java
false
false
5,396
java
package example.rx.com.rxexampledemo.zoomeye; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.TargetApi; import android.app.Activity; import android.os.Build; import android.os.Bundle; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.LinearLayout; import android.widget.Spinner; import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import example.rx.com.rxexampledemo.R; import example.rx.com.rxexampledemo.model.HostQueryResult; import example.rx.com.rxexampledemo.retrofit.ZoomeyeService; import rx.Observer; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; /** * Created by Administrator on 2016/5/28 0028. */ public class ZoomEyeSearch extends Activity { private static final String TAG = ZoomEyeSearch.class.getSimpleName(); @BindView(R.id.spinner) Spinner typeSpinner; @BindView(R.id.search_content) AutoCompleteTextView mSearchContentView; @BindView(R.id.search_loading) View mLoadingView; @BindView(R.id.search_button) Button mSearchButton; @BindView(R.id.recyclerView) RecyclerView mRecyclerView; private SearchRecyclerAdapter recyclerAdapter; private ArrayList<String> searchTypeList = new ArrayList<>(); private ArrayAdapter<String> adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_zoomeye_search); ButterKnife.bind(this); LinearLayoutManager manager = new LinearLayoutManager(getApplicationContext()); manager.setOrientation(LinearLayout.VERTICAL);//默认是LinearLayout.VERTICAL mRecyclerView.setLayoutManager(manager); mRecyclerView.setItemAnimator(new DefaultItemAnimator()); searchTypeList.add("主机"); searchTypeList.add("网站"); adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, searchTypeList); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); typeSpinner.setAdapter(adapter); } @OnClick(R.id.search_button) void search() { // Check for a valid email address. if (TextUtils.isEmpty(mSearchContentView.getText().toString())) { mSearchContentView.setError(getString(R.string.error_field_required)); return; } showLoading(true); ZoomeyeService.getZoomEyeApi().searchWithHost(mSearchContentView.getText().toString()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<HostQueryResult>() { @Override public void onCompleted() { Log.d(TAG,"search completed!!!"); } @Override public void onError(Throwable e) { Log.e(TAG,"search with error : " + e); showLoading(false); } @Override public void onNext(HostQueryResult result) { if(result != null && result.matches != null && result.matches.size() > 0) { int size = result.matches.size(); for(int i=0;i<size;i++) { HostQueryResult.result infoResult = result.matches.get(i); Log.d(TAG,"ip : " + infoResult.ip); } mRecyclerView.removeAllViews(); recyclerAdapter = null; recyclerAdapter = new SearchRecyclerAdapter(ZoomEyeSearch.this,result.matches); mRecyclerView.setAdapter(recyclerAdapter); showLoading(false); } } }); } /** * Shows the progress UI and hides the login form. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) private void showLoading(final boolean show) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); mLoadingView.setVisibility(show ? View.VISIBLE : View.GONE); mLoadingView.animate().setDuration(shortAnimTime).alpha( show ? 1 : 0).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mLoadingView.setVisibility(show ? View.VISIBLE : View.GONE); } }); } else { mLoadingView.setVisibility(show ? View.VISIBLE : View.GONE); } } }
d0b844ede96c9cb713200d251e87593f9c9d5952
b2bac83818f1e3a97d33988423a8b737627b3be9
/javaIO/src/fileApi/file.java
95d5e9e58c2f89472fdedeac725f78ea9b0d3b46
[]
no_license
pupilBin/learn
8177fe0cfa060955c3ff88ac63a57f2cfc14e1ad
132fb53adc3d4f0501e86a8cd466221c9e06876c
refs/heads/master
2020-12-07T07:43:28.630882
2017-07-14T14:49:28
2017-07-14T14:49:28
53,180,867
0
0
null
null
null
null
UTF-8
Java
false
false
897
java
package fileApi; import java.io.File; import java.io.IOException; /** * Created by pupil on 2016/4/6. */ public class file { public static void main(String[] args) { File file=new File("C:\\Users\\BaiLiuBin\\IdeaProjects\\workSpace\\javaIO\\src\\fileApi\\directory"); if(!file.exists()){ file.mkdir(); } else{ file.delete(); } System.out.println(file.isDirectory()+" "+file.isFile()); File file2=new File("C:\\Users\\BaiLiuBin\\IdeaProjects\\workSpace\\javaIO\\src\\fileApi\\test.txt"); if(!file2.exists()){ try { file2.createNewFile(); } catch (IOException e) { e.printStackTrace(); } // 输出file2的路径 System.out.println(file2); } else{ file2.delete(); } } }
200eb3fba33d46a208781c1bd8e90355aba4144b
d6267a448e056b47d79cc716d18edec6dd91154c
/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/OdbcColumnMeta.java
0edfabcfd4a0bcc2d1fb19f4fe020b6fb1fbb82c
[ "Apache-2.0", "LicenseRef-scancode-gutenberg-2020", "CC0-1.0", "BSD-3-Clause" ]
permissive
sk8tz/ignite
1635163cc2309aa0f9fd65734317af861679679f
2774d879a72b0eeced862cc9a3fbd5d9c5ff2d72
refs/heads/master
2023-04-19T03:07:50.202953
2017-01-04T21:01:13
2017-01-04T21:01:13
78,094,618
0
0
Apache-2.0
2023-04-17T19:45:36
2017-01-05T08:30:14
Java
UTF-8
Java
false
false
3,356
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.processors.odbc; import org.apache.ignite.binary.BinaryRawWriter; import org.apache.ignite.internal.binary.BinaryUtils; import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata; /** * ODBC column-related metadata. */ public class OdbcColumnMeta { /** Cache name. */ private final String schemaName; /** Table name. */ private final String tableName; /** Column name. */ private final String columnName; /** Data type. */ private final Class<?> dataType; /** * @param schemaName Cache name. * @param tableName Table name. * @param columnName Column name. * @param dataType Data type. */ public OdbcColumnMeta(String schemaName, String tableName, String columnName, Class<?> dataType) { this.schemaName = OdbcUtils.addQuotationMarksIfNeeded(schemaName); this.tableName = tableName; this.columnName = columnName; this.dataType = dataType; } /** * @param info Field metadata. */ public OdbcColumnMeta(GridQueryFieldMetadata info) { this.schemaName = OdbcUtils.addQuotationMarksIfNeeded(info.schemaName()); this.tableName = info.typeName(); this.columnName = info.fieldName(); Class<?> type; try { type = Class.forName(info.fieldTypeName()); } catch (Exception ignored) { type = Object.class; } this.dataType = type; } /** {@inheritDoc} */ @Override public int hashCode() { int hash = schemaName.hashCode(); hash = 31 * hash + tableName.hashCode(); hash = 31 * hash + columnName.hashCode(); hash = 31 * hash + dataType.hashCode(); return hash; } /** {@inheritDoc} */ @Override public boolean equals(Object o) { if (o instanceof OdbcColumnMeta) { OdbcColumnMeta other = (OdbcColumnMeta) o; return this == other || schemaName.equals(other.schemaName) && tableName.equals(other.tableName) && columnName.equals(other.columnName) && dataType.equals(other.dataType); } return false; } /** * Write in a binary format. * * @param writer Binary writer. */ public void write(BinaryRawWriter writer) { writer.writeString(schemaName); writer.writeString(tableName); writer.writeString(columnName); byte typeId = BinaryUtils.typeByClass(dataType); writer.writeByte(typeId); } }
2269ba3ad855883dcb168122ff2b18eea46e3792
efb6430b47accc21b20848ffcff7bcd0e5fdeb74
/Structural/Bridge/src/platform/Database.java
98ec9317eda2059a653bc53e7d2d2e28447ad9ef
[]
no_license
rawen17/patterns
7ee6c95cd4cb3d21344804b8df7db8a4f10581c2
25541ab50dfa150d4b7ee88ae19360ab80c45e9a
refs/heads/master
2022-10-07T19:59:22.156373
2020-06-12T07:46:12
2020-06-12T07:46:12
267,336,463
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
package platform; public interface Database { boolean hasUser(String userName); void queryData(); }
3e733483fcb55f4bf07002353a23a84863ee7305
49b4cb79c910a17525b59d4b497a09fa28a9e3a8
/parserValidCheck/src/main/java/com/ke/css/cimp/ffm/ffm8/Rule_Grp_ULD_Utilisation_Detail.java
2576698abb2ed3c83970a726a9885189dcb5577f
[]
no_license
ganzijo/koreanair
a7d750b62cec2647bfb2bed4ca1bf8648d9a447d
e980fb11bc4b8defae62c9d88e5c70a659bef436
refs/heads/master
2021-04-26T22:04:17.478461
2018-03-06T05:59:32
2018-03-06T05:59:32
124,018,887
0
0
null
null
null
null
UTF-8
Java
false
false
4,227
java
package com.ke.css.cimp.ffm.ffm8; /* ----------------------------------------------------------------------------- * Rule_Grp_ULD_Utilisation_Detail.java * ----------------------------------------------------------------------------- * * Producer : com.parse2.aparse.Parser 2.5 * Produced : Fri Feb 23 10:57:44 KST 2018 * * ----------------------------------------------------------------------------- */ import java.util.ArrayList; final public class Rule_Grp_ULD_Utilisation_Detail extends Rule { public Rule_Grp_ULD_Utilisation_Detail(String spelling, ArrayList<Rule> rules) { super(spelling, rules); } public Object accept(Visitor visitor) { return visitor.visit(this); } public static Rule_Grp_ULD_Utilisation_Detail parse(ParserContext context) { context.push("Grp_ULD_Utilisation_Detail"); boolean parsed = true; int s0 = context.index; ParserAlternative a0 = new ParserAlternative(s0); ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>(); parsed = false; { int s1 = context.index; ParserAlternative a1 = new ParserAlternative(s1); parsed = true; if (parsed) { boolean f1 = true; int c1 = 0; for (int i1 = 0; i1 < 1 && f1; i1++) { int g1 = context.index; ArrayList<ParserAlternative> as2 = new ArrayList<ParserAlternative>(); parsed = false; { int s2 = context.index; ParserAlternative a2 = new ParserAlternative(s2); parsed = true; if (parsed) { boolean f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { Rule rule = Rule_Sep_Slant.parse(context); if ((f2 = rule != null)) { a2.add(rule, context.index); c2++; } } parsed = c2 == 1; } if (parsed) { boolean f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { Rule rule = Rule_ULD_VOLUME_AVAILABLE_CODE.parse(context); if ((f2 = rule != null)) { a2.add(rule, context.index); c2++; } } parsed = c2 == 1; } if (parsed) { boolean f2 = true; int c2 = 0; for (int i2 = 0; i2 < 1 && f2; i2++) { Rule rule = Rule_Sep_CRLF.parse(context); if ((f2 = rule != null)) { a2.add(rule, context.index); c2++; } } parsed = c2 == 1; } if (parsed) { as2.add(a2); } context.index = s2; } ParserAlternative b = ParserAlternative.getBest(as2); parsed = b != null; if (parsed) { a1.add(b.rules, b.end); context.index = b.end; } f1 = context.index > g1; if (parsed) c1++; } parsed = c1 == 1; } if (parsed) { as1.add(a1); } context.index = s1; } ParserAlternative b = ParserAlternative.getBest(as1); parsed = b != null; if (parsed) { a0.add(b.rules, b.end); context.index = b.end; } Rule rule = null; if (parsed) { rule = new Rule_Grp_ULD_Utilisation_Detail(context.text.substring(a0.start, a0.end), a0.rules); } else { context.index = s0; } context.pop("Grp_ULD_Utilisation_Detail", parsed); return (Rule_Grp_ULD_Utilisation_Detail)rule; } } /* ----------------------------------------------------------------------------- * eof * ----------------------------------------------------------------------------- */
[ "wrjo@wrjo-PC" ]
wrjo@wrjo-PC
54ca90b572719f0a2d1b63d03d3ef1a8a317af36
6bb024b505570317c130c535c043fe70631543ff
/src/main/java/me/kts/boardexample/service/IdiotService.java
e9eefbff4448cb73ff44be61be1401bd9e3143b2
[]
no_license
Kim-Taesu/springboot_board
b7250dd4d68294883c6b0e98324a01f397956b90
6318f2b3afb692d2dbaf802002a5a58063c4d6bc
refs/heads/master
2022-04-06T11:40:30.740366
2020-03-10T15:38:34
2020-03-10T15:38:34
236,267,399
2
0
null
null
null
null
UTF-8
Java
false
false
3,227
java
package me.kts.boardexample.service; import me.kts.boardexample.domain.*; import me.kts.boardexample.repository.*; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Service; import java.util.List; @Service public class IdiotService { private final IdiotRepository idiotRepository; private final IdiotCustomRepository idiotCustomRepository; private final BoardRepository boardRepository; private final AccountRepository accountRepository; private final CommentRepository commentRepository; public IdiotService(IdiotRepository idiotRepository, IdiotCustomRepository idiotCustomRepository, BoardRepository boardRepository, AccountRepository accountRepository, CommentRepository commentRepository) { this.idiotRepository = idiotRepository; this.idiotCustomRepository = idiotCustomRepository; this.boardRepository = boardRepository; this.accountRepository = accountRepository; this.commentRepository = commentRepository; } public boolean addIdiot(String idiotId, String type, String typeId, IdiotDto idiotDto) { UserDetails principal = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = principal.getUsername(); if (type.equals("board")) { List<Board> isExist = idiotCustomRepository.findExistBoard(username, type, typeId, idiotId); if (!isExist.isEmpty()) return false; } else { List<Comment> isExist = idiotCustomRepository.findExistComment(username, type, typeId, idiotId); if (!isExist.isEmpty()) return false; } Idiot idiot = Idiot.builder() .idiotId(idiotId) .title(idiotDto.getTitle()) .content(idiotDto.getContent()) .idiotType(type) .build(); if (type.equals("board")) { Board board = boardRepository.findById(typeId).orElse(null); if (board == null) { return false; } board.setIdiotCount(board.getIdiotCount() + 1); board.setPersisted(true); boardRepository.save(board); idiot.setIdiotDetail(board); } else { Comment comment = commentRepository.findById(typeId).orElse(null); if (comment == null) { return false; } idiot.setIdiotDetail(comment); } idiot.makeId(username); idiotRepository.save(idiot); Account account = accountRepository.findById(idiotId).orElse(null); if (account == null) { return false; } account.setIdiotCount(account.getIdiotCount() + 1); account.setPersisted(true); accountRepository.save(account); return true; } public List<Account> getIdiots() { return accountRepository.findByIdiotCountGreaterThan(0); } public String getBoardId(String typeId) { return commentRepository.findById(typeId).orElse(null).getBoardId(); } }
5572f37bdb720b136285557af399f7ca863c2dec
f7262d403dcb7a374e277b68bef6f0a44f2db62d
/xmtdb/src/main/java/com/trs/xmtdb/web/account/ProfileController.java
1badd2247cc55d78ad30bd584652e51bfb29fa40
[ "MIT" ]
permissive
trs-project4/xmtdb-version1
43f12c1da6f00fd573247b8b2e31f5a9a2c42765
1187813da7d9f4477c5f3abe6d6c0d7cb6bf9d17
refs/heads/master
2020-05-31T20:44:56.546113
2014-09-23T03:12:57
2014-09-23T03:12:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,459
java
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package com.trs.xmtdb.web.account; import javax.validation.Valid; import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.trs.xmtdb.entity.User; import com.trs.xmtdb.service.account.AccountService; import com.trs.xmtdb.service.account.ShiroDbRealm.ShiroUser; /** * 用户修改自己资料的Controller. * * @author calvin */ @Controller @RequestMapping(value = "/profile") public class ProfileController { @Autowired private AccountService accountService; @RequestMapping(method = RequestMethod.GET) public String updateForm(Model model) { Long id = getCurrentUserId(); model.addAttribute("user", accountService.getUser(id)); return "account/profile"; } @RequestMapping(method = RequestMethod.POST) public String update(@Valid @ModelAttribute("user") User user) { accountService.updateUser(user); updateCurrentUserName(user.getName()); return "redirect:/"; } /** * 所有RequestMapping方法调用前的Model准备方法, 实现Struts2 Preparable二次部分绑定的效果,先根据form的id从数据库查出User对象,再把Form提交的内容绑定到该对象上。 * 因为仅update()方法的form中有id属性,因此仅在update时实际执行. */ @ModelAttribute public void getUser(@RequestParam(value = "id", defaultValue = "-1") Long id, Model model) { if (id != -1) { model.addAttribute("user", accountService.getUser(id)); } } /** * 取出Shiro中的当前用户Id. */ private Long getCurrentUserId() { ShiroUser user = (ShiroUser) SecurityUtils.getSubject().getPrincipal(); return user.id; } /** * 更新Shiro中当前用户的用户名. */ private void updateCurrentUserName(String userName) { ShiroUser user = (ShiroUser) SecurityUtils.getSubject().getPrincipal(); user.name = userName; } }
725aecb7e6fc297e3ff2e47db1477ae195c1820b
5c53527860b3313e78884d7d6a2d362003189601
/src/controllers/LoginServletController.java
8cb8a448d7ad4e1fcb29ad83ef03366e12b0f5b0
[]
no_license
jailimbu/state-mgmt
ea8adcefed1d3fd878a84d7a3c15576f6921771a
9a2037f9b24297e359ebd3a14274dc25ee48e79e
refs/heads/master
2021-01-11T21:14:14.703044
2017-01-17T22:15:56
2017-01-17T22:15:56
79,275,054
0
0
null
null
null
null
UTF-8
Java
false
false
2,299
java
package controllers; import java.io.IOException; 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 models.User; /** * Servlet implementation class loginController */ @WebServlet(name = "LoginServletController", urlPatterns = {"/LoginServlet"}) public class LoginServletController extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public LoginServletController() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.getWriter().append("Served at: ").append(request.getContextPath()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub processRequest(request, response); } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String userName=request.getParameter("username"); String password=request.getParameter("password"); if(userName.equals("admin") && password.equals("test123")) { User userObj = new User(); userObj.setUserName(userName); userObj.setPassword(password); HttpSession session = request.getSession(); session.setAttribute("userName", userName); response.sendRedirect("welcome.jsp"); } else { javax.servlet.RequestDispatcher rd = request.getRequestDispatcher("/login.jsp"); request.setAttribute("msg","Incorrect Username Password"); rd.forward(request, response); } } }
2865ad2345612d5027420401e0fdf53ed9903f51
0098dcc18897acc64fde60d56993a989a640c34a
/src/main/java/com/zking/q03/quartz/MyTask2.java
851523c37f80587ac1361591bbfdfb79ae0b126f
[]
no_license
yaoyulan21/warehouse01
84540dec8c9b7994406984574ce7b0e205b91a5f
047fe274191f1a58df046660020f32175ff411a4
refs/heads/master
2023-03-09T07:51:34.189086
2021-02-23T08:32:38
2021-02-23T08:32:38
341,447,947
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
package com.zking.q03.quartz; import com.sun.media.jfxmedia.logging.Logger; import com.zking.q03.service.IOrderService; import lombok.extern.slf4j.Slf4j; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.quartz.QuartzJobBean; import org.springframework.stereotype.Component; @Slf4j @Component public class MyTask2 extends QuartzJobBean { @Autowired private IOrderService orderService; @Override protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { JobDetail jobDetail = jobExecutionContext.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); Object orderId = jobDataMap.get("orderId"); log.info("orderId=" + orderId); orderService.doCancelOrder(); } }
34bdc10107cd530cb42c6141c5c04091a0b67558
46786b383a16fff9c5d57b6b197b905e56a40dba
/xcloud/xcloud-vijava/src/main/java/com/vmware/vim25/StorageDrsVmConfigInfo.java
5beeede3c226e6f93293d302b76d19b1ef8ea123
[]
no_license
yiguotang/x-cloud
feeb9c6288e01a45fca82648153238ed85d4069e
2b255249961efb99d48a0557f7d74ce3586918fe
refs/heads/master
2020-04-05T06:18:30.750373
2016-08-03T06:48:35
2016-08-03T06:48:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,867
java
/*================================================================================ Copyright (c) 2013 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of VMware, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class StorageDrsVmConfigInfo extends DynamicData { public ManagedObjectReference vm; public Boolean enabled; public String behavior; public Boolean intraVmAffinity; public VirtualDiskAntiAffinityRuleSpec intraVmAntiAffinity; public ManagedObjectReference getVm() { return this.vm; } public Boolean getEnabled() { return this.enabled; } public String getBehavior() { return this.behavior; } public Boolean getIntraVmAffinity() { return this.intraVmAffinity; } public VirtualDiskAntiAffinityRuleSpec getIntraVmAntiAffinity() { return this.intraVmAntiAffinity; } public void setVm(ManagedObjectReference vm) { this.vm=vm; } public void setEnabled(Boolean enabled) { this.enabled=enabled; } public void setBehavior(String behavior) { this.behavior=behavior; } public void setIntraVmAffinity(Boolean intraVmAffinity) { this.intraVmAffinity=intraVmAffinity; } public void setIntraVmAntiAffinity(VirtualDiskAntiAffinityRuleSpec intraVmAntiAffinity) { this.intraVmAntiAffinity=intraVmAntiAffinity; } }
a0a6ed84c3a509c825e05689c3dc0b279e48d5a5
d2eb8e8af7962b2080d83e25408739b94a8a5e66
/src/main/java/com/belerweb/social/qq/connect/bean/PicUploadResult.java
17c7aa2418c9b8c29d4f619c449829c3c50ee9c8
[]
no_license
shiqiyue/social-sdk
ad88d18308dc9fb1c17624ada581b348b20d8c95
4c6805e00c939b7d32368690116abdc20381e48f
refs/heads/master
2020-12-25T11:32:01.284597
2016-02-25T02:52:19
2016-02-25T02:52:19
52,768,375
2
1
null
2016-02-29T06:09:37
2016-02-29T06:09:37
null
UTF-8
Java
false
false
2,010
java
package com.belerweb.social.qq.connect.bean; import org.json.JSONObject; import com.belerweb.social.bean.JsonBean; import com.belerweb.social.bean.Result; public class PicUploadResult extends JsonBean { public PicUploadResult() {} private PicUploadResult(JSONObject jsonObject) { super(jsonObject); } private String albumId; private String lLoc; private String sLoc; private String largeUrl; private String smallUrl; private Integer width; private Integer height; public String getAlbumId() { return albumId; } public void setAlbumId(String albumId) { this.albumId = albumId; } public String getlLoc() { return lLoc; } public void setlLoc(String lLoc) { this.lLoc = lLoc; } public String getsLoc() { return sLoc; } public void setsLoc(String sLoc) { this.sLoc = sLoc; } public String getLargeUrl() { return largeUrl; } public void setLargeUrl(String largeUrl) { this.largeUrl = largeUrl; } public String getSmallUrl() { return smallUrl; } public void setSmallUrl(String smallUrl) { this.smallUrl = smallUrl; } public Integer getWidth() { return width; } public void setWidth(Integer width) { this.width = width; } public Integer getHeight() { return height; } public void setHeight(Integer height) { this.height = height; } public static PicUploadResult parse(JSONObject jsonObject) { if (jsonObject == null) { return null; } PicUploadResult obj = new PicUploadResult(jsonObject); obj.albumId = Result.toString(jsonObject.opt("albumid")); obj.lLoc = Result.toString(jsonObject.opt("lloc")); obj.sLoc = Result.toString(jsonObject.opt("sloc")); obj.largeUrl = Result.toString(jsonObject.opt("large_url")); obj.smallUrl = Result.toString(jsonObject.opt("small_url")); obj.width = Result.parseInteger(jsonObject.opt("width")); obj.height = Result.parseInteger(jsonObject.opt("height")); return obj; } }
258c4e35f0ba1e487e3cf4c28567eab03f4bc0ee
36f797ddbd8a72ce9908154043478b93ca03e0ff
/src/test/java/com/rmarini/pontointeligente/api/services/FuncionarioServiceTest.java
1dbd4189b6678c9e62336c59f6ec49fdb0167b0d
[ "MIT" ]
permissive
rcmarini/ponto-inteligente-api
f42942e8023f81fcd6a8dcafd8077235b6561034
b05f48d9f3970fc0913f459346e73d6ed90e8d01
refs/heads/master
2020-04-21T10:47:59.385658
2019-05-15T02:15:46
2019-05-15T02:15:46
169,497,442
0
0
null
null
null
null
UTF-8
Java
false
false
2,203
java
package com.rmarini.pontointeligente.api.services; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.Optional; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.BDDMockito; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import com.rmarini.pontointeligente.api.entities.Funcionario; import com.rmarini.pontointeligente.api.repositories.FuncionarioRepository; @RunWith(SpringRunner.class) @SpringBootTest @ActiveProfiles("test") public class FuncionarioServiceTest { @MockBean private FuncionarioRepository funcionarioRepository; @Autowired private FuncionarioService funcionarioService; @Before public void setUp() throws Exception { BDDMockito.given(this.funcionarioRepository.save(Mockito.any(Funcionario.class))).willReturn(new Funcionario()); BDDMockito.given(this.funcionarioRepository.findOne(Mockito.anyLong())).willReturn(new Funcionario()); BDDMockito.given(this.funcionarioRepository.findByEmail(Mockito.anyString())).willReturn(new Funcionario()); BDDMockito.given(this.funcionarioRepository.findByCpf(Mockito.anyString())).willReturn(new Funcionario()); } @Test public void testPersistirFuncionario() { Funcionario funcionario = this.funcionarioService.persistir(new Funcionario()); assertNotNull(funcionario); } @Test public void testBuscarFuncionarioPorId() { Optional<Funcionario> funcionario = this.funcionarioService.buscarPorId(1L); assertTrue(funcionario.isPresent()); } @Test public void testBuscarFuncionarioPorEmail() { Optional<Funcionario> funcionario = this.funcionarioService.buscarPorEmail("[email protected]"); assertTrue(funcionario.isPresent()); } @Test public void testBuscarFuncionarioPorCpf() { Optional<Funcionario> funcionario = this.funcionarioService.buscarPorCpf("556365442545"); assertTrue(funcionario.isPresent()); } }
9b777b2ccef449b10a6f2aef5d2aa9fb7ae14ecd
5c96dd9932c822a43579f2a1f4180cd1c538dec2
/src/ab/vision/ShowSeg.java
f785d16d3e807301c62da483bbf18ba0a3e01ce8
[]
no_license
LightningDev/AngryBird
a774c0d5d8bc0b5723758cdd892870a89443d0ff
d94d8716db84ab6e54b63451c1dc04e06ce724f9
refs/heads/master
2020-05-30T10:50:58.436054
2014-10-15T15:15:46
2014-10-15T15:15:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,686
java
/***************************************************************************** ** ANGRYBIRDS AI AGENT FRAMEWORK ** Copyright (c) 2014,XiaoYu (Gary) Ge, Stephen Gould,Jochen Renz ** Sahan Abeyasinghe, Jim Keys, Andrew Wang, Peng Zhang ** All rights reserved. **This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. **To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ *or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. *****************************************************************************/ package ab.vision; import java.awt.Color; import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.net.UnknownHostException; import java.util.Arrays; import java.util.List; import javax.imageio.ImageIO; import Jama.Matrix; import ab.demo.other.ActionRobot; import ab.server.Proxy; import ab.server.proxy.message.ProxyScreenshotMessage; import ab.utils.ImageSegFrame; /* TestVision ------------------------------------------------------------- */ public class ShowSeg implements Runnable { private static List<Rectangle> pigs, redBirds, blueBirds, yellowBirds, blackBirds, whiteBirds, iceBlocks, woodBlocks, stoneBlocks, TNTs; private static List<Point> trajPoints; public static boolean useRealshape = false; private static VisionRealShape vision; static public Proxy getGameConnection(int port) { Proxy proxy = null; try { proxy = new Proxy(port) { @Override public void onOpen() { System.out.println("...connected to game proxy"); } @Override public void onClose() { System.out.println("...disconnected from game proxy"); } }; } catch (UnknownHostException e) { e.printStackTrace(); } proxy.start(); System.out.println("Waiting for proxy to connect..."); proxy.waitForClients(1); return proxy; } static public int[][] computeMetaInformation(BufferedImage screenshot) { // image size final int nHeight = screenshot.getHeight(); final int nWidth = screenshot.getWidth(); // meta debugging information int[][] meta = new int[nHeight][nWidth]; for (int y = 0; y < nHeight; y++) { for (int x = 0; x < nWidth; x++) { final int colour = screenshot.getRGB(x, y); meta[y][x] = ((colour & 0x00e00000) >> 15) | ((colour & 0x0000e000) >> 10) | ((colour & 0x000000e0) >> 5); } } return meta; } public static BufferedImage drawRealshape(BufferedImage screenshot) { // get game state GameStateExtractor game = new GameStateExtractor(); GameStateExtractor.GameState state = game.getGameState(screenshot); if (state != GameStateExtractor.GameState.PLAYING) { screenshot = VisionUtils.convert2grey(screenshot); return screenshot; } vision = new VisionRealShape(screenshot); vision.findObjects(); vision.findPigs(); vision.findHills(); vision.findBirds(); vision.findSling(); vision.findTrajectory(); //vision.drawObjects(screenshot, true); vision.drawObjectsWithID(screenshot, true); return screenshot; } public static BufferedImage drawMBRs(BufferedImage screenshot) { // get game state GameStateExtractor game = new GameStateExtractor(); GameStateExtractor.GameState state = game.getGameState(screenshot); if (state != GameStateExtractor.GameState.PLAYING) { screenshot = VisionUtils.convert2grey(screenshot); return screenshot; } // process image Vision vision = new Vision(screenshot); pigs = vision.getMBRVision().findPigsMBR(); redBirds = vision.getMBRVision().findRedBirdsMBRs(); blueBirds = vision.getMBRVision().findBlueBirdsMBRs(); yellowBirds = vision.getMBRVision().findYellowBirdsMBRs(); woodBlocks = vision.getMBRVision().findWoodMBR(); stoneBlocks = vision.getMBRVision().findStonesMBR(); iceBlocks = vision.getMBRVision().findIceMBR(); whiteBirds = vision.getMBRVision().findWhiteBirdsMBRs(); blackBirds = vision.getMBRVision().findBlackBirdsMBRs(); TNTs = vision.getMBRVision().findTNTsMBR(); trajPoints = vision.findTrajPoints(); Rectangle sling = vision.findSlingshotMBR(); // draw objects screenshot = VisionUtils.convert2grey(screenshot); VisionUtils.drawBoundingBoxes(screenshot, pigs, Color.GREEN); VisionUtils.drawBoundingBoxes(screenshot, redBirds, Color.RED); VisionUtils.drawBoundingBoxes(screenshot, blueBirds, Color.BLUE); VisionUtils.drawBoundingBoxes(screenshot, yellowBirds, Color.YELLOW); VisionUtils.drawBoundingBoxes(screenshot, woodBlocks, Color.WHITE, Color.ORANGE); VisionUtils.drawBoundingBoxes(screenshot, stoneBlocks, Color.WHITE, Color.GRAY); VisionUtils.drawBoundingBoxes(screenshot, iceBlocks, Color.WHITE, Color.CYAN); VisionUtils.drawBoundingBoxes(screenshot, whiteBirds, Color.WHITE, Color.lightGray); VisionUtils.drawBoundingBoxes(screenshot, TNTs, Color.WHITE, Color.PINK); VisionUtils.drawBoundingBoxes(screenshot, blackBirds, Color.BLACK); if (sling != null) { VisionUtils.drawBoundingBox(screenshot, sling, Color.ORANGE, Color.BLACK); // generate traj points using estimated parameters Matrix W = vision.getMBRVision().fitParabola(trajPoints); int p[][] = new int[2][100]; int startx = (int) sling.getCenterX(); for (int i = 0; i < 100; i++) { p[0][i] = startx; double tem = W.get(0, 0) * Math.pow(p[0][i], 2) + W.get(1, 0) * p[0][i] + W.get(2, 0); p[1][i] = (int) tem; startx += 10; } if (W.get(0, 0) > 0) VisionUtils.drawtrajectory(screenshot, p, Color.RED); } return screenshot; } public static void main(String[] args) { ImageSegFrame frame = null; BufferedImage screenshot = null; // check command line arguments if (args.length > 1) { System.err.println(" USAGE: java TestVision [(<directory> | <image>)]"); System.exit(1); } // connect to game proxy if no arguments given if (args.length == 0) { Proxy game = getGameConnection(9000); while (true) { // Capture an image byte[] imageBytes = game.send(new ProxyScreenshotMessage()); try { screenshot = ImageIO.read(new ByteArrayInputStream( imageBytes)); } catch (IOException e) { e.printStackTrace(); } // Analyze and show image screenshot = drawMBRs(screenshot); //screenshot = drawRealshape(screenshot); if (frame == null) { frame = new ImageSegFrame("Vision", screenshot, null); } else { frame.refresh(screenshot, null); } // sleep for 50ms try { Thread.sleep(50); } catch (InterruptedException e) { System.err.println("Thread Interrupted"); } } } // Get list of images to process File[] images = null; // Check if argument is a directory or an image if ((new File(args[0])).isDirectory()) { images = new File(args[0]).listFiles(new FilenameFilter() { @Override public boolean accept(File directory, String fileName) { return fileName.endsWith(".png"); } }); } else { images = new File[1]; images[0] = new File(args[0]); } // Iterate through the images Arrays.sort(images); for (File filename : images) { if (filename.isDirectory()) { continue; } // Load the screenshot try { screenshot = ImageIO.read(filename); } catch (IOException e) { System.err.println("ERROR: could not load image " + filename); System.exit(1); } // analyse and show image int[][] meta = computeMetaInformation(screenshot); screenshot = drawMBRs(screenshot); if (frame == null) { frame = new ImageSegFrame("Image Segementation", screenshot, meta); } else { frame.refresh(screenshot, meta); } frame.waitForKeyPress(); } frame.close(); } //add for LoadLevel Agent @Override public void run() { ImageSegFrame frame = null; BufferedImage screenshot = null; while (true) { // capture an image screenshot = ActionRobot.doScreenShot(); // analyse and show image //int[][] meta = computeMetaInformation(screenshot); if(!useRealshape) screenshot = drawMBRs(screenshot); else screenshot = drawRealshape(screenshot); if (frame == null) { frame = new ImageSegFrame("Image Segmentation", screenshot, null); } else { frame.refresh(screenshot, null); } // sleep for 50ms try { Thread.sleep(50); } catch (InterruptedException e) { System.err.println(" Thread Interrupt"); } } } }
e272c005f6f4a25b64897feea2c360eca3fc8caa
028d6009f3beceba80316daa84b628496a210f8d
/uidesigner/com.nokia.sdt.sourcegen/src/com/nokia/sdt/sourcegen/doms/rss/impl/RssModelProxy.java
e1a2f3d1367a33d62508a0406c6c21be5f9f012b
[]
no_license
JamesLinus/oss.FCL.sftools.dev.ide.carbidecpp
fa50cafa69d3e317abf0db0f4e3e557150fd88b3
4420f338bc4e522c563f8899d81201857236a66a
refs/heads/master
2020-12-30T16:45:28.474973
2010-10-20T16:19:31
2010-10-20T16:19:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,579
java
/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: * */ /** * */ package com.nokia.sdt.sourcegen.doms.rss.impl; import com.nokia.sdt.datamodel.IDesignerDataModel; import com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy; import com.nokia.sdt.sourcegen.doms.rss.IRssProjectInfo; import com.nokia.cpp.internal.api.utils.core.Check; import com.nokia.sdt.workspace.IDesignerDataModelSpecifier; import org.eclipse.core.runtime.IPath; /** * * */ public class RssModelProxy implements IRssModelProxy { private IRssProjectInfo projectInfo; private IDesignerDataModelSpecifier specifier; private IDesignerDataModel loadedModel; protected String rssBaseName; private boolean isCached; private String rssFileName; public RssModelProxy(IRssProjectInfo info, IDesignerDataModelSpecifier dmSpec, String rssBaseName) { Check.checkArg(info); Check.checkArg(dmSpec); this.projectInfo = info; this.specifier = dmSpec; this.loadedModel = null; this.isCached = false; setRssBaseName(rssBaseName); } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { return "RssModelProxy for " + specifier; } /* (non-Javadoc) * @see com.nokia.sdt.utils.IDisposable#dispose() */ public synchronized void dispose() { if (loadedModel != null) { if (isCached) loadedModel.dispose(); isCached = false; loadedModel = null; } } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#getProjectInfo() */ public IRssProjectInfo getProjectInfo() { return projectInfo; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#getModelSpecifier() */ public IDesignerDataModelSpecifier getModelSpecifier() { return specifier; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#setModelSpecifier(com.nokia.sdt.workspace.IDesignerDataModelSpecifier) */ public synchronized void setModelSpecifier(IDesignerDataModelSpecifier dmSpec) { if (this.specifier != null && this.specifier.equals(dmSpec)) return; this.specifier = dmSpec; if (loadedModel != null) { if (isCached) loadedModel.dispose(); isCached = false; loadedModel = null; } } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#requestDataModel() */ public synchronized IDesignerDataModel requestDataModel() { if (loadedModel == null) { loadedModel = specifier.loadNoSourceGen().getModel(); isCached = true; } return loadedModel; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#setDataModel(com.nokia.sdt.datamodel.IDesignerDataModel) */ public synchronized void setDataModel(IDesignerDataModel dataModel) { if (loadedModel == dataModel) return; if (loadedModel != null && isCached) loadedModel.dispose(); loadedModel = dataModel; isCached = false; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#isRootModel() */ public boolean isRootModel() { return false; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#getDesignLocation() */ public synchronized IPath getDesignPath() { return specifier.getPrimaryResource().getFullPath(); } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#getRssBaseName() */ public String getRssBaseName() { return rssBaseName; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#setRssBaseName(java.lang.String) */ public void setRssBaseName(String baseName) { Check.checkArg(baseName); this.rssBaseName = baseName; rssFileName = isRootModel() ? rssBaseName + ".rss" : //$NON-NLS-1$ rssBaseName + ".rssi"; //$NON-NLS-1$ } public String getRssFileName() { return rssFileName; } /* (non-Javadoc) * @see com.nokia.sdt.sourcegen.doms.rss.IRssModelProxy#setRssFileName(java.lang.String) */ public void setRssFileName(String fileName) { Check.checkArg(fileName); this.rssFileName = fileName; } }
59df77735d427c64bfa37ec160ad4418cba53536
59e7cd121e34fce370a29d7d23f811ff3a29fe23
/house-demo-server/src/main/java/com/house/mapper/PersonInfoManagementMapper.java
ba451c07b195ad0911e7f63d65fe747d2d2aaed9
[]
no_license
tiger-super/bi-jian
796badb42209dca4abcca8a443dea993f4aacefb
2b357166e60e8235a0569fca84b059df76f2c110
refs/heads/master
2020-04-14T23:30:25.925733
2019-05-10T13:03:37
2019-05-10T13:03:37
164,204,664
1
0
null
null
null
null
UTF-8
Java
false
false
921
java
package com.house.mapper; import org.springframework.stereotype.Repository; import com.house.entity.Customer; @Repository public interface PersonInfoManagementMapper { // 修改密码 int updatePassword(Customer customer); // 修改用户名 int updateName(Customer customer); // 修改年龄 int updateAge(Customer customer); // 修改性别 int updateSex(Customer customer); // 修改邮箱 int updateMailbox(Customer customer); // 查询用户的id和姓名 Customer selectCustomerIdAndCustomerName(Customer customer); // 根据id查询用户的所有信息 Customer selectCustomerAllInfoFromId(Customer customer); // 根据id查询图片地址 String selectPhotoAddressFromId(String id); // 更新图片地址 int updatePhotoAddressFromId(Customer customer); // 查询用户的id和邮箱 Customer selectCustomerIdAndMail(Customer customer); }
75acc35321b464077979dd45a78c1299378fb303
1601ca2f86ff1243bb6e36859e2e34da7928eab7
/demo/src/main/java/com/qinzx/demo/jvm/part5/AtomicTest.java
b00b61d690a6ece9a3850363186879de50ece84c
[]
no_license
qinzixiang/demo
d61d4a76008f67bb7de77fc4f477c6522b3a09c6
d5c05564ff2dc03d3d8b16712ae68aaafba6f82b
refs/heads/master
2022-12-06T14:19:30.839507
2020-08-24T06:12:30
2020-08-24T06:12:30
195,946,104
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.qinzx.demo.jvm.part5; import java.util.concurrent.atomic.AtomicInteger; /** * 原子int型 * Atomic 变量自增运算测试 * * @author qinzx * @date 2020/03/27 15:06 */ public class AtomicTest { public static AtomicInteger race = new AtomicInteger(); public static void increase() { race.incrementAndGet(); } public static final int THREADS_COUNT = 20; public static void main(String[] args){ Thread[] threads = new Thread[THREADS_COUNT]; for (int i = 0; i < THREADS_COUNT; i++) { threads[i] = new Thread(() -> { for (int j = 0; j < 10000; j++) { increase(); } }); threads[i].start(); } while (Thread.activeCount() > 1) { System.out.println(Thread.activeCount()+":"+ AtomicTest.race); Thread.yield(); } System.out.println(race); } }
f6e9c29862bc234512f357a59cb0e8d506c41db6
d2af5e3cb2dfbc3416cd64ea855f99c3292e5fa9
/src/java8/ToysDistribution.java
ab680de071215364a6138e650914b6c990c181f4
[]
no_license
sadhnosh/practice
d9ae4de16d95114ce7df7af4f93816024ef511ca
8fc3051e98eb578520ef0f6462cbc4dd468f1dda
refs/heads/master
2023-06-18T00:09:45.710903
2021-07-15T09:22:28
2021-07-15T09:22:28
386,229,717
0
0
null
null
null
null
UTF-8
Java
false
false
1,619
java
package java8; import java.util.*; public class ToysDistribution { public static void main(String[] args) { List<String> toys = Arrays.asList("Toy1","Toy2","Toy3","Toy4","Toy5","Toy6","Toy7","Toy8","Toy9","Toy10"); Map<String,List<String>> childrenToysCollection = new HashMap<>(); childrenToysCollection.put("Childer1",new ArrayList<>()); childrenToysCollection.put("Childer2",new ArrayList<>()); childrenToysCollection.put("Childer3",new ArrayList<>()); int toyIndex = 0; for (String toy: toys) { final String index = String.valueOf(toyIndex); Optional<String> child = childrenToysCollection.entrySet().stream().filter(e->e.getValue().size()==Integer.valueOf(index)) .map(Map.Entry::getKey).findFirst(); if(!child.isPresent()) { final String newIndex = String.valueOf(toyIndex+1); toyIndex++; child = childrenToysCollection.entrySet().stream().filter(e->e.getValue().size()==Integer.valueOf(newIndex)) .map(Map.Entry::getKey).findFirst(); } if(child.isPresent()) { List<String> childToysList = childrenToysCollection.get(child.get()); childToysList.add(toy); childrenToysCollection.put(child.get(),childToysList); } } childrenToysCollection.forEach((key,value)->{ System.out.println("Children Name: "+key+" Toy Collection: "+value); }); } }
fd097220f47a63959e2ec0c00f5c2477044755eb
2597d2a666dd14d64c51da39a4442af3c1d9c1e0
/Insurance/src/dao/TypeDao.java
350a429d67af3da163d1f0c8f84d321d58fa9f1a
[]
no_license
JefferyLuo-create/insurance
44bd45127ccccb6c3262b9d3a229cf21a323ee80
14905ddcea96d8129844eb9bf3b29a4c5e84ec52
refs/heads/master
2022-01-05T09:26:32.471352
2018-08-28T12:24:07
2018-08-28T12:24:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package dao; import java.util.List; import domain.Type; public interface TypeDao extends BaseDao { int addType(Type type); int deleteType(String tName); int updateType(Type type); Type getAppointType(String tName); List<Type> getAllType(); List<Type> mohuQuery(String keyword); }
b7880f536354be0c849a08c62d873abcc302e3d4
cb2f67d9934c04ab6472553e0db34cbccd7c8c19
/src/main/java/com/bolsadeideas/springboot/app/MvcConfig.java
0a254df4830cc07acd9219175158b10223ce7b88
[]
no_license
AguDecima/spring-boot-jpa-facturacion
2ac7993ca990f8a0a7f9e3142ef567695ef22f2f
c9d0dd25fdae01dbf3614243fa880d8df734a08d
refs/heads/master
2020-03-30T22:01:31.506842
2018-10-05T00:15:26
2018-10-05T00:15:26
151,651,395
0
0
null
null
null
null
UTF-8
Java
false
false
861
java
package com.bolsadeideas.springboot.app; //import java.nio.file.Paths; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; //import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; @Configuration public class MvcConfig implements WebMvcConfigurer { /*private final Logger log = LoggerFactory.getLogger(getClass()); @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { // TODO Auto-generated method stub super.addResourceHandlers(registry); String resourcePath = Paths.get("uploads").toAbsolutePath().toUri().toString(); log.info(resourcePath); registry.addResourceHandler("/uploads/**") .addResourceLocations(resourcePath); }*/ }
1961368463cd01313dae7b168dd0dff7baf2d5c5
6eb82e580b25d10321d8e625991abb30e3c7879b
/doma-gen/src/main/java/org/seasar/doma/extension/gen/DaoDescFactory.java
a9ee2fd3b68ee1f789ca57383add0a1020caf8a0
[ "Apache-2.0" ]
permissive
teramura/doma-gen
ec93a3f76566b5e2d9186032977e748059a26883
fef900d7ada1dd7620cca028e089acd26ae62dad
refs/heads/master
2021-01-21T18:14:42.458279
2013-10-01T01:54:14
2013-10-01T01:54:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,308
java
/* * Copyright 2004-2010 the Seasar Foundation and the Others. * * 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.seasar.doma.extension.gen; import org.seasar.doma.extension.gen.internal.util.ClassUtil; /** * {@link DaoDesc} のファクトリです。 * * @author taedium */ public class DaoDescFactory { /** パッケージ名 */ protected final String packageName; /** サフィックス */ protected final String suffix; /** 設定クラス名 */ protected final String configClassName; /** クラス記述のサポートクラス */ protected final ClassDescSupport classDescSupport = new ClassDescSupport(); /** * インスタンスを構築します。 * * @param packageName * パッケージ名 * @param suffix * サフィックス * @param configClassName * 設定クラス名、指定しない場合 {@code null} */ public DaoDescFactory(String packageName, String suffix, String configClassName) { if (suffix == null) { throw new GenNullPointerException("suffix"); } this.packageName = packageName; this.suffix = suffix; this.configClassName = configClassName; } /** * Dao記述を作成します。 * * @param entityDesc * エンティティ記述 * @return Dao記述 */ public DaoDesc createDaoDesc(EntityDesc entityDesc) { DaoDesc daoDesc = new DaoDesc(); daoDesc.setPackageName(packageName); daoDesc.setSimpleName(entityDesc.getSimpleName() + suffix); if (configClassName != null) { daoDesc.setConfigClassSimpleName(ClassUtil .getSimpleName(configClassName)); } daoDesc.setEntityDesc(entityDesc); daoDesc.setTemplateName(Constants.DAO_TEMPLATE); handleImportName(daoDesc, entityDesc); return daoDesc; } /** * インポート名を処理します。 * * @param daoDesc * Dao記述 * @param entityDesc * エンティティ記述 */ protected void handleImportName(DaoDesc daoDesc, EntityDesc entityDesc) { classDescSupport.addImportName(daoDesc, ClassConstants.Dao); classDescSupport.addImportName(daoDesc, ClassConstants.Insert); classDescSupport.addImportName(daoDesc, ClassConstants.Update); classDescSupport.addImportName(daoDesc, ClassConstants.Delete); if (configClassName != null) { classDescSupport.addImportName(daoDesc, configClassName); } classDescSupport.addImportName(daoDesc, entityDesc.getQualifiedName()); for (EntityPropertyDesc propertyDesc : entityDesc .getIdEntityPropertyDescs()) { classDescSupport.addImportName(daoDesc, propertyDesc .getPropertyClassName()); classDescSupport.addImportName(daoDesc, ClassConstants.Select); } if (entityDesc.getIdEntityPropertyDescs().size() > 0) { classDescSupport.addImportName(daoDesc, ClassConstants.Select); for (EntityPropertyDesc propertyDesc : entityDesc .getIdEntityPropertyDescs()) { classDescSupport.addImportName(daoDesc, propertyDesc .getPropertyClassName()); } if (entityDesc.getVersionEntityPropertyDesc() != null) { classDescSupport.addImportName(daoDesc, entityDesc .getVersionEntityPropertyDesc().getPropertyClassName()); } } } }
becdc5ef7e23b261edf2b01db8019dfab168e052
353a353a7c141d01a58b8065aef0a5bc8c22a483
/wiscess-pdf/src/main/java/com/wiscess/exporter/pdf/ExportPdfParameter.java
390aeb73485c65ed171d508ef6933f1f49285f0a
[]
no_license
wiscess/wiscess
3897ea04ece7e3e9b0576ed38ad9ecc5678ed002
768bf38b6fdad489b3f2c46342803a4acfe9dbd9
refs/heads/master
2023-09-04T10:56:00.302684
2023-08-29T04:01:30
2023-08-29T04:01:30
70,655,887
4
1
null
2022-12-15T23:44:29
2016-10-12T02:46:07
Java
UTF-8
Java
false
false
1,547
java
package com.wiscess.exporter.pdf; import java.util.ArrayList; import java.util.List; import com.itextpdf.kernel.font.PdfFont; import com.itextpdf.kernel.geom.PageSize; import com.itextpdf.layout.element.IElement; import com.itextpdf.layout.element.Paragraph; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Builder @AllArgsConstructor @NoArgsConstructor @Data public class ExportPdfParameter { /** * 模板文件名称 */ private String templateName; private String title; private String author; private String subject; private String keyword; private String creator; private String fontPath; @Builder.Default private PageSize pageSize=PageSize.A4; private PdfFont pdfFont; private PdfMargin margin; //默认页边距36 private PageSize currentPageSize; private PdfMargin currentMargin; @Builder.Default private Float fontSize=12f; /** * 背景图片 */ private String backgroundImage; /** * 页眉设置 */ private PdfHeader header; /** * 页码设置 */ private PdfFooter footer; /** * 水印设置 */ private String waterMark; @Builder.Default private List<IElement> dataList=new ArrayList<>(); public void addData(IElement e){ if(dataList==null){ dataList=new ArrayList<>(); } dataList.add(e); } public void addData(String text){ if(dataList==null){ dataList=new ArrayList<>(); } dataList.add(new Paragraph().add(text)); } }
003894900f72144baffd3228b5ba0c6fd43c8c82
d5fc8713614bdaa7780f5038ed62e99566803f62
/src/main/java/org/tepi/filtertable/demo/FilterTableDemoUI.java
61d13f14a9de16c2b37c6507f2803b0b8faf491e
[]
no_license
amarkeyev/VaadinComplexHeaderTable
560b3ff9a26b30834c4d1be45e31360065b93413
3e17a48e4b91ef791925d48115c82c1e824f1614
refs/heads/master
2021-01-01T15:50:32.581837
2015-08-30T20:47:29
2015-08-30T20:47:29
41,642,379
0
0
null
null
null
null
UTF-8
Java
false
false
11,837
java
package org.tepi.filtertable.demo; import com.vaadin.annotations.PreserveOnRefresh; import com.vaadin.annotations.Theme; import com.vaadin.annotations.Title; import com.vaadin.data.Container; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.IndexedContainer; import com.vaadin.server.BootstrapFragmentResponse; import com.vaadin.server.BootstrapListener; import com.vaadin.server.BootstrapPageResponse; import com.vaadin.server.SessionInitEvent; import com.vaadin.server.SessionInitListener; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; import com.vaadin.ui.CustomTable.HeaderClickEvent; import com.vaadin.ui.CustomTable.HeaderClickListener; import com.vaadin.ui.CustomTable.RowHeaderMode; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.TabSheet; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.themes.Reindeer; import org.tepi.filtertable.FilterTable; import org.tepi.filtertable.paged.PagedFilterTable; import javax.servlet.ServletException; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; import java.util.Random; @SuppressWarnings("serial") @Title("FilterTable Demo Application") @Theme("mytheme") @PreserveOnRefresh public class FilterTableDemoUI extends UI { /** * Example enum for enum filtering feature */ enum State { CREATED, PROCESSING, PROCESSED, FINISHED; } @Override protected void init(VaadinRequest request) { // setLocale(new Locale("ru", "RU")); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setMargin(new MarginInfo(true, false, false, false)); mainLayout.setSizeFull(); /* final TabSheet ts = new TabSheet(); ts.setStyleName(Reindeer.TABSHEET_MINIMAL); ts.setSizeFull(); */ final Component ts = buildNormalTableTab(); ts.setStyleName(Reindeer.TABSHEET_MINIMAL); ts.setSizeFull(); mainLayout.addComponent(ts); mainLayout.setExpandRatio(ts, 1); /* ts.addTab(buildNormalTableTab(), "Normal FilterTable"); ts.addTab(buildPagedTableTab(), "Paged FilterTable"); */ setContent(mainLayout); } private Component buildNormalTableTab() { /* Create FilterTable */ FilterTable normalFilterTable = buildFilterTable(); final VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSizeFull(); mainLayout.setSpacing(true); mainLayout.setMargin(true); mainLayout.addComponent(normalFilterTable); mainLayout.setExpandRatio(normalFilterTable, 1); mainLayout.addComponent(buildButtons(normalFilterTable)); Panel p = new Panel(); p.setStyleName(Reindeer.PANEL_LIGHT); p.setSizeFull(); p.setContent(mainLayout); return p; } private FilterTable buildFilterTable() { FilterTable filterTable = new FilterTable(); filterTable.setSizeFull(); filterTable.setFilterDecorator(new DemoFilterDecorator()); filterTable.setFilterGenerator(new DemoFilterGenerator()); filterTable.setFilterBarVisible(true); filterTable.setSelectable(true); filterTable.setImmediate(true); filterTable.setMultiSelect(true); //filterTable.setRowHeaderMode(RowHeaderMode.INDEX); filterTable.setColumnCollapsingAllowed(true); filterTable.setColumnReorderingAllowed(true); filterTable.setContainerDataSource(buildContainer()); Object[] vc = new String[] { "name", "id", "state", "date", "validated", "checked"}; filterTable.setVisibleColumns(vc); String complexHeader[][] = { {"name 0", "area 1", "area 1", "date", "area 2", "area 2"}, {"name 1", "area 1", "area 1", "date", "validated", "checked"}, {"name 2 ", "id", "state", "date", "validated", "checked"}}; filterTable.setComplexColumnHeaders(complexHeader); filterTable.setColumnCollapsingAllowed(true); filterTable.setComplexColumnHeaders(complexHeader); filterTable.addHeaderClickListener(new HeaderClickListener() { public void headerClick(HeaderClickEvent event) { System.out.print(event.toString()); } } ); return filterTable; } private Component buildButtons(final FilterTable relatedFilterTable) { HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setHeight(null); buttonLayout.setWidth("100%"); buttonLayout.setSpacing(true); Label hideFilters = new Label("Show Columns:"); hideFilters.setSizeUndefined(); buttonLayout.addComponent(hideFilters); buttonLayout.setComponentAlignment(hideFilters, Alignment.MIDDLE_LEFT); for (Object propId : relatedFilterTable.getContainerPropertyIds()) { Component t = createToggle(relatedFilterTable, propId); buttonLayout.addComponent(t); buttonLayout.setComponentAlignment(t, Alignment.MIDDLE_LEFT); } CheckBox showFilters = new CheckBox("Toggle Filter Bar visibility"); showFilters.setValue(relatedFilterTable.isFilterBarVisible()); showFilters.setImmediate(true); showFilters.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { relatedFilterTable.setFilterBarVisible((Boolean) event .getProperty().getValue()); } }); buttonLayout.addComponent(showFilters); buttonLayout.setComponentAlignment(showFilters, Alignment.MIDDLE_RIGHT); buttonLayout.setExpandRatio(showFilters, 1); Button setVal = new Button("Set the State filter to 'Processed'"); setVal.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { relatedFilterTable .setFilterFieldValue("state", State.PROCESSED); } }); buttonLayout.addComponent(setVal); Button reset = new Button("Reset"); reset.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { relatedFilterTable.resetFilters(); } }); buttonLayout.addComponent(reset); return buttonLayout; } @SuppressWarnings("unchecked") private Container buildContainer() { IndexedContainer cont = new IndexedContainer(); Calendar c = Calendar.getInstance(); cont.addContainerProperty("name", String.class, null); cont.addContainerProperty("id", Integer.class, null); cont.addContainerProperty("state", State.class, null); cont.addContainerProperty("date", Timestamp.class, null); cont.addContainerProperty("validated", Boolean.class, null); cont.addContainerProperty("checked", Boolean.class, null); Random random = new Random(); for (int i = 0; i < 10000; i++) { cont.addItem(i); /* Set name and id properties */ cont.getContainerProperty(i, "name").setValue("Order " + i); cont.getContainerProperty(i, "id").setValue(i); /* Set state property */ int rndInt = random.nextInt(4); State stateToSet = State.CREATED; if (rndInt == 0) { stateToSet = State.PROCESSING; } else if (rndInt == 1) { stateToSet = State.PROCESSED; } else if (rndInt == 2) { stateToSet = State.FINISHED; } cont.getContainerProperty(i, "state").setValue(stateToSet); /* Set date property */ cont.getContainerProperty(i, "date").setValue( new Timestamp(c.getTimeInMillis())); c.add(Calendar.DAY_OF_MONTH, 1); /* Set validated property */ cont.getContainerProperty(i, "validated").setValue( random.nextBoolean()); /* Set checked property */ cont.getContainerProperty(i, "checked").setValue( random.nextBoolean()); } return cont; } private Component createToggle(final FilterTable relatedFilterTable, final Object propId) { final CheckBox toggle = new CheckBox(propId.toString()); toggle.setValue(true); toggle.setImmediate(true); toggle.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { relatedFilterTable.setColumnCollapsed(propId,!(toggle.getValue())); } }); return toggle; } public class Servlet extends VaadinServlet { /* @Override protected void servletInitialized() throws ServletException { super.servletInitialized(); getService().addSessionInitListener(new SessionInitListener() { @Override public void sessionInit(SessionInitEvent event) { event.getSession().addBootstrapListener(new BootstrapListener() { @Override public void modifyBootstrapFragment( BootstrapFragmentResponse response) { // TODO Auto-generated method stub } @Override public void modifyBootstrapPage( BootstrapPageResponse response) { response.getDocument().head() .prependElement("meta") .attr("name", "viewport") .attr("content", "width=device-width"); response.getDocument().head() .prependElement("meta") .append("<link href='http://fonts.googleapis.com/css?family=Cabin+Sketch' rel='stylesheet' type='text/css'>"); } } ); } }); } */ } }
dc12c43f82137ed7e308b293a27d9ad7842ee580
0e69f5627479ee661836d9b5c91514c1323def0f
/src/main/java/ca/poc/uilogic/service/MessagesService.java
f77d95c97fa75e2448f6a5cce6d740f9bd130f57
[]
no_license
arvin-tomachovsky/uilogic-for-poc
6937c0d2fdadc709cbc5d064be46fdb612803425
64368fa1fb457eb11ff2efd2a5f406e5810032f1
refs/heads/master
2021-06-29T13:22:52.032383
2017-09-15T08:26:33
2017-09-15T08:26:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,133
java
package ca.poc.uilogic.service; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import ca.poc.uilogic.domain.Message; import ca.poc.uilogic.repository.interfaces.IMessagesRepository; import ca.poc.uilogic.service.interfaces.IMessagesService; /** * Service implementation for: operations on messages. * * @author daniel.fryze */ @Named("messagesService") public class MessagesService implements IMessagesService { private IMessagesRepository messagesRepository; @Inject public MessagesService(@Named("messagesRepository") IMessagesRepository messagesRepository) { this.messagesRepository = messagesRepository; init(); } private void init() { messagesRepository.addMessage(new Message("2017-08-01 12:15", "Offline BZWBK. Utrudnienia w dostępie do transakcji kartowych.", "W dniu dzisiejszym wystąpią trudności techniczne w dostępie do operacji na kartach kredytowych i rachunkach ubezpieczeniowych.")); messagesRepository.addMessage(new Message("2017-08-03 10:10", "Niedostępność modułu płatności przez dwa tygodnie.", "Przez najbliższe dwa dni z uwagi na prace serwisowe niedostępne będą moduły płatności zarówno internetowych jak i tych na aplikacjach mobilnych.")); messagesRepository.addMessage(new Message("2017-08-07 16:05", "Brak dostepu do systemu Profile przez tydzień od dzisiaj", "Operatorzy z Back Office będą mieli utrudnienia w logowaniu do Profile z powodu na trwające tam prace serwisowe wykonywane przez zespół administratorów.")); messagesRepository.addMessage(new Message("2017-08-11 18:00", "Offline Alior Bank. Utrudnienia w dostępie do transakcji krdytowych.", "W dniu dzisiejszym wystąpią trudności techniczne w dostępie do operacji na kartach kredytowych i niektórych ubezpieczeniwoych.")); } public Message getMessage(long id) { return messagesRepository.getMessage(id); } public List<Message> getMessages() { return messagesRepository.getMessages(); } public long getMessagesCount() { return getMessages().size(); } }
3622470f57cafd09c9ddd63eb0f35b301e04dee3
87207c5c1f7d1497fa6dddf42823edc7fd489929
/src/com/pie/tlatoani/Tablist/Simple/SimpleTablist.java
def823b293dd6d7116e9d72c859157cffbdb32ae
[ "MIT" ]
permissive
Pikachu920/MundoSK
2e0352cb1028f18d2333edd18aa9bee30335d332
e80e88e77d17e301c73d3fcfcf5bdba6fb42e0a9
refs/heads/master
2021-01-22T09:54:38.362298
2016-12-03T17:06:31
2016-12-03T17:06:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,787
java
package com.pie.tlatoani.Tablist.Simple; import com.comphenix.protocol.PacketType; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.wrappers.*; import com.pie.tlatoani.Mundo; import com.pie.tlatoani.ProtocolLib.UtilPacketEvent; import com.pie.tlatoani.Skin.Skin; import com.pie.tlatoani.Tablist.Tablist; import org.bukkit.entity.Player; import java.lang.reflect.InvocationTargetException; import java.nio.charset.Charset; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Consumer; /** * Created by Tlatoani on 7/15/16. */ public class SimpleTablist { private final Tablist tablist; private final HashMap<String, String> displayNames = new HashMap<>(); private final HashMap<String, Integer> latencies = new HashMap<>(); private final HashMap<String, Skin> heads = new HashMap<>(); private final HashMap<String, Integer> scores = new HashMap<>(); public static final Charset UTF_8 = Charset.forName("UTF-8"); public SimpleTablist(Tablist tablist) { this.tablist = tablist; } private void sendPacketToAll(String id, EnumWrappers.PlayerInfoAction action) { sendPacket(id, action, tablist.players); } private void sendPacket(String id, EnumWrappers.PlayerInfoAction action, Collection<Player> players) { int ping = latencies.get(id); String displayName = displayNames.get(id); WrappedChatComponent chatComponent = WrappedChatComponent.fromJson(Tablist.colorStringToJson(displayName)); UUID uuid = UUID.nameUUIDFromBytes(("MundoSKTablist::" + id).getBytes(UTF_8)); Skin icon = heads.get(id); WrappedGameProfile gameProfile = new WrappedGameProfile(uuid, id + "-MSK"); if (action == EnumWrappers.PlayerInfoAction.ADD_PLAYER) { if (icon == null) icon = Tablist.DEFAULT_SKIN_TEXTURE; icon.retrieveSkinTextures(gameProfile.getProperties()); } PlayerInfoData playerInfoData = new PlayerInfoData(gameProfile, ping, EnumWrappers.NativeGameMode.NOT_SET, chatComponent); List<PlayerInfoData> playerInfoDatas = Arrays.asList(playerInfoData); PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.PLAYER_INFO); packetContainer.getPlayerInfoDataLists().writeSafely(0, playerInfoDatas); packetContainer.getPlayerInfoAction().writeSafely(0, action); players.forEach(new Consumer<Player>() { @Override public void accept(Player player) { try { UtilPacketEvent.protocolManager.sendServerPacket(player, packetContainer); } catch (InvocationTargetException e) { Mundo.reportException(this, e); } } }); } private void sendScorePacketToAll(String id) { sendScorePacket(id, tablist.players); } private void sendScorePacket(String id, Collection<Player> players) { if (!tablist.areScoresEnabled()) return; PacketContainer packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_SCORE); packet.getStrings().writeSafely(0, id + "-MSK"); packet.getStrings().writeSafely(1, Tablist.OBJECTIVE_NAME); packet.getIntegers().writeSafely(0, scores.get(id)); packet.getScoreboardActions().writeSafely(0, EnumWrappers.ScoreboardAction.CHANGE); players.forEach(new Consumer<Player>() { @Override public void accept(Player player) { try { UtilPacketEvent.protocolManager.sendServerPacket(player, packet); } catch (InvocationTargetException e) { Mundo.reportException(this, e); } } }); } public void addPlayers(Collection<Player> players) { heads.forEach(new BiConsumer<String, Skin>() { @Override public void accept(String s, Skin skin) { sendPacket(s, EnumWrappers.PlayerInfoAction.ADD_PLAYER, players); } }); } public void removePlayers(Collection<Player> players) { heads.forEach(new BiConsumer<String, Skin>() { @Override public void accept(String s, Skin skin) { sendPacket(s, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER, players); } }); } public void clear() { String[] ids = displayNames.keySet().toArray(new String[0]); for (int i = 0; i < ids.length; i++) { deleteTab(ids[i]); } } public boolean tabExists(String id) { return id.length() <= 12 && displayNames.containsKey(id); } public void createTab(String id, String displayName, Integer ping, Skin head, Integer score) { tablist.arrayTablist.setColumns(0); if (id.length() <= 12 && !tabExists(id)) { ping = Math.max(ping, 0); ping = Math.min(ping, 5); latencies.put(id, ping); displayNames.put(id, displayName); heads.put(id, head); scores.put(id, score); sendPacketToAll(id, EnumWrappers.PlayerInfoAction.ADD_PLAYER); if (score != 0) sendScorePacketToAll(id); } } public void deleteTab(String id) { if (tabExists(id)) { sendPacketToAll(id, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER); displayNames.remove(id); latencies.remove(id); heads.remove(id); } } public String getDisplayName(String id) { return displayNames.get(id); } public Integer getLatency(String id) { return latencies.get(id); } public Skin getHead(String id) { return heads.get(id); } public Integer getScore(String id) { return scores.get(id); } public void setDisplayName(String id, String displayName) { if (tabExists(id)) { displayNames.put(id, displayName); sendPacketToAll(id, EnumWrappers.PlayerInfoAction.UPDATE_DISPLAY_NAME); } } public void setLatency(String id, Integer ping) { if (tabExists(id)) { latencies.put(id, ping); sendPacketToAll(id, EnumWrappers.PlayerInfoAction.UPDATE_LATENCY); } } public void setHead(String id, Skin icon) { if (tabExists(id)) { sendPacketToAll(id, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER); heads.put(id, icon); sendPacketToAll(id, EnumWrappers.PlayerInfoAction.ADD_PLAYER); } } public void setScore(String id, Integer ping) { if (tabExists(id)) { scores.put(id, ping); sendScorePacketToAll(id); } } }
634aaae3069f1ca155d874b11c90e22192196129
85eb470c9b11ca969a1b6371c47c4e2df45b195b
/src/main/java/ioreaderclasspath/countries/Country.java
a38dccbaec94b6efd25ef0dad428307be4150445
[]
no_license
csgrabt/training-solutions
b694332b856f17c237831123bd2c6504a18d5cb4
5e5fc887dc3d72aa673f8df01ba3f1d097f37176
refs/heads/master
2023-08-15T00:29:28.460172
2021-10-04T08:36:23
2021-10-04T08:36:23
308,076,903
1
1
null
null
null
null
UTF-8
Java
false
false
393
java
package ioreaderclasspath.countries; public class Country { private String name; private int borderCountries; public Country(String name, int borderCountries) { this.name = name; this.borderCountries = borderCountries; } public int getBorderCountries() { return borderCountries; } public String getName() { return name; } }
baf23cd3c4fa5480f62f1e117cd4575f7f22a3a8
260dc2c19a6b1f3faaaa6427d6db35c97bf8c2c8
/favouriteservice/src/main/java/com/stackroute/favouriteservice/service/UserServiceImpl.java
45ead5338a9cbc407502ea445205795e41df417c
[]
no_license
subashnaik/cmatches-master
9eb92b0a7411829ca8970fba8140fdb42cf7f87c
2ebf26e2a7ed7d645b4688c2152962241cdad98c
refs/heads/master
2023-05-13T02:36:44.732384
2019-11-12T12:18:32
2019-11-12T12:18:32
220,997,287
0
0
null
2023-05-07T06:18:13
2019-11-11T14:18:38
Java
UTF-8
Java
false
false
683
java
package com.stackroute.favouriteservice.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.stackroute.favouriteservice.domain.model.User; import com.stackroute.favouriteservice.repository.IUserServiceRepository; @Service public class UserServiceImpl implements IUserService { @Autowired private IUserServiceRepository userServiceRepository; public UserServiceImpl(IUserServiceRepository userServiceRepository) { this.userServiceRepository = userServiceRepository; } @Override public User findByUserId(String userId) { return userServiceRepository.findByUserId(userId); } }
62ebf79a8e9c678d034291a5b3328b13e16a16b9
476c26f37e9bf0ad33c0981f64b75230b2ee8b9a
/plugin/src/main/java/com/fasten/component/plugin/task/ServiceRegistryGenerationTask.java
c57c4873603c333170b79fc1daab369847e217cd
[ "Apache-2.0" ]
permissive
stormzsl/androidSPI
4bd7fc0cc43aea77a8a68bfed6e76c2b56c4aef7
4b9ab5a8beeb536cd19b1775ca4d2f2cda576450
refs/heads/master
2021-06-26T07:57:30.848925
2021-04-28T07:51:09
2021-04-28T07:51:09
226,661,334
1
1
null
null
null
null
UTF-8
Java
false
false
1,396
java
package com.fasten.component.plugin.task; import org.gradle.api.DefaultTask; import org.gradle.api.file.FileCollection; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.TaskAction; import java.io.File; /** * Generate {@code ServiceRegistry} class by scanning all classes from classpath */ public class ServiceRegistryGenerationTask extends DefaultTask { private File sourceDir; private File servicesDir; private FileCollection classpath; public ServiceRegistryGenerationTask() { this.classpath = this.getProject().files(); } @InputFiles public FileCollection getClasspath() { return this.classpath; } public void setClasspath(final FileCollection classpath) { this.classpath = classpath; } @OutputDirectory public File getSourceDir() { return this.sourceDir; } public void setSourceDir(final File sourceDir) { this.sourceDir = sourceDir; } @OutputDirectory public File getServicesDir() { return this.servicesDir; } public void setServicesDir(final File servicesDir) { this.servicesDir = servicesDir; } @TaskAction protected void generate() { this.setDidWork(new ServiceRegistryGenerationAction(this.classpath, this.servicesDir, this.sourceDir).execute()); } }
d271085940e68f6e3da54857e16b3054f36e77b6
ecf8383275e70237d8d3ecacad4140140343a69c
/apawnd-wms-standard-provider/src/main/java/com/maersk/apawnd/wms/standard/mapper/CarrierMapper.java
b9226f0d3463239ed3c46c36c901be4a60fc25ed
[ "Apache-2.0" ]
permissive
huangbiyun-1512/apawnd-wms-standard
0db1e56c93e64d85adba2b7c6b74018a8d587164
73a997ff506a9b4aecbfb29017af6186420e961b
refs/heads/master
2023-01-02T04:52:26.454018
2020-10-27T02:37:26
2020-10-27T02:37:26
283,645,044
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package com.maersk.apawnd.wms.standard.mapper; import com.maersk.apawnd.wms.standard.model.CarrierModel; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @Mapper public interface CarrierMapper { List<CarrierModel> selectByCarrierName(@Param("carrierName") String carrierName); }
9df608f66b4a73672c522c54abd8c3e9d21ccaab
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/64/org/apache/commons/math/distribution/AbstractIntegerDistribution_cumulativeProbability_87.java
6276f62d38bfcd1abbb38f93a5d3f69ae4343758
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,148
java
org apach common math distribut base integ valu discret distribut default implement provid method vari distribut distribut version revis date abstract integ distribut abstractintegerdistribut abstract distribut abstractdistribut random variabl valu distribut distribut method return param inclus lower bound param inclus upper bound probabl random variabl distribut code code code code includ endpoint math except mathexcept cumul probabl comput due converg numer error illeg argument except illegalargumentexcept code code overrid cumul probabl cumulativeprob math except mathexcept math runtim except mathruntimeexcept creat illeg argument except createillegalargumentexcept local format localizedformat lower endpoint upper endpoint math floor cumul probabl cumulativeprob math floor math floor count mass mathemat integ cumul probabl cumulativeprob math floor math floor
ac832d62b7a2d04a786ecc9d565458be913785d2
955492b38652588990c368e2102375dc1f5118b2
/Urlshortener/src/test/java/com/newbie/urlshortenerservices/EnlargerServiceTest.java
4342e5263ff49ec9158738c13671d15c60da9559
[]
no_license
IanScott/URLShortener
7bce5606b0bcd07240489d6ff88f9b9d28093427
e07eb6a8320aead3eb496a9303e50aa68b1fea0c
refs/heads/master
2020-03-27T17:53:42.255721
2018-09-16T20:13:32
2018-09-16T20:13:32
146,882,614
0
0
null
null
null
null
UTF-8
Java
false
false
1,835
java
package com.newbie.urlshortenerservices; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.net.MalformedURLException; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.newbie.urlshortener.model.LongUrl; import com.newbie.urlshortener.model.ShortUrl; import com.newbie.urlshortener.services.EnlargerService; import com.newbie.urlshortener.services.ShortenerService; import com.newbie.urlshortener.UrlshortenerApplication; import com.newbie.urlshortener.exceptions.UrlNotFoundException; @SpringBootTest(classes = UrlshortenerApplication.class) @RunWith(SpringJUnit4ClassRunner.class) public class EnlargerServiceTest { @Autowired private EnlargerService enlargerService; @Autowired private ShortenerService shortenerService; @Test public void should_reuseExistingShortenedUrl_when_postedUrlExists() throws IOException { ShortUrl shorturl = shortenerService.shortenUrl("http://www.test123.nl"); LongUrl longurl = enlargerService.enlargeUrl(shorturl.getShortUrl()); assertThat(longurl.getLongUrl()).isEqualTo("http://www.test123.nl"); } @Test(expected = MalformedURLException.class) public void expecting_MalformedURlException() throws MalformedURLException { String shortUrl = "error"; enlargerService.enlargeUrl(shortUrl); } @Test(expected = UrlNotFoundException.class) public void expecting_UrlNotFoundException() throws MalformedURLException { String shortUrl = "http://www.error.com"; enlargerService.enlargeUrl(shortUrl); } }
7aeb74f1185de992244a43fa04e2cd8c78b37132
f847855178fca60efb77d1505bb10615b2d1284b
/src/net/davidrobles/games/tetris/view/TetrisModelObserver.java
5a6c1f05bd21bc4aa6239040c4e368876dedb157
[]
no_license
davidrobles/tetris
c00f1f9c63545d416997ea4359e6f0c94999286c
e619c2bda200545d4f0e9c20b381cbd5a1a78205
refs/heads/master
2021-01-22T14:40:13.590613
2013-08-31T03:46:13
2013-08-31T03:46:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
package net.davidrobles.games.tetris.view; public interface TetrisModelObserver { void update(); }
11aaf53479a7d51b333b7c4c053b9510c176a5e7
c09b36141799135b4b19b18bc60ac594e08302d0
/giraph-core/src/main/java/org/apache/giraph/types/heaps/Long2IntMapEntryIterable.java
08e44d40b0d890235b1e3f7b0cffb8e2d410df59
[ "Apache-2.0" ]
permissive
kboom/giraph
50f37e0b3e5b6e2c74b49cd2025ac7cdc52f663d
6e8906ea1eabf86ce3ac358995b4110fc3d92d6f
refs/heads/master
2020-07-26T07:01:47.846101
2019-11-10T13:31:54
2019-11-10T13:31:54
208,571,201
0
0
NOASSERTION
2020-02-12T21:10:13
2019-09-15T09:33:48
Java
UTF-8
Java
false
false
1,470
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.giraph.types.heaps; import it.unimi.dsi.fastutil.longs.Long2IntMap;; import it.unimi.dsi.fastutil.objects.ObjectIterable; import it.unimi.dsi.fastutil.objects.ObjectIterator; /** * Iterable which has its size and ObjectIterator<Long2IntMap.Entry> */ public interface Long2IntMapEntryIterable extends ObjectIterable<Long2IntMap.Entry> { /** * Get the iterator. Not thread-safe and reuses iterator object, * so you can't have several iterators at the same time. * * @return Iterator */ ObjectIterator<Long2IntMap.Entry> iterator(); /** * Get the size of this iterable * * @return Size */ int size(); }
896390ab751d4345eef6037259b50dd0c0fca169
26db89ac918398297f509334032c872356d9cf68
/src/main/java/br/com/willianantunes/examocp/chap8/ReadFileInformation.java
a832f98d8140b04728b3fb4eb9c83af3d039316d
[]
no_license
willianantunes/oca-ocp-evaluation
0708ab38114e4178703068619689d2e0e30c3109
0d6daa57ca7a7dcc63682a840b8ac4809453e9c0
refs/heads/master
2020-07-04T08:40:36.731032
2017-02-11T17:53:37
2017-02-11T17:53:37
73,863,982
0
0
null
null
null
null
UTF-8
Java
false
false
1,520
java
package br.com.willianantunes.examocp.chap8; import java.io.File; public class ReadFileInformation { public static void main(String[] args) { // File file = new File("C:\\Users\\Willian\\Development\\tools\\eclipse-neon-R\\eclipse.exe"); File file = new File("C:\\Users\\Willian\\Development\\tools\\eclipse-neon-R"); System.out.println("File exists: " + file.exists()); if (file.exists()) { System.out.println("Absolute path: " + file.getAbsolutePath()); System.out.println("Is directory: " + file.isDirectory()); System.out.println("Parent path: " + file.getParent()); if (file.isFile()) { System.out.println("File size: " + file.length()); System.out.println("File LastModified: " + file.lastModified()); } else { for (File subfile: file.listFiles()) { System.out.println("\t" + subfile.getName()); } } } /** * Sample of output for a file: File exists: true Absolute path: C:\Users\Willian\Development\tools\eclipse-neon-R\eclipse.exe Is directory: false Parent path: C:\Users\Willian\Development\tools\eclipse-neon-R File size: 319984 File LastModified: 1465848114000 * Sample of output for a folder: File exists: true Absolute path: C:\Users\Willian\Development\tools\eclipse-neon-R Is directory: true Parent path: C:\Users\Willian\Development\tools .eclipseproduct artifacts.xml configuration dropins eclipse.exe eclipse.ini eclipsec.exe features p2 plugins readme */ } }
411638755d6ddc53b48a9e686a76e263b06c0629
8a1a2f98fc8266f8f65441c077a38889fa3af5c6
/mall-manager/mall-manager-dao/src/main/java/com/ntc/mall/mapper/TbContentCategoryMapper.java
a808d852e2906a8f28ec5f6cd4bd634a0c4bc21e
[]
no_license
Michael-F-Chen/ntc-mall
1f854fe2ead0642e80d13a651828a132235be4fb
a9717e00a66c8c1fc95a2d674323c8089dd9f310
refs/heads/master
2020-03-29T12:17:42.354968
2018-10-22T14:32:53
2018-10-22T14:32:53
149,892,412
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.ntc.mall.mapper; import com.ntc.mall.pojo.TbContentCategory; import com.ntc.mall.pojo.TbContentCategoryExample; import java.util.List; import org.apache.ibatis.annotations.Param; public interface TbContentCategoryMapper { int countByExample(TbContentCategoryExample example); int deleteByExample(TbContentCategoryExample example); int deleteByPrimaryKey(Long id); int insert(TbContentCategory record); int insertSelective(TbContentCategory record); List<TbContentCategory> selectByExample(TbContentCategoryExample example); TbContentCategory selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") TbContentCategory record, @Param("example") TbContentCategoryExample example); int updateByExample(@Param("record") TbContentCategory record, @Param("example") TbContentCategoryExample example); int updateByPrimaryKeySelective(TbContentCategory record); int updateByPrimaryKey(TbContentCategory record); }
c01c9bae821d2d971b28057d58f50d8919b68867
bd63b955e874b4bfb1f7e67bfeef42a74237623c
/hw06-Crypto_Shell/hw06-1191233690/src/main/java/hr/fer/zemris/java/hw06/shell/ShellCommand.java
b99cef3af4be77e278c60a42027ee4714a6d489a
[]
no_license
nijelic/Introduction-to-Java-Programming-Language
ec6063581db817371c123b9732cab2175162b784
ed37b3a9496a70fd990146fba2eca12460bd0e84
refs/heads/master
2022-12-06T08:54:48.135836
2019-09-24T11:59:01
2019-09-24T11:59:01
174,699,653
0
0
null
2022-11-24T09:35:01
2019-03-09T13:44:55
Java
UTF-8
Java
false
false
673
java
package hr.fer.zemris.java.hw06.shell; import java.util.List; /** * Interface used for MyShell commands. * */ public interface ShellCommand { /** * This method executes command. * @param env {@link Environment} which is used to communicate with user. * @param arguments of the command * @return ShellStatus TERMINATE or CONTINUE * */ ShellStatus executeCommand(Environment env, String arguments); /** * This method returns name of command. * @return Name of the command. * */ String getCommandName(); /** * Returns description of command. * @return List<String> Description of the command. * */ List<String> getCommandDescription(); }
99b74e0e4e13b9513fb36a6b97d13ae1eef8a384
cd7092b301c0da351d579bd9306bd3a5358e0998
/src/main/java/com/lagou/edu/dao/impl/JdbcAccountDaoImpl.java
adc71960887f10e9541051803a3e83f9119f0825
[]
no_license
xiaolianggu/lagou-transfer
a321d0c2d0c0d43ae696c433c6ca3cc990c613e1
4d3b50422adc10333849374d23cda5ef6ae23d1b
refs/heads/master
2022-11-28T08:50:35.554420
2020-01-23T09:55:09
2020-01-23T09:55:09
235,702,657
0
0
null
2022-11-16T10:54:11
2020-01-23T01:29:06
Java
UTF-8
Java
false
false
2,398
java
package com.lagou.edu.dao.impl; import com.lagou.edu.annotation.MyAutowired; import com.lagou.edu.annotation.MyService; import com.lagou.edu.pojo.Account; import com.lagou.edu.dao.AccountDao; import com.lagou.edu.utils.ConnectionUtils; import com.lagou.edu.utils.DruidUtils; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; /** * @author 应癫 */ @MyService public class JdbcAccountDaoImpl implements AccountDao { /* public void setConnectionUtils(ConnectionUtils connectionUtils) { this.connectionUtils = connectionUtils; }*/ public void init() { System.out.println("初始化方法....."); } public void destory() { System.out.println("销毁方法......"); } @Override public Account queryAccountByCardNo(String cardNo) throws Exception { //从连接池获取连接 // Connection con = DruidUtils.getInstance().getConnection(); Connection con = ConnectionUtils.getInstance().getCurrentThreadConn(); String sql = "select * from account where cardNo=?"; PreparedStatement preparedStatement = con.prepareStatement(sql); preparedStatement.setString(1,cardNo); ResultSet resultSet = preparedStatement.executeQuery(); Account account = new Account(); while(resultSet.next()) { account.setCardNo(resultSet.getString("cardNo")); account.setName(resultSet.getString("name")); account.setMoney(resultSet.getInt("money")); } resultSet.close(); preparedStatement.close(); //con.close(); return account; } @Override public int updateAccountByCardNo(Account account) throws Exception { // 从连接池获取连接 // 改造为:从当前线程当中获取绑定的connection连接 //Connection con = DruidUtils.getInstance().getConnection(); Connection con = ConnectionUtils.getInstance().getCurrentThreadConn(); String sql = "update account set money=? where cardNo=?"; PreparedStatement preparedStatement = con.prepareStatement(sql); preparedStatement.setInt(1,account.getMoney()); preparedStatement.setString(2,account.getCardNo()); int i = preparedStatement.executeUpdate(); preparedStatement.close(); //con.close(); return i; } }
0d2056321a59bcb23f7b3747ff6fb6dae1e725ec
42337d23e155cc9f61982386aa4917ef37a9bca5
/src/main/java/com/game/map/bean/ConcreteMap.java
7eafe85868ab4c27745d55b53b7da0bbfeccf29d
[]
no_license
lengzyuez/MMORPG
0599c042f7cabd64410f054897c3906c1154311f
2e67f34d387c56e7a91dc7e822ec3ad5620147ad
refs/heads/master
2020-09-08T15:14:05.973142
2019-09-16T09:41:53
2019-09-16T09:41:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,696
java
package com.game.map.bean; import com.game.npc.bean.ConcreteMonster; import com.game.role.bean.ConcreteRole; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @ClassName ConcreteMap * @Description 地图实体类 * @Author DELL * @Date 2019/5/3015:09 * @Version 1.0 */ public class ConcreteMap { /** * 唯一id */ private int id; /** * 地图名 */ private String name; /** * 怪兽的引用 */ private Map<String, ConcreteMonster> monsterMap = new HashMap<>(); /** * 角色列表 */ private List<ConcreteRole> roleList = new ArrayList<>(); public void setMonsterMap(Map<String, ConcreteMonster> monsterMap) { this.monsterMap = monsterMap; } public void setRoleList(List<ConcreteRole> roleList) { this.roleList = roleList; } public List<ConcreteRole> getRoleList() { return roleList; } public Map<String, ConcreteMonster> getMonsterMap() { return monsterMap; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public String toString() { return "ConcreteMap{" + "id=" + id + ", name='" + name + '\'' + '}'; } public ConcreteMap(int id,String name){ this.id = id; this.name = name; } public ConcreteMap(){} @Override public int hashCode() { return super.hashCode(); } }
2975d7d2fc3406c54ad80475560b270192e0ef75
a782977a8901d9a6bae5c0d6fefdc3046c87b0c6
/app-artifacts/hydrator-plugins/kafka-plugins/kafka-plugins-0.8/src/main/java/io/cdap/plugin/sink/KafkaOutputFormat.java
41e5de131ff7f5cd1fb1a5f5d455b8955ab20217
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
logan-jun/cdapimage
34ec81e41f38a73750efa79c8598451ff9a6fc46
f78c3dcf1bbe603da06cc964f5e06a7f5039b183
refs/heads/master
2022-12-14T21:08:49.284911
2020-09-02T10:24:25
2020-09-02T10:24:25
292,229,637
0
0
null
null
null
null
UTF-8
Java
false
false
4,360
java
/* * Copyright © 2018 Cask Data, Inc. * * 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 io.cdap.plugin.sink; import com.google.common.base.Strings; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.OutputCommitter; import org.apache.hadoop.mapreduce.OutputFormat; import org.apache.hadoop.mapreduce.RecordWriter; import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.Map; import java.util.Properties; /** * Output format to write to kafka */ public class KafkaOutputFormat extends OutputFormat<Text, Text> { private static final Logger LOG = LoggerFactory.getLogger(KafkaOutputFormat.class); private KafkaProducer<String, String> producer; @Override public void checkOutputSpecs(JobContext jobContext) throws IOException, InterruptedException { } @Override public OutputCommitter getOutputCommitter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException { return new OutputCommitter() { @Override public void setupJob(JobContext jobContext) throws IOException { // no-op } @Override public void setupTask(TaskAttemptContext taskContext) throws IOException { //no-op } @Override public boolean needsTaskCommit(TaskAttemptContext taskContext) throws IOException { return false; } @Override public void commitTask(TaskAttemptContext taskContext) throws IOException { //no-op } @Override public void abortTask(TaskAttemptContext taskContext) throws IOException { //no-op } }; } @Override public RecordWriter<Text, Text> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException { Configuration configuration = context.getConfiguration(); // Extract the topics String topic = configuration.get("topic"); Properties props = new Properties(); // Configure the properties for kafka. props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, configuration.get(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG)); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, configuration.get(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG)); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, configuration.get(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG)); props.put("compression.type", configuration.get("compression.type")); if (!Strings.isNullOrEmpty(configuration.get("hasKey"))) { // set partitioner class only if key is provided props.put("partitioner.class", "io.cdap.plugin.sink.StringPartitioner"); } if (configuration.get("async") != null && configuration.get("async").equalsIgnoreCase("true")) { props.put("producer.type", "async"); props.put(ProducerConfig.ACKS_CONFIG, "1"); } else { props.put("producer.type", "sync"); } Map<String, String> valByRegex = configuration.getValByRegex("^additional."); for (Map.Entry<String, String> entry : valByRegex.entrySet()) { //strip off the prefix we added while creating the conf. props.put(entry.getKey().substring(11), entry.getValue()); LOG.info("Property key: {}, value: {}", entry.getKey().substring(11), entry.getValue()); } // CDAP-9178: cached the producer object to avoid being created on every batch interval if (producer == null) { producer = new org.apache.kafka.clients.producer.KafkaProducer<>(props); } return new KafkaRecordWriter(producer, topic); } }
d004afe91ab4ce6fa5f05e3341ffe24ec0f20950
1816704eaacfdadfdc84806f67d77e2c00bf5453
/InvestigaciónOperaciones/IOREOQPanel.java
fe0293dbf228007cd67117f3103f5e4f664af446
[]
no_license
afre/ProyectoEstructuras
9fe20db4fc752538cbf929bc0563a62e8e184c67
4b3394a6e6b8be69372944c21c3748b95a8ffa04
refs/heads/master
2021-01-15T13:48:44.449744
2015-07-27T14:16:31
2015-07-27T14:16:31
39,709,899
0
0
null
null
null
null
UTF-8
Java
false
false
21,906
java
/* */ import java.awt.Color; /* */ import java.awt.Dimension; /* */ import java.awt.Font; /* */ import java.awt.Graphics; /* */ import java.awt.Image; /* */ import java.awt.Point; /* */ import java.awt.event.AdjustmentEvent; /* */ import java.io.ObjectInputStream; /* */ import java.io.ObjectOutputStream; /* */ import java.io.PrintStream; /* */ import java.text.DecimalFormat; /* */ import javax.swing.BorderFactory; /* */ import javax.swing.BoxLayout; /* */ import javax.swing.JButton; /* */ import javax.swing.JLabel; /* */ import javax.swing.JPanel; /* */ import javax.swing.JScrollBar; /* */ /* */ public class IOREOQPanel extends IORActionPanel /* */ { /* */ private IORITProcessController controller; /* 22 */ private int XSCALE = 10; /* 23 */ private int YSCALE = 100; /* */ /* 25 */ boolean isStandalone = false; /* */ /* */ Image offscreen; /* */ Graphics gS2; /* 29 */ private int GRAPHEIGHT = 340; /* 30 */ final int marginx = 110; /* 31 */ final int marginy = 20; /* 32 */ private int XSTEP = 40; /* 33 */ private int YSTEP = 25; /* 34 */ private int TOP = 60; /* */ /* 36 */ double H = 9.0D; /* 37 */ double D = 360.0D; /* 38 */ double S = 15.0D; /* */ /* */ int Qstar; /* */ int Qy; /* 42 */ DecimalFormat decfm = new DecimalFormat(); /* */ Font f; /* */ Font f1; /* 45 */ private JButton reset = new JButton("Reset"); /* */ private JScrollBar scrolH; /* */ private JScrollBar scrolD; /* */ private JScrollBar scrolK; /* 49 */ private JLabel hlab = new JLabel(" h = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.H))))); /* 50 */ private JLabel dlab = new JLabel(" d = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.D))))); /* 51 */ private JLabel slab = new JLabel(" K = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.S))))); /* */ /* 53 */ private JPanel locationPane = new JPanel(); /* 54 */ private IOREOQPanel.CanvasPanel canv = new IOREOQPanel.CanvasPanel(); /* 55 */ private JPanel controllerPanel = new JPanel(); /* 56 */ private JPanel scrolHPan = new JPanel(); /* 57 */ private JPanel scrolDPan = new JPanel(); /* 58 */ private JPanel scrolKPan = new JPanel(); /* */ /* */ /* 61 */ private JPanel infoPane = new JPanel(); /* */ /* */ public IOREOQPanel(IORITProcessController c) { /* 64 */ super(c); /* 65 */ this.controller = c; /* 66 */ this.controllerPanel.setLayout(new java.awt.FlowLayout()); /* */ /* 68 */ this.canv.setSize(600, 300); /* 69 */ this.locationPane.setLayout(new java.awt.BorderLayout()); /* 70 */ this.locationPane.add(this.canv); /* */ /* 72 */ this.scrolHPan.setLayout(new BoxLayout(this.scrolHPan, 1)); /* 73 */ this.scrolHPan.setBorder(BorderFactory.createEmptyBorder(0, 10, 20, 10)); /* 74 */ this.hlab.setBorder(BorderFactory.createEmptyBorder(0, 30, 10, 30)); /* 75 */ this.scrolH.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 30)); /* 76 */ this.scrolHPan.add(this.hlab); /* 77 */ this.scrolHPan.add(this.scrolH); /* */ /* 79 */ this.scrolDPan.setLayout(new BoxLayout(this.scrolDPan, 1)); /* 80 */ this.scrolDPan.setBorder(BorderFactory.createEmptyBorder(0, 10, 20, 10)); /* 81 */ this.dlab.setBorder(BorderFactory.createEmptyBorder(0, 30, 10, 30)); /* 82 */ this.scrolD.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 30)); /* 83 */ this.scrolDPan.add(this.dlab); /* 84 */ this.scrolDPan.add(this.scrolD); /* */ /* 86 */ this.scrolKPan.setLayout(new BoxLayout(this.scrolKPan, 1)); /* 87 */ this.scrolKPan.setBorder(BorderFactory.createEmptyBorder(0, 10, 20, 10)); /* 88 */ this.slab.setBorder(BorderFactory.createEmptyBorder(0, 30, 10, 30)); /* 89 */ this.scrolK.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 30)); /* 90 */ this.scrolKPan.add(this.slab); /* 91 */ this.scrolKPan.add(this.scrolK); /* 92 */ this.locationPane.setBorder(null); /* */ /* 94 */ this.controllerPanel.add(this.scrolHPan); /* 95 */ this.controllerPanel.add(this.scrolDPan); /* 96 */ this.controllerPanel.add(this.scrolKPan); /* 97 */ this.controllerPanel.add(this.reset); /* */ /* */ /* 100 */ this.infoPane.setPreferredSize(new Dimension(600, 120)); /* */ /* */ /* 103 */ addInfoPanel(); /* */ /* 105 */ setLayout(new java.awt.BorderLayout()); /* 106 */ add(this.infoPane, "North"); /* 107 */ add(this.locationPane, "Center"); /* 108 */ add(this.controllerPanel, "South"); /* */ } /* */ /* */ public void addInfoPanel() { /* 112 */ this.infoPane.setLayout(null); /* 113 */ JLabel infoLab1 = new JLabel("(1). Q: Order quantity each time an order is placed; (2). Qo: Optimal order quantity"); /* 114 */ JLabel infoLab2 = new JLabel("(3). K: Fixed cost associated with placing each order (excludes the acquisition cost);"); /* 115 */ JLabel infoLab3 = new JLabel("(4). h: Holding cost per unit held per unit time; d: Demand rate"); /* 116 */ JLabel infoLab4 = new JLabel("(5). TC: The total-cost curve is U-shaped. TC=Q*h/2+d*K/Q "); /* 117 */ JLabel infoLab5 = new JLabel("(6). HC: Holding cost per unit time is linearly related to order size. HC=Q*h/2 "); /* 118 */ JLabel infoLab6 = new JLabel("(7). OC: Ordering cost per unit time because of K is inversely and nonlinearly related to order size. "); /* 119 */ JLabel infoLab7 = new JLabel("(7). OC: OC=d*K/Q"); /* */ /* 121 */ infoLab1.setBounds(15, 0, 605, 17); /* 122 */ infoLab2.setBounds(15, 17, 605, 17); /* 123 */ infoLab3.setBounds(15, 34, 605, 17); /* 124 */ infoLab4.setBounds(15, 51, 605, 17); /* 125 */ infoLab5.setBounds(15, 68, 605, 17); /* 126 */ infoLab6.setBounds(15, 85, 605, 17); /* 127 */ infoLab7.setBounds(15, 102, 605, 17); /* */ /* 129 */ this.infoPane.add(infoLab1); /* 130 */ this.infoPane.add(infoLab2); /* 131 */ this.infoPane.add(infoLab3); /* 132 */ this.infoPane.add(infoLab4); /* 133 */ this.infoPane.add(infoLab5); /* 134 */ this.infoPane.add(infoLab6); /* 135 */ this.infoPane.add(infoLab7); /* */ } /* */ /* */ /* */ public void updatePanel() {} /* */ /* */ /* */ protected void backStep() {} /* */ /* */ /* */ protected void initializeCurrentStepHelpPanel() /* */ { /* 147 */ String str = "EOQ Analysis\n\n"; /* 148 */ str = String.valueOf(String.valueOf(str)).concat("You can change the three parameters: H, D and K to see "); /* 149 */ str = String.valueOf(String.valueOf(str)).concat("the impact of the curve. "); /* */ /* 151 */ str = String.valueOf(String.valueOf(str)).concat("\n\n\nPress the ENTER key to continue the current procedure."); /* */ /* 153 */ this.help_content_step.setText(str); /* 154 */ this.help_content_step.revalidate(); /* */ } /* */ /* */ protected void initializeCurrentProcedureHelpPanel() { /* 158 */ String str = "EOQ Analysis\n\n"; /* 159 */ str = String.valueOf(String.valueOf(str)).concat("The EOQ Analysis implemented here is based on the basic EOQ model. This"); /* 160 */ str = String.valueOf(String.valueOf(str)).concat("model used to identify the order size that will minimize the sum of the "); /* 161 */ str = String.valueOf(String.valueOf(str)).concat("annual costs of holding inventory (HC)\n and ordering cost (OC), excluding "); /* 162 */ str = String.valueOf(String.valueOf(str)).concat("the acquisition cost. Users can change each parameter to\nsee the effect."); /* */ /* 164 */ str = String.valueOf(String.valueOf(str)).concat("\n\n\nPress the ENTER key to continue the current procedure."); /* 165 */ this.help_content_procedure.setText(str); /* 166 */ this.help_content_procedure.revalidate(); /* */ } /* */ /* */ /* */ protected void finishProcedure() {} /* */ /* */ public void LoadFile(ObjectInputStream in) /* */ { /* 174 */ double[] loadData = new double[3]; /* */ try { /* 176 */ loadData = (double[])in.readObject(); /* */ } catch (Exception e) { /* 178 */ System.out.println("LOAD Fails"); /* */ } /* 180 */ this.D = loadData[0]; /* 181 */ this.H = loadData[1]; /* 182 */ this.S = loadData[2]; /* */ /* 184 */ this.scrolD.setValue((int)(this.D / 10)); /* 185 */ this.scrolH.setValue((int)this.H); /* 186 */ this.scrolK.setValue((int)this.S); /* */ /* */ /* 189 */ this.hlab.setText(" H = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.H))))); /* 190 */ this.dlab.setText(" d = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.D))))); /* 191 */ this.slab.setText(" K = ".concat(String.valueOf(String.valueOf(this.decfm.format(this.S))))); /* */ /* 193 */ invalidate(); /* 194 */ System.out.println(String.valueOf(String.valueOf(new StringBuffer("LOAD EOQd=").append(this.D).append(" h=").append(this.H).append(" k=").append(this.S)))); /* 195 */ repaint(); /* */ } /* */ /* */ public void savePrintInfo() { /* 199 */ this.controller.data.EOQ_D = this.D; /* 200 */ this.controller.data.EOQ_H = this.H; /* 201 */ this.controller.data.EOQ_S = this.S; /* 202 */ this.controller.data.Qstar = this.Qstar; /* 203 */ this.controller.data.Qy = this.Qy; /* */ } /* */ /* */ public void SaveFile(ObjectOutputStream out) { /* 207 */ double[] saveData = new double[3]; /* 208 */ saveData[0] = this.D; /* 209 */ saveData[1] = this.H; /* 210 */ saveData[2] = this.S; /* */ try { /* 212 */ out.writeObject(saveData); /* 213 */ out.close(); /* */ } /* */ catch (Exception e1) { /* 216 */ e1.printStackTrace(); /* 217 */ System.out.println("Save fails"); /* */ } /* */ } /* */ /* */ public class CanvasPanel extends JPanel implements java.awt.event.AdjustmentListener, java.awt.event.ActionListener /* */ { /* */ CanvasPanel() { /* 224 */ setSize(600, 380); /* 225 */ init(); /* */ } /* */ /* */ public void init() { /* */ try { /* 230 */ jbInit(); /* */ } /* */ catch (Exception e) { /* 233 */ e.printStackTrace(); /* */ } /* */ } /* */ /* */ private void jbInit() throws Exception /* */ { /* 239 */ IOREOQPanel.this.f = new Font("Arial", 1, 12); /* 240 */ IOREOQPanel.this.f1 = new Font("Arial", 0, 12); /* 241 */ IOREOQPanel.this.scrolH = new JScrollBar(0, 9, 1, 2, 21); /* 242 */ IOREOQPanel.this.scrolD = new JScrollBar(0, 36, 1, 20, 41); /* 243 */ IOREOQPanel.this.scrolK = new JScrollBar(0, 15, 1, 4, 21); /* 244 */ IOREOQPanel.this.scrolH.addAdjustmentListener(this); /* 245 */ IOREOQPanel.this.scrolD.addAdjustmentListener(this); /* 246 */ IOREOQPanel.this.scrolK.addAdjustmentListener(this); /* */ /* 248 */ IOREOQPanel.this.reset.addActionListener(this); /* */ } /* */ /* 251 */ public void paint(Graphics g) { if (IOREOQPanel.this.offscreen == null) /* 252 */ IOREOQPanel.this.offscreen = createImage(getSize().width, getSize().height); /* 253 */ IOREOQPanel.this.gS2 = IOREOQPanel.this.offscreen.getGraphics(); /* 254 */ IOREOQPanel.this.gS2.clearRect(0, 0, getSize().width, getSize().height); /* 255 */ IOREOQPanel.this.gS2.setColor(Color.black); /* 256 */ IOREOQPanel.this.gS2.draw3DRect(15, 15, 597, 384, true); /* */ /* 258 */ IOREOQPanel.this.gS2.drawLine(110, IOREOQPanel.this.GRAPHEIGHT - 20, 110 + 10 * IOREOQPanel.this.XSTEP + 10, IOREOQPanel.this.GRAPHEIGHT - 20); /* */ /* 260 */ for (int i = 0; i < 11; i++) { /* 261 */ IOREOQPanel.this.gS2.drawLine(110 + IOREOQPanel.this.XSTEP * i, IOREOQPanel.this.GRAPHEIGHT - 20 - 5, 110 + IOREOQPanel.this.XSTEP * i, IOREOQPanel.this.GRAPHEIGHT - 20); /* 262 */ IOREOQPanel.this.gS2.drawString("".concat(String.valueOf(String.valueOf(i * IOREOQPanel.this.XSCALE))), 110 + IOREOQPanel.this.XSTEP * i - 5, IOREOQPanel.this.GRAPHEIGHT - 20 + 15); /* */ } /* 264 */ IOREOQPanel.this.gS2.setFont(IOREOQPanel.this.f); /* 265 */ IOREOQPanel.this.gS2.drawString("Quantity ", 110 + IOREOQPanel.this.XSTEP * 10 + 25, IOREOQPanel.this.GRAPHEIGHT - 20 + 10); /* 266 */ IOREOQPanel.this.gS2.setFont(IOREOQPanel.this.f1); /* */ /* */ /* 269 */ IOREOQPanel.this.gS2.drawLine(110, IOREOQPanel.this.TOP, 110, IOREOQPanel.this.GRAPHEIGHT - 20); /* */ /* 271 */ for (int i = 1; i < 11; i++) { /* 272 */ IOREOQPanel.this.gS2.drawLine(110, IOREOQPanel.this.GRAPHEIGHT - 20 - IOREOQPanel.this.YSTEP * i, 115, IOREOQPanel.this.GRAPHEIGHT - 20 - IOREOQPanel.this.YSTEP * i); /* 273 */ IOREOQPanel.this.gS2.drawString("".concat(String.valueOf(String.valueOf(i * IOREOQPanel.this.YSCALE))), 80, IOREOQPanel.this.GRAPHEIGHT - 20 - IOREOQPanel.this.YSTEP * i + 3); /* */ } /* */ /* 276 */ IOREOQPanel.this.gS2.setFont(IOREOQPanel.this.f); /* 277 */ IOREOQPanel.this.gS2.drawString("($)The costs ", 30, 50); /* 278 */ IOREOQPanel.this.gS2.setFont(IOREOQPanel.this.f1); /* */ /* 280 */ IOREOQPanel.this.gS2.setFont(IOREOQPanel.this.f); /* 281 */ IOREOQPanel.this.gS2.drawString("TC = h*Q/2 + K*d/Q", 80, IOREOQPanel.this.GRAPHEIGHT + 40); /* 282 */ IOREOQPanel.this.gS2.drawString("HC = h*Q/2", 280, IOREOQPanel.this.GRAPHEIGHT + 40); /* 283 */ IOREOQPanel.this.gS2.drawString("OC = K*d/Q", 430, IOREOQPanel.this.GRAPHEIGHT + 40); /* */ /* 285 */ drawnonlinear(); /* 286 */ g.drawImage(IOREOQPanel.this.offscreen, 0, 0, this); /* 287 */ IOREOQPanel.this.gS2.dispose(); /* */ } /* */ /* */ /* */ private void drawnonlinear() /* */ { /* 293 */ int qinit = 2; /* 294 */ double ocinit = IOREOQPanel.this.D * IOREOQPanel.this.S * 1.0D / qinit; /* 295 */ double tcinit = ocinit + 0.5D * IOREOQPanel.this.H * qinit; /* */ /* 297 */ Point ocprv = new Point(qinit * IOREOQPanel.this.XSTEP / IOREOQPanel.this.XSCALE, IOREOQPanel.this.GRAPHEIGHT - 20 - (int)ocinit * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE); /* 298 */ Point tcprv = new Point(qinit * IOREOQPanel.this.XSTEP / IOREOQPanel.this.XSCALE, IOREOQPanel.this.GRAPHEIGHT - 20 - (int)tcinit * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE); /* */ /* */ /* 301 */ double hcend = 0.5D * IOREOQPanel.this.H * 10 * IOREOQPanel.this.XSCALE; /* 302 */ IOREOQPanel.this.gS2.drawLine(110, IOREOQPanel.this.GRAPHEIGHT - 20, 110 + 10 * IOREOQPanel.this.XSTEP, IOREOQPanel.this.GRAPHEIGHT - 20 - (int)hcend * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE); /* 303 */ IOREOQPanel.this.gS2.drawString("H C", 110 + 10 * IOREOQPanel.this.XSTEP - 20, IOREOQPanel.this.GRAPHEIGHT - 20 - (int)hcend * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE - 5); /* */ /* 305 */ boolean find = false; /* 306 */ for (int q = 2; q <= 10 * IOREOQPanel.this.XSCALE; q++) { /* 307 */ double ocval = IOREOQPanel.this.D * IOREOQPanel.this.S * 1.0D / q; /* 308 */ double tcval = ocval + 0.5D * IOREOQPanel.this.H * q; /* 309 */ int x = q * IOREOQPanel.this.XSTEP / IOREOQPanel.this.XSCALE; /* 310 */ int yoc = IOREOQPanel.this.GRAPHEIGHT - 20 - (int)ocval * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE; /* 311 */ int ytc = IOREOQPanel.this.GRAPHEIGHT - 20 - (int)tcval * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE; /* */ /* 313 */ if ((ocprv.y > IOREOQPanel.this.TOP) && (tcprv.y > IOREOQPanel.this.TOP)) /* */ { /* 315 */ IOREOQPanel.this.gS2.setColor(Color.red); /* 316 */ IOREOQPanel.this.gS2.drawLine(ocprv.x + 110, ocprv.y, x + 110, yoc); /* */ /* 318 */ IOREOQPanel.this.gS2.setColor(Color.blue); /* 319 */ IOREOQPanel.this.gS2.drawLine(tcprv.x + 110, tcprv.y, x + 110, ytc); /* */ } /* */ /* 322 */ tcprv.x = x; /* 323 */ tcprv.y = ytc; /* 324 */ ocprv.x = x; /* 325 */ ocprv.y = yoc; /* */ } /* */ /* 328 */ IOREOQPanel.this.Qstar = Math.round((float)Math.sqrt(2.0D * IOREOQPanel.this.D * IOREOQPanel.this.S / IOREOQPanel.this.H)); /* 329 */ IOREOQPanel.this.Qy = Math.round((float)(IOREOQPanel.this.Qstar * 0.5D * IOREOQPanel.this.H + IOREOQPanel.this.D * IOREOQPanel.this.S / IOREOQPanel.this.Qstar)); /* 330 */ int optmx = 110 + IOREOQPanel.this.Qstar * IOREOQPanel.this.XSTEP / IOREOQPanel.this.XSCALE; /* 331 */ int optmy = IOREOQPanel.this.GRAPHEIGHT - 20 - IOREOQPanel.this.Qy * IOREOQPanel.this.YSTEP / IOREOQPanel.this.YSCALE; /* */ /* 333 */ IOREOQPanel.this.gS2.clearRect(50, optmy - 10, 50, 15); /* */ /* 335 */ IOREOQPanel.this.gS2.setColor(Color.black); /* */ /* 337 */ for (int temy = optmy; temy < IOREOQPanel.this.GRAPHEIGHT - 20; temy += 6) { /* 338 */ IOREOQPanel.this.gS2.drawLine(optmx, temy, optmx, temy + 3); /* */ } /* 340 */ for (int temx = optmx; temx > 110; temx -= 6) { /* 341 */ IOREOQPanel.this.gS2.drawLine(temx, optmy, temx - 3, optmy); /* */ } /* 343 */ IOREOQPanel.this.gS2.setColor(Color.black); /* 344 */ IOREOQPanel.this.gS2.drawString("Q", 53, optmy); /* 345 */ IOREOQPanel.this.gS2.drawString("Q", optmx - 17, IOREOQPanel.this.GRAPHEIGHT - 20 + 30); /* 346 */ IOREOQPanel.this.gS2.setFont(new Font("", 1, 10)); /* 347 */ IOREOQPanel.this.gS2.drawString("0", optmx - 8, IOREOQPanel.this.GRAPHEIGHT - 20 + 30 + 2); /* 348 */ IOREOQPanel.this.gS2.drawString("y", 60, optmy + 2); /* */ /* 350 */ IOREOQPanel.this.gS2.setFont(new Font("", 1, 12)); /* 351 */ IOREOQPanel.this.gS2.drawString("=".concat(String.valueOf(String.valueOf(IOREOQPanel.this.Qstar))), optmx, IOREOQPanel.this.GRAPHEIGHT - 20 + 30 + 2); /* 352 */ IOREOQPanel.this.gS2.drawString("=".concat(String.valueOf(String.valueOf(IOREOQPanel.this.Qy))), 65, optmy + 2); /* */ /* 354 */ IOREOQPanel.this.gS2.setColor(Color.red); /* 355 */ IOREOQPanel.this.gS2.drawString("O C", ocprv.x + 110 - 20, ocprv.y - 5); /* 356 */ IOREOQPanel.this.gS2.setColor(Color.blue); /* 357 */ IOREOQPanel.this.gS2.drawString("T C", tcprv.x + 110 - 20, tcprv.y - 5); /* */ } /* */ /* */ public void update(Graphics g) /* */ { /* 362 */ paint(g); /* */ } /* */ /* */ public void adjustmentValueChanged(AdjustmentEvent e) { /* 366 */ JScrollBar src = (JScrollBar)e.getSource(); /* */ /* 368 */ if (src == IOREOQPanel.this.scrolH) { /* 369 */ int value = IOREOQPanel.this.scrolH.getValue(); /* 370 */ IOREOQPanel.this.H = (value * 1.0D); /* 371 */ IOREOQPanel.this.hlab.setText(" H = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.H))))); /* 372 */ invalidate(); /* 373 */ repaint(); /* 374 */ } else if (src == IOREOQPanel.this.scrolD) { /* 375 */ int value = IOREOQPanel.this.scrolD.getValue(); /* 376 */ IOREOQPanel.this.D = (value * 10.0D); /* 377 */ IOREOQPanel.this.dlab.setText(" D = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.D))))); /* 378 */ invalidate(); /* 379 */ repaint(); /* */ } else { /* 381 */ int value = IOREOQPanel.this.scrolK.getValue(); /* 382 */ IOREOQPanel.this.S = (value * 1.0D); /* 383 */ IOREOQPanel.this.slab.setText(" S = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.S))))); /* 384 */ invalidate(); /* 385 */ repaint(); /* */ } /* 387 */ IOREOQPanel.this.savePrintInfo(); /* 388 */ IOREOQPanel.this.controller.solver.initEOQPrintInfo(IOREOQPanel.this.controller.data); /* */ } /* */ /* 391 */ public void actionPerformed(java.awt.event.ActionEvent evt) { IOREOQPanel.this.H = 9.0D; /* 392 */ IOREOQPanel.this.scrolH.setValue(9); /* 393 */ IOREOQPanel.this.hlab.setText(" H = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.H))))); /* 394 */ IOREOQPanel.this.S = 15.0D; /* 395 */ IOREOQPanel.this.scrolK.setValue(15); /* 396 */ IOREOQPanel.this.slab.setText(" S = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.S))))); /* 397 */ IOREOQPanel.this.D = 360.0D; /* 398 */ IOREOQPanel.this.scrolD.setValue(36); /* 399 */ IOREOQPanel.this.dlab.setText(" D = ".concat(String.valueOf(String.valueOf(IOREOQPanel.this.decfm.format(IOREOQPanel.this.D))))); /* 400 */ invalidate(); /* 401 */ repaint(); /* 402 */ IOREOQPanel.this.savePrintInfo(); /* 403 */ IOREOQPanel.this.controller.solver.initEOQPrintInfo(IOREOQPanel.this.controller.data); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Accelet\IORTutorial\IORTutorial.jar!\IOREOQPanel.class * Java compiler version: 2 (46.0) * JD-Core Version: 0.7.1 */
c7fa65890afce38538858626df168a90aaf53a69
eb6e5377dbb05bdde5c10e7adac489875aabfa22
/lib_common/src/main/java/com/d/lib/common/component/cache/base/CacheManager.java
e15905ee8dc30d138d5aa0d0d583c02f4bc3c8e9
[]
no_license
infinte-star/finalproject
c80fb53634fed15b6a65cf572bc2beeb5cec4791
0918618a98817cce26998c6192eb15164abaf23f
refs/heads/master
2020-04-13T10:52:00.850531
2018-12-26T08:36:02
2018-12-26T08:36:02
163,155,748
1
1
null
null
null
null
UTF-8
Java
false
false
513
java
package com.d.lib.common.component.cache.base; import android.content.Context; public class CacheManager { protected volatile static ACache aCache; protected CacheManager(Context context) { init(context.getApplicationContext()); } private void init(Context context) { if (aCache == null) { synchronized (CacheManager.class) { if (aCache == null) { aCache = ACache.get(context); } } } } }
c5a05e737248843df66b80f4a5796d7785e97843
39018cda78fb25700c1951f74db4368ea7e24fe0
/app/src/main/java/br/senai/sp/cfp132/contagotas/activities/MedicaoActivity.java
4c6af8156d3a34a0bff95f09c8b8f3c2c6afe45a
[]
no_license
gabrielgasparotto/ContaGotas
87c6f30f644fca34792afd48dbdae93d9945fa9a
9a6faccd3a1a802440f8f2cd9bf853ca361b4189
refs/heads/master
2020-04-28T23:17:56.159253
2019-03-14T15:30:04
2019-03-14T15:30:04
175,649,639
0
0
null
null
null
null
UTF-8
Java
false
false
2,291
java
package br.senai.sp.cfp132.contagotas.activities; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.view.View; import java.util.Calendar; import br.senai.sp.cfp132.contagotas.R; import br.senai.sp.cfp132.contagotas.dao.MedicaoDAO; import br.senai.sp.cfp132.contagotas.modelo.Medicao; import br.senai.sp.cfp132.contagotas.view.NumberPickView; public class MedicaoActivity extends AppCompatActivity { private Medicao ultimaMedicao; private MedicaoDAO daoMedicao; private NumberPickView picker; private NumberPickView pickerInicial; @Override protected void onCreate(Bundle savedInstanceState) { daoMedicao = new MedicaoDAO(this); super.onCreate(savedInstanceState); setContentView(R.layout.activity_medicao); pickerInicial = (NumberPickView) findViewById(R.id.number_pick_inic_periodo); picker = (NumberPickView) findViewById(R.id.number_pick); } @Override protected void onDestroy() { super.onDestroy(); daoMedicao.close(); } @Override protected void onStart() { super.onStart(); pickerInicial.setValorReadOnly(PrincipalActivity.getPeriodoVigente().getValorInicial()); ultimaMedicao = daoMedicao.getLast(PrincipalActivity.getPeriodoVigente()); if (ultimaMedicao != null) { picker.setValor(ultimaMedicao.getValoratual()); } else { picker.setValor(PrincipalActivity.getPeriodoVigente().getValorInicial()); } } public void salvar(View v) { int valor = picker.getValor(); if (ultimaMedicao != null && valor < ultimaMedicao.getValoratual()) { Snackbar.make(v, R.string.valida_medicao, Snackbar.LENGTH_SHORT).show(); } else if (valor < PrincipalActivity.getPeriodoVigente().getValorInicial()) { Snackbar.make(v, R.string.valida_medicao, Snackbar.LENGTH_SHORT).show(); } else { Medicao m = new Medicao(); m.setDataMedicao(Calendar.getInstance()); m.setPeriodo(PrincipalActivity.getPeriodoVigente()); m.setValoratual(picker.getValor()); daoMedicao.incluir(m); finish(); } } }
26f122152cfeab70a11719eaa8f99bae930e75ca
49bd8347e8cff4afa74dce423ff87976ff909503
/app/src/main/java/com/example/checky/LoginActivity.java
326f9624ae1f2cc251c26e307e3339701b4dcbf7
[]
no_license
ayarmarxio/AndroidChecky
9089c141e22bdda218b5e1d4581e0a8b0d3f53d0
44892a3fac6edf9cbf00b792a7eae4f5a9d3ba8e
refs/heads/master
2020-04-29T16:29:43.517049
2019-03-31T18:56:43
2019-03-31T18:56:43
176,262,753
0
0
null
null
null
null
UTF-8
Java
false
false
3,417
java
package com.example.checky; import android.app.ProgressDialog; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; public class LoginActivity extends AppCompatActivity implements View.OnClickListener { private Button buttonSignIn; private EditText editTextEmail; private EditText editTextPassword; private TextView textViewSignUp; private ProgressDialog progressDialog; private FirebaseAuth firebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); editTextEmail = (EditText) findViewById(R.id.editTextEmail); editTextPassword = (EditText) findViewById(R.id.editTextPassword); buttonSignIn = (Button) findViewById(R.id.buttonSignIn); textViewSignUp = (TextView) findViewById(R.id.textViewSignUp); buttonSignIn.setOnClickListener(this); textViewSignUp.setOnClickListener(this); progressDialog = new ProgressDialog(this); firebaseAuth = FirebaseAuth.getInstance(); if (firebaseAuth.getCurrentUser() != null){ // profile activity here finish(); startActivity(new Intent(getApplicationContext(), ProfileActivity.class)); } } private void userLogin(){ String email = editTextEmail.getText().toString().trim(); String password = editTextPassword.getText().toString().trim(); if (TextUtils.isEmpty(email)) { //email is empty Toast.makeText(this, "Please enter email", Toast.LENGTH_SHORT).show(); // stoping function to executing further } if (TextUtils.isEmpty(password)){ // password is empty Toast.makeText(this, "Please enter password", Toast.LENGTH_SHORT).show(); // stoping function to executing further } // If validations are ok // We will first show a progressbar progressDialog.setMessage("Login user"); progressDialog.show(); firebaseAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { progressDialog.dismiss(); if (task.isSuccessful()){ // Start the profile activity finish(); startActivity(new Intent(getApplicationContext(), ProfileActivity.class)); } } }); } @Override public void onClick(View v) { if (v == buttonSignIn){ userLogin(); } if (v == textViewSignUp){ finish(); startActivity(new Intent(this, MainActivity.class)); } } }
c62a84a569404037ee7e9f0ca6cd113f7b5a7fd9
44df6372c2483bfa8dad16fde00b14bbf142aefc
/app/src/main/java/com/learnMVP/architect/module/login/LoginPresenter.java
2a526afeaaec06a4e61ff8abf985215f693ec4b9
[]
no_license
reypryma/Profile
b0edaae1d499fc3761f13050e5dbc37663f3ddd9
9b2acf0c036550a243c27f49887bf0176d7c368f
refs/heads/master
2022-12-24T22:14:42.648395
2020-10-09T06:48:03
2020-10-09T06:48:03
302,504,198
0
0
null
2020-10-09T06:48:05
2020-10-09T01:41:02
Java
UTF-8
Java
false
false
1,080
java
package com.learnMVP.architect.module.login; import android.content.Context; import android.content.SharedPreferences; import com.learnMVP.architect.module.Constants; public class LoginPresenter implements LoginContract.Presenter { private final LoginContract.View view; private final SharedPreferences sharedPreferences; public LoginPresenter(LoginContract.View view, Context context) { this.sharedPreferences = context.getSharedPreferences(Constants.PREFERENCE_KEY, Context.MODE_PRIVATE); this.view = view; } @Override public void performLogin(String user, String email) { // This is not the way // Cause it isn't SRP saveUser(user, email); view.redirectToProfile(); } @Override public void start() { } private void saveUser(String userName, String email) { SharedPreferences.Editor editor = this.sharedPreferences.edit(); editor.putString(Constants.USER_KEY, userName); editor.putString(Constants.PASSWORD_KEY, email); editor.commit(); } }